Skip to content

Commit

Permalink
Value
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Oct 9, 2023
1 parent 865f98b commit 47cc6db
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions messaging/value/contracts/Value.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ import "@zetachain/protocol-contracts/contracts/evm/tools/ZetaInteractor.sol";
import "@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.sol";
import "@zetachain/protocol-contracts/contracts/evm/Zeta.eth.sol";

contract Value is ZetaInteractor, ZetaReceiver {
error InvalidMessageType();
contract Value is ZetaInteractor {
error ErrorTransferringZeta();

event ValueEvent();
event ValueRevertedEvent();

bytes32 public constant VALUE_MESSAGE_TYPE = keccak256("CROSS_CHAIN_VALUE");
IERC20 internal immutable _zetaToken;

constructor(
Expand Down Expand Up @@ -44,30 +39,10 @@ contract Value is ZetaInteractor, ZetaReceiver {
destinationChainId: destinationChainId,
destinationAddress: interactorsByChainId[destinationChainId],
destinationGasLimit: 300000,
message: abi.encode(VALUE_MESSAGE_TYPE),
message: abi.encode(),
zetaValueAndGas: zetaValueAndGas,
zetaParams: abi.encode("")
})
);
}

function onZetaMessage(
ZetaInterfaces.ZetaMessage calldata zetaMessage
) external override isValidMessageCall(zetaMessage) {
bytes32 messageType = abi.decode(zetaMessage.message, (bytes32));

if (messageType != VALUE_MESSAGE_TYPE) revert InvalidMessageType();

emit ValueEvent();
}

function onZetaRevert(
ZetaInterfaces.ZetaRevert calldata zetaRevert
) external override isValidRevertCall(zetaRevert) {
bytes32 messageType = abi.decode(zetaRevert.message, (bytes32));

if (messageType != VALUE_MESSAGE_TYPE) revert InvalidMessageType();

emit ValueRevertedEvent();
}
}

0 comments on commit 47cc6db

Please sign in to comment.