Skip to content

Conversation

@buv22
Copy link

@buv22 buv22 commented May 14, 2024

ounter.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IGmpReceiver} from "contracts/IGmpReceiver.sol";

contract Counter is IGmpReceiver {
address private immutable _gateway;
uint256 public number;

constructor(address gateway) {
    _gateway = gateway;
}

function onGmpReceived(bytes32, uint128, bytes32, bytes calldata) external payable returns (bytes32) {
    require(msg.sender == _gateway, "unauthorized");
    number++;
    return bytes32(number);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant