Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Sponsored
Latest 25 from a total of 76 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Release | 15844485 | 336 days 2 hrs ago | IN | 0 ETH | 0.00118138 | ||||
Release | 15817713 | 339 days 20 hrs ago | IN | 0 ETH | 0.00147499 | ||||
Release | 15774968 | 345 days 19 hrs ago | IN | 0 ETH | 0.00190826 | ||||
Stake | 15774965 | 345 days 19 hrs ago | IN | 0 ETH | 0.00188518 | ||||
Stake | 15493162 | 386 days 8 hrs ago | IN | 0 ETH | 0.00052589 | ||||
Release | 15373362 | 405 days 11 hrs ago | IN | 0 ETH | 0.00118678 | ||||
Release | 15354657 | 408 days 11 hrs ago | IN | 0 ETH | 0.00164828 | ||||
Stake | 15348320 | 409 days 10 hrs ago | IN | 0 ETH | 0.00389718 | ||||
Release | 15266916 | 422 days 5 hrs ago | IN | 0 ETH | 0.00131024 | ||||
Release | 15257739 | 423 days 15 hrs ago | IN | 0 ETH | 0.0020513 | ||||
Release | 15251411 | 424 days 15 hrs ago | IN | 0 ETH | 0.00122443 | ||||
Release | 15067486 | 453 days 3 hrs ago | IN | 0 ETH | 0.00233508 | ||||
Stake | 15016693 | 462 days 2 hrs ago | IN | 0 ETH | 0.00148442 | ||||
Stake | 15005995 | 464 days 2 hrs ago | IN | 0 ETH | 0.00106248 | ||||
Release | 14999470 | 465 days 7 hrs ago | IN | 0 ETH | 0.00109504 | ||||
Stake | 14835759 | 492 days 19 hrs ago | IN | 0 ETH | 0.00178167 | ||||
Stake | 14830611 | 493 days 15 hrs ago | IN | 0 ETH | 0.00228758 | ||||
Unstake | 14830252 | 493 days 17 hrs ago | IN | 0 ETH | 0.00215113 | ||||
Unstake | 14823495 | 494 days 19 hrs ago | IN | 0 ETH | 0.00205737 | ||||
Unstake | 14803572 | 498 days 1 hr ago | IN | 0 ETH | 0.00111228 | ||||
Release | 14802970 | 498 days 3 hrs ago | IN | 0 ETH | 0.00362352 | ||||
Stake | 14801885 | 498 days 7 hrs ago | IN | 0 ETH | 0.00120415 | ||||
Stake | 14798637 | 498 days 20 hrs ago | IN | 0 ETH | 0.00185112 | ||||
Stake | 14786407 | 500 days 19 hrs ago | IN | 0 ETH | 0.00113587 | ||||
Release | 14785320 | 500 days 23 hrs ago | IN | 0 ETH | 0.00174987 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
FlowerShower
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ____ _ _ _ _ // / ___|_ __ __ _| |_(_) |_ _ _ __| | ___ // | | _| '__/ _` | __| | __| | | |/ _` |/ _ \ // | |_| | | | (_| | |_| | |_| |_| | (_| | __/ // \____|_| \__,_|\__|_|\__|\__,_|\__,_|\___| // // A collection of 2,222 unique Non-Fungible Power SUNFLOWERS living in // the metaverse. Becoming a GRATITUDE GANG NFT owner introduces you to // a FAMILY of heart-centered, purpose-driven, service-oriented human // beings. // // https://www.gratitudegang.io/ // import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; // ============ Errors ============ error InvalidCall(); // ============ Interfaces ============ interface IGratis is IERC20 { function mint(address to, uint256 amount) external; } interface IERC721B is IERC721 { function totalSupply() external view returns(uint256); } // ============ Contract ============ /** * @dev Soft stake sunflowers, get $GRATIS. $GRATIS can be used to * purchase items in the Gratitude Store */ contract FlowerShower is Context, ReentrancyGuard { //used in unstake() using Address for address; // ============ Constants ============ //tokens earned per second uint256 public constant TOKEN_RATE = 0.00006 ether; IERC721B public immutable SUNFLOWER_COLLECTION; //this is the contract address for $GRATIS IGratis public immutable GRATIS; // ============ Storage ============ //start time of a token staked mapping(uint256 => uint256) private _start; // ============ Deploy ============ constructor(IERC721B collection, IGratis gratis) { SUNFLOWER_COLLECTION = collection; GRATIS = gratis; } // ============ Read Methods ============ /** * @dev Returns all the tokens an owner owns (just a helper) */ function ownerTokens(address owner) public view returns( uint256[] memory staked, uint256[] memory unstaked ) { uint256 balance = SUNFLOWER_COLLECTION.balanceOf(owner); if (balance == 0) { return (staked, unstaked); } uint256 supply = SUNFLOWER_COLLECTION.totalSupply(); uint256 stakedIndex; uint256 unstakedIndex; staked = new uint256[](balance); unstaked = new uint256[](balance); for (uint256 i = 1; i <= supply; i++) { if (SUNFLOWER_COLLECTION.ownerOf(i) == owner) { if (_start[i] > 0) { staked[stakedIndex++] = i; } else { unstaked[unstakedIndex++] = i; } } } uint256 stakedSub = balance - stakedIndex; uint256 unstakedSub = balance - unstakedIndex; //resize arrays assembly { mstore(staked, sub(mload(staked), stakedSub)) mstore(unstaked, sub(mload(unstaked), unstakedSub)) } } /** * @dev Calculate how many a tokens an NFT earned */ function releaseable(uint256 tokenId) public view returns(uint256) { if (_start[tokenId] == 0) { return 0; } return (block.timestamp - _start[tokenId]) * TOKEN_RATE; } /** * @dev Returns the start time when stake started */ function stakedSince(uint256 tokenId) public view returns(uint256) { return _start[tokenId]; } /** * @dev Calculate how many a tokens a staker earned */ function totalReleaseable(uint256[] memory tokenIds) public view returns(uint256 total) { for (uint256 i = 0; i < tokenIds.length; i++) { total += releaseable(tokenIds[i]); } } // ============ Write Methods ============ /** * @dev Releases tokens without unstaking */ function release(uint256[] memory tokenIds) external nonReentrant { //get the staker address staker = _msgSender(); uint256 toRelease = 0; uint256 timestamp = block.timestamp; for (uint256 i = 0; i < tokenIds.length; i++) { //if not owner if (SUNFLOWER_COLLECTION.ownerOf(tokenIds[i]) != staker) revert InvalidCall(); //add releaseable toRelease += releaseable(tokenIds[i]); //reset when staking started _start[tokenIds[i]] = timestamp; } //next mint tokens address(GRATIS).functionCall( abi.encodeWithSelector(GRATIS.mint.selector, staker, toRelease), "Low-level mint failed" ); } /** * @dev Stakes NFTs */ function stake(uint256[] memory tokenIds) external { //get the staker address staker = _msgSender(); for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; //if (for some reason) token is already staked if (_start[tokenId] > 0 //or if not owner || SUNFLOWER_COLLECTION.ownerOf(tokenId) != staker ) revert InvalidCall(); //remember when staking started _start[tokenId] = block.timestamp; } } /** * @dev Unstakes NFTs and releases tokens */ function unstake(uint256[] memory tokenIds) external nonReentrant { //get the staker address staker = _msgSender(); uint256 toRelease = 0; for (uint256 i = 0; i < tokenIds.length; i++) { //if not owner if (SUNFLOWER_COLLECTION.ownerOf(tokenIds[i]) != staker) revert InvalidCall(); //add releasable toRelease += releaseable(tokenIds[i]); //zero out the start date _start[tokenIds[i]] = 0; } //next mint tokens address(GRATIS).functionCall( abi.encodeWithSelector(GRATIS.mint.selector, staker, toRelease), "Low-level mint failed" ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @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`, 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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 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; 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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC721B","name":"collection","type":"address"},{"internalType":"contract IGratis","name":"gratis","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidCall","type":"error"},{"inputs":[],"name":"GRATIS","outputs":[{"internalType":"contract IGratis","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUNFLOWER_COLLECTION","outputs":[{"internalType":"contract IERC721B","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ownerTokens","outputs":[{"internalType":"uint256[]","name":"staked","type":"uint256[]"},{"internalType":"uint256[]","name":"unstaked","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"releaseable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakedSince","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"totalReleaseable","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b506040516110da3803806110da83398101604081905261002f91610063565b60016000556001600160a01b039182166080521660a05261009d565b6001600160a01b038116811461006057600080fd5b50565b6000806040838503121561007657600080fd5b82516100818161004b565b60208401519092506100928161004b565b809150509250929050565b60805160a051610fe76100f36000396000818161010301526105ae01526000818161015501528181610272015281816103d901528181610653015281816106e00152818161081401526109e60152610fe76000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80636582f4fa116100665780636582f4fa1461013d5780638795fcf414610150578063bba7723e14610177578063ceedebe914610198578063e449f341146101b857600080fd5b80630747a337146100a35780630fbf0a93146100c95780633e97394c146100de5780634174f1a5146100f1578063516fb458146100fe575b600080fd5b6100b66100b1366004610cf2565b6101cb565b6040519081526020015b60405180910390f35b6100dc6100d7366004610cf2565b61021e565b005b6100dc6100ec366004610cf2565b610360565b6100b6653691d6afc00081565b6101257f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c0565b6100b661014b366004610db0565b6105e0565b6101257f000000000000000000000000000000000000000000000000000000000000000081565b61018a610185366004610de1565b61062c565b6040516100c0929190610e39565b6100b66101a6366004610db0565b60009081526001602052604090205490565b6100dc6101c6366004610cf2565b610973565b6000805b8251811015610218576101fa8382815181106101ed576101ed610e67565b60200260200101516105e0565b6102049083610e93565b91508061021081610eab565b9150506101cf565b50919050565b3360005b825181101561035b57600083828151811061023f5761023f610e67565b6020026020010151905060006001600083815260200190815260200160002054118061031a5750826001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016102be91815260200190565b60206040518083038186803b1580156102d657600080fd5b505afa1580156102ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030e9190610ec6565b6001600160a01b031614155b156103385760405163574b16a760e11b815260040160405180910390fd5b60009081526001602052604090204290558061035381610eab565b915050610222565b505050565b600260005414156103b85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000908155339042815b845181101561051a57836001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e87848151811061041857610418610e67565b60200260200101516040518263ffffffff1660e01b815260040161043e91815260200190565b60206040518083038186803b15801561045657600080fd5b505afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190610ec6565b6001600160a01b0316146104b55760405163574b16a760e11b815260040160405180910390fd5b6104ca8582815181106101ed576101ed610e67565b6104d49084610e93565b925081600160008784815181106104ed576104ed610e67565b6020026020010151815260200190815260200160002081905550808061051290610eab565b9150506103c4565b506040516001600160a01b0384166024820152604481018390526105d4906340c10f1960e01b906064015b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935280518082019091526015815274131bddcb5b195d995b081b5a5b9d0819985a5b1959605a1b928101929092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691610b62565b50506001600055505050565b6000818152600160205260408120546105fb57506000919050565b600082815260016020526040902054653691d6afc0009061061c9042610ee3565b6106269190610efa565b92915050565b6040516370a0823160e01b81526001600160a01b03828116600483015260609182916000917f0000000000000000000000000000000000000000000000000000000000000000909116906370a082319060240160206040518083038186803b15801561069757600080fd5b505afa1580156106ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cf9190610f19565b9050806106dc5750915091565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561073757600080fd5b505afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f9190610f19565b90506000808367ffffffffffffffff81111561078d5761078d610cdc565b6040519080825280602002602001820160405280156107b6578160200160208202803683370190505b5095508367ffffffffffffffff8111156107d2576107d2610cdc565b6040519080825280602002602001820160405280156107fb578160200160208202803683370190505b50945060015b83811161093f57876001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161086091815260200190565b60206040518083038186803b15801561087857600080fd5b505afa15801561088c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b09190610ec6565b6001600160a01b0316141561092d5760008181526001602052604090205415610902578087846108df81610eab565b9550815181106108f1576108f1610e67565b60200260200101818152505061092d565b80868361090e81610eab565b94508151811061092057610920610e67565b6020026020010181815250505b8061093781610eab565b915050610801565b50600061094c8386610ee3565b9050600061095a8387610ee3565b9050818851038852808751038752505050505050915091565b600260005414156109c65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103af565b600260009081553390805b8351811015610b2857826001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e868481518110610a2557610a25610e67565b60200260200101516040518263ffffffff1660e01b8152600401610a4b91815260200190565b60206040518083038186803b158015610a6357600080fd5b505afa158015610a77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190610ec6565b6001600160a01b031614610ac25760405163574b16a760e11b815260040160405180910390fd5b610ad78482815181106101ed576101ed610e67565b610ae19083610e93565b9150600060016000868481518110610afb57610afb610e67565b60200260200101518152602001908152602001600020819055508080610b2090610eab565b9150506109d1565b506040516001600160a01b038316602482015260448101829052610b57906340c10f1960e01b90606401610545565b505060016000555050565b6060610b718484600085610b7b565b90505b9392505050565b606082471015610bdc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103af565b843b610c2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103af565b600080866001600160a01b03168587604051610c469190610f62565b60006040518083038185875af1925050503d8060008114610c83576040519150601f19603f3d011682016040523d82523d6000602084013e610c88565b606091505b5091509150610c98828286610ca3565b979650505050505050565b60608315610cb2575081610b74565b825115610cc25782518084602001fd5b8160405162461bcd60e51b81526004016103af9190610f7e565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610d0557600080fd5b823567ffffffffffffffff80821115610d1d57600080fd5b818501915085601f830112610d3157600080fd5b813581811115610d4357610d43610cdc565b8060051b604051601f19603f83011681018181108582111715610d6857610d68610cdc565b604052918252848201925083810185019188831115610d8657600080fd5b938501935b82851015610da457843584529385019392850192610d8b565b98975050505050505050565b600060208284031215610dc257600080fd5b5035919050565b6001600160a01b0381168114610dde57600080fd5b50565b600060208284031215610df357600080fd5b8135610b7481610dc9565b600081518084526020808501945080840160005b83811015610e2e57815187529582019590820190600101610e12565b509495945050505050565b604081526000610e4c6040830185610dfe565b8281036020840152610e5e8185610dfe565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610ea657610ea6610e7d565b500190565b6000600019821415610ebf57610ebf610e7d565b5060010190565b600060208284031215610ed857600080fd5b8151610b7481610dc9565b600082821015610ef557610ef5610e7d565b500390565b6000816000190483118215151615610f1457610f14610e7d565b500290565b600060208284031215610f2b57600080fd5b5051919050565b60005b83811015610f4d578181015183820152602001610f35565b83811115610f5c576000848401525b50505050565b60008251610f74818460208701610f32565b9190910192915050565b6020815260008251806020840152610f9d816040850160208701610f32565b601f01601f1916919091016040019291505056fea2646970667358221220d1b1bf9e9872db3f2f387eb5818d7f7266ec4ce3b0719be00da34166b5df6fb164736f6c63430008090033000000000000000000000000641475850e0316220a2d7e902508e08f72848316000000000000000000000000b33ac190e67993bf584aad1453bc4ed668ea6072
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80636582f4fa116100665780636582f4fa1461013d5780638795fcf414610150578063bba7723e14610177578063ceedebe914610198578063e449f341146101b857600080fd5b80630747a337146100a35780630fbf0a93146100c95780633e97394c146100de5780634174f1a5146100f1578063516fb458146100fe575b600080fd5b6100b66100b1366004610cf2565b6101cb565b6040519081526020015b60405180910390f35b6100dc6100d7366004610cf2565b61021e565b005b6100dc6100ec366004610cf2565b610360565b6100b6653691d6afc00081565b6101257f000000000000000000000000b33ac190e67993bf584aad1453bc4ed668ea607281565b6040516001600160a01b0390911681526020016100c0565b6100b661014b366004610db0565b6105e0565b6101257f000000000000000000000000641475850e0316220a2d7e902508e08f7284831681565b61018a610185366004610de1565b61062c565b6040516100c0929190610e39565b6100b66101a6366004610db0565b60009081526001602052604090205490565b6100dc6101c6366004610cf2565b610973565b6000805b8251811015610218576101fa8382815181106101ed576101ed610e67565b60200260200101516105e0565b6102049083610e93565b91508061021081610eab565b9150506101cf565b50919050565b3360005b825181101561035b57600083828151811061023f5761023f610e67565b6020026020010151905060006001600083815260200190815260200160002054118061031a5750826001600160a01b03167f000000000000000000000000641475850e0316220a2d7e902508e08f728483166001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016102be91815260200190565b60206040518083038186803b1580156102d657600080fd5b505afa1580156102ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030e9190610ec6565b6001600160a01b031614155b156103385760405163574b16a760e11b815260040160405180910390fd5b60009081526001602052604090204290558061035381610eab565b915050610222565b505050565b600260005414156103b85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000908155339042815b845181101561051a57836001600160a01b03167f000000000000000000000000641475850e0316220a2d7e902508e08f728483166001600160a01b0316636352211e87848151811061041857610418610e67565b60200260200101516040518263ffffffff1660e01b815260040161043e91815260200190565b60206040518083038186803b15801561045657600080fd5b505afa15801561046a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190610ec6565b6001600160a01b0316146104b55760405163574b16a760e11b815260040160405180910390fd5b6104ca8582815181106101ed576101ed610e67565b6104d49084610e93565b925081600160008784815181106104ed576104ed610e67565b6020026020010151815260200190815260200160002081905550808061051290610eab565b9150506103c4565b506040516001600160a01b0384166024820152604481018390526105d4906340c10f1960e01b906064015b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935280518082019091526015815274131bddcb5b195d995b081b5a5b9d0819985a5b1959605a1b928101929092526001600160a01b037f000000000000000000000000b33ac190e67993bf584aad1453bc4ed668ea60721691610b62565b50506001600055505050565b6000818152600160205260408120546105fb57506000919050565b600082815260016020526040902054653691d6afc0009061061c9042610ee3565b6106269190610efa565b92915050565b6040516370a0823160e01b81526001600160a01b03828116600483015260609182916000917f000000000000000000000000641475850e0316220a2d7e902508e08f72848316909116906370a082319060240160206040518083038186803b15801561069757600080fd5b505afa1580156106ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cf9190610f19565b9050806106dc5750915091565b60007f000000000000000000000000641475850e0316220a2d7e902508e08f728483166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561073757600080fd5b505afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f9190610f19565b90506000808367ffffffffffffffff81111561078d5761078d610cdc565b6040519080825280602002602001820160405280156107b6578160200160208202803683370190505b5095508367ffffffffffffffff8111156107d2576107d2610cdc565b6040519080825280602002602001820160405280156107fb578160200160208202803683370190505b50945060015b83811161093f57876001600160a01b03167f000000000000000000000000641475850e0316220a2d7e902508e08f728483166001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161086091815260200190565b60206040518083038186803b15801561087857600080fd5b505afa15801561088c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b09190610ec6565b6001600160a01b0316141561092d5760008181526001602052604090205415610902578087846108df81610eab565b9550815181106108f1576108f1610e67565b60200260200101818152505061092d565b80868361090e81610eab565b94508151811061092057610920610e67565b6020026020010181815250505b8061093781610eab565b915050610801565b50600061094c8386610ee3565b9050600061095a8387610ee3565b9050818851038852808751038752505050505050915091565b600260005414156109c65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103af565b600260009081553390805b8351811015610b2857826001600160a01b03167f000000000000000000000000641475850e0316220a2d7e902508e08f728483166001600160a01b0316636352211e868481518110610a2557610a25610e67565b60200260200101516040518263ffffffff1660e01b8152600401610a4b91815260200190565b60206040518083038186803b158015610a6357600080fd5b505afa158015610a77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190610ec6565b6001600160a01b031614610ac25760405163574b16a760e11b815260040160405180910390fd5b610ad78482815181106101ed576101ed610e67565b610ae19083610e93565b9150600060016000868481518110610afb57610afb610e67565b60200260200101518152602001908152602001600020819055508080610b2090610eab565b9150506109d1565b506040516001600160a01b038316602482015260448101829052610b57906340c10f1960e01b90606401610545565b505060016000555050565b6060610b718484600085610b7b565b90505b9392505050565b606082471015610bdc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103af565b843b610c2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103af565b600080866001600160a01b03168587604051610c469190610f62565b60006040518083038185875af1925050503d8060008114610c83576040519150601f19603f3d011682016040523d82523d6000602084013e610c88565b606091505b5091509150610c98828286610ca3565b979650505050505050565b60608315610cb2575081610b74565b825115610cc25782518084602001fd5b8160405162461bcd60e51b81526004016103af9190610f7e565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610d0557600080fd5b823567ffffffffffffffff80821115610d1d57600080fd5b818501915085601f830112610d3157600080fd5b813581811115610d4357610d43610cdc565b8060051b604051601f19603f83011681018181108582111715610d6857610d68610cdc565b604052918252848201925083810185019188831115610d8657600080fd5b938501935b82851015610da457843584529385019392850192610d8b565b98975050505050505050565b600060208284031215610dc257600080fd5b5035919050565b6001600160a01b0381168114610dde57600080fd5b50565b600060208284031215610df357600080fd5b8135610b7481610dc9565b600081518084526020808501945080840160005b83811015610e2e57815187529582019590820190600101610e12565b509495945050505050565b604081526000610e4c6040830185610dfe565b8281036020840152610e5e8185610dfe565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610ea657610ea6610e7d565b500190565b6000600019821415610ebf57610ebf610e7d565b5060010190565b600060208284031215610ed857600080fd5b8151610b7481610dc9565b600082821015610ef557610ef5610e7d565b500390565b6000816000190483118215151615610f1457610f14610e7d565b500290565b600060208284031215610f2b57600080fd5b5051919050565b60005b83811015610f4d578181015183820152602001610f35565b83811115610f5c576000848401525b50505050565b60008251610f74818460208701610f32565b9190910192915050565b6020815260008251806020840152610f9d816040850160208701610f32565b601f01601f1916919091016040019291505056fea2646970667358221220d1b1bf9e9872db3f2f387eb5818d7f7266ec4ce3b0719be00da34166b5df6fb164736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000641475850e0316220a2d7e902508e08f72848316000000000000000000000000b33ac190e67993bf584aad1453bc4ed668ea6072
-----Decoded View---------------
Arg [0] : collection (address): 0x641475850e0316220a2D7E902508E08F72848316
Arg [1] : gratis (address): 0xb33Ac190E67993BF584aAd1453BC4Ed668eA6072
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000641475850e0316220a2d7e902508e08f72848316
Arg [1] : 000000000000000000000000b33ac190e67993bf584aad1453bc4ed668ea6072
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.
[ 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.