Solidity API
InterchainAddressTracker
Manages and validates trusted interchain addresses of an application.
PREFIX_ADDRESS_MAPPING
bytes32 PREFIX_ADDRESS_MAPPING
PREFIX_ADDRESS_HASH_MAPPING
bytes32 PREFIX_ADDRESS_HASH_MAPPING
_CHAIN_NAME_SLOT
_setChainName
function _setChainName(string chainName_) internal
chainName
function chainName() public view returns (string chainName_)
Gets the name of the chain this is deployed at
trustedAddress
function trustedAddress(string chain) public view returns (string trustedAddress_)
Gets the trusted address at a remote chain
Parameters
Name |
Type |
Description |
chain |
string |
Chain name of the remote chain |
Return Values
Name |
Type |
Description |
trustedAddress_ |
string |
The trusted address for the chain. Returns ‘’ if the chain is untrusted |
trustedAddressHash
function trustedAddressHash(string chain) public view returns (bytes32 trustedAddressHash_)
Gets the trusted address hash for a chain
Parameters
Name |
Type |
Description |
chain |
string |
Chain name |
Return Values
Name |
Type |
Description |
trustedAddressHash_ |
bytes32 |
the hash of the trusted address for that chain |
isTrustedAddress
function isTrustedAddress(string chain, string address_) public view returns (bool)
Checks whether the interchain sender is a trusted address
Parameters
Name |
Type |
Description |
chain |
string |
Chain name of the sender |
address_ |
string |
Address of the sender |
Return Values
Name |
Type |
Description |
[0] |
bool |
bool true if the sender chain/address are trusted, false otherwise |
_getTrustedAddressSlot
function _getTrustedAddressSlot(string chain) internal pure returns (bytes32 slot)
Gets the key for the trusted address at a remote chain
Parameters
Name |
Type |
Description |
chain |
string |
Chain name of the remote chain |
Return Values
Name |
Type |
Description |
slot |
bytes32 |
the slot to store the trusted address in |
_getTrustedAddressHashSlot
function _getTrustedAddressHashSlot(string chain) internal pure returns (bytes32 slot)
Gets the key for the trusted address at a remote chain
Parameters
Name |
Type |
Description |
chain |
string |
Chain name of the remote chain |
Return Values
Name |
Type |
Description |
slot |
bytes32 |
the slot to store the trusted address hash in |
_setTrustedAddress
function _setTrustedAddress(string chain, string address_) internal
Sets the trusted address and its hash for a remote chain
Parameters
Name |
Type |
Description |
chain |
string |
Chain name of the remote chain |
address_ |
string |
the string representation of the trusted address |
_removeTrustedAddress
function _removeTrustedAddress(string chain) internal
Remove the trusted address of the chain.
Parameters
Name |
Type |
Description |
chain |
string |
Chain name that should be made untrusted |