Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ounter.sol #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create ounter.sol #9

wants to merge 1 commit into from

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