ChainBridge uses Solidity smart contracts to enable transfers to and from EVM compatible chains. These contracts consist of a core bridge contract (Bridge.sol) and a set of handler contracts (ERC20Handler.sol, ERC721Handler.sol, and GenericHandler.sol). The bridge contract is responsible for initiating, voting on, and executing proposed transfers. The handlers are used by the bridge contract to interact with other existing contracts.
Read more here.
A CLI to deploy and interact with these contracts can be found here.
Requires nodejs
and npm
.
make install-deps
: Installs truffle and ganache globally, fetches local dependencies. Also installs abigen
from go-ethereum
.
make bindings
: Creates go bindings in ./build/bindings/go
PORT=<port> SILENT=<bool> make start-ganache
: Starts a ganache instance, default PORT=8545 SILENT=false
make start-geth
: Starts a geth instance with test keys
yarn compile
: Compile contracts.
yarn deploy --network <network>
: Deploys all contracts with default args (test).
yarn deploy:bridge --network <network>
: Deploys bridge and all handler contracts.
yarn deploy:erc20 --network <network> <name> <symbol>
: Deploy an mintable ERC20 with given args.
yarn deploy:erc721 --network <network> <name> <symbol> <baseURI>
: Deploy an mintable ERC721 with given args.
yarn deploy:erc1155 --network <network> <name> <symbol> <uri>
: Deploy an mintable ERC1155 with given args.
yarn test
: Runs truffle tests.
yarn run:register_erc20 --network <network> <resourceId> <erc20Address>
: Register ERC20 at ResourceID.
yarn run:register_erc721 --network <network> <resourceId> <erc721Address>
: Register ERC721 at ResourceID.
yarn run:register_erc1155 --network <network> <resourceId> <erc1155Address>
: Register ERC1155 at ResourceID.
yarn run:setmintburn_erc20 --network <network> <erc20Address>
: Set ERC20 as burnable, mintable by its handler.
yarn run:setmintburn_erc721 --network <network> <erc721Address>
: Set ERC721 as burnable, mintable by its handler.
yarn run:setmintburn_erc1155 --network <network> <erc1155Address>
: Set ERC1155 as burnable, mintable by its handler.
We take all security issues seriously, if you believe you have found a security issue within a ChainSafe project please notify us immediately. If an issue is confirmed, we will take all necessary precautions to ensure a statement and patch release is made in a timely manner.
Please email us a description of the flaw and any related information (e.g. reproduction steps, version) to security at chainsafe dot io.