Near-One / rainbow-token-connector

ERC-20/NEP-141 Token Connector for Rainbow Bridge
62 stars 18 forks source link

Silo to silo transfers #225

Closed karim-en closed 8 months ago

karim-en commented 1 year ago

The PR implements a contract to make silo to silo transfers of the ERC20 tokens that are bridged from near. The main public functions to interact with the contract:

registerToken(IEvmErc20 token) // To register the token address
storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) // To do the storage deposit
ftTransferCallToNear(IEvmErc20 token, uint128 amount, string receiverId, string calldata message) // To initiate the silo to silo transfer
withdraw(IEvmErc20 token) // To do a refund if the transfer failed

To deploy the contract on testnet run:

yarn hardhat deploy --silo aurora-testnet --network testnet_aurora

To upgrade the contract on testnet run:

yarn hardhat upgrade --silo aurora-testnet --proxy 0x<PROXY_ADDRESS> --network testnet_aurora