6.2 Ethereum IBC Protocol

Deposit

If you want to send ERC20 tokens to the Orbit IBC contract, you must check that the token is registered‌
decimal(address tokenAddr)
Send a deposit transaction to the Orbit IBC contract on the Ethereum MAINNET/ROPSTEN
1
// deposit ETHfunction deposit(address toAddr, address extraToAddr) payable public// deposit ERC20 TOKENfunction depositToken(address token, address toAddr, uint amount, address extraToAddr) public
Copied!
If your transaction succeeds,
1
event Deposit(address tokenAddr, address addr, address toAddr, uint amount, uint depositId, address extraToAddr);
Copied!
Deposit event occurs in your transaction‌.
Then, Ethereum IBC operator and Validator begin to proceed this deposit‌.
When deposit is completed in the Orbit chain, DepositValidated and BalanceChange events occur.
1
// EthpeggingContractevent DepositValidated(address mainAddr, address tokenAddr, address addr, address toAddr, uint amount, uint depositId, address extraToAddr)// BalanceContractevent BalanceChange(address indexed user, bytes32 indexed tokenId, uint balance);
Copied!

Withdrawal

Send a withdrawal transaction to Orbit Balancecontract.
1
function withdrawBySignature(bytes32[] memory bytes32s, uint[] memory uints, address fromAddr, bytes memory destination, bytes memory comment, uint8 v) publicfunction withdraw(bytes32 tokenId, bytes memory destination, uint amount, bytes memory comment) public
Copied!
Then, Ethereum IBC operator and Validator begin to proceed this withdrawal‌
When withdrawal is completed in Ethereum, Withdrawal event occurs.
1
event Withdraw(address tokenAddr, address addr, address toAddr, uint amount, bytes32 whash, uint withdrawId, bytes comment);
Copied!
Copy link