Port Contract On EVM L2s
Supported Chains:
Chain | Canister Id | Contract |
---|---|---|
Bevm | rp433-4qaaa-aaaar-qaf2q-cai | 0xDA290C4D658c767fA06c27bc2AcaD59bDFCCff4A |
Bitlayer | he2gn-7qaaa-aaaar-qagaq-cai | 0x2AFDA75BFfE47dDE22254937ef1E81E1C32B90d9 |
B² Network | gsr6g-kaaaa-aaaar-qagfq-cai | 0xF3D7bc94095454D5F8538a808941729c9B3D3B7A |
X Layer | gjucd-qyaaa-aaaar-qagha-cai | 0x1Ad8cec9E5a4A441FE407785E188AbDeb4371468 |
Merlin | govex-5aaaa-aaaar-qaghq-cai | 0x1Ad8cec9E5a4A441FE407785E188AbDeb4371468 |
Bob | epmqo-ziaaa-aaaar-qagka-cai | 0x21cf922c8bf60d1d11ADC8aDCFdd4BdAae9e8320 |
Rootstock | if3hq-3iaaa-aaaar-qahga-cai | 0x1Ad8cec9E5a4A441FE407785E188AbDeb4371468 |
Bitfinity | pw3ee-pyaaa-aaaar-qahva-cai | 0x1Ad8cec9E5a4A441FE407785E188AbDeb4371468 |
AILayer | pk76v-yyaaa-aaaar-qahxa-cai | 0x1Ad8cec9E5a4A441FE407785E188AbDeb4371468 |
Update
generate_ticket
Generate an cross-chain transaction from the bitcoin network to layer 2 evm-compatible instances.
Workflow:
1. Call the corresponding Solidity function(E.g. burnToken) from the UI and get the calculated function_hash:
- omnity-port-solidity is the solidity implementation of Omnity Port on evm-compatible blockchains, a contract module which provides a basic access control mechanism on the runes tokens. It provides the following apis:
To destroy a amount of tokenId runes tokens from the caller:
burnToken(string memory tokenId, uint256 amount)
Creates an event involving a certain amount (depending on the type of runes) of tokenId and assigns it to the receiver. The cross-chain application will read the event and perform the mint action on the bitcoin network.
mintRunes(string memory tokenId, address receiver)
Creates an event to transfer a specified amount of tokenId runes tokens from the caller’s account to the receiver's account on dstChainId, with an optional memo. The cross-chain application will read the event and perform the transfer action on the bitcoin network.
transportToken(string memory dstChainId, string memory tokenId, string memory receiver, uint256 amount, string memory memo)
Creates an event to burn a specified amount of wrapped tokenId runes tokens and withdraw the corresponding amount of underlying tokens to the receiver. The cross-chain application will read the event and perform the withdrawal action on the bitcoin network.
redeemToken(string memory tokenId, string memory receiver, uint256 amount)
2. Put the function_hash as a parameter into generate_ticket from your dapp( either in Rust or Typescript ):
- omnity-interoperability is the rust implementation of Omnity protocol. And you can find the details of generate_ticket in it.
3. Go to Omnity Explorer to track the generated ticket status.
Query
mint_token_status
Returns the status of the wrapped token minting operation on the layer 2 chain:
* Finalized { tx_hash: String } represents the operation is succeeded with the transaction hash on the layer 2 chain.
* Unknown represents the operation is not completed.
Sources : MintTokenStatus
get_chain_list
Retrieve a list of chains that connect with the layer 2 chain.
Sources : Chain
get_token_list
Retrieve a list of tokens available on the layer 2 chain.
Sources : TokenResp
get_fee
Retrieve the transaction fee based on chain_id as the target chain.
Sources : ChainId