eosnetworkfoundation / evm-bridge-contracts

Contracts to support the trustless bridge of the EOS EVM
Other
1 stars 2 forks source link

eosio.erc2o contract implementation #5

Closed taokayan closed 1 year ago

taokayan commented 1 year ago

Resolves #612, based on @yarkinwho 's work.

list of actions:

example commands:

echo "=== deploy eosio.erc2o contract & register bridge ==="
./cleos set code eosio.erc2o ~/workspaces/evm-bridge-contracts/erc20.wasm
./cleos set abi eosio.erc2o ~/workspaces/evm-bridge-contracts/erc20.abi
./cleos push action eosio.evm bridgereg '["eosio.erc2o","eosio.erc2o","0.0100 EOS"]' -p eosio.erc2o -p eosio.evm@owner
./cleos transfer a123 eosio.evm "100.0000 EOS" "eosio.erc2o"
./cleos set account permission eosio.erc2o active --add-code

echo "=== link USDT EVM bridge (usdt <==> 0x4ea3b729669bf6c34f7b80e5d6c17db71f89f21f) ==="
./cleos push action eosio.erc2o upgrade '[]' -p eosio.erc2o

./cleos push action eosio.erc2o regtoken '["usdt","EVM USDT Token","WUSDT","0.0100 USDT","0.0100 EOS",6]' -p eosio.erc2o

echo "=== the USDT-ERC20 contract should be 3a13a4653761299d8b9d0d5dcac100d0c961938b ==="

echo "=== transfer USDT (EOS->EVM) ==="
./cleos get currency balance usdt usdt
./cleos transfer usdt eosio.erc2o "1000.0000 USDT" "0x2787b98fc4e731d0456b3941f0b3fe2e01439961" -c usdt
./cleos get currency balance usdt usdt

echo "=== call bridge Transfer (EVM 0x278...->EOS a123) 12 USDT to account ==="
python3 ./send_data_via_cleos.py 0x2787B98fC4e731d0456b3941f0B3fe2e01439961 0x3A13A4653761299D8b9D0D5DCaC100D0c961938B 10000000000000000 73761828000000000000000000000000bbbbbbbbbbbbbbbbbbbbbbbb30443000000000000000000000000000000000000000000000000000000000000000000000b71b000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000f6b6179616e6b6179616e6b6179616e0000000000000000000000000000000000 3

echo "=== a123 now should have some USDT ==="
./cleos get currency balance usdt a123
arhag commented 1 year ago

Make sure tests work with other token symbol names other than USDT (and also other precisions).

arhag commented 1 year ago

Also:

taokayan commented 1 year ago

Also:

Done