Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x80d5C4E7A3B2FD6C376b2AB058e0a3d88931962e
Balance 0 ETH
Nonce 1
Code Size 7766 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

7766 bytes
0x608060405260043610610094575f3560e01c8063bc197c8111610058578063bc197c8114610171578063dc2f8744146101ad578063f0f284fc146101ed578063f23a6e611461022d578063f851a440146102695761009b565b806301ffc9a71461009f57806306641f7e146100db5780630ec9ef7e1461010557806344021ad714610121578063aabf80ff146101495761009b565b3661009b57005b5f5ffd5b3480156100aa575f5ffd5b506100c560048036038101906100c091906110d8565b610293565b6040516100d2919061111d565b60405180910390f35b3480156100e6575f5ffd5b506100ef61030c565b6040516100fc919061114e565b60405180910390f35b61011f600480360381019061011a9190611230565b610318565b005b34801561012c575f5ffd5b50610147600480360381019061014291906112aa565b610741565b005b348015610154575f5ffd5b5061016f600480360381019061016a91906112d5565b610a15565b005b34801561017c575f5ffd5b50610197600480360381019061019291906113c9565b610dda565b6040516101a491906114af565b60405180910390f35b3480156101b8575f5ffd5b506101d360048036038101906101ce91906112aa565b610df1565b6040516101e495949392919061151b565b60405180910390f35b3480156101f8575f5ffd5b50610213600480360381019061020e91906112aa565b610e91565b60405161022495949392919061156c565b60405180910390f35b348015610238575f5ffd5b50610253600480360381019061024e91906115bd565b610f8c565b60405161026091906114af565b60405180910390f35b348015610274575f5ffd5b5061027d610fa1565b60405161028a9190611653565b60405180910390f35b5f7f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610305575061030482610fc5565b5b9050919050565b5f600180549050905090565b7f00000000000000000000000034927c779298aea054aa81b0653f78cba4e27c3f73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039d906116ec565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040b9061177a565b60405180910390fd5b5f8163ffffffff161161045c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045390611808565b60405180910390fd5b5f341161049e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049590611896565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166301ffc9a77fd9b67a26000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b81526004016104f791906114af565b602060405180830381865afa158015610512573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061053691906118de565b610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056c9061199f565b60405180910390fd5b5f34905060016040518060a001604052808673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018560ff1681526020018463ffffffff1681526020015f1515815250908060018154018082558091505060019003905f5260205f2090600202015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151815f0160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548160ff021916908360ff16021790555060608201518160010160016101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160056101000a81548160ff02191690831515021790555050505f600180805490500390508360ff168573ffffffffffffffffffffffffffffffffffffffff16827fc89f351af95176a934a0d3199d8e4e66e1e81ad5a05db0e2e2f40fe34cfd350986866040516107329291906119bd565b60405180910390a45050505050565b61074961102e565b6001805490508110610790576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078790611a54565b60405180910390fd5b5f600182815481106107a5576107a4611a72565b5b905f5260205f20906002020190508060010160059054906101000a900460ff1615610805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fc90611b0f565b60405180910390fd5b5f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f826001015f9054906101000a900460ff1690505f8360010160019054906101000a900463ffffffff1690505f845f0160149054906101000a90046bffffffffffffffffffffffff1690508373ffffffffffffffffffffffffffffffffffffffff1663f242432a333086866040518563ffffffff1660e01b81526004016108b59493929190611bc9565b5f604051808303815f87803b1580156108cc575f5ffd5b505af11580156108de573d5f5f3e3d5ffd5b5050505060018560010160056101000a81548160ff0219169083151502179055505f3373ffffffffffffffffffffffffffffffffffffffff16826bffffffffffffffffffffffff1660405161093290611c49565b5f6040518083038185875af1925050503d805f811461096c576040519150601f19603f3d011682016040523d82523d5f602084013e610971565b606091505b50509050806109b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ac90611ccd565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16877fbaabe5ce1d04d49e03ac2aff211b4b8dc8fb819a0da8f8f391aca9275045f90e846040516109fc9190611ceb565b60405180910390a3505050505050610a12611072565b50565b7f00000000000000000000000034927c779298aea054aa81b0653f78cba4e27c3f73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610aa3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9a906116ec565b60405180910390fd5b6001805490508210610aea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae190611a54565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4f9061177a565b60405180910390fd5b5f60018381548110610b6d57610b6c611a72565b5b905f5260205f20906002020190508060010160059054906101000a900460ff1615610bcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc490611d74565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77fd9b67a26000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610c2691906114af565b602060405180830381865afa158015610c41573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c6591906118de565b610ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9b9061199f565b60405180910390fd5b5f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2f90611e02565b60405180910390fd5b82825f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16857fb227b61c84f633665412a3d22b6bea2c4293ee51840fe53796375905590b5c6b60405160405180910390a450505050565b5f63bc197c8160e01b905098975050505050505050565b60018181548110610e00575f80fd5b905f5260205f2090600202015f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690805f0160149054906101000a90046bffffffffffffffffffffffff1690806001015f9054906101000a900460ff16908060010160019054906101000a900463ffffffff16908060010160059054906101000a900460ff16905085565b5f5f5f5f5f6001805490508610610edd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed490611a54565b60405180910390fd5b5f60018781548110610ef257610ef1611a72565b5b905f5260205f2090600202019050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900460ff168260010160019054906101000a900463ffffffff16835f0160149054906101000a90046bffffffffffffffffffffffff168460010160059054906101000a900460ff1615955095509550955095505091939590929450565b5f63f23a6e6160e01b90509695505050505050565b7f00000000000000000000000034927c779298aea054aa81b0653f78cba4e27c3f81565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60025f5403611069576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f81905550565b60015f81905550565b5f5ffd5b5f5ffd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6110b781611083565b81146110c1575f5ffd5b50565b5f813590506110d2816110ae565b92915050565b5f602082840312156110ed576110ec61107b565b5b5f6110fa848285016110c4565b91505092915050565b5f8115159050919050565b61111781611103565b82525050565b5f6020820190506111305f83018461110e565b92915050565b5f819050919050565b61114881611136565b82525050565b5f6020820190506111615f83018461113f565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61119082611167565b9050919050565b6111a081611186565b81146111aa575f5ffd5b50565b5f813590506111bb81611197565b92915050565b5f60ff82169050919050565b6111d6816111c1565b81146111e0575f5ffd5b50565b5f813590506111f1816111cd565b92915050565b5f63ffffffff82169050919050565b61120f816111f7565b8114611219575f5ffd5b50565b5f8135905061122a81611206565b92915050565b5f5f5f606084860312156112475761124661107b565b5b5f611254868287016111ad565b9350506020611265868287016111e3565b92505060406112768682870161121c565b9150509250925092565b61128981611136565b8114611293575f5ffd5b50565b5f813590506112a481611280565b92915050565b5f602082840312156112bf576112be61107b565b5b5f6112cc84828501611296565b91505092915050565b5f5f604083850312156112eb576112ea61107b565b5b5f6112f885828601611296565b9250506020611309858286016111ad565b9150509250929050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261133457611333611313565b5b8235905067ffffffffffffffff81111561135157611350611317565b5b60208301915083602082028301111561136d5761136c61131b565b5b9250929050565b5f5f83601f84011261138957611388611313565b5b8235905067ffffffffffffffff8111156113a6576113a5611317565b5b6020830191508360018202830111156113c2576113c161131b565b5b9250929050565b5f5f5f5f5f5f5f5f60a0898b0312156113e5576113e461107b565b5b5f6113f28b828c016111ad565b98505060206114038b828c016111ad565b975050604089013567ffffffffffffffff8111156114245761142361107f565b5b6114308b828c0161131f565b9650965050606089013567ffffffffffffffff8111156114535761145261107f565b5b61145f8b828c0161131f565b9450945050608089013567ffffffffffffffff8111156114825761148161107f565b5b61148e8b828c01611374565b92509250509295985092959890939650565b6114a981611083565b82525050565b5f6020820190506114c25f8301846114a0565b92915050565b6114d181611186565b82525050565b5f6bffffffffffffffffffffffff82169050919050565b6114f7816114d7565b82525050565b611506816111c1565b82525050565b611515816111f7565b82525050565b5f60a08201905061152e5f8301886114c8565b61153b60208301876114ee565b61154860408301866114fd565b611555606083018561150c565b611562608083018461110e565b9695505050505050565b5f60a08201905061157f5f8301886114c8565b61158c60208301876114fd565b611599604083018661150c565b6115a660608301856114ee565b6115b3608083018461110e565b9695505050505050565b5f5f5f5f5f5f60a087890312156115d7576115d661107b565b5b5f6115e489828a016111ad565b96505060206115f589828a016111ad565b955050604061160689828a01611296565b945050606061161789828a01611296565b935050608087013567ffffffffffffffff8111156116385761163761107f565b5b61164489828a01611374565b92509250509295509295509295565b5f6020820190506116665f8301846114c8565b92915050565b5f82825260208201905092915050565b7f50726f6a6563743032426f756e74793a2063616c6c6572206973206e6f7420745f8201527f68652061646d696e000000000000000000000000000000000000000000000000602082015250565b5f6116d660288361166c565b91506116e18261167c565b604082019050919050565b5f6020820190508181035f830152611703816116ca565b9050919050565b7f50726f6a6563743032426f756e74793a20746f6b656e20636f6e7472616374205f8201527f63616e6e6f74206265207a65726f206164647265737300000000000000000000602082015250565b5f61176460368361166c565b915061176f8261170a565b604082019050919050565b5f6020820190508181035f83015261179181611758565b9050919050565b7f50726f6a6563743032426f756e74793a207175616e74697479206d75737420625f8201527f652067726561746572207468616e207a65726f00000000000000000000000000602082015250565b5f6117f260338361166c565b91506117fd82611798565b604082019050919050565b5f6020820190508181035f83015261181f816117e6565b9050919050565b7f50726f6a6563743032426f756e74793a20726577617264206d757374206265205f8201527f67726561746572207468616e207a65726f000000000000000000000000000000602082015250565b5f61188060318361166c565b915061188b82611826565b604082019050919050565b5f6020820190508181035f8301526118ad81611874565b9050919050565b6118bd81611103565b81146118c7575f5ffd5b50565b5f815190506118d8816118b4565b92915050565b5f602082840312156118f3576118f261107b565b5b5f611900848285016118ca565b91505092915050565b7f50726f6a6563743032426f756e74793a20746f6b656e20636f6e7472616374205f8201527f646f6573206e6f7420737570706f7274204552433131353520696e746572666160208201527f6365000000000000000000000000000000000000000000000000000000000000604082015250565b5f61198960428361166c565b915061199482611909565b606082019050919050565b5f6020820190508181035f8301526119b68161197d565b9050919050565b5f6040820190506119d05f83018561150c565b6119dd60208301846114ee565b9392505050565b7f50726f6a6563743032426f756e74793a20626f756e747920646f6573206e6f745f8201527f2065786973740000000000000000000000000000000000000000000000000000602082015250565b5f611a3e60268361166c565b9150611a49826119e4565b604082019050919050565b5f6020820190508181035f830152611a6b81611a32565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f50726f6a6563743032426f756e74793a20626f756e747920616c7265616479205f8201527f636c61696d656400000000000000000000000000000000000000000000000000602082015250565b5f611af960278361166c565b9150611b0482611a9f565b604082019050919050565b5f6020820190508181035f830152611b2681611aed565b9050919050565b5f819050919050565b5f611b50611b4b611b46846111c1565b611b2d565b611136565b9050919050565b611b6081611b36565b82525050565b5f611b80611b7b611b76846111f7565b611b2d565b611136565b9050919050565b611b9081611b66565b82525050565b5f82825260208201905092915050565b50565b5f611bb45f83611b96565b9150611bbf82611ba6565b5f82019050919050565b5f60a082019050611bdc5f8301876114c8565b611be960208301866114c8565b611bf66040830185611b57565b611c036060830184611b87565b8181036080830152611c1481611ba9565b905095945050505050565b5f81905092915050565b5f611c345f83611c1f565b9150611c3f82611ba6565b5f82019050919050565b5f611c5382611c29565b9150819050919050565b7f50726f6a6563743032426f756e74793a206661696c656420746f2073656e64205f8201527f7265776172640000000000000000000000000000000000000000000000000000602082015250565b5f611cb760268361166c565b9150611cc282611c5d565b604082019050919050565b5f6020820190508181035f830152611ce481611cab565b9050919050565b5f602082019050611cfe5f8301846114ee565b92915050565b7f50726f6a6563743032426f756e74793a2063616e6e6f742075706461746520635f8201527f6c61696d656420626f756e747900000000000000000000000000000000000000602082015250565b5f611d5e602d8361166c565b9150611d6982611d04565b604082019050919050565b5f6020820190508181035f830152611d8b81611d52565b9050919050565b7f50726f6a6563743032426f756e74793a206e657720746f6b656e20636f6e74725f8201527f616374206d75737420626520646966666572656e740000000000000000000000602082015250565b5f611dec60358361166c565b9150611df782611d92565b604082019050919050565b5f6020820190508181035f830152611e1981611de0565b905091905056fea2646970667358221220eaebe68994f8cdf8700ce24ada57f662aed5eb3a753c558860a293ab4ccb80de64736f6c634300081d0033

