-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
In cases where we want to invoke an interface (there are a few of them across all the contracts), we can call them in a controlled way, such as in:
IZRC20 zrc20token = IZRC20(zrc20);
try zrc20token.withdrawGasFee() returns (address gasZRC20, uint256 gasFee) {
if (gasZRC20 == address(0)) revert InvalidZRC20;
if (!zrc20token.transferFrom(msg.sender, FUNGIBLE_MODULE_ADDRESS, gasFee)) {
revert GasFeeTransferFailed();
}
} catch {
revert SomeErrorEvent();
}
Originally posted by @fbac in https://github.com/zeta-chain/protocol-contracts/pull/162#discussion_r1663924981
Metadata
Metadata
Assignees
Labels
No labels