Closed ws4charlie closed 2 years ago
Hey @ws4charlie, sorry for the long wait response! Definitely, there is a mistake in the description because adminWithdraw withdraws funds from Handlers (liquidity). In order to withdraw collected fees (that are collected on Bridge smart contract), you need to use https://github.com/ChainSafe/chainbridge-solidity/blob/v1.0.1/contracts/Bridge.sol#L425. Unfortunately, looks like, this method is not implemented in JS cli. Also, we are not going to support this version of chainbridge and JS CLI, right now we are focused on the new version https://github.com/ChainSafe/chainbridge-core that includes built-in CLI. But you are free to create PR with this method. Thank you for your question!
I am trying to bridge 2 Ethereum chains and came across below fee withdraw issue.
step-0: setup bridges properly on both home chain and destination chain. step-1: Set any amount of fee(2 tokens in below case) using below command
step-2: Trigger a deposit (e.g. 10 tokens) transaction on the SRC_BRIDGE contract and wait for transaction to finalize. step-3: We'll see the balance of bridge as 20 because the fee was set to 20. step-4: Try and withdraw collected fee from the bridge using below command
step-5: The withdraw will fail because it actually tried to withdraw 20 token from the HANDLER(having only 10 in its balance) instead of BRIDGE contract. The behaviour is different from the description of the CLI below.
Expected Behavior
cb-sol-cli admin withdraw
is supposed to withdraw the fee collected instead of from HANDLER contract. I'm curious if there is a way to withdraw the fee back? What's the correct command/parameter?Versions
ChainBridge commit (or docker tag): v1.1.5 chainbridge-deploy: master chainbridge-solidity version: any chainbridge-substrate version: None Go version: go1.15.7