Build
Architecture
contracts
contracts
evm
tools
ZetaInteractor.sol
Abstract.zetainteractor

Git Source (opens in a new tab)

Inherits: Ownable2Step, ZetaInteractorErrors

ZERO_BYTES

bytes32 constant ZERO_BYTES = keccak256(new bytes(0));

currentChainId

uint256 internal immutable currentChainId;

connector

ZetaConnector public immutable connector;

interactorsByChainId

*Maps a chain id to its corresponding address of the MultiChainSwap contract The address is expressed in bytes to allow non-EVM chains This mapping is useful, mainly, for two reasons:

  • Given a chain id, the contract is able to route a transaction to its corresponding address
  • To check that the messages (onZetaMessage, onZetaRevert) come from a trusted source*
mapping(uint256 => bytes) public interactorsByChainId;

isValidMessageCall

modifier isValidMessageCall(ZetaInterfaces.ZetaMessage calldata zetaMessage);

isValidRevertCall

modifier isValidRevertCall(ZetaInterfaces.ZetaRevert calldata zetaRevert);

constructor

constructor(address zetaConnectorAddress);

_isValidCaller

function _isValidCaller() private view;

_isValidChainId

Useful for contracts that inherit from this one

function _isValidChainId(uint256 chainId) internal view returns (bool);

setInteractorByChainId

function setInteractorByChainId(uint256 destinationChainId, bytes calldata contractAddress) external onlyOwner;