Bridge Smart Contract
Interacting with the Bridge Smart Contract
Last updated
Interacting with the Bridge Smart Contract
Last updated
For those advanced users willing to query the bridge smart contract for more insights into the system can do so through our Block Explorer page. This page will guide you through the process of querying the bridge smart chain data using our Blockscout block explorer.
We have different block explorers for the Electroneum Smart Chain mainnet and testnet, you can access them by following the link:
Mainnet Block Explorer: https://blockexplorer.electroneum.com/
Testnet Block Explorer: https://blockexplorer.thesecurityteam.rocks/
Depending on whether you are querying the bridge smart contract in mainnet or testnet, the contract address vary:
Mainnet Contract Address: 0xb7990022d3f22b6fb3afb626e05289ee3bf0ae62
Testnet Contract Address: 0xe5da12b1bcf74ff0aec20671beabc466f8b54727
For the rest of this guide we'll use the testnet block explorer and contract address for demonstration purposes.
First, head to the block explorer page and type the bridge contract address in explorer's search bar.
Make sure the address is correct and the explorer says "ERC1967Proxy", then click on the search result.
You are now in the bridge smart contract page where you can get some insights about the contract. The block explorer displays the bridge balance, how many calls to the bridge smart contract have been made (Transactions field), and the complete list of all transactions associated with this contract.
In order to get more specific info about the bridge smart contract itself, head to the "Read Proxy" tab.
The "Read Proxy" section allows you to interact with specific functions exposed by the contract implementation.
Some interesting functions exposed by our bridge smart contract includes:
getAddressFromLegacy: returns the new Smart Chain address associated with the provided legacy ETN address
getLegacyETNAddress: returns the legacy ETN address associated with the provided Smart Chain address
getTotalCrosschainAmount: returns the total amount of ETN that went through the bridge so far. (amount is displayed in atomic units - wei - by default)
getTotalTxCount: returns how many crosschain transfers were made so far
getTxAmount: returns the amount transacted in the specified crosschain tx hash (amount is displayed in atomic units - wei - by default)
getTxHistory: returns the crosschain transaction history of the provided Smart Chain address