OraclyxClaim

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

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

interface IERC20 {
    function transfer(address to, uint256 amount) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
}

interface IERC721 {
    function ownerOf(uint256 tokenId) external view returns (address);
}

contract OraclyxClaim {
    IERC20 public immutable orx;
    IERC721 public immutable nft;
    address public owner;
    uint256 public constant AMOUNT_PER_NFT = 1000000000; // 10,000 * 10^8  (8 decimais)
    mapping(uint256 => bool) public claimed;

    event Claimed(address indexed claimer, uint256 indexed tokenId, uint256 amount);

    modifier onlyOwner() {
        require(msg.sender == owner, "Not owner");
        _;
    }

    constructor(address _orx, address _nft) {
        require(_orx != address(0) && _nft != address(0), "zero addr");
        orx = IERC20(_orx);
        nft = IERC721(_nft);
        owner = msg.sender;
    }

    function claim(uint256 tokenId) external {
        require(!claimed[tokenId], "Already claimed");
        require(nft.ownerOf(tokenId) == msg.sender, "Not NFT owner");
        claimed[tokenId] = true;
        require(orx.transfer(msg.sender, AMOUNT_PER_NFT), "Transfer failed");
        emit Claimed(msg.sender, tokenId, AMOUNT_PER_NFT);
    }

    // Caso sobre saldo após o período de claim
    function withdrawRemaining(address to) external onlyOwner {
        require(to != address(0), "zero");
        uint256 bal = orx.balanceOf(address(this));
        require(orx.transfer(to, bal), "Withdraw failed");
    }
}

Tags:
addr:0xb2d8e7ebe7a597583eeda98ed5ec43ed89db9d88|verified:true|block:23727574|tx:0x4da694a57fdd4f5f1337d82fb750efdc0fdf0ac90ffe9e9634c45c988b979fd9|first_check:1762282488

Submitted on: 2025-11-04 19:54:48

Comments

Log in to comment.

No comments yet.