The bridge supply can be audited by looking at the number of tokens stored in the bridge account: 4dpEcgqFor2TJw9uWSjx2JpjkNmTic2UjJAK1j9fRtcTUoRu as well as the ERC20 token supply.
You can submit an RPC call a to a full node and query chainBridge.relayerThreshold
. This will give you the number of confirmations needed on the Centrifuge Chain to trigger a transfer.
On Ethereum, you can query the Chainbridge public method _relayerThreshold()(uint8)
:
1seth call 0xFe50BA7241b635Eda23a32875c383A34E8a3596c '_relayerThreshold()(uint8)'
1export CB_DEPLOY=${CB_DEPLOY:-v1.0.0}2CB_SOL_COMMIT=${CB_SOL_COMMIT:-v1.0.0}34cd $PARENT_DIR5git clone https://github.com/ChainSafe/chainbridge-deploy.git6cd $PARENT_DIR/chainbridge-deploy7git checkout $CB_CB_DEPLOY89BRIDGE_DEPLOYMENT_DIR=$PARENT_DIR/chainbridge-deploy/cb-sol-cli10cd $BRIDGE_DEPLOYMENT_DIR11GIT_COMMIT=$CB_SOL_COMMIT make install
In the bash snippet below, we use subkey
to convert the SS58 address into its public key representation, required by the deposit operation.
Follow instructions here: https://github.com/paritytech/substrate/tree/master/bin/utils/subkey
Or run the docker image: https://hub.docker.com/r/parity/subkey
In the bash snippet below we use jq
to parse a JSON output. You can choose to omit that and paste the address manually.
Otherwise, follow instructions here to install in your distribution: https://stedolan.github.io/jq/.
Please reach out to us on Slack or Telegram for contract addresses.
1export ETH_RPC_URL="YOUR_ETH_CLIENT_URL"2ETH_PRIVATE_KEY="YOUR_PRIVATE_KEY"3ETH_GAS_LIMIT=3000004BRIDGE_ERC20_RESOURCE_ID="0x00000000000000000000000000000009e974040e705c10fb4de576d6cc261900"
Amber (Kovan) Config:
1export ERC20_ADDRESS="AMBER_ERC20_CONTRACT"2BRIDGE_ADDRESS="AMBER_BRIDGE_CONTRACT"3BRIDGE_ERC20_HANDLER="AMBER_ERC20_HANDLER"4ETH_GAS_PRICE=10000000000
Mainnet Config:
1export ERC20_ADDRESS="MAINNET_ERC20_CONTRACT"2BRIDGE_ADDRESS="MAINNET_BRIDGE_CONTRACT"3BRIDGE_ERC20_HANDLER="MAINNET_ERC20_HANDLER"4ETH_GAS_PRICE=40000000000
In the substrate UI, select the Extrinsics
tab and call palletBridge.transferNative
with these parameters:
1000000000000000000
1 CFGYOUR_ETH_TARGET_ACCOUNT
0
Depending on environment and network state, this may take some time.
You can query the recipients balance on Ethereum:
1cb-sol-cli --url $ETH_RPC_URL erc20 balance --address YOUR_ETH_TARGET_ACCOUNT --erc20Address $ERC20_ADDRESS
Approve ERC20 Handler to move tokens on your behalf:
1cb-sol-cli --gasLimit $ETH_GAS_LIMIT --gasPrice $ETH_GAS_PRICE --privateKey $ETH_PRIVATE_KEY --url $ETH_RPC_URL erc20 approve --amount 1000000000000000000 --recipient $BRIDGE_ERC20_HANDLER --erc20Address $ERC20_ADDRESS
Trigger Deposit against target chain and address:
1TARGET_SUBSTRATE_ADDR="YOUR_SUBSTRATE_SS58_ADDRESS"2TARGET_PUBLICKEY=`subkey inspect --output-type json $TARGET_SUBSTRATE_ADDR | jq -r '.publicKey'`34cb-sol-cli --gasLimit $ETH_GAS_LIMIT --gasPrice $ETH_GAS_PRICE --privateKey $ETH_PRIVATE_KEY --url $ETH_RPC_URL erc20 deposit --amount 1000000000000000000 --dest 1 --recipient $TARGET_PUBLICKEY --resourceId $BRIDGE_ERC20_RESOURCE_ID --bridge $BRIDGE_ADDRESS