1

after following the tutorial[https://chainbridge.chainsafe.io/local/] of running Chainbridge locally,

I can send 1 Substrate Native Token to ERC20

But when I sent 1, 100, 1000000, even 1000000000000000000 ERC20 tokens to 0xd4359..da27d, the ALICE Polkadot account balance does not increase after waiting 10 blocks...

accounts                    type      transactions  balances    
ALICE  5Grwva…GKutQY    type=sr25519       28      2.1529 MUnit

From this command: subkey inspect //Alice

  Network ID:        substrate 
 Secret seed:       0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
  Public key (hex):  0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  Account ID:        0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  Public key (SS58): 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  SS58 Address:      5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

This confirms Alice 5Grwva is 0xd4359..da27d on Ethereum side

Logs from cb-sol-cli erc20 ... command sending tokens:

[erc20/deposit] Constructed deposit:
[erc20/deposit]   Resource Id: 0x000000000000000000000000000000c76ebe4a02bbc34786d860b355f5a5ce00
[erc20/deposit]   Amount: 0xd3c21bcecceda1000000
[erc20/deposit]   len(recipient): 32
[erc20/deposit]   Recipient: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
[erc20/deposit]   Raw: 0x00000000000000000000000000000000000000000000d3c21bcecceda10000000000000000000000000000000000000000000000000000000000000000000020d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
[erc20/deposit] Creating deposit to initiate transfer!
Waiting for tx: 0x43f50cebc459b1d959a515250be28a861639f8983ddc730ad8f464f9448cf58a...

Logs from running the ChainBridge:

INFO[06-10|17:57:50] Starting ChainBridge... 
INFO[06-10|17:57:50] Connecting to ethereum chain...          chain=eth url=ws://localhost:8545
INFO[06-10|17:57:50] Connecting to substrate chain...         chain=sub url=ws://localhost:9944
2022/06/10 17:57:50 Connecting to ws://localhost:9944...
INFO[06-10|17:57:50] Started eth chain                        system=core
INFO[06-10|17:57:50] Started sub chain                        system=core
INFO[06-10|17:57:50] Polling Blocks...                        chain=eth block=14856
INFO[06-10|18:38:33] Got fungible transfer event!             chain=sub destination=0 resourceId=000000000000000000000000000000c76ebe4a02bbc34786d860b355f5a5ce00 amount=1000
INFO[06-10|18:38:33] Attempting to resolve message            chain=eth type=FungibleTransfer src=1 dst=0 nonce=1 rId=000000000000000000000000000000c76ebe4a02bbc34786d860b355f5a5ce00
INFO[06-10|18:38:33] Creating erc20 proposal                  chain=eth src=1 nonce=1
INFO[06-10|18:38:33] Watching for finalization event          chain=eth src=1 nonce=1
INFO[06-10|18:38:33] Submitted proposal vote                  chain=eth tx=0xbdc73d76fb45ed29b194afc6208785b37f38dd6851869fb95fab28673611f5bb src=1 depositNonce=1 gasPrice=20000000
INFO[06-10|18:38:48] Submitted proposal execution             chain=eth tx=0x366ce097f45b10e25d5047f366d08dc12d8b185e4c6deae49df1d58bea26cf97 src=1 dst=0 nonce=1 gasPrice=20000000
INFO[06-10|18:43:17] Handling fungible deposit event          chain=eth dest=1 nonce=7
INFO[06-10|18:43:17] Acknowledging proposal on chain          chain=sub nonce=7 source=0 resource=000000000000000000000000000000c76ebe4a02bbc34786d860b355f5a5ce00 method=Example.transfer

I think there is something missing in Polkadot JS Apps -> definitions to the developer settings: https://github.com/ChainSafe/chainbridge-Substrate-chain#polkadot-js-apps

{
  "chainbridge::ChainId": "u8",
  "ChainId": "u8",
  "ResourceId": "[u8; 32]",
  "DepositNonce": "u64",
  "ProposalVotes": {
    "votes_for": "Vec<AccountId>",
    "votes_against": "Vec<AccountId>",
    "status": "enum"
  },
  "Erc721Token": {
    "id": "TokenId",
    "metadata": "Vec<u8>"
  },
  "TokenId": "U256",
  "Address": "AccountId",
  "LookupSource": "AccountId"
}

I have to add "AccountInfo": "AccountInfoWithDualRefCount" on top of above settings to see the account balances.

And I can see ALICE transactions is increasing, but ALICE's balance has never increased after the transfer!

How can I show transferred amount from ERC20 to Substrate parachain?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.