Verified Source Code Full Match

Compiler: v0.8.29+commit.ab55807c EVM: cancun Optimization: No
bounty.sol 192 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract Project02BountyV1 is IERC1155Receiver, ERC165, ReentrancyGuard {

    struct Bounty {
        address tokenContract;  
        uint96 reward;          
        uint8 tokenId;          
        uint32 quantity;        
        bool claimed;           
    }

    address public immutable admin;
    
    Bounty[] public bounties;
    

    event BountyCreated(
        uint256 indexed bountyId,
        address indexed tokenContract,
        uint8 indexed tokenId,
        uint32 quantity,
        uint96 reward
    );


    event BountyClaimed(
        uint256 indexed bountyId,
        address indexed claimer,
        uint96 reward
    );

    event BountyTokenContractUpdated(
        uint256 indexed bountyId,
        address indexed oldTokenContract,
        address indexed newTokenContract
    );

    constructor() {
        admin = msg.sender;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin, "Project02Bounty: caller is not the admin");
        _;
    }


    function createBounty(
        address tokenContract,
        uint8 tokenId,
        uint32 quantity
    ) external payable onlyAdmin {
        require(tokenContract != address(0), "Project02Bounty: token contract cannot be zero address");
        require(quantity > 0, "Project02Bounty: quantity must be greater than zero");
        require(msg.value > 0, "Project02Bounty: reward must be greater than zero");
        
        require(
            IERC1155(tokenContract).supportsInterface(type(IERC1155).interfaceId),
            "Project02Bounty: token contract does not support ERC1155 interface"
        );

        uint96 reward = uint96(msg.value);
        bounties.push(Bounty({
            tokenContract: tokenContract,
            tokenId: tokenId,
            quantity: quantity,
            reward: reward,
            claimed: false
        }));

        uint256 newBountyId;
        unchecked {
            newBountyId = bounties.length - 1;
        }
        
        emit BountyCreated(
            newBountyId,
            tokenContract,
            tokenId,
            quantity,
            reward
        );
    }


    function claimBounty(uint256 bountyId) external nonReentrant {
        require(bountyId < bounties.length, "Project02Bounty: bounty does not exist");
        
        Bounty storage bounty = bounties[bountyId];
        require(!bounty.claimed, "Project02Bounty: bounty already claimed");
        
        address tokenContract = bounty.tokenContract;
        uint8 tokenId = bounty.tokenId;
        uint32 quantity = bounty.quantity;
        uint96 rewardAmount = bounty.reward;
        

        IERC1155(tokenContract).safeTransferFrom(
            msg.sender,
            address(this),
            tokenId,
            quantity,
            ""
        );

        bounty.claimed = true;
        
        (bool success, ) = payable(msg.sender).call{value: rewardAmount}("");
        require(success, "Project02Bounty: failed to send reward");
        
        emit BountyClaimed(bountyId, msg.sender, rewardAmount);
    }

    function getBountyDetails(uint256 bountyId) external view returns (
        address tokenContract,
        uint8 tokenId,
        uint32 quantity,
        uint96 reward,
        bool available
    ) {
        require(bountyId < bounties.length, "Project02Bounty: bounty does not exist");
        
        Bounty storage bounty = bounties[bountyId];
        return (
            bounty.tokenContract,
            bounty.tokenId,
            bounty.quantity,
            bounty.reward,
            !bounty.claimed
        );
    }

    function getBountyCount() external view returns (uint256) {
        return bounties.length;
    }

    function updateBountyTokenContract(uint256 bountyId, address newTokenContract) external onlyAdmin {
        require(bountyId < bounties.length, "Project02Bounty: bounty does not exist");
        require(newTokenContract != address(0), "Project02Bounty: token contract cannot be zero address");
        
        Bounty storage bounty = bounties[bountyId];
        require(!bounty.claimed, "Project02Bounty: cannot update claimed bounty");
        
        require(
            IERC1155(newTokenContract).supportsInterface(type(IERC1155).interfaceId),
            "Project02Bounty: token contract does not support ERC1155 interface"
        );
        
        address oldTokenContract = bounty.tokenContract;
        require(oldTokenContract != newTokenContract, "Project02Bounty: new token contract must be different");
        
        bounty.tokenContract = newTokenContract;
        
        emit BountyTokenContractUpdated(bountyId, oldTokenContract, newTokenContract);
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
        return this.onERC1155Received.selector;
    }


    function onERC1155BatchReceived(
        address,
        address,
        uint256[] calldata,
        uint256[] calldata,
        bytes calldata
    ) external pure override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    function supportsInterface(bytes4 interfaceId) public view override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC1155Receiver).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    receive() external payable {}
}
ReentrancyGuard.sol 87 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}
ERC165.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
IERC1155Receiver.sol 59 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Interface that must be implemented by smart contracts in order to receive
 * ERC-1155 token transfers.
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC-1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC-1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}
IERC1155.sol 123 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[ERC].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the value of tokens of token type `id` owned by `account`.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the zero address.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `value` amount.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external;
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Read Contract

admin 0xf851a440 → address
bounties 0xdc2f8744 → address, uint96, uint8, uint32, bool
getBountyCount 0x06641f7e → uint256
getBountyDetails 0xf0f284fc → address, uint8, uint32, uint96, bool
onERC1155BatchReceived 0xbc197c81 → bytes4
onERC1155Received 0xf23a6e61 → bytes4
supportsInterface 0x01ffc9a7 → bool

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

claimBounty 0x44021ad7
uint256 bountyId
createBounty 0x0ec9ef7e
address tokenContract
uint8 tokenId
uint32 quantity
updateBountyTokenContract 0xaabf80ff
uint256 bountyId
address newTokenContract

Recent Transactions

No transactions found for this address