Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xec21d142281e85e3c471148c4f98c75d0ffe884c1a7351d6b4bd07524fc3408e | 0x60a06040 | 29212787 | 27 days 1 hr ago | 0x77447f2ca205d6405206d1af316f1f5954bc2bb5 | IN | Create: NFTtreasuryXVMC | 0 MATIC | 0.021687292 |
[ Download CSV Export ]
Contract Name:
NFTtreasuryXVMC
Compiler Version
v0.8.0+commit.c7dfd78e
Contract Source Code (Solidity)
/** *Submitted for verification at polygonscan.com on 2022-06-05 */ // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * 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[EIP 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); } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: xvmc-contracts/wallets/NFTwallet.sol pragma solidity 0.8.0; interface IToken { function governor() external view returns (address); } contract NFTtreasuryXVMC is IERC721Receiver { address public immutable xvmc; //XVMC token address constructor(address _XVMC) { xvmc = _XVMC; } modifier onlyOwner() { require(msg.sender == IToken(xvmc).governor(), "admin: wut?"); _; } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } //safe transfer NFT (can be used for sending or claiming NFTs) function transferNFT(address token, address from, address to, uint256 tokenID) external onlyOwner returns (bool) { if(IERC721(token).getApproved(tokenID) == to) { IERC721(token).safeTransferFrom(from, to, tokenID); return true; } else { return false; } } function approveNFT(address claimer, address token, uint256 tokenID) external onlyOwner { IERC721(token).approve(claimer, tokenID); } function approveNFTall(address claimer, address token, bool approval) external onlyOwner { IERC721(token).setApprovalForAll(claimer, approval); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_XVMC","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"approveNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"claimer","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"approval","type":"bool"}],"name":"approveNFTall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"transferNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xvmc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161089338038061089383398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c6107ef6100a46000396000818160f5015281816102240152818161031501526104de01526107ef6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063150b7a021461005c5780636b85cc43146100855780637336aaf01461009a578063b0306671146100ad578063dd194cad146100cd575b600080fd5b61006f61006a366004610601565b6100e2565b60405161007c9190610748565b60405180910390f35b610098610093366004610573565b6100f3565b005b6100986100a83660046105c1565b610222565b6100c06100bb366004610523565b610311565b60405161007c919061073d565b6100d56104dc565b60405161007c91906106d1565b630a85bd0160e11b5b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561014c57600080fd5b505afa158015610160573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101849190610500565b6001600160a01b0316336001600160a01b0316146101bd5760405162461bcd60e51b81526004016101b49061075d565b60405180910390fd5b60405163a22cb46560e01b81526001600160a01b0383169063a22cb465906101eb9086908590600401610709565b600060405180830381600087803b15801561020557600080fd5b505af1158015610219573d6000803e3d6000fd5b50505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561027b57600080fd5b505afa15801561028f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b39190610500565b6001600160a01b0316336001600160a01b0316146102e35760405162461bcd60e51b81526004016101b49061075d565b60405163095ea7b360e01b81526001600160a01b0383169063095ea7b3906101eb9086908590600401610724565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561036c57600080fd5b505afa158015610380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a49190610500565b6001600160a01b0316336001600160a01b0316146103d45760405162461bcd60e51b81526004016101b49061075d565b826001600160a01b0316856001600160a01b031663081812fc846040518263ffffffff1660e01b815260040161040a9190610782565b60206040518083038186803b15801561042257600080fd5b505afa158015610436573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045a9190610500565b6001600160a01b031614156104d457604051632142170760e11b81526001600160a01b038616906342842e0e90610499908790879087906004016106e5565b600060405180830381600087803b1580156104b357600080fd5b505af11580156104c7573d6000803e3d6000fd5b50505050600190506100eb565b5060006100eb565b7f000000000000000000000000000000000000000000000000000000000000000081565b600060208284031215610511578081fd5b815161051c816107a1565b9392505050565b60008060008060808587031215610538578283fd5b8435610543816107a1565b93506020850135610553816107a1565b92506040850135610563816107a1565b9396929550929360600135925050565b600080600060608486031215610587578283fd5b8335610592816107a1565b925060208401356105a2816107a1565b9150604084013580151581146105b6578182fd5b809150509250925092565b6000806000606084860312156105d5578283fd5b83356105e0816107a1565b925060208401356105f0816107a1565b929592945050506040919091013590565b60008060008060808587031215610616578384fd5b8435610621816107a1565b9350602085810135610632816107a1565b935060408601359250606086013567ffffffffffffffff80821115610655578384fd5b818801915088601f830112610668578384fd5b81358181111561067a5761067a61078b565b604051601f8201601f191681018501838111828210171561069d5761069d61078b565b60405281815283820185018b10156106b3578586fd5b81858501868301379081019093019390935250939692955090935050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b039290921682521515602082015260400190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6001600160e01b031991909116815260200190565b6020808252600b908201526a61646d696e3a207775743f60a81b604082015260600190565b90815260200190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b657600080fd5b5056fea2646970667358221220e985ad6754b74b3a53c97b7582e2d9f010a3509042a8e7216fae91781ab2d46264736f6c63430008000033000000000000000000000000970ccee657dd831e9c37511aa3eb5302c1eb5eee
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000970ccee657dd831e9c37511aa3eb5302c1eb5eee
-----Decoded View---------------
Arg [0] : _XVMC (address): 0x970ccee657dd831e9c37511aa3eb5302c1eb5eee
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000970ccee657dd831e9c37511aa3eb5302c1eb5eee
Deployed ByteCode Sourcemap
7909:1183:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8203:164;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;8930:159;;;;;;:::i;:::-;;:::i;:::-;;8775:147;;;;;;:::i;:::-;;:::i;8438:325::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;7960:29::-;;;:::i;:::-;;;;;;;:::i;8203:164::-;-1:-1:-1;;;8203:164:0;;;;;;;:::o;8930:159::-;8142:4;-1:-1:-1;;;;;8135:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;8121:37:0;:10;-1:-1:-1;;;;;8121:37:0;;8113:61;;;;-1:-1:-1;;;8113:61:0;;;;;;;:::i;:::-;;;;;;;;;9030:51:::1;::::0;-1:-1:-1;;;9030:51:0;;-1:-1:-1;;;;;9030:32:0;::::1;::::0;::::1;::::0;:51:::1;::::0;9063:7;;9072:8;;9030:51:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;8930:159:::0;;;:::o;8775:147::-;8142:4;-1:-1:-1;;;;;8135:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;8121:37:0;:10;-1:-1:-1;;;;;8121:37:0;;8113:61;;;;-1:-1:-1;;;8113:61:0;;;;;;;:::i;:::-;8874:40:::1;::::0;-1:-1:-1;;;8874:40:0;;-1:-1:-1;;;;;8874:22:0;::::1;::::0;::::1;::::0;:40:::1;::::0;8897:7;;8906;;8874:40:::1;;;:::i;8438:325::-:0;8545:4;8142;-1:-1:-1;;;;;8135:21:0;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;8121:37:0;:10;-1:-1:-1;;;;;8121:37:0;;8113:61;;;;-1:-1:-1;;;8113:61:0;;;;;;;:::i;:::-;8604:2:::1;-1:-1:-1::0;;;;;8565:41:0::1;8573:5;-1:-1:-1::0;;;;;8565:26:0::1;;8592:7;8565:35;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;8565:41:0::1;;8562:194;;;8623:50;::::0;-1:-1:-1;;;8623:50:0;;-1:-1:-1;;;;;8623:31:0;::::1;::::0;::::1;::::0;:50:::1;::::0;8655:4;;8661:2;;8665:7;;8623:50:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;8695:4;8688:11;;;;8562:194;-1:-1:-1::0;8739:5:0::1;8732:12;;7960:29:::0;;;:::o;14:263:1:-;;137:2;125:9;116:7;112:23;108:32;105:2;;;158:6;150;143:22;105:2;195:9;189:16;214:33;241:5;214:33;:::i;:::-;266:5;95:182;-1:-1:-1;;;95:182:1:o;282:614::-;;;;;445:3;433:9;424:7;420:23;416:33;413:2;;;467:6;459;452:22;413:2;511:9;498:23;530:33;557:5;530:33;:::i;:::-;582:5;-1:-1:-1;639:2:1;624:18;;611:32;652:35;611:32;652:35;:::i;:::-;706:7;-1:-1:-1;765:2:1;750:18;;737:32;778:35;737:32;778:35;:::i;:::-;403:493;;;;-1:-1:-1;832:7:1;;886:2;871:18;858:32;;-1:-1:-1;;403:493:1:o;901:581::-;;;;1044:2;1032:9;1023:7;1019:23;1015:32;1012:2;;;1065:6;1057;1050:22;1012:2;1109:9;1096:23;1128:33;1155:5;1128:33;:::i;:::-;1180:5;-1:-1:-1;1237:2:1;1222:18;;1209:32;1250:35;1209:32;1250:35;:::i;:::-;1304:7;-1:-1:-1;1363:2:1;1348:18;;1335:32;1405:15;;1398:23;1386:36;;1376:2;;1441:6;1433;1426:22;1376:2;1469:7;1459:17;;;1002:480;;;;;:::o;1487:470::-;;;;1633:2;1621:9;1612:7;1608:23;1604:32;1601:2;;;1654:6;1646;1639:22;1601:2;1698:9;1685:23;1717:33;1744:5;1717:33;:::i;:::-;1769:5;-1:-1:-1;1826:2:1;1811:18;;1798:32;1839:35;1798:32;1839:35;:::i;:::-;1591:366;;1893:7;;-1:-1:-1;;;1947:2:1;1932:18;;;;1919:32;;1591:366::o;1962:1306::-;;;;;2134:3;2122:9;2113:7;2109:23;2105:33;2102:2;;;2156:6;2148;2141:22;2102:2;2200:9;2187:23;2219:33;2246:5;2219:33;:::i;:::-;2271:5;-1:-1:-1;2295:2:1;2334:18;;;2321:32;2362:35;2321:32;2362:35;:::i;:::-;2416:7;-1:-1:-1;2470:2:1;2455:18;;2442:32;;-1:-1:-1;2525:2:1;2510:18;;2497:32;2548:18;2578:14;;;2575:2;;;2610:6;2602;2595:22;2575:2;2653:6;2642:9;2638:22;2628:32;;2698:7;2691:4;2687:2;2683:13;2679:27;2669:2;;2725:6;2717;2710:22;2669:2;2766;2753:16;2788:2;2784;2781:10;2778:2;;;2794:18;;:::i;:::-;2843:2;2837:9;2912:2;2893:13;;-1:-1:-1;;2889:27:1;2877:40;;2873:49;;2937:18;;;2957:22;;;2934:46;2931:2;;;2983:18;;:::i;:::-;3019:2;3012:22;3043:18;;;3080:11;;;3076:20;;3073:33;-1:-1:-1;3070:2:1;;;3124:6;3116;3109:22;3070:2;3185;3180;3176;3172:11;3167:2;3159:6;3155:15;3142:46;3208:15;;;3204:24;;;3197:40;;;;-1:-1:-1;2092:1176:1;;;;-1:-1:-1;2092:1176:1;;-1:-1:-1;;2092:1176:1:o;3273:203::-;-1:-1:-1;;;;;3437:32:1;;;;3419:51;;3407:2;3392:18;;3374:102::o;3481:375::-;-1:-1:-1;;;;;3739:15:1;;;3721:34;;3791:15;;;;3786:2;3771:18;;3764:43;3838:2;3823:18;;3816:34;;;;3671:2;3656:18;;3638:218::o;3861:284::-;-1:-1:-1;;;;;4047:32:1;;;;4029:51;;4123:14;4116:22;4111:2;4096:18;;4089:50;4017:2;4002:18;;3984:161::o;4150:274::-;-1:-1:-1;;;;;4342:32:1;;;;4324:51;;4406:2;4391:18;;4384:34;4312:2;4297:18;;4279:145::o;4429:187::-;4594:14;;4587:22;4569:41;;4557:2;4542:18;;4524:92::o;4621:202::-;-1:-1:-1;;;;;;4783:33:1;;;;4765:52;;4753:2;4738:18;;4720:103::o;4828:335::-;5030:2;5012:21;;;5069:2;5049:18;;;5042:30;-1:-1:-1;;;5103:2:1;5088:18;;5081:41;5154:2;5139:18;;5002:161::o;5168:177::-;5314:25;;;5302:2;5287:18;;5269:76::o;5350:127::-;5411:10;5406:3;5402:20;5399:1;5392:31;5442:4;5439:1;5432:15;5466:4;5463:1;5456:15;5482:133;-1:-1:-1;;;;;5559:31:1;;5549:42;;5539:2;;5605:1;5602;5595:12;5539:2;5529:86;:::o
Swarm Source
ipfs://e985ad6754b74b3a53c97b7582e2d9f010a3509042a8e7216fae91781ab2d462
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.