
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@socket.tech/socket-plugs
Advanced tools
This project features a collection of applications built using Socket's data layer.
contracts
- Source code for the contracts.deployments
- Deployment addresses for the project, categorized by project type (SuperToken, SuperBridge).scripts
- Scripts for deploying, verifying contracts, and more.scripts/constants/projectConstants
- Project constants, categorized by project type (SuperToken, SuperBridge).src/enums
- Token and project enums.test
- Tests for the contracts.SuperToken SuperTokens are contracts that enable the creation of tokens on multiple chains. They function by locking/unlocking tokens on the initial chain using a Vault and minting/burning tokens on the destination chain using a Controller. More details on SuperTokens can be found here.
SuperBridge SuperBridges are contracts that allow Chains or AppChains to onboard assets and tokens from other chains. They use lock/unlock mechanisms on the source chain and mint/burn mechanisms on the destination chain. More details on SuperBridges can be found here.
Hook Contracts Hooks are extensions to the SuperBridge and SuperToken. They add additional functionality to the bridge or token and are invoked during the execution of a SuperBridge or SuperToken transaction.
Clone project and install dependencies.
git clone https://github.com/SocketDotTech/socket-plugs
Move to the repository folder and install dependencies.
cd socket-plugs
Install all dependencies.
yarn setup:all
To create a new project, run:
yarn project:new
Follow the prompts to create a new project. This will create a new project in scripts/constants/projectConstants/supertoken/projectname_<mainnet/testnet>.ts
or scripts/constants/projectConstants/superbridge/projectname_<mainnet/testnet>.ts
.
Note: SuperBridge allows custom setups where multiple tokens on the vault chain can be mapped to a single token on the app chain. For more information, refer to the Project Constants Help Guide section and contact the team for assistance.
Note: this scripts updates your .env to add relevant env variables. If you have anything sensitive/important in .env file, please take a backup first.
forge create --rpc-url <your_rpc_url> \
--constructor-args "USDCoin" "USDC" 6 \
--private-key <your_private_key> \
contracts/token/DummyERC20.sol:DummyERC20
update the constructor arguments according to your needs.Note: Ensure you have the correct environment variables set in your .env file. You need to set OWNER_SIGNER_KEY
and RPC URLs for the network you are deploying to.
To deploy the contracts, run:
yarn script:deploy
Note: based on the chain you may run into some rpc issues like intrinsic gas too low
, etc. while running the deploy script. We store network overrides in script/helpers/networks.ts
. You can add overrides for gasPrice, gasLimits to be used by all scripts. For example, if you are running the script for arbitrum sepolia, and it throw intrinsic gas too low
error, try increasing gas limit for arbitrum sepolia to 5 million and retry.
To verify the contracts on a block explorer, you can use the following command:
yarn script:verify --network <your network>
If you are verifying the contracts for SuperBridge on the destination chain and the verify command throws an error H100: Network doesn't exist
, you need to update the hardhat.config.ts
file to add the network -
CustomNetworks
CustomNetworksConfig
(chainId, rpc, accounts)liveNetworks
arrayconfig.etherscan.apiKey
config.etherscan.customChains
(chainId, browserUrl, verification api Url). This config is used by hardhat-etherscan
plugin to verify contracts.To test your deployment, you can use the following command to send a bridge transaction -
yarn script:bridge --srcChain 421614 --dstChain 11155420 --token USDC --amount 1
the PROJECT
env variable should be set in .env
file. It is used to fetch relevant bridge addresses.
Vault Chains - The chains where the token contract is already deployed, and the token will be locked/unlocked for bridging.
Controller Chains - The chains where the token is minted/burned.
Hooks - Hooks are plugins that can be added for extra functionality. We have 2 options for hooks right now:
Rate Limits - You can specify per token daily sending and receiving limits.
Integration Types - We have 3 options for integration types (Recommended: FAST)
Pool Count - This only applies for SuperBridge. Normally, we don't need to specify this and have a default value of 0.
Tests are run using the Forge tool of Foundry.
forge test
Use these faucets to receive test tokens on Arbitrum Sepolia and Optimism Sepolia testnets. Each request will send you 1000 units of the requested tokens (adjusted for token decimals). These can be used on the demo projects deployed when adding a new chain.
You can request tokens using Foundry's cast
command. Here's an example using Arbitrum Sepolia:
cast send 0x406c77947d91f965f09b458c07a66a033c3efea4 "getTokens(address,address[])" YOUR_ADDRESS "[TOKEN_ADDRESS]" --rpc-url https://sepolia-rollup.arbitrum.io/rpc --private-key $YOUR_PRIVATE_KEY
To get test USDC on Arbitrum Sepolia:
cast send 0x406c77947d91f965f09b458c07a66a033c3efea4 "getTokens(address,address[])" YOUR_ADDRESS "[0x8537307810fC40F4073A12a38554D4Ff78EfFf41]" --rpc-url https://sepolia-rollup.arbitrum.io/rpc --private-key $YOUR_PRIVATE_KEY
Replace:
YOUR_ADDRESS
with your wallet address$YOUR_PRIVATE_KEY
with your private key environment variableFor Optimism Sepolia, use the Optimism faucet address and RPC URL: https://sepolia.optimism.io
FAQs
Plugs built using socket's data layer
We found that @socket.tech/socket-plugs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.