ZetaConnectorZEVM
Git Source (opens in a new tab)
State Variables
wzeta
WZETA token address.
address public wzeta;
FUNGIBLE_MODULE_ADDRESS
Fungible module address.
address public constant FUNGIBLE_MODULE_ADDRESS = payable(0x735b14BB79463307AAcBED86DAf3322B1e6226aB);
Functions
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
Name | Type | Description |
---|---|---|
input | ZetaInterfaces.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;
Events
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
);
Errors
OnlyWZETAOrFungible
Contract custom errors.
error OnlyWZETAOrFungible();
WZETATransferFailed
error WZETATransferFailed();
OnlyFungibleModule
error OnlyFungibleModule();
FailedZetaSent
error FailedZetaSent();
WrongValue
error WrongValue();