SurfDailyGM

0x3d97b802ffd7f36d50ce1498e8ca5318c5c8e9ec

Verification
Verified
v0.8.13+commit.abaa5c0e
Type
Contract
1,052 bytes
ABI entries
11
2 read · 4 write
License
none

Contract information

Address
0x3d97b802ffd7f36d50ce1498e8ca5318c5c8e9ec
Chain
Robinhood Chain (4663)
Compiler
v0.8.13+commit.abaa5c0e
Optimization
Enabled
Creation tx
0xf17a8da3f2…83d899e6bd

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (2)

gasFee()uint256
owner()address

Events (2)

OwnershipTransferredSuccess

ABI

[
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_gasFee",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "_feeRecipient",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "NoFund",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "TransferFailed",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "previousOwner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "OwnershipTransferred",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "sender",
        "type": "address"
      }
    ],
    "name": "Success",
    "type": "event"
  },
  {
    "inputs": [],
    "name": "dailyGM",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "gasFee",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "owner",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "renounceOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "transferOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_gasFee",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "_feeRecipient",
        "type": "address"
      }
    ],
    "name": "updateConfig",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";

contract SurfDailyGM is Ownable {
    address internal feeRecipient;
    uint256 public gasFee;

    event Success(address indexed sender);
    error NoFund();
    error TransferFailed();

    constructor(uint256 _gasFee, address _feeRecipient) {
        feeRecipient = _feeRecipient;
        gasFee = _gasFee;
    }

    function dailyGM() external payable {
        if (msg.value != gasFee) {
            revert NoFund();
        }

        (bool success, ) = feeRecipient.call{value: msg.value}("");

        if (!success) {
            revert TransferFailed();
        }

        emit Success(msg.sender);
    }

    function updateConfig(
        uint256 _gasFee,
        address _feeRecipient
    ) external onlyOwner {
        feeRecipient = _feeRecipient;
        gasFee = _gasFee;
    }
}
Chain explorer1479msChain node89ms