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

ZetaInteractor

Git Source (opens in a new tab)

Inherits: Ownable2Step, ZetaInteractorErrors

bytes32 constant ZERO_BYTES = keccak256(new bytes(0));
uint256 internal immutable currentChainId;
ZetaConnector public immutable connector;

*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;
modifier isValidMessageCall(ZetaInterfaces.ZetaMessage calldata zetaMessage);
modifier isValidRevertCall(ZetaInterfaces.ZetaRevert calldata zetaRevert);
constructor(address zetaConnectorAddress);
function _isValidCaller() private view;

Useful for contracts that inherit from this one

function _isValidChainId(uint256 chainId) internal view returns (bool);
function setInteractorByChainId(uint256 destinationChainId, bytes calldata contractAddress) external onlyOwner;

Continue Learning

Continue with the next part or try a related tutorial