Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 20 from a total of 20 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 17492027 | 457 days ago | IN | 0 ETH | 0.00105604 | ||||
Claim | 17470736 | 460 days ago | IN | 0 ETH | 0.00046267 | ||||
Claim | 17470734 | 460 days ago | IN | 0 ETH | 0.00162224 | ||||
Claim | 17458233 | 462 days ago | IN | 0 ETH | 0.00313047 | ||||
Claim | 17331636 | 480 days ago | IN | 0 ETH | 0.00336207 | ||||
Claim | 17319703 | 482 days ago | IN | 0 ETH | 0.00222977 | ||||
Claim | 17309751 | 483 days ago | IN | 0 ETH | 0.00164345 | ||||
Claim | 17274282 | 488 days ago | IN | 0 ETH | 0.0067982 | ||||
Claim | 17247412 | 492 days ago | IN | 0 ETH | 0.00506652 | ||||
Claim | 17246868 | 492 days ago | IN | 0 ETH | 0.00618104 | ||||
Claim | 17245662 | 492 days ago | IN | 0 ETH | 0.00742842 | ||||
Claim | 17229666 | 494 days ago | IN | 0 ETH | 0.00885674 | ||||
Claim | 17228009 | 495 days ago | IN | 0 ETH | 0.00647598 | ||||
Claim | 17221931 | 495 days ago | IN | 0 ETH | 0.00182605 | ||||
Claim | 17221927 | 495 days ago | IN | 0 ETH | 0.00431403 | ||||
Claim | 17219364 | 496 days ago | IN | 0 ETH | 0.00736935 | ||||
Claim | 17218115 | 496 days ago | IN | 0 ETH | 0.01072857 | ||||
Claim | 17215281 | 496 days ago | IN | 0 ETH | 0.00720131 | ||||
Set Role | 17209725 | 497 days ago | IN | 0 ETH | 0.00603917 | ||||
0x60806040 | 17193948 | 499 days ago | IN | 0 ETH | 0.0360498 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MutariuumGiveaways
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "../interfaces/IERC721.sol"; import "../libraries/ECDSA.sol"; import "./Roles.sol"; contract MutariuumGiveaways is Roles { error ClaimTimeout(); constructor() { _setRole(msg.sender, 0, true); } function claim( address nft, address sender, uint256[] calldata tokenIds, uint256 blockNumber, bytes calldata signature ) external { _verifySignature(nft, sender, tokenIds, blockNumber, signature); IERC721 collection = IERC721(nft); uint256 tokensLength = tokenIds.length; for (uint256 i = 0; i < tokensLength;) { collection.safeTransferFrom(sender, msg.sender, tokenIds[i]); unchecked { ++i; } } } function _verifySignature( address nft, address sender, uint256[] calldata tokenIds, uint256 blockNumber, bytes calldata signature ) internal view { unchecked { if (block.number > blockNumber + 10) { revert ClaimTimeout(); } } address signer = _getSigner( keccak256( abi.encode( msg.sender, nft, sender, tokenIds, blockNumber ) ), signature ); if (!_hasRole(signer, 1)) { revert ECDSA.InvalidSignature(); } } function _getSigner(bytes32 message, bytes calldata signature) internal pure returns(address) { bytes32 hash = keccak256( abi.encodePacked( "\x19Ethereum Signed Message:\n32", message ) ); return ECDSA.recover(hash, signature); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; import "../libraries/Bits.sol"; contract Roles { using Bits for bytes32; error MissingRole(address user, uint256 role); event RoleUpdated(address indexed user, uint256 indexed role, bool indexed status); /** * @dev There is a maximum of 256 roles: each bit says if the role is on or off */ mapping(address => bytes32) private _addressRoles; function _hasRole(address user, uint8 role) internal view returns(bool) { bytes32 roles = _addressRoles[user]; return roles.getBool(role); } function _checkRole(address user, uint8 role) internal virtual view { if (user == address(this)) return; bytes32 roles = _addressRoles[user]; bool allowed = roles.getBool(role); if (!allowed) { revert MissingRole(user, role); } } function _setRole(address user, uint8 role, bool status) internal virtual { _addressRoles[user] = _addressRoles[user].setBit(role, status); emit RoleUpdated(user, role, status); } function setRole(address user, uint8 role, bool status) external virtual { _checkRole(msg.sender, 0); _setRole(user, role, status); } function getRoles(address user) external view returns(bytes32) { return _addressRoles[user]; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; library Bits { /** * @dev unpack bit [offset] (bool) */ function getBool(bytes32 p, uint8 offset) internal pure returns (bool r) { assembly { r := and(shr(offset, p), 1) } } /** * @dev set bit [{offset}] to {value} */ function setBit( bytes32 p, uint8 offset, bool value ) internal pure returns (bytes32 np) { assembly { np := or( and( p, xor( 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, shl(offset, 1) ) ), shl(offset, value) ) } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; library ECDSA { error InvalidSignature(); function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { if (signature.length != 65) { revert InvalidSignature(); } bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { revert InvalidSignature(); } return ecrecover(hash, v, r, s); } }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ClaimTimeout","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"role","type":"uint256"}],"name":"MissingRole","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"role","type":"uint256"},{"indexed":true,"internalType":"bool","name":"status","type":"bool"}],"name":"RoleUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getRoles","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint8","name":"role","type":"uint8"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001e3360006001610023565b610082565b6001600160a01b03831660008181526020819052604080822080546000196001881b181685871b179055518315159260ff86169290917f3e4657b0da61ffd251af36cb52bd766075e299a246b4cb5f3a200bdbdea2c0939190a4505050565b6106d7806100916000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063161b622d14610046578063ce6ccfaf1461005b578063f6bb6b3714610096575b600080fd5b6100596100543660046104e9565b6100a9565b005b6100846100693660046105b4565b6001600160a01b031660009081526020819052604090205490565b60405190815260200160405180910390f35b6100596100a43660046105d6565b61016e565b6100b887878787878787610189565b868460005b8181101561016257826001600160a01b03166342842e0e8a338b8b868181106100e8576100e861062a565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b505050508060010190506100bd565b50505050505050505050565b610179336000610233565b6101848383836102a2565b505050565b82600a014311156101ad576040516340c7517560e11b815260040160405180910390fd5b60006101ea3389898989896040516020016101cd96959493929190610640565b604051602081830303815290604052805190602001208484610301565b6001600160a01b038116600090815260208190526040902054909150600190811c1661022957604051638baa579f60e01b815260040160405180910390fd5b5050505050505050565b306001600160a01b03831603610247575050565b6001600160a01b03821660009081526020819052604090205480821c6001168061029c5760405163607b74c960e11b81526001600160a01b038516600482015260ff8416602482015260440160405180910390fd5b50505050565b6001600160a01b03831660008181526020819052604080822080546000196001881b181685871b179055518315159260ff86169290917f3e4657b0da61ffd251af36cb52bd766075e299a246b4cb5f3a200bdbdea2c0939190a4505050565b6040517b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6020820152603c81018490526000908190605c016040516020818303038152906040528051906020012090506103908185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061039992505050565b95945050505050565b600081516041146103bd57604051638baa579f60e01b815260040160405180910390fd5b60208201516040830151606084015160001a6103db868285856103e5565b9695505050505050565b60006fa2a8918ca85bafe22016d0b997e4df60600160ff1b0382111561041e57604051638baa579f60e01b815260040160405180910390fd5b60408051600081526020810180835287905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610471573d6000803e3d6000fd5b5050604051601f1901519695505050505050565b80356001600160a01b038116811461049c57600080fd5b919050565b60008083601f8401126104b357600080fd5b5081356001600160401b038111156104ca57600080fd5b6020830191508360208285010111156104e257600080fd5b9250929050565b600080600080600080600060a0888a03121561050457600080fd5b61050d88610485565b965061051b60208901610485565b955060408801356001600160401b038082111561053757600080fd5b818a0191508a601f83011261054b57600080fd5b81358181111561055a57600080fd5b8b60208260051b850101111561056f57600080fd5b6020830197508096505060608a0135945060808a013591508082111561059457600080fd5b506105a18a828b016104a1565b989b979a50959850939692959293505050565b6000602082840312156105c657600080fd5b6105cf82610485565b9392505050565b6000806000606084860312156105eb57600080fd5b6105f484610485565b9250602084013560ff8116811461060a57600080fd5b91506040840135801515811461061f57600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03878116825286811660208301528516604082015260a060608201819052810183905260006001600160fb1b0384111561068057600080fd5b8360051b808660c08501376080830193909352500160c0019594505050505056fea26469706673582212201d547e1aed0d793a406d88ed155fbd681497857f62f0313e739f5ad773fa61ec64736f6c63430008130033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063161b622d14610046578063ce6ccfaf1461005b578063f6bb6b3714610096575b600080fd5b6100596100543660046104e9565b6100a9565b005b6100846100693660046105b4565b6001600160a01b031660009081526020819052604090205490565b60405190815260200160405180910390f35b6100596100a43660046105d6565b61016e565b6100b887878787878787610189565b868460005b8181101561016257826001600160a01b03166342842e0e8a338b8b868181106100e8576100e861062a565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b505050508060010190506100bd565b50505050505050505050565b610179336000610233565b6101848383836102a2565b505050565b82600a014311156101ad576040516340c7517560e11b815260040160405180910390fd5b60006101ea3389898989896040516020016101cd96959493929190610640565b604051602081830303815290604052805190602001208484610301565b6001600160a01b038116600090815260208190526040902054909150600190811c1661022957604051638baa579f60e01b815260040160405180910390fd5b5050505050505050565b306001600160a01b03831603610247575050565b6001600160a01b03821660009081526020819052604090205480821c6001168061029c5760405163607b74c960e11b81526001600160a01b038516600482015260ff8416602482015260440160405180910390fd5b50505050565b6001600160a01b03831660008181526020819052604080822080546000196001881b181685871b179055518315159260ff86169290917f3e4657b0da61ffd251af36cb52bd766075e299a246b4cb5f3a200bdbdea2c0939190a4505050565b6040517b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6020820152603c81018490526000908190605c016040516020818303038152906040528051906020012090506103908185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061039992505050565b95945050505050565b600081516041146103bd57604051638baa579f60e01b815260040160405180910390fd5b60208201516040830151606084015160001a6103db868285856103e5565b9695505050505050565b60006fa2a8918ca85bafe22016d0b997e4df60600160ff1b0382111561041e57604051638baa579f60e01b815260040160405180910390fd5b60408051600081526020810180835287905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610471573d6000803e3d6000fd5b5050604051601f1901519695505050505050565b80356001600160a01b038116811461049c57600080fd5b919050565b60008083601f8401126104b357600080fd5b5081356001600160401b038111156104ca57600080fd5b6020830191508360208285010111156104e257600080fd5b9250929050565b600080600080600080600060a0888a03121561050457600080fd5b61050d88610485565b965061051b60208901610485565b955060408801356001600160401b038082111561053757600080fd5b818a0191508a601f83011261054b57600080fd5b81358181111561055a57600080fd5b8b60208260051b850101111561056f57600080fd5b6020830197508096505060608a0135945060808a013591508082111561059457600080fd5b506105a18a828b016104a1565b989b979a50959850939692959293505050565b6000602082840312156105c657600080fd5b6105cf82610485565b9392505050565b6000806000606084860312156105eb57600080fd5b6105f484610485565b9250602084013560ff8116811461060a57600080fd5b91506040840135801515811461061f57600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03878116825286811660208301528516604082015260a060608201819052810183905260006001600160fb1b0384111561068057600080fd5b8360051b808660c08501376080830193909352500160c0019594505050505056fea26469706673582212201d547e1aed0d793a406d88ed155fbd681497857f62f0313e739f5ad773fa61ec64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.