More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 8,012 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Batch Restake | 20972773 | 18 hrs ago | IN | 0 ETH | 0.00218155 | ||||
Batch Restake | 20959448 | 2 days ago | IN | 0 ETH | 0.00126977 | ||||
Batch Restake | 20959448 | 2 days ago | IN | 0 ETH | 0.00166178 | ||||
Batch Restake | 20959448 | 2 days ago | IN | 0 ETH | 0.00177798 | ||||
Batch Unstake | 20958457 | 2 days ago | IN | 0 ETH | 0.00178642 | ||||
Batch Unstake | 20958275 | 2 days ago | IN | 0 ETH | 0.0029481 | ||||
Restake | 20957473 | 2 days ago | IN | 0 ETH | 0.00155014 | ||||
Restake | 20955503 | 3 days ago | IN | 0 ETH | 0.00074566 | ||||
Unstake | 20951517 | 3 days ago | IN | 0 ETH | 0.00146261 | ||||
Batch Unstake | 20939249 | 5 days ago | IN | 0 ETH | 0.004592 | ||||
Batch Restake | 20933675 | 6 days ago | IN | 0 ETH | 0.00102791 | ||||
Batch Restake | 20894837 | 11 days ago | IN | 0 ETH | 0.00095697 | ||||
Batch Unstake | 20892448 | 11 days ago | IN | 0 ETH | 0.00262668 | ||||
Batch Unstake | 20877826 | 14 days ago | IN | 0 ETH | 0.00212918 | ||||
Batch Restake | 20861757 | 16 days ago | IN | 0 ETH | 0.00110258 | ||||
Batch Stake | 20858366 | 16 days ago | IN | 0 ETH | 0.00394836 | ||||
Batch Unstake | 20842290 | 18 days ago | IN | 0 ETH | 0.00223534 | ||||
Batch Restake | 20814489 | 22 days ago | IN | 0 ETH | 0.00571757 | ||||
Batch Restake | 20813168 | 23 days ago | IN | 0 ETH | 0.00214033 | ||||
Batch Restake | 20801454 | 24 days ago | IN | 0 ETH | 0.00060755 | ||||
Batch Restake | 20793836 | 25 days ago | IN | 0 ETH | 0.0012958 | ||||
Batch Stake | 20787830 | 26 days ago | IN | 0 ETH | 0.00109886 | ||||
Batch Restake | 20787819 | 26 days ago | IN | 0 ETH | 0.00076615 | ||||
Batch Restake | 20787815 | 26 days ago | IN | 0 ETH | 0.00156638 | ||||
Unstake | 20781169 | 27 days ago | IN | 0 ETH | 0.00118874 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
OnnaBugeishaStaking
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IMintableERC20.sol"; import "./libraries/NftStakingPool.sol"; import "./libraries/MinterAccess.sol"; /** * @title OnnaBugeishaStaking */ contract OnnaBugeishaStaking is NftStakingPool, MinterAccess { constructor(IERC721 _nftCollection, IMintableERC20 _rewardToken) NftStakingPool(_nftCollection, _rewardToken) {} function _sendRewards(address destination, uint256 amount) internal override { IMintableERC20(address(rewardToken)).mint(destination, amount); } function stakeFrom(address from, uint256 poolId, uint256 tokenId) external onlyMinters { require(from != address(0), "Stake: address(0)"); _stake(from, poolId, tokenId); emit Stake(from, poolId, tokenId); } function batchStakeFrom(address from, uint256 poolId, uint256[] calldata tokenIds) external onlyMinters { require(from != address(0), "Stake: address(0)"); for (uint256 i = 0; i < tokenIds.length; i++) { _stake(from, poolId, tokenIds[i]); } emit BatchStake(from, poolId, tokenIds); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IMintableERC20 is IERC20 { function mint(address destination, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./Poolable.sol"; import "./Recoverable.sol"; /** @title NftStakingPool */ contract NftStakingPool is Ownable, Poolable, Recoverable, ReentrancyGuard, ERC721Holder { using SafeERC20 for IERC20; struct PoolDeposit { uint256 depositDate; uint64 pool; address owner; } IERC721 public nftCollection; IERC20 public rewardToken; // poolDeposit per tokenId mapping(uint256 => PoolDeposit) private _deposits; // user rewards mapping mapping(address => uint256) private _userRewards; event Stake(address indexed account, uint256 poolId, uint256 tokenId); event Unstake(address indexed account, uint256 tokenId); event BatchStake(address indexed account, uint256 poolId, uint256[] tokenIds); event BatchUnstake(address indexed account, uint256[] tokenIds); constructor(IERC721 _nftCollection, IERC20 _rewardToken) { nftCollection = _nftCollection; rewardToken = _rewardToken; } function _sendRewards(address destination, uint256 amount) internal virtual { rewardToken.safeTransfer(destination, amount); } function _sendAndUpdateRewards(address account, uint256 amount) internal { if (amount > 0) { _userRewards[account] = _userRewards[account] + amount; _sendRewards(account, amount); } } function _stake(address account, uint256 poolId, uint256 tokenId) internal { require(_deposits[tokenId].owner == address(0), "Stake: Token already staked"); // add deposit _deposits[tokenId] = PoolDeposit({depositDate: block.timestamp, pool: uint64(poolId), owner: account}); // _userTokens[account].add(tokenId); // transfer token nftCollection.safeTransferFrom(account, address(this), tokenId); } /** * @notice Stake a token from the collection */ function stake(uint256 poolId, uint256 tokenId) external nonReentrant whenPoolOpened(poolId) { address account = _msgSender(); _stake(account, poolId, tokenId); emit Stake(account, poolId, tokenId); } function _unstake(address account, uint256 tokenId) internal returns (uint256) { uint256 poolId = _deposits[tokenId].pool; require(isUnlockable(poolId, _deposits[tokenId].depositDate), "Stake: Not yet unstakable"); bool unlocked = isUnlocked(poolId, _deposits[tokenId].depositDate); // transfer token nftCollection.safeTransferFrom(address(this), account, tokenId); // update deposit delete _deposits[tokenId]; uint256 rewards = 0; if (unlocked) { Pool memory pool = getPool(poolId); rewards = pool.rewardAmount; } return rewards; } /** * @notice Unstake a token */ function unstake(uint256 tokenId) external nonReentrant { require(_deposits[tokenId].owner == _msgSender(), "Stake: Not owner of token"); address account = _msgSender(); uint256 rewards = _unstake(account, tokenId); _sendAndUpdateRewards(account, rewards); emit Unstake(account, tokenId); } function _restake(uint256 newPoolId, uint256 tokenId) internal returns (uint256) { require(isPoolOpened(newPoolId), "Stake: Pool is closed"); uint256 oldPoolId = _deposits[tokenId].pool; require(isUnlockable(oldPoolId, _deposits[tokenId].depositDate), "Stake: Not yet unstakable"); bool unlocked = isUnlocked(oldPoolId, _deposits[tokenId].depositDate); // update deposit _deposits[tokenId].pool = uint64(newPoolId); _deposits[tokenId].depositDate = block.timestamp; uint256 rewards = 0; if (unlocked) { Pool memory pool = getPool(oldPoolId); rewards = pool.rewardAmount; } return rewards; } /** * @notice Allow a user to [re]stake a token in a new pool without unstaking it first. */ function restake(uint256 newPoolId, uint256 tokenId) external nonReentrant { require(_deposits[tokenId].owner != address(0), "Stake: Token not staked"); require(_deposits[tokenId].owner == _msgSender(), "Stake: Not owner of token"); address account = _msgSender(); uint256 rewards = _restake(newPoolId, tokenId); _sendAndUpdateRewards(account, rewards); emit Unstake(account, tokenId); emit Stake(account, newPoolId, tokenId); } /** * @notice Batch stake a list of tokens from the collection */ function batchStake(uint256 poolId, uint256[] calldata tokenIds) external whenPoolOpened(poolId) nonReentrant { address account = _msgSender(); for (uint256 i = 0; i < tokenIds.length; i++) { _stake(account, poolId, tokenIds[i]); } emit BatchStake(account, poolId, tokenIds); } /** * @notice Batch unstake tokens */ function batchUnstake(uint256[] calldata tokenIds) external nonReentrant { address account = _msgSender(); uint256 rewards = 0; for (uint256 i = 0; i < tokenIds.length; i++) { require(_deposits[tokenIds[i]].owner == account, "Stake: Not owner of token"); rewards = rewards + _unstake(account, tokenIds[i]); } _sendAndUpdateRewards(account, rewards); emit BatchUnstake(account, tokenIds); } /** * @notice Batch restake tokens */ function batchRestake(uint256 poolId, uint256[] calldata tokenIds) external nonReentrant { address account = _msgSender(); uint256 rewards = 0; for (uint256 i = 0; i < tokenIds.length; i++) { require(_deposits[tokenIds[i]].owner == account, "Stake: Not owner of token"); rewards = rewards + _restake(poolId, tokenIds[i]); } _sendAndUpdateRewards(account, rewards); emit BatchUnstake(account, tokenIds); emit BatchStake(account, poolId, tokenIds); } /** * @notice Checks if a token has been deposited for enough time to get rewards */ function isTokenUnlocked(uint256 tokenId) public view returns (bool) { require(_deposits[tokenId].owner != address(0), "Stake: Token not staked"); return isUnlocked(_deposits[tokenId].pool, _deposits[tokenId].depositDate); } /** * @notice Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date) */ function getStakeInfo(uint256 tokenId) external view returns ( address, // owner uint256, // poolId uint256, // deposit date uint256, // unlock date uint256 // reward date ) { require(_deposits[tokenId].owner != address(0), "Stake: Token not staked"); PoolDeposit memory deposit = _deposits[tokenId]; Pool memory pool = getPool(deposit.pool); return (deposit.owner, deposit.pool, deposit.depositDate, deposit.depositDate + pool.minDuration, deposit.depositDate + pool.lockDuration); } /** * @notice Returns the total reward for a user */ function getUserTotalRewards(address account) external view returns (uint256) { return _userRewards[account]; } function recoverNonFungibleToken(address _token, uint256 _tokenId) external override onlyOwner { // staked collection cannot be recovered by admin require(_token != address(nftCollection), "Stake: Cannot recover staked collection"); IERC721(_token).transferFrom(address(this), address(msg.sender), _tokenId); emit NonFungibleTokenRecovery(_token, _tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IContractUri.sol"; /** * @title MinterAccess */ abstract contract MinterAccess is Ownable { mapping(address => bool) private _minters; event MinterAdded(address indexed minter); event MinterRemoved(address indexed minter); modifier onlyMinters() { require(_minters[_msgSender()], "Mintable: Caller is not minter"); _; } function isMinter(address account) public view returns (bool) { return _minters[account]; } function addMinter(address minter) external onlyOwner { require(!_minters[minter], "Mintable: Already minter"); _minters[minter] = true; emit MinterAdded(minter); } function removeMinter(address minter) external onlyOwner { require(_minters[minter], "Mintable: Not minter"); _minters[minter] = false; emit MinterRemoved(minter); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, 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.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; /** @title Poolable. @dev This contract manage configuration of pools */ abstract contract Poolable is Ownable { struct Pool { uint256 lockDuration; // locked timespan uint256 minDuration; // min deposit timespan bool opened; // flag indicating if the pool is open uint256 rewardAmount; // amount rewarded when lockDuration is reached } // pools mapping uint256 public poolsLength; mapping(uint256 => Pool) private _pools; /** * @dev Emitted when a pool is created */ event PoolAdded(uint256 poolIndex, Pool pool); /** * @dev Emitted when a pool is updated */ event PoolUpdated(uint256 poolIndex, Pool pool); /** * @dev Modifier that checks that the pool at index `poolIndex` is open */ modifier whenPoolOpened(uint256 poolIndex) { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); require(_pools[poolIndex].opened, "Poolable: Pool is closed"); _; } /** * @dev Modifier that checks that the now() - `depositDate` is above or equal to the min lock duration for pool at index `poolIndex` */ modifier whenUnlocked(uint256 poolIndex, uint256 depositDate) { require( isUnlocked(poolIndex, depositDate), "Poolable: Not unlocked" ); _; } function getPool(uint256 poolIndex) public view returns (Pool memory) { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); return _pools[poolIndex]; } function addPool(Pool calldata pool) external onlyOwner { uint256 poolIndex = poolsLength; _pools[poolIndex] = pool; poolsLength = poolsLength + 1; emit PoolAdded(poolIndex, _pools[poolIndex]); } function updatePool(uint256 poolIndex, Pool calldata pool) external onlyOwner { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); Pool storage editedPool = _pools[poolIndex]; editedPool.lockDuration = pool.lockDuration; editedPool.minDuration = pool.minDuration; editedPool.opened = pool.opened; editedPool.rewardAmount = pool.rewardAmount; emit PoolUpdated(poolIndex, editedPool); } function isUnlocked(uint256 poolIndex, uint256 depositDate) internal view returns (bool) { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); require( depositDate < block.timestamp, "Poolable: Invalid deposit date" ); return block.timestamp - depositDate >= _pools[poolIndex].lockDuration; } function isUnlockable(uint256 poolIndex, uint256 depositDate) internal view returns (bool) { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); require( depositDate < block.timestamp, "Poolable: Invalid deposit date" ); return block.timestamp - depositDate >= _pools[poolIndex].minDuration; } function isPoolOpened(uint256 poolIndex) public view returns (bool) { require(poolIndex < poolsLength, "Poolable: Invalid poolIndex"); return _pools[poolIndex].opened; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../interfaces/IRecoverable.sol"; abstract contract Recoverable is Ownable, IRecoverable { using SafeERC20 for IERC20; event NonFungibleTokenRecovery(address indexed token, uint256 tokenId); event TokenRecovery(address indexed token, uint256 amount); event EthRecovery(uint256 amount); /** * @notice Allows the owner to recover non-fungible tokens sent to the contract by mistake * @param _token: NFT token address * @param _tokenId: tokenId * @dev Callable by owner */ function recoverNonFungibleToken(address _token, uint256 _tokenId) external virtual onlyOwner { IERC721(_token).transferFrom(address(this), address(msg.sender), _tokenId); emit NonFungibleTokenRecovery(_token, _tokenId); } /** * @notice Allows the owner to recover tokens sent to the contract by mistake * @param _token: token address * @dev Callable by owner */ function recoverToken(address _token) external virtual onlyOwner { uint256 balance = IERC20(_token).balanceOf(address(this)); require(balance != 0, "Operations: Cannot recover zero balance"); IERC20(_token).safeTransfer(address(msg.sender), balance); emit TokenRecovery(_token, balance); } function recoverEth(address payable _to) external virtual onlyOwner { uint256 balance = address(this).balance; _to.transfer(balance); emit EthRecovery(balance); } }
// SPDX-License-Identifier: MIT // 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; } }
// SPDX-License-Identifier: MIT // 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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 pragma solidity ^0.8.0; interface IRecoverable { /** * @notice Allows the owner to recover non-fungible tokens sent to the NFT contract by mistake and this contract * @param _token: NFT token address * @param _tokenId: tokenId * @dev Callable by owner */ function recoverNonFungibleToken(address _token, uint256 _tokenId) external; /** * @notice Allows the owner to recover tokens sent to the NFT contract and this contract by mistake * @param _token: token address * @dev Callable by owner */ function recoverToken(address _token) external; /** * @notice Allows the owner to recover ETH sent to the NFT contract ans and contract by mistake * @param _to: target address * @dev Callable by owner */ function recoverEth(address payable _to) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IContractUri { function contractURI() external view returns (string memory); /** * @notice Allows the owner to set the contracy URI to be used * @param _uri: contract URI * @dev Callable by owner */ function setContractURI(string memory _uri) external; }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC721","name":"_nftCollection","type":"address"},{"internalType":"contract IMintableERC20","name":"_rewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"BatchStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"BatchUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EthRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"}],"name":"MinterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"}],"name":"MinterRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NonFungibleTokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"bool","name":"opened","type":"bool"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"indexed":false,"internalType":"struct Poolable.Pool","name":"pool","type":"tuple"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"bool","name":"opened","type":"bool"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"indexed":false,"internalType":"struct Poolable.Pool","name":"pool","type":"tuple"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"addMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"bool","name":"opened","type":"bool"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"internalType":"struct Poolable.Pool","name":"pool","type":"tuple"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchRestake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchStakeFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"getPool","outputs":[{"components":[{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"bool","name":"opened","type":"bool"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"internalType":"struct Poolable.Pool","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getStakeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getUserTotalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"isPoolOpened","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftCollection","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"recoverEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"recoverNonFungibleToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"removeMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPoolId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"restake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"bool","name":"opened","type":"bool"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"internalType":"struct Poolable.Pool","name":"pool","type":"tuple"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002b6538038062002b658339810160408190526200003491620000e4565b818162000041336200007b565b6001600355600480546001600160a01b039384166001600160a01b0319918216179091556005805492909316911617905550620001239050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000e157600080fd5b50565b60008060408385031215620000f857600080fd5b82516200010581620000cb565b60208401519092506200011881620000cb565b809150509250929050565b612a3280620001336000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80637504db3e116100f9578063aa271e1a11610097578063d2acd13d11610071578063d2acd13d14610475578063f2fde38b14610488578063f3a6bd521461049b578063f7c618c1146104ae57600080fd5b8063aa271e1a14610423578063b8e7023d1461044f578063bb0fd1471461046257600080fd5b80638da5cb5b116100d35780638da5cb5b146103d9578063983b2d56146103ea5780639be65a60146103fd578063a0e7813f1461041057600080fd5b80637504db3e146103a05780637b0472f0146103b357806388f2de9f146103c657600080fd5b80633092afd51161016657806361cab72d1161014057806361cab72d146103315780636588103b14610344578063666c4b5c1461036f578063715018a61461039857600080fd5b80633092afd5146102f85780634c69b52e1461030b578063532224f41461031e57600080fd5b80631bbda52b116101a25780631bbda52b146102965780632716ae66146102ab5780632a182489146102c25780632e17de78146102e557600080fd5b8063068bcd8d146101c9578063098134821461021a578063150b7a021461025f575b600080fd5b6101dc6101d7366004612417565b6104c1565b604051610211919081518152602080830151908201526040808301511515908201526060918201519181019190915260800190565b60405180910390f35b61022d610228366004612417565b610579565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a001610211565b61027d61026d36600461245b565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610211565b6102a96102a4366004612587565b61068c565b005b6102b460015481565b604051908152602001610211565b6102d56102d0366004612417565b610819565b6040519015158152602001610211565b6102a96102f3366004612417565b610874565b6102a96103063660046125d3565b61099f565b6102a96103193660046125f0565b610a98565b6102a961032c36600461263d565b610b95565b6102a961033f36600461266a565b610ca8565b600454610357906001600160a01b031681565b6040516001600160a01b039091168152602001610211565b6102b461037d3660046125d3565b6001600160a01b031660009081526007602052604090205490565b6102a9610d6b565b6102a96103ae3660046125d3565b610dbf565b6102a96103c1366004612686565b610e70565b6102d56103d4366004612417565b610fc7565b6000546001600160a01b0316610357565b6102a96103f83660046125d3565b61105e565b6102a961040b3660046125d3565b61115b565b6102a961041e3660046126a8565b6112c8565b6102d56104313660046125d3565b6001600160a01b031660009081526008602052604090205460ff1690565b6102a961045d366004612686565b6113f1565b6102a9610470366004612704565b6115bb565b6102a9610483366004612730565b611712565b6102a96104963660046125d3565b61189b565b6102a96104a9366004612587565b611954565b600554610357906001600160a01b031681565b6104ee60405180608001604052806000815260200160008152602001600015158152602001600081525090565b60015482106105325760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd83398151915260448201526064015b60405180910390fd5b506000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015460ff1615159281019290925260030154606082015290565b6000818152600660205260408120600101548190819081908190600160401b90046001600160a01b03166105e95760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b600086815260066020908152604080832081516060810183528154815260019091015467ffffffffffffffff8116938201849052600160401b90046001600160a01b031691810191909152919061063f906104c1565b6040830151602080850151855191840151939450919261065f9082612788565b8451865161066d9190612788565b939c67ffffffffffffffff9093169b5090995097509095509350505050565b8260015481106106cc5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000818152600260208190526040909120015460ff1661072e5760405162461bcd60e51b815260206004820152601860248201527f506f6f6c61626c653a20506f6f6c20697320636c6f73656400000000000000006044820152606401610529565b600260035414156107815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b60026003553360005b838110156107c7576107b582878787858181106107a9576107a96127a0565b90506020020135611b22565b806107bf816127b6565b91505061078a565b50806001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b7429238742386868660405161080593929190612820565b60405180910390a250506001600355505050565b6000600154821061085a5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b506000908152600260208190526040909120015460ff1690565b600260035414156108c75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b60026003556000818152600660205260409020600101546001600160a01b03600160401b9091041633146109395760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b3360006109468284611c67565b90506109528282611db2565b816001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd8460405161098d91815260200190565b60405180910390a25050600160035550565b6000546001600160a01b031633146109e75760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b03811660009081526008602052604090205460ff16610a4f5760405162461bcd60e51b815260206004820152601460248201527f4d696e7461626c653a204e6f74206d696e7465720000000000000000000000006044820152606401610529565b6001600160a01b038116600081815260086020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b3360009081526008602052604090205460ff16610af75760405162461bcd60e51b815260206004820152601e60248201527f4d696e7461626c653a2043616c6c6572206973206e6f74206d696e74657200006044820152606401610529565b6001600160a01b038316610b415760405162461bcd60e51b81526020600482015260116024820152705374616b653a206164647265737328302960781b6044820152606401610529565b610b4c838383611b22565b60408051838152602081018390526001600160a01b038516917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b6910160405180910390a2505050565b6000546001600160a01b03163314610bdd5760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001548210610c1c5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000828152600260209081526040918290208335815590830135600182015590610c4c9060608401908401612848565b60028201805460ff1916911515919091179055606082013560038201556040517f7bc88466db0a5c28612bd0db9ed2dc9e57583c2b25548d1a7b33a1b57d3f8c0f90610c9b9085908490612865565b60405180910390a1505050565b6000546001600160a01b03163314610cf05760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b60015460008181526002602052604090208290610d0d828261289b565b505060018054610d1c91612788565b6001556000818152600260205260409081902090517ff170715f6c4300e572bf83fd219333fb050850fff498e5f52595f1e13dc0e20b91610d5f91849190612865565b60405180910390a15050565b6000546001600160a01b03163314610db35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b610dbd6000611e03565b565b6000546001600160a01b03163314610e075760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610e3f573d6000803e3d6000fd5b506040518181527f5c0a34c718716ee467140afbc9fb741fc2980e41d00f04a8f7f635d76484ff4790602001610d5f565b60026003541415610ec35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b600260035560015482908110610f095760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000818152600260208190526040909120015460ff16610f6b5760405162461bcd60e51b815260206004820152601860248201527f506f6f6c61626c653a20506f6f6c20697320636c6f73656400000000000000006044820152606401610529565b33610f77818585611b22565b60408051858152602081018590526001600160a01b038316917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b691015b60405180910390a2505060016003555050565b600081815260066020526040812060010154600160401b90046001600160a01b031661102f5760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b6000828152600660205260409020600181015490546110589167ffffffffffffffff1690611e60565b92915050565b6000546001600160a01b031633146110a65760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b03811660009081526008602052604090205460ff161561110f5760405162461bcd60e51b815260206004820152601860248201527f4d696e7461626c653a20416c7265616479206d696e74657200000000000000006044820152606401610529565b6001600160a01b038116600081815260086020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b6000546001600160a01b031633146111a35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156111ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120e91906128dc565b90508061126d5760405162461bcd60e51b815260206004820152602760248201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572207a65726f2060448201526662616c616e636560c81b6064820152608401610529565b6112816001600160a01b0383163383611f12565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e98826040516112bc91815260200190565b60405180910390a25050565b3360009081526008602052604090205460ff166113275760405162461bcd60e51b815260206004820152601e60248201527f4d696e7461626c653a2043616c6c6572206973206e6f74206d696e74657200006044820152606401610529565b6001600160a01b0384166113715760405162461bcd60e51b81526020600482015260116024820152705374616b653a206164647265737328302960781b6044820152606401610529565b60005b818110156113a55761139385858585858181106107a9576107a96127a0565b8061139d816127b6565b915050611374565b50836001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b742923874238484846040516113e393929190612820565b60405180910390a250505050565b600260035414156114445760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355600081815260066020526040902060010154600160401b90046001600160a01b03166114b15760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b6000818152600660205260409020600101546001600160a01b03600160401b90910416331461151e5760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b33600061152b8484611f7e565b90506115378282611db2565b816001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd8460405161157291815260200190565b60405180910390a260408051858152602081018590526001600160a01b038416917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b69101610fb4565b6000546001600160a01b031633146116035760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6004546001600160a01b03838116911614156116715760405162461bcd60e51b815260206004820152602760248201527f5374616b653a2043616e6e6f74207265636f766572207374616b656420636f6c6044820152663632b1ba34b7b760c91b6064820152608401610529565b6040516323b872dd60e01b8152306004820152336024820152604481018290526001600160a01b038316906323b872dd90606401600060405180830381600087803b1580156116bf57600080fd5b505af11580156116d3573d6000803e3d6000fd5b50505050816001600160a01b03167f861c3ea25dbda3af0bf5d258ba8582c0276c9446b1479e817be3f1b4a89acf91826040516112bc91815260200190565b600260035414156117655760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355336000805b8381101561185557826001600160a01b031660066000878785818110611797576117976127a0565b90506020020135815260200190815260200160002060010160089054906101000a90046001600160a01b03166001600160a01b0316146118155760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b6118378386868481811061182b5761182b6127a0565b90506020020135611c67565b6118419083612788565b91508061184d816127b6565b91505061176f565b506118608282611db2565b816001600160a01b03167f82d1e5b1747de628b87fc583915fd7ba5a43d2d1195c691ea894ba77cda297df8585604051610fb49291906128f5565b6000546001600160a01b031633146118e35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b0381166119485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610529565b61195181611e03565b50565b600260035414156119a75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355336000805b83811015611a9757826001600160a01b0316600660008787858181106119d9576119d96127a0565b90506020020135815260200190815260200160002060010160089054906101000a90046001600160a01b03166001600160a01b031614611a575760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b611a7986868684818110611a6d57611a6d6127a0565b90506020020135611f7e565b611a839083612788565b915080611a8f816127b6565b9150506119b1565b50611aa28282611db2565b816001600160a01b03167f82d1e5b1747de628b87fc583915fd7ba5a43d2d1195c691ea894ba77cda297df8585604051611add9291906128f5565b60405180910390a2816001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b7429238742386868660405161080593929190612820565b600081815260066020526040902060010154600160401b90046001600160a01b031615611b915760405162461bcd60e51b815260206004820152601b60248201527f5374616b653a20546f6b656e20616c7265616479207374616b656400000000006044820152606401610529565b6040805160608101825242815267ffffffffffffffff84811660208084019182526001600160a01b0388811685870181815260008981526006909452928790209551865592516001909501805492518216600160401b026001600160e01b0319909316959094169490941717909155600480549351632142170760e11b815290810191909152306024820152604481018490529116906342842e0e90606401600060405180830381600087803b158015611c4a57600080fd5b505af1158015611c5e573d6000803e3d6000fd5b50505050505050565b60008181526006602052604081206001810154905467ffffffffffffffff90911690611c949082906120ac565b611ce05760405162461bcd60e51b815260206004820152601960248201527f5374616b653a204e6f742079657420756e7374616b61626c65000000000000006044820152606401610529565b600083815260066020526040812054611cfa908390611e60565b60048054604051632142170760e11b815230928101929092526001600160a01b0388811660248401526044830188905292935091909116906342842e0e90606401600060405180830381600087803b158015611d5557600080fd5b505af1158015611d69573d6000803e3d6000fd5b505050600085815260066020526040812081815560010180546001600160e01b031916905590508115611da9576000611da1846104c1565b606001519150505b95945050505050565b8015611dff576001600160a01b038216600090815260076020526040902054611ddc908290612788565b6001600160a01b038316600090815260076020526040902055611dff8282612158565b5050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001548310611ea15760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b428210611ef05760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c61626c653a20496e76616c6964206465706f736974206461746500006044820152606401610529565b600083815260026020526040902054611f098342612909565b10159392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052611f799084906121c2565b505050565b6000611f8983610819565b611fd55760405162461bcd60e51b815260206004820152601560248201527f5374616b653a20506f6f6c20697320636c6f73656400000000000000000000006044820152606401610529565b60008281526006602052604090206001810154905467ffffffffffffffff909116906120029082906120ac565b61204e5760405162461bcd60e51b815260206004820152601960248201527f5374616b653a204e6f742079657420756e7374616b61626c65000000000000006044820152606401610529565b600083815260066020526040812054612068908390611e60565b600085815260066020526040812060018101805467ffffffffffffffff191667ffffffffffffffff8a161790554290559091508115611da9576000611da1846104c1565b600060015483106120ed5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b42821061213c5760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c61626c653a20496e76616c6964206465706f736974206461746500006044820152606401610529565b600083815260026020526040902060010154611f098342612909565b6005546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b1580156121a657600080fd5b505af11580156121ba573d6000803e3d6000fd5b505050505050565b6000612217826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122949092919063ffffffff16565b805190915015611f7957808060200190518101906122359190612920565b611f795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610529565b60606122a384846000856122ad565b90505b9392505050565b60608247101561230e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610529565b6001600160a01b0385163b6123655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610529565b600080866001600160a01b03168587604051612381919061296d565b60006040518083038185875af1925050503d80600081146123be576040519150601f19603f3d011682016040523d82523d6000602084013e6123c3565b606091505b50915091506123d38282866123de565b979650505050505050565b606083156123ed5750816122a6565b8251156123fd5782518084602001fd5b8160405162461bcd60e51b81526004016105299190612989565b60006020828403121561242957600080fd5b5035919050565b6001600160a01b038116811461195157600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561247157600080fd5b843561247c81612430565b9350602085013561248c81612430565b925060408501359150606085013567ffffffffffffffff808211156124b057600080fd5b818701915087601f8301126124c457600080fd5b8135818111156124d6576124d6612445565b604051601f8201601f19908116603f011681019083821181831017156124fe576124fe612445565b816040528281528a602084870101111561251757600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008083601f84011261254d57600080fd5b50813567ffffffffffffffff81111561256557600080fd5b6020830191508360208260051b850101111561258057600080fd5b9250929050565b60008060006040848603121561259c57600080fd5b83359250602084013567ffffffffffffffff8111156125ba57600080fd5b6125c68682870161253b565b9497909650939450505050565b6000602082840312156125e557600080fd5b81356122a681612430565b60008060006060848603121561260557600080fd5b833561261081612430565b95602085013595506040909401359392505050565b60006080828403121561263757600080fd5b50919050565b60008060a0838503121561265057600080fd5b823591506126618460208501612625565b90509250929050565b60006080828403121561267c57600080fd5b6122a68383612625565b6000806040838503121561269957600080fd5b50508035926020909101359150565b600080600080606085870312156126be57600080fd5b84356126c981612430565b935060208501359250604085013567ffffffffffffffff8111156126ec57600080fd5b6126f88782880161253b565b95989497509550505050565b6000806040838503121561271757600080fd5b823561272281612430565b946020939093013593505050565b6000806020838503121561274357600080fd5b823567ffffffffffffffff81111561275a57600080fd5b6127668582860161253b565b90969095509350505050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561279b5761279b612772565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156127ca576127ca612772565b5060010190565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561280357600080fd5b8260051b8083602087013760009401602001938452509192915050565b838152604060208201526000611da96040830184866127d1565b801515811461195157600080fd5b60006020828403121561285a57600080fd5b81356122a68161283a565b8281528154602082015260018201546040820152600282015460ff16151560608201526003820154608082015260a081016122a6565b81358155602082013560018201556002810160408301356128bb8161283a565b60ff1982541660ff8215151681178355505050606082013560038201555050565b6000602082840312156128ee57600080fd5b5051919050565b6020815260006122a36020830184866127d1565b60008282101561291b5761291b612772565b500390565b60006020828403121561293257600080fd5b81516122a68161283a565b60005b83811015612958578181015183820152602001612940565b83811115612967576000848401525b50505050565b6000825161297f81846020870161293d565b9190910192915050565b60208152600082518060208401526129a881604085016020870161293d565b601f01601f1916919091016040019291505056fe506f6f6c61626c653a20496e76616c696420706f6f6c496e64657800000000004f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b70847eac5e7cc351b4e0e43ddf42caa2c409a69f2b6c5a9a617c9adbfe789bf64736f6c634300080b003300000000000000000000000023a5ddd62aac108d1e1a81aa2b83a59055963e9e00000000000000000000000024c487fc99f31181ffdc3b7664b7471ee0506518
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637504db3e116100f9578063aa271e1a11610097578063d2acd13d11610071578063d2acd13d14610475578063f2fde38b14610488578063f3a6bd521461049b578063f7c618c1146104ae57600080fd5b8063aa271e1a14610423578063b8e7023d1461044f578063bb0fd1471461046257600080fd5b80638da5cb5b116100d35780638da5cb5b146103d9578063983b2d56146103ea5780639be65a60146103fd578063a0e7813f1461041057600080fd5b80637504db3e146103a05780637b0472f0146103b357806388f2de9f146103c657600080fd5b80633092afd51161016657806361cab72d1161014057806361cab72d146103315780636588103b14610344578063666c4b5c1461036f578063715018a61461039857600080fd5b80633092afd5146102f85780634c69b52e1461030b578063532224f41461031e57600080fd5b80631bbda52b116101a25780631bbda52b146102965780632716ae66146102ab5780632a182489146102c25780632e17de78146102e557600080fd5b8063068bcd8d146101c9578063098134821461021a578063150b7a021461025f575b600080fd5b6101dc6101d7366004612417565b6104c1565b604051610211919081518152602080830151908201526040808301511515908201526060918201519181019190915260800190565b60405180910390f35b61022d610228366004612417565b610579565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a001610211565b61027d61026d36600461245b565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610211565b6102a96102a4366004612587565b61068c565b005b6102b460015481565b604051908152602001610211565b6102d56102d0366004612417565b610819565b6040519015158152602001610211565b6102a96102f3366004612417565b610874565b6102a96103063660046125d3565b61099f565b6102a96103193660046125f0565b610a98565b6102a961032c36600461263d565b610b95565b6102a961033f36600461266a565b610ca8565b600454610357906001600160a01b031681565b6040516001600160a01b039091168152602001610211565b6102b461037d3660046125d3565b6001600160a01b031660009081526007602052604090205490565b6102a9610d6b565b6102a96103ae3660046125d3565b610dbf565b6102a96103c1366004612686565b610e70565b6102d56103d4366004612417565b610fc7565b6000546001600160a01b0316610357565b6102a96103f83660046125d3565b61105e565b6102a961040b3660046125d3565b61115b565b6102a961041e3660046126a8565b6112c8565b6102d56104313660046125d3565b6001600160a01b031660009081526008602052604090205460ff1690565b6102a961045d366004612686565b6113f1565b6102a9610470366004612704565b6115bb565b6102a9610483366004612730565b611712565b6102a96104963660046125d3565b61189b565b6102a96104a9366004612587565b611954565b600554610357906001600160a01b031681565b6104ee60405180608001604052806000815260200160008152602001600015158152602001600081525090565b60015482106105325760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd83398151915260448201526064015b60405180910390fd5b506000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015460ff1615159281019290925260030154606082015290565b6000818152600660205260408120600101548190819081908190600160401b90046001600160a01b03166105e95760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b600086815260066020908152604080832081516060810183528154815260019091015467ffffffffffffffff8116938201849052600160401b90046001600160a01b031691810191909152919061063f906104c1565b6040830151602080850151855191840151939450919261065f9082612788565b8451865161066d9190612788565b939c67ffffffffffffffff9093169b5090995097509095509350505050565b8260015481106106cc5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000818152600260208190526040909120015460ff1661072e5760405162461bcd60e51b815260206004820152601860248201527f506f6f6c61626c653a20506f6f6c20697320636c6f73656400000000000000006044820152606401610529565b600260035414156107815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b60026003553360005b838110156107c7576107b582878787858181106107a9576107a96127a0565b90506020020135611b22565b806107bf816127b6565b91505061078a565b50806001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b7429238742386868660405161080593929190612820565b60405180910390a250506001600355505050565b6000600154821061085a5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b506000908152600260208190526040909120015460ff1690565b600260035414156108c75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b60026003556000818152600660205260409020600101546001600160a01b03600160401b9091041633146109395760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b3360006109468284611c67565b90506109528282611db2565b816001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd8460405161098d91815260200190565b60405180910390a25050600160035550565b6000546001600160a01b031633146109e75760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b03811660009081526008602052604090205460ff16610a4f5760405162461bcd60e51b815260206004820152601460248201527f4d696e7461626c653a204e6f74206d696e7465720000000000000000000000006044820152606401610529565b6001600160a01b038116600081815260086020526040808220805460ff19169055517fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb666929190a250565b3360009081526008602052604090205460ff16610af75760405162461bcd60e51b815260206004820152601e60248201527f4d696e7461626c653a2043616c6c6572206973206e6f74206d696e74657200006044820152606401610529565b6001600160a01b038316610b415760405162461bcd60e51b81526020600482015260116024820152705374616b653a206164647265737328302960781b6044820152606401610529565b610b4c838383611b22565b60408051838152602081018390526001600160a01b038516917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b6910160405180910390a2505050565b6000546001600160a01b03163314610bdd5760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001548210610c1c5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000828152600260209081526040918290208335815590830135600182015590610c4c9060608401908401612848565b60028201805460ff1916911515919091179055606082013560038201556040517f7bc88466db0a5c28612bd0db9ed2dc9e57583c2b25548d1a7b33a1b57d3f8c0f90610c9b9085908490612865565b60405180910390a1505050565b6000546001600160a01b03163314610cf05760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b60015460008181526002602052604090208290610d0d828261289b565b505060018054610d1c91612788565b6001556000818152600260205260409081902090517ff170715f6c4300e572bf83fd219333fb050850fff498e5f52595f1e13dc0e20b91610d5f91849190612865565b60405180910390a15050565b6000546001600160a01b03163314610db35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b610dbd6000611e03565b565b6000546001600160a01b03163314610e075760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610e3f573d6000803e3d6000fd5b506040518181527f5c0a34c718716ee467140afbc9fb741fc2980e41d00f04a8f7f635d76484ff4790602001610d5f565b60026003541415610ec35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b600260035560015482908110610f095760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b6000818152600260208190526040909120015460ff16610f6b5760405162461bcd60e51b815260206004820152601860248201527f506f6f6c61626c653a20506f6f6c20697320636c6f73656400000000000000006044820152606401610529565b33610f77818585611b22565b60408051858152602081018590526001600160a01b038316917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b691015b60405180910390a2505060016003555050565b600081815260066020526040812060010154600160401b90046001600160a01b031661102f5760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b6000828152600660205260409020600181015490546110589167ffffffffffffffff1690611e60565b92915050565b6000546001600160a01b031633146110a65760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b03811660009081526008602052604090205460ff161561110f5760405162461bcd60e51b815260206004820152601860248201527f4d696e7461626c653a20416c7265616479206d696e74657200000000000000006044820152606401610529565b6001600160a01b038116600081815260086020526040808220805460ff19166001179055517f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f69190a250565b6000546001600160a01b031633146111a35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156111ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120e91906128dc565b90508061126d5760405162461bcd60e51b815260206004820152602760248201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572207a65726f2060448201526662616c616e636560c81b6064820152608401610529565b6112816001600160a01b0383163383611f12565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e98826040516112bc91815260200190565b60405180910390a25050565b3360009081526008602052604090205460ff166113275760405162461bcd60e51b815260206004820152601e60248201527f4d696e7461626c653a2043616c6c6572206973206e6f74206d696e74657200006044820152606401610529565b6001600160a01b0384166113715760405162461bcd60e51b81526020600482015260116024820152705374616b653a206164647265737328302960781b6044820152606401610529565b60005b818110156113a55761139385858585858181106107a9576107a96127a0565b8061139d816127b6565b915050611374565b50836001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b742923874238484846040516113e393929190612820565b60405180910390a250505050565b600260035414156114445760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355600081815260066020526040902060010154600160401b90046001600160a01b03166114b15760405162461bcd60e51b815260206004820152601760248201527614dd185ad94e88151bdad95b881b9bdd081cdd185ad959604a1b6044820152606401610529565b6000818152600660205260409020600101546001600160a01b03600160401b90910416331461151e5760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b33600061152b8484611f7e565b90506115378282611db2565b816001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd8460405161157291815260200190565b60405180910390a260408051858152602081018590526001600160a01b038416917f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b69101610fb4565b6000546001600160a01b031633146116035760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6004546001600160a01b03838116911614156116715760405162461bcd60e51b815260206004820152602760248201527f5374616b653a2043616e6e6f74207265636f766572207374616b656420636f6c6044820152663632b1ba34b7b760c91b6064820152608401610529565b6040516323b872dd60e01b8152306004820152336024820152604481018290526001600160a01b038316906323b872dd90606401600060405180830381600087803b1580156116bf57600080fd5b505af11580156116d3573d6000803e3d6000fd5b50505050816001600160a01b03167f861c3ea25dbda3af0bf5d258ba8582c0276c9446b1479e817be3f1b4a89acf91826040516112bc91815260200190565b600260035414156117655760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355336000805b8381101561185557826001600160a01b031660066000878785818110611797576117976127a0565b90506020020135815260200190815260200160002060010160089054906101000a90046001600160a01b03166001600160a01b0316146118155760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b6118378386868481811061182b5761182b6127a0565b90506020020135611c67565b6118419083612788565b91508061184d816127b6565b91505061176f565b506118608282611db2565b816001600160a01b03167f82d1e5b1747de628b87fc583915fd7ba5a43d2d1195c691ea894ba77cda297df8585604051610fb49291906128f5565b6000546001600160a01b031633146118e35760405162461bcd60e51b815260206004820181905260248201526000805160206129dd8339815191526044820152606401610529565b6001600160a01b0381166119485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610529565b61195181611e03565b50565b600260035414156119a75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610529565b6002600355336000805b83811015611a9757826001600160a01b0316600660008787858181106119d9576119d96127a0565b90506020020135815260200190815260200160002060010160089054906101000a90046001600160a01b03166001600160a01b031614611a575760405162461bcd60e51b815260206004820152601960248201527829ba30b5b29d102737ba1037bbb732b91037b3103a37b5b2b760391b6044820152606401610529565b611a7986868684818110611a6d57611a6d6127a0565b90506020020135611f7e565b611a839083612788565b915080611a8f816127b6565b9150506119b1565b50611aa28282611db2565b816001600160a01b03167f82d1e5b1747de628b87fc583915fd7ba5a43d2d1195c691ea894ba77cda297df8585604051611add9291906128f5565b60405180910390a2816001600160a01b03167f9cb8bf6c3e49c9547ec614a3c027ea19c19d43d5c7a00755e304b7429238742386868660405161080593929190612820565b600081815260066020526040902060010154600160401b90046001600160a01b031615611b915760405162461bcd60e51b815260206004820152601b60248201527f5374616b653a20546f6b656e20616c7265616479207374616b656400000000006044820152606401610529565b6040805160608101825242815267ffffffffffffffff84811660208084019182526001600160a01b0388811685870181815260008981526006909452928790209551865592516001909501805492518216600160401b026001600160e01b0319909316959094169490941717909155600480549351632142170760e11b815290810191909152306024820152604481018490529116906342842e0e90606401600060405180830381600087803b158015611c4a57600080fd5b505af1158015611c5e573d6000803e3d6000fd5b50505050505050565b60008181526006602052604081206001810154905467ffffffffffffffff90911690611c949082906120ac565b611ce05760405162461bcd60e51b815260206004820152601960248201527f5374616b653a204e6f742079657420756e7374616b61626c65000000000000006044820152606401610529565b600083815260066020526040812054611cfa908390611e60565b60048054604051632142170760e11b815230928101929092526001600160a01b0388811660248401526044830188905292935091909116906342842e0e90606401600060405180830381600087803b158015611d5557600080fd5b505af1158015611d69573d6000803e3d6000fd5b505050600085815260066020526040812081815560010180546001600160e01b031916905590508115611da9576000611da1846104c1565b606001519150505b95945050505050565b8015611dff576001600160a01b038216600090815260076020526040902054611ddc908290612788565b6001600160a01b038316600090815260076020526040902055611dff8282612158565b5050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001548310611ea15760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b428210611ef05760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c61626c653a20496e76616c6964206465706f736974206461746500006044820152606401610529565b600083815260026020526040902054611f098342612909565b10159392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052611f799084906121c2565b505050565b6000611f8983610819565b611fd55760405162461bcd60e51b815260206004820152601560248201527f5374616b653a20506f6f6c20697320636c6f73656400000000000000000000006044820152606401610529565b60008281526006602052604090206001810154905467ffffffffffffffff909116906120029082906120ac565b61204e5760405162461bcd60e51b815260206004820152601960248201527f5374616b653a204e6f742079657420756e7374616b61626c65000000000000006044820152606401610529565b600083815260066020526040812054612068908390611e60565b600085815260066020526040812060018101805467ffffffffffffffff191667ffffffffffffffff8a161790554290559091508115611da9576000611da1846104c1565b600060015483106120ed5760405162461bcd60e51b815260206004820152601b60248201526000805160206129bd8339815191526044820152606401610529565b42821061213c5760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c61626c653a20496e76616c6964206465706f736974206461746500006044820152606401610529565b600083815260026020526040902060010154611f098342612909565b6005546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b1580156121a657600080fd5b505af11580156121ba573d6000803e3d6000fd5b505050505050565b6000612217826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122949092919063ffffffff16565b805190915015611f7957808060200190518101906122359190612920565b611f795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610529565b60606122a384846000856122ad565b90505b9392505050565b60608247101561230e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610529565b6001600160a01b0385163b6123655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610529565b600080866001600160a01b03168587604051612381919061296d565b60006040518083038185875af1925050503d80600081146123be576040519150601f19603f3d011682016040523d82523d6000602084013e6123c3565b606091505b50915091506123d38282866123de565b979650505050505050565b606083156123ed5750816122a6565b8251156123fd5782518084602001fd5b8160405162461bcd60e51b81526004016105299190612989565b60006020828403121561242957600080fd5b5035919050565b6001600160a01b038116811461195157600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561247157600080fd5b843561247c81612430565b9350602085013561248c81612430565b925060408501359150606085013567ffffffffffffffff808211156124b057600080fd5b818701915087601f8301126124c457600080fd5b8135818111156124d6576124d6612445565b604051601f8201601f19908116603f011681019083821181831017156124fe576124fe612445565b816040528281528a602084870101111561251757600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008083601f84011261254d57600080fd5b50813567ffffffffffffffff81111561256557600080fd5b6020830191508360208260051b850101111561258057600080fd5b9250929050565b60008060006040848603121561259c57600080fd5b83359250602084013567ffffffffffffffff8111156125ba57600080fd5b6125c68682870161253b565b9497909650939450505050565b6000602082840312156125e557600080fd5b81356122a681612430565b60008060006060848603121561260557600080fd5b833561261081612430565b95602085013595506040909401359392505050565b60006080828403121561263757600080fd5b50919050565b60008060a0838503121561265057600080fd5b823591506126618460208501612625565b90509250929050565b60006080828403121561267c57600080fd5b6122a68383612625565b6000806040838503121561269957600080fd5b50508035926020909101359150565b600080600080606085870312156126be57600080fd5b84356126c981612430565b935060208501359250604085013567ffffffffffffffff8111156126ec57600080fd5b6126f88782880161253b565b95989497509550505050565b6000806040838503121561271757600080fd5b823561272281612430565b946020939093013593505050565b6000806020838503121561274357600080fd5b823567ffffffffffffffff81111561275a57600080fd5b6127668582860161253b565b90969095509350505050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561279b5761279b612772565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156127ca576127ca612772565b5060010190565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561280357600080fd5b8260051b8083602087013760009401602001938452509192915050565b838152604060208201526000611da96040830184866127d1565b801515811461195157600080fd5b60006020828403121561285a57600080fd5b81356122a68161283a565b8281528154602082015260018201546040820152600282015460ff16151560608201526003820154608082015260a081016122a6565b81358155602082013560018201556002810160408301356128bb8161283a565b60ff1982541660ff8215151681178355505050606082013560038201555050565b6000602082840312156128ee57600080fd5b5051919050565b6020815260006122a36020830184866127d1565b60008282101561291b5761291b612772565b500390565b60006020828403121561293257600080fd5b81516122a68161283a565b60005b83811015612958578181015183820152602001612940565b83811115612967576000848401525b50505050565b6000825161297f81846020870161293d565b9190910192915050565b60208152600082518060208401526129a881604085016020870161293d565b601f01601f1916919091016040019291505056fe506f6f6c61626c653a20496e76616c696420706f6f6c496e64657800000000004f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b70847eac5e7cc351b4e0e43ddf42caa2c409a69f2b6c5a9a617c9adbfe789bf64736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000023a5ddd62aac108d1e1a81aa2b83a59055963e9e00000000000000000000000024c487fc99f31181ffdc3b7664b7471ee0506518
-----Decoded View---------------
Arg [0] : _nftCollection (address): 0x23A5DdD62AAC108D1e1a81aa2b83a59055963e9e
Arg [1] : _rewardToken (address): 0x24c487fC99f31181FFdC3b7664b7471EE0506518
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000023a5ddd62aac108d1e1a81aa2b83a59055963e9e
Arg [1] : 00000000000000000000000024c487fc99f31181ffdc3b7664b7471ee0506518
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.