Build
Architecture
contracts
contracts
zevm
ZetaConnectorZEVM.sol
Contract.zetaconnectorzevm

Git Source (opens in a new tab)

wzeta

WZETA token address.

address public wzeta;

FUNGIBLE_MODULE_ADDRESS

Fungible module address.

address public constant FUNGIBLE_MODULE_ADDRESS = payable(0x735b14BB79463307AAcBED86DAf3322B1e6226aB);

onlyFungibleModule

Modifier to restrict actions to fungible module.

modifier onlyFungibleModule();

constructor

constructor(address wzeta_);

receive

Receive function to receive ZETA from WETH9.withdraw().

receive() external payable;

setWzetaAddress

function setWzetaAddress(address wzeta_) external onlyFungibleModule;

send

Sends ZETA and bytes messages (to execute it) crosschain.

function send(ZetaInterfaces.SendInput calldata input) external;

Parameters

NameTypeDescription
inputZetaInterfaces.SendInput

onReceive

Handler to receive data from other chain. This method can be called only by Fungible Module. Transfer the Zeta tokens to destination and calls onZetaMessage if it's needed. To perform the transfer wrap the new tokens

function onReceive(
    bytes calldata zetaTxSenderAddress,
    uint256 sourceChainId,
    address destinationAddress,
    uint256 zetaValue,
    bytes calldata message,
    bytes32 internalSendHash
) external payable onlyFungibleModule;

onRevert

Handler to receive errors from other chain. This method can be called only by Fungible Module. Transfer the Zeta tokens to destination and calls onZetaRevert if it's needed.

function onRevert(
    address zetaTxSenderAddress,
    uint256 sourceChainId,
    bytes calldata destinationAddress,
    uint256 destinationChainId,
    uint256 remainingZetaValue,
    bytes calldata message,
    bytes32 internalSendHash
) external payable onlyFungibleModule;

SetWZETA

event SetWZETA(address wzeta_);

ZetaSent

event ZetaSent(
    address sourceTxOriginAddress,
    address indexed zetaTxSenderAddress,
    uint256 indexed destinationChainId,
    bytes destinationAddress,
    uint256 zetaValueAndGas,
    uint256 destinationGasLimit,
    bytes message,
    bytes zetaParams
);

ZetaReceived

event ZetaReceived(
    bytes zetaTxSenderAddress,
    uint256 indexed sourceChainId,
    address indexed destinationAddress,
    uint256 zetaValue,
    bytes message,
    bytes32 indexed internalSendHash
);

ZetaReverted

event ZetaReverted(
    address zetaTxSenderAddress,
    uint256 sourceChainId,
    uint256 indexed destinationChainId,
    bytes destinationAddress,
    uint256 remainingZetaValue,
    bytes message,
    bytes32 indexed internalSendHash
);

OnlyWZETAOrFungible

Contract custom errors.

error OnlyWZETAOrFungible();

WZETATransferFailed

error WZETATransferFailed();

OnlyFungibleModule

error OnlyFungibleModule();

FailedZetaSent

error FailedZetaSent();

WrongValue

error WrongValue();