Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BendNftPool
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {IERC20Upgradeable, SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import {INftVault} from "./interfaces/INftVault.sol"; import {IStakeManager} from "./interfaces/IStakeManager.sol"; import {INftPool, IStakedNft, IApeCoinStaking} from "./interfaces/INftPool.sol"; import {ICoinPool} from "./interfaces/ICoinPool.sol"; import {IBNFTRegistry} from "./interfaces/IBNFTRegistry.sol"; contract BendNftPool is INftPool, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; using SafeERC20Upgradeable for ICoinPool; uint256 private constant APE_COIN_PRECISION = 1e18; IApeCoinStaking public apeCoinStaking; IERC20Upgradeable public apeCoin; mapping(address => PoolState) public poolStates; IStakeManager public override staker; ICoinPool public coinPool; address public bayc; address public mayc; address public bakc; IBNFTRegistry public bnftRegistry; modifier onlyApe(address nft_) { require(bayc == nft_ || mayc == nft_ || bakc == nft_, "BendNftPool: not ape"); _; } modifier onlyApes(address[] calldata nfts_) { address nft_; for (uint256 i = 0; i < nfts_.length; i++) { nft_ = nfts_[i]; require(bayc == nft_ || mayc == nft_ || bakc == nft_, "BendNftPool: not ape"); } _; } modifier onlyStaker() { require(msg.sender == address(staker), "BendNftPool: caller is not staker"); _; } function initialize( IBNFTRegistry bnftRegistry_, IApeCoinStaking apeStaking_, ICoinPool coinPool_, IStakeManager staker_, IStakedNft stBayc_, IStakedNft stMayc_, IStakedNft stBakc_ ) external initializer { __Ownable_init(); __Pausable_init(); __ReentrancyGuard_init(); apeCoinStaking = apeStaking_; staker = staker_; coinPool = coinPool_; bnftRegistry = bnftRegistry_; bayc = stBayc_.underlyingAsset(); mayc = stMayc_.underlyingAsset(); bakc = stBakc_.underlyingAsset(); poolStates[bayc].stakedNft = stBayc_; poolStates[mayc].stakedNft = stMayc_; poolStates[bakc].stakedNft = stBakc_; apeCoin = IERC20Upgradeable(apeCoinStaking.apeCoin()); apeCoin.approve(address(coinPool), type(uint256).max); } function deposit( address[] calldata nfts_, uint256[][] calldata tokenIds_ ) external override onlyApes(nfts_) nonReentrant whenNotPaused { address nft_; uint256 tokenId_; PoolState storage pool_; _checkDuplicateNfts(nfts_); _checkDuplicateTokenIds(tokenIds_); for (uint256 i = 0; i < nfts_.length; i++) { nft_ = nfts_[i]; pool_ = poolStates[nft_]; _compoundApeCoin(pool_); require(tokenIds_[i].length > 0, "BendNftPool: empty tokenIds"); for (uint256 j = 0; j < tokenIds_[i].length; j++) { tokenId_ = tokenIds_[i][j]; IERC721Upgradeable(nft_).safeTransferFrom(msg.sender, address(staker), tokenId_); pool_.rewardsDebt[tokenId_] = pool_.accumulatedRewardsPerNft; } staker.mintStNft(pool_.stakedNft, msg.sender, tokenIds_[i]); emit NftDeposited(nft_, tokenIds_[i], msg.sender); } } function withdraw( address[] calldata nfts_, uint256[][] calldata tokenIds_ ) external override onlyApes(nfts_) nonReentrant whenNotPaused { _checkDuplicateNfts(nfts_); _checkDuplicateTokenIds(tokenIds_); _claim(msg.sender, msg.sender, nfts_, tokenIds_); PoolState storage pool_; uint256 tokenId_; address nft_; for (uint256 i = 0; i < nfts_.length; i++) { require(tokenIds_[i].length > 0, "BendNftPool: empty tokenIds"); nft_ = nfts_[i]; pool_ = poolStates[nft_]; for (uint256 j = 0; j < tokenIds_[i].length; j++) { tokenId_ = tokenIds_[i][j]; pool_.stakedNft.safeTransferFrom(msg.sender, address(this), tokenId_); } pool_.stakedNft.burn(tokenIds_[i]); for (uint256 j = 0; j < tokenIds_[i].length; j++) { tokenId_ = tokenIds_[i][j]; IERC721Upgradeable(pool_.stakedNft.underlyingAsset()).safeTransferFrom( address(this), msg.sender, tokenId_ ); delete pool_.rewardsDebt[tokenId_]; } emit NftWithdrawn(nft_, tokenIds_[i], msg.sender); } } function _claim( address owner_, address receiver_, address[] calldata nfts_, uint256[][] calldata tokenIds_ ) internal { address nft_; PoolState storage pool_; uint256 tokenId_; uint256 claimableShares; uint256 totalClaimableShares; address tokenOwner_; for (uint256 i = 0; i < nfts_.length; i++) { require(tokenIds_[i].length > 0, "BendNftPool: empty tokenIds"); nft_ = nfts_[i]; pool_ = poolStates[nft_]; (address bnftProxy, ) = bnftRegistry.getBNFTAddresses(address(pool_.stakedNft)); claimableShares = 0; _compoundApeCoin(pool_); for (uint256 j = 0; j < tokenIds_[i].length; j++) { tokenId_ = tokenIds_[i][j]; tokenOwner_ = pool_.stakedNft.ownerOf(tokenId_); if (tokenOwner_ != owner_ && bnftProxy != address(0) && tokenOwner_ == bnftProxy) { tokenOwner_ = IERC721Upgradeable(bnftProxy).ownerOf(tokenId_); } require(tokenOwner_ == owner_, "BendNftPool: invalid token owner"); require(pool_.stakedNft.stakerOf(tokenId_) == address(staker), "BendNftPool: invalid token staker"); claimableShares += _calculateRewards(pool_.accumulatedRewardsPerNft, pool_.rewardsDebt[tokenId_]); // set token rewards debt with pool index pool_.rewardsDebt[tokenId_] = pool_.accumulatedRewardsPerNft; } if (claimableShares > 0) { emit NftRewardClaimed( nft_, tokenIds_[i], receiver_, coinPool.previewRedeem(claimableShares), pool_.accumulatedRewardsPerNft ); } totalClaimableShares += claimableShares; } if (totalClaimableShares > 0) { coinPool.redeem(totalClaimableShares, receiver_, address(this)); } } function claim( address[] calldata nfts_, uint256[][] calldata tokenIds_ ) external override onlyApes(nfts_) nonReentrant whenNotPaused { _checkDuplicateNfts(nfts_); _checkDuplicateTokenIds(tokenIds_); _claim(msg.sender, msg.sender, nfts_, tokenIds_); } function receiveApeCoin(address nft_, uint256 rewardsAmount_) external override onlyApe(nft_) onlyStaker { apeCoin.safeTransferFrom(msg.sender, address(this), rewardsAmount_); poolStates[nft_].pendingApeCoin += rewardsAmount_; if (rewardsAmount_ > 0) { emit NftRewardDistributed(nft_, rewardsAmount_); } } function _compoundApeCoin(PoolState storage pool_) internal { uint256 rewardsAmount_ = pool_.pendingApeCoin; if (rewardsAmount_ == 0) { return; } uint256 supply = pool_.stakedNft.totalStaked(address(staker)); uint256 accumulatedShare = coinPool.deposit(rewardsAmount_, address(this)); pool_.pendingApeCoin = 0; // In extreme cases all nft give up the earned rewards and exit if (supply > 0) { pool_.accumulatedRewardsPerNft = _calculatePoolIndex( pool_.accumulatedRewardsPerNft, accumulatedShare, supply ); } } function compoundApeCoin(address nft_) external override onlyApe(nft_) onlyStaker { _compoundApeCoin(poolStates[nft_]); } function pendingApeCoin(address nft_) external view returns (uint256) { return poolStates[nft_].pendingApeCoin; } function claimable( address[] calldata nfts_, uint256[][] calldata tokenIds_ ) external view override onlyApes(nfts_) returns (uint256 amount) { PoolState storage pool_; address nft_; uint256 accumulatedRewardsPerNft_; _checkDuplicateNfts(nfts_); _checkDuplicateTokenIds(tokenIds_); for (uint256 i = 0; i < nfts_.length; i++) { nft_ = nfts_[i]; pool_ = poolStates[nft_]; accumulatedRewardsPerNft_ = pool_.accumulatedRewardsPerNft; if (pool_.stakedNft.totalStaked(address(staker)) > 0) { accumulatedRewardsPerNft_ = _calculatePoolIndex( accumulatedRewardsPerNft_, coinPool.previewDeposit(pool_.pendingApeCoin), pool_.stakedNft.totalStaked(address(staker)) ); } for (uint256 j = 0; j < tokenIds_[i].length; j++) { amount += _calculateRewards(accumulatedRewardsPerNft_, pool_.rewardsDebt[tokenIds_[i][j]]); } } if (amount != 0) { amount = coinPool.previewRedeem(amount); } } function _calculateRewards( uint256 accumulatedRewardsPerNft, uint256 rewardDebt ) internal pure returns (uint256 rewards) { if (accumulatedRewardsPerNft > rewardDebt) { rewards = (accumulatedRewardsPerNft - rewardDebt) / APE_COIN_PRECISION; } } function _calculatePoolIndex( uint256 accumulatedRewardsPerNft, uint256 accumulatedShare, uint256 nftSupply ) internal pure returns (uint256 rewards) { return accumulatedRewardsPerNft + ((accumulatedShare * APE_COIN_PRECISION) / nftSupply); } function _checkDuplicateNfts(address[] calldata nfts_) internal pure { for (uint256 i = 0; i < nfts_.length; i++) { for (uint256 j = i + 1; j < nfts_.length; j++) { require(nfts_[i] != nfts_[j], "BendNftPool: duplicate nfts"); } } } function _checkDuplicateTokenIds(uint256[][] calldata tokenIds_) internal pure { for (uint256 i = 0; i < tokenIds_.length; i++) { for (uint256 j = 0; j < tokenIds_[i].length; j++) { for (uint256 k = j + 1; k < tokenIds_[i].length; k++) { require(tokenIds_[i][j] != tokenIds_[i][k], "BendNftPool: duplicate tokenIds"); } } } } function getPoolStateUI(address nft_) external view returns (PoolUI memory poolUI) { PoolState storage pool = poolStates[nft_]; poolUI.totalStakedNft = pool.stakedNft.totalStaked(address(staker)); poolUI.accumulatedRewardsPerNft = pool.accumulatedRewardsPerNft; poolUI.pendingApeCoin = pool.pendingApeCoin; } function getNftStateUI(address nft_, uint256 tokenId) external view returns (uint256 rewardsDebt) { PoolState storage pool = poolStates[nft_]; rewardsDebt = pool.rewardsDebt[tokenId]; } function onERC721Received( address /*operator*/, address /*from*/, uint256 /*tokenId*/, bytes calldata /*data*/ ) external view returns (bytes4) { bool isValidNFT = (bayc == msg.sender || mayc == msg.sender || bakc == msg.sender); if (!isValidNFT) { isValidNFT = (address(poolStates[bayc].stakedNft) == msg.sender || address(poolStates[mayc].stakedNft) == msg.sender || address(poolStates[bakc].stakedNft) == msg.sender); } require(isValidNFT, "BendNftPool: not ape nft"); return this.onERC721Received.selector; } function setPause(bool flag) public onlyOwner { if (flag) { _pause(); } else { _unpause(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC4626.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20Upgradeable.sol"; import "../token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; /** * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. * * _Available since v4.7._ */ interface IERC4626Upgradeable is IERC20Upgradeable, IERC20MetadataUpgradeable { event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); event Withdraw( address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); /** * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. * * - MUST be an ERC-20 token contract. * - MUST NOT revert. */ function asset() external view returns (address assetTokenAddress); /** * @dev Returns the total amount of the underlying asset that is “managed” by Vault. * * - SHOULD include any compounding that occurs from yield. * - MUST be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT revert. */ function totalAssets() external view returns (uint256 totalManagedAssets); /** * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToShares(uint256 assets) external view returns (uint256 shares); /** * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToAssets(uint256 shares) external view returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, * through a deposit call. * * - MUST return a limited value if receiver is subject to some deposit limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. * - MUST NOT revert. */ function maxDeposit(address receiver) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given * current on-chain conditions. * * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called * in the same transaction. * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the * deposit would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewDeposit(uint256 assets) external view returns (uint256 shares); /** * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * deposit execution, and are accounted for during deposit. * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function deposit(uint256 assets, address receiver) external returns (uint256 shares); /** * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. * - MUST return a limited value if receiver is subject to some mint limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. * - MUST NOT revert. */ function maxMint(address receiver) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given * current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the * same transaction. * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint * would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by minting. */ function previewMint(uint256 shares) external view returns (uint256 assets); /** * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint * execution, and are accounted for during mint. * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function mint(uint256 shares, address receiver) external returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the * Vault, through a withdraw call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST NOT revert. */ function maxWithdraw(address owner) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, * given current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if * called * in the same transaction. * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though * the withdrawal would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewWithdraw(uint256 assets) external view returns (uint256 shares); /** * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * withdraw execution, and are accounted for during withdraw. * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function withdraw( uint256 assets, address receiver, address owner ) external returns (uint256 shares); /** * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, * through a redeem call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. * - MUST NOT revert. */ function maxRedeem(address owner) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, * given current on-chain conditions. * * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the * same transaction. * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the * redemption would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by redeeming. */ function previewRedeem(uint256 shares) external view returns (uint256 assets); /** * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * redeem execution, and are accounted for during redeem. * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function redeem( uint256 shares, address receiver, address owner ) external returns (uint256 assets); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../token/ERC721/extensions/IERC721EnumerableUpgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../token/ERC721/extensions/IERC721MetadataUpgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721ReceiverUpgradeable.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../extensions/draft-IERC20PermitUpgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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)); } } function safePermit( IERC20PermitUpgradeable token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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(IERC20Upgradeable 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 (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @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 (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; interface IApeCoinStaking { struct SingleNft { uint32 tokenId; uint224 amount; } struct PairNft { uint128 mainTokenId; uint128 bakcTokenId; } struct PairNftDepositWithAmount { uint32 mainTokenId; uint32 bakcTokenId; uint184 amount; } struct PairNftWithdrawWithAmount { uint32 mainTokenId; uint32 bakcTokenId; uint184 amount; bool isUncommit; } struct Position { uint256 stakedAmount; int256 rewardsDebt; } struct Pool { uint48 lastRewardedTimestampHour; uint16 lastRewardsRangeIndex; uint96 stakedAmount; uint96 accumulatedRewardsPerShare; TimeRange[] timeRanges; } struct TimeRange { uint48 startTimestampHour; uint48 endTimestampHour; uint96 rewardsPerHour; uint96 capPerPosition; } struct PoolWithoutTimeRange { uint48 lastRewardedTimestampHour; uint16 lastRewardsRangeIndex; uint96 stakedAmount; uint96 accumulatedRewardsPerShare; } struct DashboardStake { uint256 poolId; uint256 tokenId; uint256 deposited; uint256 unclaimed; uint256 rewards24hr; DashboardPair pair; } struct DashboardPair { uint256 mainTokenId; uint256 mainTypePoolId; } struct PoolUI { uint256 poolId; uint256 stakedAmount; TimeRange currentTimeRange; } struct PairingStatus { uint248 tokenId; bool isPaired; } function mainToBakc(uint256 poolId_, uint256 mainTokenId_) external view returns (PairingStatus memory); function bakcToMain(uint256 poolId_, uint256 bakcTokenId_) external view returns (PairingStatus memory); function nftContracts(uint256 poolId_) external view returns (address); function rewardsBy(uint256 poolId_, uint256 from_, uint256 to_) external view returns (uint256, uint256); function apeCoin() external view returns (address); function getCurrentTimeRangeIndex(Pool memory pool_) external view returns (uint256); function getTimeRangeBy(uint256 poolId_, uint256 index_) external view returns (TimeRange memory); function getPoolsUI() external view returns (PoolUI memory, PoolUI memory, PoolUI memory, PoolUI memory); function getSplitStakes(address address_) external view returns (DashboardStake[] memory); function stakedTotal(address addr_) external view returns (uint256); function pools(uint256 poolId_) external view returns (PoolWithoutTimeRange memory); function nftPosition(uint256 poolId_, uint256 tokenId_) external view returns (Position memory); function addressPosition(address addr_) external view returns (Position memory); function pendingRewards(uint256 poolId_, address address_, uint256 tokenId_) external view returns (uint256); function depositBAYC(SingleNft[] calldata nfts_) external; function depositMAYC(SingleNft[] calldata nfts_) external; function depositBAKC( PairNftDepositWithAmount[] calldata baycPairs_, PairNftDepositWithAmount[] calldata maycPairs_ ) external; function depositSelfApeCoin(uint256 amount_) external; function claimSelfApeCoin() external; function claimBAYC(uint256[] calldata nfts_, address recipient_) external; function claimMAYC(uint256[] calldata nfts_, address recipient_) external; function claimBAKC(PairNft[] calldata baycPairs_, PairNft[] calldata maycPairs_, address recipient_) external; function withdrawBAYC(SingleNft[] calldata nfts_, address recipient_) external; function withdrawMAYC(SingleNft[] calldata nfts_, address recipient_) external; function withdrawBAKC( PairNftWithdrawWithAmount[] calldata baycPairs_, PairNftWithdrawWithAmount[] calldata maycPairs_ ) external; function withdrawSelfApeCoin(uint256 amount_) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; interface IBNFTRegistry { function getBNFTAddresses(address nftAsset) external view returns (address bNftProxy, address bNftImpl); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {IERC4626Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC4626Upgradeable.sol"; interface ICoinPool is IERC4626Upgradeable { event RewardDistributed(uint256 rewardAmount); function mintSelf(uint256 shares) external returns (uint256); function depositSelf(uint256 assets) external returns (uint256); function withdrawSelf(uint256 assets) external returns (uint256); function redeemSelf(uint256 shares) external returns (uint256); function pendingApeCoin() external view returns (uint256); function assetBalanceOf(address account_) external view returns (uint256); function pullApeCoin(uint256 amount_) external; function receiveApeCoin(uint256 principalAmount, uint256 rewardsAmount_) external; }
// SPDX-License-Identifier: CC0-1.0 pragma solidity 0.8.18; /** * @title An immutable registry contract to be deployed as a standalone primitive * @dev See EIP-5639, new project launches can read previous cold wallet -> hot wallet delegations * from here and integrate those permissions into their flow */ interface IDelegationRegistry { /// @notice Delegation type enum DelegationType { NONE, ALL, CONTRACT, TOKEN } /// @notice Info about a single delegation, used for onchain enumeration struct DelegationInfo { DelegationType type_; address vault; address delegate; address contract_; uint256 tokenId; } /// @notice Info about a single contract-level delegation struct ContractDelegation { address contract_; address delegate; } /// @notice Info about a single token-level delegation struct TokenDelegation { address contract_; uint256 tokenId; address delegate; } /// @notice Emitted when a user delegates their entire wallet event DelegateForAll(address vault, address delegate, bool value); /// @notice Emitted when a user delegates a specific contract event DelegateForContract(address vault, address delegate, address contract_, bool value); /// @notice Emitted when a user delegates a specific token event DelegateForToken(address vault, address delegate, address contract_, uint256 tokenId, bool value); /// @notice Emitted when a user revokes all delegations event RevokeAllDelegates(address vault); /// @notice Emitted when a user revoes all delegations for a given delegate event RevokeDelegate(address vault, address delegate); /** * ----------- WRITE ----------- */ /** * @notice Allow the delegate to act on your behalf for all contracts * @param delegate The hotwallet to act on your behalf * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForAll(address delegate, bool value) external; /** * @notice Allow the delegate to act on your behalf for a specific contract * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForContract(address delegate, address contract_, bool value) external; /** * @notice Allow the delegate to act on your behalf for a specific token * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param tokenId The token id for the token you're delegating * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForToken(address delegate, address contract_, uint256 tokenId, bool value) external; /** * @notice Revoke all delegates */ function revokeAllDelegates() external; /** * @notice Revoke a specific delegate for all their permissions * @param delegate The hotwallet to revoke */ function revokeDelegate(address delegate) external; /** * @notice Remove yourself as a delegate for a specific vault * @param vault The vault which delegated to the msg.sender, and should be removed */ function revokeSelf(address vault) external; /** * ----------- READ ----------- */ /** * @notice Returns all active delegations a given delegate is able to claim on behalf of * @param delegate The delegate that you would like to retrieve delegations for * @return info Array of DelegationInfo structs */ function getDelegationsByDelegate(address delegate) external view returns (DelegationInfo[] memory); /** * @notice Returns an array of wallet-level delegates for a given vault * @param vault The cold wallet who issued the delegation * @return addresses Array of wallet-level delegates for a given vault */ function getDelegatesForAll(address vault) external view returns (address[] memory); /** * @notice Returns an array of contract-level delegates for a given vault and contract * @param vault The cold wallet who issued the delegation * @param contract_ The address for the contract you're delegating * @return addresses Array of contract-level delegates for a given vault and contract */ function getDelegatesForContract(address vault, address contract_) external view returns (address[] memory); /** * @notice Returns an array of contract-level delegates for a given vault's token * @param vault The cold wallet who issued the delegation * @param contract_ The address for the contract holding the token * @param tokenId The token id for the token you're delegating * @return addresses Array of contract-level delegates for a given vault's token */ function getDelegatesForToken( address vault, address contract_, uint256 tokenId ) external view returns (address[] memory); /** * @notice Returns all contract-level delegations for a given vault * @param vault The cold wallet who issued the delegations * @return delegations Array of ContractDelegation structs */ function getContractLevelDelegations(address vault) external view returns (ContractDelegation[] memory delegations); /** * @notice Returns all token-level delegations for a given vault * @param vault The cold wallet who issued the delegations * @return delegations Array of TokenDelegation structs */ function getTokenLevelDelegations(address vault) external view returns (TokenDelegation[] memory delegations); /** * @notice Returns true if the address is delegated to act on the entire vault * @param delegate The hotwallet to act on your behalf * @param vault The cold wallet who issued the delegation */ function checkDelegateForAll(address delegate, address vault) external view returns (bool); /** * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param vault The cold wallet who issued the delegation */ function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool); /** * @notice Returns true if the address is delegated to act on your behalf for a specific token, the token's contract or an entire vault * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param tokenId The token id for the token you're delegating * @param vault The cold wallet who issued the delegation */ function checkDelegateForToken( address delegate, address vault, address contract_, uint256 tokenId ) external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {IApeCoinStaking} from "./IApeCoinStaking.sol"; import {IStakeManager} from "./IStakeManager.sol"; import {IStakedNft} from "./IStakedNft.sol"; interface INftPool { event NftRewardDistributed(address indexed nft, uint256 rewardAmount); event NftRewardClaimed( address indexed nft, uint256[] tokenIds, address indexed receiver, uint256 amount, uint256 rewardsDebt ); event NftDeposited(address indexed nft, uint256[] tokenIds, address indexed owner); event NftWithdrawn(address indexed nft, uint256[] tokenIds, address indexed owner); struct PoolState { IStakedNft stakedNft; uint256 accumulatedRewardsPerNft; mapping(uint256 => uint256) rewardsDebt; uint256 pendingApeCoin; } struct PoolUI { uint256 totalStakedNft; uint256 accumulatedRewardsPerNft; uint256 pendingApeCoin; } function claimable(address[] calldata nfts_, uint256[][] calldata tokenIds_) external view returns (uint256); function staker() external view returns (IStakeManager); function deposit(address[] calldata nfts_, uint256[][] calldata tokenIds_) external; function withdraw(address[] calldata nfts_, uint256[][] calldata tokenIds_) external; function claim(address[] calldata nfts_, uint256[][] calldata tokenIds_) external; function receiveApeCoin(address nft_, uint256 rewardsAmount_) external; function compoundApeCoin(address nft_) external; function pendingApeCoin(address nft_) external view returns (uint256); function getPoolStateUI(address nft_) external view returns (PoolUI memory); function getNftStateUI(address nft_, uint256 tokenId) external view returns (uint256 rewardsDebt); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {IERC721ReceiverUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import {IApeCoinStaking} from "./IApeCoinStaking.sol"; import {IDelegationRegistry} from "../interfaces/IDelegationRegistry.sol"; interface INftVault is IERC721ReceiverUpgradeable { event NftDeposited(address indexed nft, address indexed owner, address indexed staker, uint256[] tokenIds); event NftWithdrawn(address indexed nft, address indexed owner, address indexed staker, uint256[] tokenIds); event SingleNftStaked(address indexed nft, address indexed staker, IApeCoinStaking.SingleNft[] nfts); event PairedNftStaked( address indexed staker, IApeCoinStaking.PairNftDepositWithAmount[] baycPairs, IApeCoinStaking.PairNftDepositWithAmount[] maycPairs ); event SingleNftUnstaked(address indexed nft, address indexed staker, IApeCoinStaking.SingleNft[] nfts); event PairedNftUnstaked( address indexed staker, IApeCoinStaking.PairNftWithdrawWithAmount[] baycPairs, IApeCoinStaking.PairNftWithdrawWithAmount[] maycPairs ); event SingleNftClaimed(address indexed nft, address indexed staker, uint256[] tokenIds, uint256 rewards); event PairedNftClaimed( address indexed staker, IApeCoinStaking.PairNft[] baycPairs, IApeCoinStaking.PairNft[] maycPairs, uint256 rewards ); struct NftStatus { address owner; address staker; } struct VaultStorage { // nft address => nft tokenId => nftStatus mapping(address => mapping(uint256 => NftStatus)) nfts; // nft address => staker address => refund mapping(address => mapping(address => Refund)) refunds; // nft address => staker address => position mapping(address => mapping(address => Position)) positions; // nft address => staker address => staking nft tokenId array mapping(address => mapping(address => EnumerableSetUpgradeable.UintSet)) stakingTokenIds; IApeCoinStaking apeCoinStaking; IERC20Upgradeable apeCoin; address bayc; address mayc; address bakc; IDelegationRegistry delegationRegistry; mapping(address => bool) authorized; } struct Refund { uint256 principal; uint256 reward; } struct Position { uint256 stakedAmount; int256 rewardsDebt; } function authorise(address addr_, bool authorized_) external; function stakerOf(address nft_, uint256 tokenId_) external view returns (address); function ownerOf(address nft_, uint256 tokenId_) external view returns (address); function refundOf(address nft_, address staker_) external view returns (Refund memory); function positionOf(address nft_, address staker_) external view returns (Position memory); function pendingRewards(address nft_, address staker_) external view returns (uint256); function totalStakingNft(address nft_, address staker_) external view returns (uint256); function stakingNftIdByIndex(address nft_, address staker_, uint256 index_) external view returns (uint256); function isStaking(address nft_, address staker_, uint256 tokenId_) external view returns (bool); // delegate.cash function setDelegateCash(address delegate_, address nft_, uint256[] calldata tokenIds, bool value) external; // deposit nft function depositNft(address nft_, uint256[] calldata tokenIds_, address staker_) external; // withdraw nft function withdrawNft(address nft_, uint256[] calldata tokenIds_) external; // staker withdraw ape coin function withdrawRefunds(address nft_) external; // stake function stakeBaycPool(IApeCoinStaking.SingleNft[] calldata nfts_) external; function stakeMaycPool(IApeCoinStaking.SingleNft[] calldata nfts_) external; function stakeBakcPool( IApeCoinStaking.PairNftDepositWithAmount[] calldata baycPairs_, IApeCoinStaking.PairNftDepositWithAmount[] calldata maycPairs_ ) external; // unstake function unstakeBaycPool( IApeCoinStaking.SingleNft[] calldata nfts_, address recipient_ ) external returns (uint256 principal, uint256 rewards); function unstakeMaycPool( IApeCoinStaking.SingleNft[] calldata nfts_, address recipient_ ) external returns (uint256 principal, uint256 rewards); function unstakeBakcPool( IApeCoinStaking.PairNftWithdrawWithAmount[] calldata baycPairs_, IApeCoinStaking.PairNftWithdrawWithAmount[] calldata maycPairs_, address recipient_ ) external returns (uint256 principal, uint256 rewards); // claim rewards function claimBaycPool(uint256[] calldata tokenIds_, address recipient_) external returns (uint256 rewards); function claimMaycPool(uint256[] calldata tokenIds_, address recipient_) external returns (uint256 rewards); function claimBakcPool( IApeCoinStaking.PairNft[] calldata baycPairs_, IApeCoinStaking.PairNft[] calldata maycPairs_, address recipient_ ) external returns (uint256 rewards); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; interface IRewardsStrategy { function getNftRewardsShare() external view returns (uint256 nftShare); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {IERC721MetadataUpgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC721MetadataUpgradeable.sol"; import {IERC721ReceiverUpgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC721ReceiverUpgradeable.sol"; import {IERC721EnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC721EnumerableUpgradeable.sol"; interface IStakedNft is IERC721MetadataUpgradeable, IERC721ReceiverUpgradeable, IERC721EnumerableUpgradeable { event Minted(address indexed to, uint256[] tokenId); event Burned(address indexed from, uint256[] tokenId); function authorise(address addr_, bool authorized_) external; function mint(address to, uint256[] calldata tokenIds) external; function burn(uint256[] calldata tokenIds) external; /** * @dev Returns the staker of the `tokenId` token. */ function stakerOf(uint256 tokenId) external view returns (address); /** * @dev Returns a token ID owned by `staker` at a given `index` of its token list. * Use along with {totalStaked} to enumerate all of ``staker``'s tokens. */ function tokenOfStakerByIndex(address staker, uint256 index) external view returns (uint256); /** * @dev Returns the total staked amount of tokens for staker. */ function totalStaked(address staker) external view returns (uint256); function underlyingAsset() external view returns (address); function setDelegateCash(address delegate, uint256[] calldata tokenIds, bool value) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; import {IApeCoinStaking} from "./IApeCoinStaking.sol"; import {IRewardsStrategy} from "./IRewardsStrategy.sol"; import {IWithdrawStrategy} from "./IWithdrawStrategy.sol"; import {IStakedNft} from "./IStakedNft.sol"; interface IStakeManager { event FeeRatioChanged(uint256 newRatio); event FeeRecipientChanged(address newRecipient); event BotAdminChanged(address newAdmin); event RewardsStrategyChanged(address nft, address newStrategy); event WithdrawStrategyChanged(address newStrategy); event Compounded(bool isClaimCoinPool, uint256 claimedNfts); function stBayc() external view returns (IStakedNft); function stMayc() external view returns (IStakedNft); function stBakc() external view returns (IStakedNft); function totalStakedApeCoin() external view returns (uint256); function totalPendingRewards() external view returns (uint256); function totalRefund() external view returns (uint256 principal, uint256 reward); function refundOf(address nft_) external view returns (uint256 principal, uint256 reward); function stakedApeCoin(uint256 poolId_) external view returns (uint256); function pendingRewards(uint256 poolId_) external view returns (uint256); function pendingFeeAmount() external view returns (uint256); function fee() external view returns (uint256); function feeRecipient() external view returns (address); function updateFee(uint256 fee_) external; function updateFeeRecipient(address recipient_) external; // bot function updateBotAdmin(address bot_) external; // strategy function updateRewardsStrategy(address nft_, IRewardsStrategy rewardsStrategy_) external; function updateWithdrawStrategy(IWithdrawStrategy withdrawStrategy_) external; function withdrawApeCoin(uint256 required) external returns (uint256); function mintStNft(IStakedNft stNft_, address to_, uint256[] calldata tokenIds_) external; // staking function calculateFee(uint256 rewardsAmount_) external view returns (uint256 feeAmount); function stakeApeCoin(uint256 amount_) external; function unstakeApeCoin(uint256 amount_) external; function claimApeCoin() external; function stakeBayc(uint256[] calldata tokenIds_) external; function unstakeBayc(uint256[] calldata tokenIds_) external; function claimBayc(uint256[] calldata tokenIds_) external; function stakeMayc(uint256[] calldata tokenIds_) external; function unstakeMayc(uint256[] calldata tokenIds_) external; function claimMayc(uint256[] calldata tokenIds_) external; function stakeBakc( IApeCoinStaking.PairNft[] calldata baycPairs_, IApeCoinStaking.PairNft[] calldata maycPairs_ ) external; function unstakeBakc( IApeCoinStaking.PairNft[] calldata baycPairs_, IApeCoinStaking.PairNft[] calldata maycPairs_ ) external; function claimBakc( IApeCoinStaking.PairNft[] calldata baycPairs_, IApeCoinStaking.PairNft[] calldata maycPairs_ ) external; function withdrawRefund(address nft_) external; function withdrawTotalRefund() external; struct NftArgs { uint256[] bayc; uint256[] mayc; IApeCoinStaking.PairNft[] baycPairs; IApeCoinStaking.PairNft[] maycPairs; } struct CompoundArgs { bool claimCoinPool; NftArgs claim; NftArgs unstake; NftArgs stake; uint256 coinStakeThreshold; } function compound(CompoundArgs calldata args_) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.18; interface IWithdrawStrategy { function withdrawApeCoin(uint256 required) external returns (uint256 withdrawn); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"NftDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardsDebt","type":"uint256"}],"name":"NftRewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"NftRewardDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"NftWithdrawn","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":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"apeCoin","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"apeCoinStaking","outputs":[{"internalType":"contract IApeCoinStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bakc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bayc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bnftRegistry","outputs":[{"internalType":"contract IBNFTRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"nfts_","type":"address[]"},{"internalType":"uint256[][]","name":"tokenIds_","type":"uint256[][]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"nfts_","type":"address[]"},{"internalType":"uint256[][]","name":"tokenIds_","type":"uint256[][]"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coinPool","outputs":[{"internalType":"contract ICoinPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft_","type":"address"}],"name":"compoundApeCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"nfts_","type":"address[]"},{"internalType":"uint256[][]","name":"tokenIds_","type":"uint256[][]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft_","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNftStateUI","outputs":[{"internalType":"uint256","name":"rewardsDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft_","type":"address"}],"name":"getPoolStateUI","outputs":[{"components":[{"internalType":"uint256","name":"totalStakedNft","type":"uint256"},{"internalType":"uint256","name":"accumulatedRewardsPerNft","type":"uint256"},{"internalType":"uint256","name":"pendingApeCoin","type":"uint256"}],"internalType":"struct INftPool.PoolUI","name":"poolUI","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBNFTRegistry","name":"bnftRegistry_","type":"address"},{"internalType":"contract IApeCoinStaking","name":"apeStaking_","type":"address"},{"internalType":"contract ICoinPool","name":"coinPool_","type":"address"},{"internalType":"contract IStakeManager","name":"staker_","type":"address"},{"internalType":"contract IStakedNft","name":"stBayc_","type":"address"},{"internalType":"contract IStakedNft","name":"stMayc_","type":"address"},{"internalType":"contract IStakedNft","name":"stBakc_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mayc","outputs":[{"internalType":"address","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":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft_","type":"address"}],"name":"pendingApeCoin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolStates","outputs":[{"internalType":"contract IStakedNft","name":"stakedNft","type":"address"},{"internalType":"uint256","name":"accumulatedRewardsPerNft","type":"uint256"},{"internalType":"uint256","name":"pendingApeCoin","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft_","type":"address"},{"internalType":"uint256","name":"rewardsAmount_","type":"uint256"}],"name":"receiveApeCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"flag","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staker","outputs":[{"internalType":"contract IStakeManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"nfts_","type":"address[]"},{"internalType":"uint256[][]","name":"tokenIds_","type":"uint256[][]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612f5d806100206000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806390672ad8116100de578063c09e5cc211610097578063f2fde38b11610071578063f2fde38b146103cd578063f4ea77f3146103e0578063fa5f81e4146103f3578063ff5e653e1461042857600080fd5b8063c09e5cc214610349578063c9112a771461035c578063de5222841461036f57600080fd5b806390672ad8146102d7578063a80679c3146102ea578063ac7ad9ba146102fd578063ae4ae1c014610310578063b8e851a314610323578063bedb86fb1461033657600080fd5b80635ebaf1db116101305780635ebaf1db146102595780636b4ad1421461026c578063715018a6146102985780637685807d146102a05780637c367f92146102b35780638da5cb5b146102c657600080fd5b8063150b7a02146101785780631ab95b9d146101a957806335876476146101d4578063365c1031146101e95780635bcd9b07146101fc5780635c975abb14610243575b600080fd5b61018b610186366004612918565b61043b565b6040516001600160e01b031990911681526020015b60405180910390f35b60d0546101bc906001600160a01b031681565b6040516001600160a01b0390911681526020016101a0565b6101e76101e23660046129b7565b610555565b005b6101e76101f7366004612a4d565b61098a565b61023561020a366004612a71565b6001600160a01b03909116600090815260cb6020908152604080832093835260029093019052205490565b6040519081526020016101a0565b60655460ff1660405190151581526020016101a0565b60cc546101bc906001600160a01b031681565b61023561027a366004612a4d565b6001600160a01b0316600090815260cb602052604090206003015490565b6101e7610a38565b60ce546101bc906001600160a01b031681565b6101e76102c1366004612ae9565b610a4c565b6033546001600160a01b03166101bc565b6101e76102e5366004612ae9565b610f15565b6102356102f8366004612ae9565b610ff9565b60ca546101bc906001600160a01b031681565b6101e761031e366004612ae9565b6113b8565b60d1546101bc906001600160a01b031681565b6101e7610344366004612b63565b611730565b6101e7610357366004612a71565b611751565b60c9546101bc906001600160a01b031681565b6103a861037d366004612a4d565b60cb602052600090815260409020805460018201546003909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016101a0565b6101e76103db366004612a4d565b611871565b60cd546101bc906001600160a01b031681565b610406610401366004612a4d565b6118e7565b60408051825181526020808401519082015291810151908201526060016101a0565b60cf546101bc906001600160a01b031681565b60ce5460009081906001600160a01b0316331480610463575060cf546001600160a01b031633145b80610478575060d0546001600160a01b031633145b9050806104f05760ce546001600160a01b03908116600090815260cb6020526040902054163314806104c6575060cf546001600160a01b03908116600090815260cb60205260409020541633145b806104ed575060d0546001600160a01b03908116600090815260cb60205260409020541633145b90505b806105425760405162461bcd60e51b815260206004820152601860248201527f42656e644e6674506f6f6c3a206e6f7420617065206e6674000000000000000060448201526064015b60405180910390fd5b50630a85bd0160e11b9695505050505050565b600054610100900460ff16158080156105755750600054600160ff909116105b8061058f5750303b15801561058f575060005460ff166001145b6105f25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610539565b6000805460ff191660011790558015610615576000805461ff0019166101001790555b61061d6119a7565b6106256119d6565b61062d611a05565b60c980546001600160a01b03199081166001600160a01b038a81169190911790925560cc8054821688841617905560cd8054821689841617905560d180549091168a831617905560408051631c56369f60e21b8152905191861691637158da7c916004808201926020929091908290030181865afa1580156106b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d79190612b80565b60ce60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b0316637158da7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190612b80565b60cf60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550816001600160a01b0316637158da7c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e79190612b80565b60d080546001600160a01b03199081166001600160a01b0393841617825560ce548316600090815260cb60209081526040808320805485168b881617905560cf5486168352808320805485168a88161790559354851682529083902080549092168685161790915560c954825163563d6cdd60e11b8152925193169263ac7ad9ba9260048082019392918290030181865afa15801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190612b80565b60ca80546001600160a01b0319166001600160a01b0392831690811790915560cd5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109399190612b9d565b508015610980576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b60ce5481906001600160a01b03808316911614806109b5575060cf546001600160a01b038281169116145b806109cd575060d0546001600160a01b038281169116145b6109e95760405162461bcd60e51b815260040161053990612bba565b60cc546001600160a01b03163314610a135760405162461bcd60e51b815260040161053990612be8565b6001600160a01b038216600090815260cb60205260409020610a3490611a34565b5050565b610a40611b5f565b610a4a6000611bb9565b565b83836000805b82811015610af357838382818110610a6c57610a6c612c29565b9050602002016020810190610a819190612a4d565b60ce549092506001600160a01b0380841691161480610aad575060cf546001600160a01b038381169116145b80610ac5575060d0546001600160a01b038381169116145b610ae15760405162461bcd60e51b815260040161053990612bba565b80610aeb81612c55565b915050610a52565b50610afc611c0b565b610b04611c64565b610b0e8787611caa565b610b188585611d9f565b610b26333389898989611f12565b60008080805b89811015610efe576000898983818110610b4857610b48612c29565b9050602002810190610b5a9190612c6e565b905011610b795760405162461bcd60e51b815260040161053990612cb8565b8a8a82818110610b8b57610b8b612c29565b9050602002016020810190610ba09190612a4d565b6001600160a01b038116600090815260cb6020526040812095509092505b898983818110610bd057610bd0612c29565b9050602002810190610be29190612c6e565b9050811015610ca457898983818110610bfd57610bfd612c29565b9050602002810190610c0f9190612c6e565b82818110610c1f57610c1f612c29565b8754604051632142170760e11b81526020909202939093013596506001600160a01b03909216916342842e0e9150610c5f90339030908990600401612cef565b600060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505050508080610c9c90612c55565b915050610bbe565b5083546001600160a01b031663b80f55c98a8a84818110610cc757610cc7612c29565b9050602002810190610cd99190612c6e565b6040518363ffffffff1660e01b8152600401610cf6929190612d45565b600060405180830381600087803b158015610d1057600080fd5b505af1158015610d24573d6000803e3d6000fd5b5050505060005b898983818110610d3d57610d3d612c29565b9050602002810190610d4f9190612c6e565b9050811015610e8557898983818110610d6a57610d6a612c29565b9050602002810190610d7c9190612c6e565b82818110610d8c57610d8c612c29565b875460408051631c56369f60e21b815290516020938402959095013598506001600160a01b0390911693637158da7c9350600480830193928290030181865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190612b80565b6001600160a01b03166342842e0e3033876040518463ffffffff1660e01b8152600401610e3093929190612cef565b600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505060008581526002870160205260408120555080610e7d81612c55565b915050610d2b565b50336001600160a01b0383167f4b394698f2be8b63be065dcab6df5ffe0e5591903cc0ee5902dcb41d6b4edf688b8b85818110610ec457610ec4612c29565b9050602002810190610ed69190612c6e565b604051610ee4929190612d45565b60405180910390a380610ef681612c55565b915050610b2c565b50505050610f0c6001609755565b50505050505050565b83836000805b82811015610fbc57838382818110610f3557610f35612c29565b9050602002016020810190610f4a9190612a4d565b60ce549092506001600160a01b0380841691161480610f76575060cf546001600160a01b038381169116145b80610f8e575060d0546001600160a01b038381169116145b610faa5760405162461bcd60e51b815260040161053990612bba565b80610fb481612c55565b915050610f1b565b50610fc5611c0b565b610fcd611c64565b610fd78787611caa565b610fe18585611d9f565b610fef333389898989611f12565b610f0c6001609755565b6000848482805b828110156110a15783838281811061101a5761101a612c29565b905060200201602081019061102f9190612a4d565b60ce549092506001600160a01b038084169116148061105b575060cf546001600160a01b038381169116145b80611073575060d0546001600160a01b038381169116145b61108f5760405162461bcd60e51b815260040161053990612bba565b8061109981612c55565b915050611000565b5060008060006110b18b8b611caa565b6110bb8989611d9f565b60005b8a811015611333578b8b828181106110d8576110d8612c29565b90506020020160208101906110ed9190612a4d565b6001600160a01b03818116600090815260cb60205260408082206001810154815460cc549351639bfd8d6160e01b81529386166004850152919950949750939550909290911690639bfd8d6190602401602060405180830381865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612d59565b11156112795760cd54600385015460405163ef8b30f760e01b81526112769285926001600160a01b039091169163ef8b30f7916111c19160040190815260200190565b602060405180830381865afa1580156111de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112029190612d59565b865460cc54604051639bfd8d6160e01b81526001600160a01b039182166004820152911690639bfd8d6190602401602060405180830381865afa15801561124d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112719190612d59565b6124ef565b91505b60005b8a8a8381811061128e5761128e612c29565b90506020028101906112a09190612c6e565b905081101561132057611302838660020160008e8e878181106112c5576112c5612c29565b90506020028101906112d79190612c6e565b868181106112e7576112e7612c29565b90506020020135815260200190815260200160002054612520565b61130c908a612d72565b98508061131881612c55565b91505061127c565b508061132b81612c55565b9150506110be565b5086156113aa5760cd5460405163266d6a8360e11b8152600481018990526001600160a01b0390911690634cdad50690602401602060405180830381865afa158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190612d59565b96505b505050505050949350505050565b83836000805b8281101561145f578383828181106113d8576113d8612c29565b90506020020160208101906113ed9190612a4d565b60ce549092506001600160a01b0380841691161480611419575060cf546001600160a01b038381169116145b80611431575060d0546001600160a01b038381169116145b61144d5760405162461bcd60e51b815260040161053990612bba565b8061145781612c55565b9150506113be565b50611468611c0b565b611470611c64565b600080600061147f8a8a611caa565b6114898888611d9f565b60005b89811015610efe578a8a828181106114a6576114a6612c29565b90506020020160208101906114bb9190612a4d565b6001600160a01b038116600090815260cb6020526040902090945091506114e182611a34565b60008989838181106114f5576114f5612c29565b90506020028101906115079190612c6e565b9050116115265760405162461bcd60e51b815260040161053990612cb8565b60005b89898381811061153b5761153b612c29565b905060200281019061154d9190612c6e565b90508110156116285789898381811061156857611568612c29565b905060200281019061157a9190612c6e565b8281811061158a5761158a612c29565b60cc54604051632142170760e11b81526020909202939093013596506001600160a01b03808916936342842e0e93506115ce92339291909116908990600401612cef565b600060405180830381600087803b1580156115e857600080fd5b505af11580156115fc573d6000803e3d6000fd5b50505060018401546000868152600286016020526040902055508061162081612c55565b915050611529565b5060cc5482546001600160a01b0391821691633d6f43349116338c8c8681811061165457611654612c29565b90506020028101906116669190612c6e565b6040518563ffffffff1660e01b81526004016116859493929190612d85565b600060405180830381600087803b15801561169f57600080fd5b505af11580156116b3573d6000803e3d6000fd5b5033925050506001600160a01b0385167fdb6d35979e943a3a34892e2a1ada2a2583e9f361a3d7807438e77402d3625ca98b8b858181106116f6576116f6612c29565b90506020028101906117089190612c6e565b604051611716929190612d45565b60405180910390a38061172881612c55565b91505061148c565b611738611b5f565b801561174957611746612550565b50565b6117466125aa565b60ce5482906001600160a01b038083169116148061177c575060cf546001600160a01b038281169116145b80611794575060d0546001600160a01b038281169116145b6117b05760405162461bcd60e51b815260040161053990612bba565b60cc546001600160a01b031633146117da5760405162461bcd60e51b815260040161053990612be8565b60ca546117f2906001600160a01b03163330856125e3565b6001600160a01b038316600090815260cb60205260408120600301805484929061181d908490612d72565b9091555050811561186c57826001600160a01b03167fd1028b5116c51cc56c30771e8270d6ab7ea36e9be200d2fcba1c13343ad0abdc8360405161186391815260200190565b60405180910390a25b505050565b611879611b5f565b6001600160a01b0381166118de5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610539565b61174681611bb9565b61190b60405180606001604052806000815260200160008152602001600081525090565b6001600160a01b03828116600090815260cb602052604090819020805460cc549251639bfd8d6160e01b8152928416600484015290921690639bfd8d6190602401602060405180830381865afa158015611969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198d9190612d59565b825260018101546020830152600301546040820152919050565b600054610100900460ff166119ce5760405162461bcd60e51b815260040161053990612dbc565b610a4a61263b565b600054610100900460ff166119fd5760405162461bcd60e51b815260040161053990612dbc565b610a4a61266b565b600054610100900460ff16611a2c5760405162461bcd60e51b815260040161053990612dbc565b610a4a61269e565b60038101546000819003611a46575050565b815460cc54604051639bfd8d6160e01b81526001600160a01b0391821660048201526000929190911690639bfd8d6190602401602060405180830381865afa158015611a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aba9190612d59565b60cd54604051636e553f6560e01b8152600481018590523060248201529192506000916001600160a01b0390911690636e553f65906044016020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612d59565b6000600386015590508115611b5957611b53846001015482846124ef565b60018501555b50505050565b6033546001600160a01b03163314610a4a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610539565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260975403611c5d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610539565b6002609755565b60655460ff1615610a4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610539565b60005b8181101561186c576000611cc2826001612d72565b90505b82811015611d8c57838382818110611cdf57611cdf612c29565b9050602002016020810190611cf49190612a4d565b6001600160a01b0316848484818110611d0f57611d0f612c29565b9050602002016020810190611d249190612a4d565b6001600160a01b031603611d7a5760405162461bcd60e51b815260206004820152601b60248201527f42656e644e6674506f6f6c3a206475706c6963617465206e66747300000000006044820152606401610539565b80611d8481612c55565b915050611cc5565b5080611d9781612c55565b915050611cad565b60005b8181101561186c5760005b838383818110611dbf57611dbf612c29565b9050602002810190611dd19190612c6e565b9050811015611eff576000611de7826001612d72565b90505b848484818110611dfc57611dfc612c29565b9050602002810190611e0e9190612c6e565b9050811015611eec57848484818110611e2957611e29612c29565b9050602002810190611e3b9190612c6e565b82818110611e4b57611e4b612c29565b90506020020135858585818110611e6457611e64612c29565b9050602002810190611e769190612c6e565b84818110611e8657611e86612c29565b9050602002013503611eda5760405162461bcd60e51b815260206004820152601f60248201527f42656e644e6674506f6f6c3a206475706c696361746520746f6b656e496473006044820152606401610539565b80611ee481612c55565b915050611dea565b5080611ef781612c55565b915050611dad565b5080611f0a81612c55565b915050611da2565b60008060008060008060005b89811015612454576000898983818110611f3a57611f3a612c29565b9050602002810190611f4c9190612c6e565b905011611f6b5760405162461bcd60e51b815260040161053990612cb8565b8a8a82818110611f7d57611f7d612c29565b9050602002016020810190611f929190612a4d565b6001600160a01b03818116600090815260cb602052604080822060d15481549251632cf98ebd60e11b81529285166004840152949b5099509092909116906359f31d7a906024016040805180830381865afa158015611ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120199190612e07565b5090506000945061202987611a34565b60005b8a8a8481811061203e5761203e612c29565b90506020028101906120509190612c6e565b9050811015612349578a8a8481811061206b5761206b612c29565b905060200281019061207d9190612c6e565b8281811061208d5761208d612c29565b8a546040516331a9108f60e11b815260209290920293909301356004820181905299506001600160a01b0390921691636352211e9150602401602060405180830381865afa1580156120e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121079190612b80565b93508e6001600160a01b0316846001600160a01b03161415801561213357506001600160a01b03821615155b80156121505750816001600160a01b0316846001600160a01b0316145b156121c1576040516331a9108f60e11b8152600481018890526001600160a01b03831690636352211e90602401602060405180830381865afa15801561219a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121be9190612b80565b93505b8e6001600160a01b0316846001600160a01b0316146122225760405162461bcd60e51b815260206004820181905260248201527f42656e644e6674506f6f6c3a20696e76616c696420746f6b656e206f776e65726044820152606401610539565b60cc54885460405163564370c360e11b8152600481018a90526001600160a01b03928316929091169063ac86e18690602401602060405180830381865afa158015612271573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122959190612b80565b6001600160a01b0316146122f55760405162461bcd60e51b815260206004820152602160248201527f42656e644e6674506f6f6c3a20696e76616c696420746f6b656e207374616b656044820152603960f91b6064820152608401610539565b6001880154600088815260028a0160205260409020546123159190612520565b61231f9087612d72565b6001890154600089815260028b01602052604090205595508061234181612c55565b91505061202c565b508415612434578c6001600160a01b0316886001600160a01b03167faf8c97f043b1a7f3c8d7490203d9851d7bc3c504ce73389ae77baea617b7ca838c8c8681811061239757612397612c29565b90506020028101906123a99190612c6e565b60cd5460405163266d6a8360e11b8152600481018c90526001600160a01b0390911690634cdad50690602401602060405180830381865afa1580156123f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124169190612d59565b8c6001015460405161242b9493929190612e41565b60405180910390a35b61243e8585612d72565b935050808061244c90612c55565b915050611f1e565b5081156124da5760cd54604051635d043b2960e11b8152600481018490526001600160a01b038d811660248301523060448301529091169063ba087652906064016020604051808303816000875af11580156124b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d89190612d59565b505b505050505050505050505050565b6001609755565b600081612504670de0b6b3a764000085612e68565b61250e9190612e7f565b6125189085612d72565b949350505050565b60008183111561254a57670de0b6b3a764000061253d8385612ea1565b6125479190612e7f565b90505b92915050565b612558611c64565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861258d3390565b6040516001600160a01b03909116815260200160405180910390a1565b6125b26126c5565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361258d565b611b59846323b872dd60e01b85858560405160240161260493929190612cef565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261270e565b600054610100900460ff166126625760405162461bcd60e51b815260040161053990612dbc565b610a4a33611bb9565b600054610100900460ff166126925760405162461bcd60e51b815260040161053990612dbc565b6065805460ff19169055565b600054610100900460ff166124e85760405162461bcd60e51b815260040161053990612dbc565b60655460ff16610a4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610539565b6000612763826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127e09092919063ffffffff16565b80519091501561186c57808060200190518101906127819190612b9d565b61186c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610539565b6060612518848460008585600080866001600160a01b031685876040516128079190612ed8565b60006040518083038185875af1925050503d8060008114612844576040519150601f19603f3d011682016040523d82523d6000602084013e612849565b606091505b509150915061285a87838387612865565b979650505050505050565b606083156128d45782516000036128cd576001600160a01b0385163b6128cd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610539565b5081612518565b61251883838151156128e95781518083602001fd5b8060405162461bcd60e51b81526004016105399190612ef4565b6001600160a01b038116811461174657600080fd5b60008060008060006080868803121561293057600080fd5b853561293b81612903565b9450602086013561294b81612903565b935060408601359250606086013567ffffffffffffffff8082111561296f57600080fd5b818801915088601f83011261298357600080fd5b81358181111561299257600080fd5b8960208285010111156129a457600080fd5b9699959850939650602001949392505050565b600080600080600080600060e0888a0312156129d257600080fd5b87356129dd81612903565b965060208801356129ed81612903565b955060408801356129fd81612903565b94506060880135612a0d81612903565b93506080880135612a1d81612903565b925060a0880135612a2d81612903565b915060c0880135612a3d81612903565b8091505092959891949750929550565b600060208284031215612a5f57600080fd5b8135612a6a81612903565b9392505050565b60008060408385031215612a8457600080fd5b8235612a8f81612903565b946020939093013593505050565b60008083601f840112612aaf57600080fd5b50813567ffffffffffffffff811115612ac757600080fd5b6020830191508360208260051b8501011115612ae257600080fd5b9250929050565b60008060008060408587031215612aff57600080fd5b843567ffffffffffffffff80821115612b1757600080fd5b612b2388838901612a9d565b90965094506020870135915080821115612b3c57600080fd5b50612b4987828801612a9d565b95989497509550505050565b801515811461174657600080fd5b600060208284031215612b7557600080fd5b8135612a6a81612b55565b600060208284031215612b9257600080fd5b8151612a6a81612903565b600060208284031215612baf57600080fd5b8151612a6a81612b55565b60208082526014908201527342656e644e6674506f6f6c3a206e6f742061706560601b604082015260600190565b60208082526021908201527f42656e644e6674506f6f6c3a2063616c6c6572206973206e6f74207374616b656040820152603960f91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612c6757612c67612c3f565b5060010190565b6000808335601e19843603018112612c8557600080fd5b83018035915067ffffffffffffffff821115612ca057600080fd5b6020019150600581901b3603821315612ae257600080fd5b6020808252601b908201527f42656e644e6674506f6f6c3a20656d70747920746f6b656e4964730000000000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b81835260006001600160fb1b03831115612d2c57600080fd5b8260051b80836020870137939093016020019392505050565b602081526000612518602083018486612d13565b600060208284031215612d6b57600080fd5b5051919050565b8082018082111561254a5761254a612c3f565b6001600160a01b03858116825284166020820152606060408201819052600090612db29083018486612d13565b9695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008060408385031215612e1a57600080fd5b8251612e2581612903565b6020840151909250612e3681612903565b809150509250929050565b606081526000612e55606083018688612d13565b6020830194909452506040015292915050565b808202811582820484141761254a5761254a612c3f565b600082612e9c57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561254a5761254a612c3f565b60005b83811015612ecf578181015183820152602001612eb7565b50506000910152565b60008251612eea818460208701612eb4565b9190910192915050565b6020815260008251806020840152612f13816040850160208701612eb4565b601f01601f1916919091016040019291505056fea2646970667358221220bb2c8fdda0ca75c3fe07f4b11c0a8c5a9b062146737b6d204951dcaaf75abf8564736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806390672ad8116100de578063c09e5cc211610097578063f2fde38b11610071578063f2fde38b146103cd578063f4ea77f3146103e0578063fa5f81e4146103f3578063ff5e653e1461042857600080fd5b8063c09e5cc214610349578063c9112a771461035c578063de5222841461036f57600080fd5b806390672ad8146102d7578063a80679c3146102ea578063ac7ad9ba146102fd578063ae4ae1c014610310578063b8e851a314610323578063bedb86fb1461033657600080fd5b80635ebaf1db116101305780635ebaf1db146102595780636b4ad1421461026c578063715018a6146102985780637685807d146102a05780637c367f92146102b35780638da5cb5b146102c657600080fd5b8063150b7a02146101785780631ab95b9d146101a957806335876476146101d4578063365c1031146101e95780635bcd9b07146101fc5780635c975abb14610243575b600080fd5b61018b610186366004612918565b61043b565b6040516001600160e01b031990911681526020015b60405180910390f35b60d0546101bc906001600160a01b031681565b6040516001600160a01b0390911681526020016101a0565b6101e76101e23660046129b7565b610555565b005b6101e76101f7366004612a4d565b61098a565b61023561020a366004612a71565b6001600160a01b03909116600090815260cb6020908152604080832093835260029093019052205490565b6040519081526020016101a0565b60655460ff1660405190151581526020016101a0565b60cc546101bc906001600160a01b031681565b61023561027a366004612a4d565b6001600160a01b0316600090815260cb602052604090206003015490565b6101e7610a38565b60ce546101bc906001600160a01b031681565b6101e76102c1366004612ae9565b610a4c565b6033546001600160a01b03166101bc565b6101e76102e5366004612ae9565b610f15565b6102356102f8366004612ae9565b610ff9565b60ca546101bc906001600160a01b031681565b6101e761031e366004612ae9565b6113b8565b60d1546101bc906001600160a01b031681565b6101e7610344366004612b63565b611730565b6101e7610357366004612a71565b611751565b60c9546101bc906001600160a01b031681565b6103a861037d366004612a4d565b60cb602052600090815260409020805460018201546003909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016101a0565b6101e76103db366004612a4d565b611871565b60cd546101bc906001600160a01b031681565b610406610401366004612a4d565b6118e7565b60408051825181526020808401519082015291810151908201526060016101a0565b60cf546101bc906001600160a01b031681565b60ce5460009081906001600160a01b0316331480610463575060cf546001600160a01b031633145b80610478575060d0546001600160a01b031633145b9050806104f05760ce546001600160a01b03908116600090815260cb6020526040902054163314806104c6575060cf546001600160a01b03908116600090815260cb60205260409020541633145b806104ed575060d0546001600160a01b03908116600090815260cb60205260409020541633145b90505b806105425760405162461bcd60e51b815260206004820152601860248201527f42656e644e6674506f6f6c3a206e6f7420617065206e6674000000000000000060448201526064015b60405180910390fd5b50630a85bd0160e11b9695505050505050565b600054610100900460ff16158080156105755750600054600160ff909116105b8061058f5750303b15801561058f575060005460ff166001145b6105f25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610539565b6000805460ff191660011790558015610615576000805461ff0019166101001790555b61061d6119a7565b6106256119d6565b61062d611a05565b60c980546001600160a01b03199081166001600160a01b038a81169190911790925560cc8054821688841617905560cd8054821689841617905560d180549091168a831617905560408051631c56369f60e21b8152905191861691637158da7c916004808201926020929091908290030181865afa1580156106b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d79190612b80565b60ce60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b0316637158da7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190612b80565b60cf60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550816001600160a01b0316637158da7c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e79190612b80565b60d080546001600160a01b03199081166001600160a01b0393841617825560ce548316600090815260cb60209081526040808320805485168b881617905560cf5486168352808320805485168a88161790559354851682529083902080549092168685161790915560c954825163563d6cdd60e11b8152925193169263ac7ad9ba9260048082019392918290030181865afa15801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190612b80565b60ca80546001600160a01b0319166001600160a01b0392831690811790915560cd5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109399190612b9d565b508015610980576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b60ce5481906001600160a01b03808316911614806109b5575060cf546001600160a01b038281169116145b806109cd575060d0546001600160a01b038281169116145b6109e95760405162461bcd60e51b815260040161053990612bba565b60cc546001600160a01b03163314610a135760405162461bcd60e51b815260040161053990612be8565b6001600160a01b038216600090815260cb60205260409020610a3490611a34565b5050565b610a40611b5f565b610a4a6000611bb9565b565b83836000805b82811015610af357838382818110610a6c57610a6c612c29565b9050602002016020810190610a819190612a4d565b60ce549092506001600160a01b0380841691161480610aad575060cf546001600160a01b038381169116145b80610ac5575060d0546001600160a01b038381169116145b610ae15760405162461bcd60e51b815260040161053990612bba565b80610aeb81612c55565b915050610a52565b50610afc611c0b565b610b04611c64565b610b0e8787611caa565b610b188585611d9f565b610b26333389898989611f12565b60008080805b89811015610efe576000898983818110610b4857610b48612c29565b9050602002810190610b5a9190612c6e565b905011610b795760405162461bcd60e51b815260040161053990612cb8565b8a8a82818110610b8b57610b8b612c29565b9050602002016020810190610ba09190612a4d565b6001600160a01b038116600090815260cb6020526040812095509092505b898983818110610bd057610bd0612c29565b9050602002810190610be29190612c6e565b9050811015610ca457898983818110610bfd57610bfd612c29565b9050602002810190610c0f9190612c6e565b82818110610c1f57610c1f612c29565b8754604051632142170760e11b81526020909202939093013596506001600160a01b03909216916342842e0e9150610c5f90339030908990600401612cef565b600060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505050508080610c9c90612c55565b915050610bbe565b5083546001600160a01b031663b80f55c98a8a84818110610cc757610cc7612c29565b9050602002810190610cd99190612c6e565b6040518363ffffffff1660e01b8152600401610cf6929190612d45565b600060405180830381600087803b158015610d1057600080fd5b505af1158015610d24573d6000803e3d6000fd5b5050505060005b898983818110610d3d57610d3d612c29565b9050602002810190610d4f9190612c6e565b9050811015610e8557898983818110610d6a57610d6a612c29565b9050602002810190610d7c9190612c6e565b82818110610d8c57610d8c612c29565b875460408051631c56369f60e21b815290516020938402959095013598506001600160a01b0390911693637158da7c9350600480830193928290030181865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e019190612b80565b6001600160a01b03166342842e0e3033876040518463ffffffff1660e01b8152600401610e3093929190612cef565b600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505060008581526002870160205260408120555080610e7d81612c55565b915050610d2b565b50336001600160a01b0383167f4b394698f2be8b63be065dcab6df5ffe0e5591903cc0ee5902dcb41d6b4edf688b8b85818110610ec457610ec4612c29565b9050602002810190610ed69190612c6e565b604051610ee4929190612d45565b60405180910390a380610ef681612c55565b915050610b2c565b50505050610f0c6001609755565b50505050505050565b83836000805b82811015610fbc57838382818110610f3557610f35612c29565b9050602002016020810190610f4a9190612a4d565b60ce549092506001600160a01b0380841691161480610f76575060cf546001600160a01b038381169116145b80610f8e575060d0546001600160a01b038381169116145b610faa5760405162461bcd60e51b815260040161053990612bba565b80610fb481612c55565b915050610f1b565b50610fc5611c0b565b610fcd611c64565b610fd78787611caa565b610fe18585611d9f565b610fef333389898989611f12565b610f0c6001609755565b6000848482805b828110156110a15783838281811061101a5761101a612c29565b905060200201602081019061102f9190612a4d565b60ce549092506001600160a01b038084169116148061105b575060cf546001600160a01b038381169116145b80611073575060d0546001600160a01b038381169116145b61108f5760405162461bcd60e51b815260040161053990612bba565b8061109981612c55565b915050611000565b5060008060006110b18b8b611caa565b6110bb8989611d9f565b60005b8a811015611333578b8b828181106110d8576110d8612c29565b90506020020160208101906110ed9190612a4d565b6001600160a01b03818116600090815260cb60205260408082206001810154815460cc549351639bfd8d6160e01b81529386166004850152919950949750939550909290911690639bfd8d6190602401602060405180830381865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612d59565b11156112795760cd54600385015460405163ef8b30f760e01b81526112769285926001600160a01b039091169163ef8b30f7916111c19160040190815260200190565b602060405180830381865afa1580156111de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112029190612d59565b865460cc54604051639bfd8d6160e01b81526001600160a01b039182166004820152911690639bfd8d6190602401602060405180830381865afa15801561124d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112719190612d59565b6124ef565b91505b60005b8a8a8381811061128e5761128e612c29565b90506020028101906112a09190612c6e565b905081101561132057611302838660020160008e8e878181106112c5576112c5612c29565b90506020028101906112d79190612c6e565b868181106112e7576112e7612c29565b90506020020135815260200190815260200160002054612520565b61130c908a612d72565b98508061131881612c55565b91505061127c565b508061132b81612c55565b9150506110be565b5086156113aa5760cd5460405163266d6a8360e11b8152600481018990526001600160a01b0390911690634cdad50690602401602060405180830381865afa158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190612d59565b96505b505050505050949350505050565b83836000805b8281101561145f578383828181106113d8576113d8612c29565b90506020020160208101906113ed9190612a4d565b60ce549092506001600160a01b0380841691161480611419575060cf546001600160a01b038381169116145b80611431575060d0546001600160a01b038381169116145b61144d5760405162461bcd60e51b815260040161053990612bba565b8061145781612c55565b9150506113be565b50611468611c0b565b611470611c64565b600080600061147f8a8a611caa565b6114898888611d9f565b60005b89811015610efe578a8a828181106114a6576114a6612c29565b90506020020160208101906114bb9190612a4d565b6001600160a01b038116600090815260cb6020526040902090945091506114e182611a34565b60008989838181106114f5576114f5612c29565b90506020028101906115079190612c6e565b9050116115265760405162461bcd60e51b815260040161053990612cb8565b60005b89898381811061153b5761153b612c29565b905060200281019061154d9190612c6e565b90508110156116285789898381811061156857611568612c29565b905060200281019061157a9190612c6e565b8281811061158a5761158a612c29565b60cc54604051632142170760e11b81526020909202939093013596506001600160a01b03808916936342842e0e93506115ce92339291909116908990600401612cef565b600060405180830381600087803b1580156115e857600080fd5b505af11580156115fc573d6000803e3d6000fd5b50505060018401546000868152600286016020526040902055508061162081612c55565b915050611529565b5060cc5482546001600160a01b0391821691633d6f43349116338c8c8681811061165457611654612c29565b90506020028101906116669190612c6e565b6040518563ffffffff1660e01b81526004016116859493929190612d85565b600060405180830381600087803b15801561169f57600080fd5b505af11580156116b3573d6000803e3d6000fd5b5033925050506001600160a01b0385167fdb6d35979e943a3a34892e2a1ada2a2583e9f361a3d7807438e77402d3625ca98b8b858181106116f6576116f6612c29565b90506020028101906117089190612c6e565b604051611716929190612d45565b60405180910390a38061172881612c55565b91505061148c565b611738611b5f565b801561174957611746612550565b50565b6117466125aa565b60ce5482906001600160a01b038083169116148061177c575060cf546001600160a01b038281169116145b80611794575060d0546001600160a01b038281169116145b6117b05760405162461bcd60e51b815260040161053990612bba565b60cc546001600160a01b031633146117da5760405162461bcd60e51b815260040161053990612be8565b60ca546117f2906001600160a01b03163330856125e3565b6001600160a01b038316600090815260cb60205260408120600301805484929061181d908490612d72565b9091555050811561186c57826001600160a01b03167fd1028b5116c51cc56c30771e8270d6ab7ea36e9be200d2fcba1c13343ad0abdc8360405161186391815260200190565b60405180910390a25b505050565b611879611b5f565b6001600160a01b0381166118de5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610539565b61174681611bb9565b61190b60405180606001604052806000815260200160008152602001600081525090565b6001600160a01b03828116600090815260cb602052604090819020805460cc549251639bfd8d6160e01b8152928416600484015290921690639bfd8d6190602401602060405180830381865afa158015611969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198d9190612d59565b825260018101546020830152600301546040820152919050565b600054610100900460ff166119ce5760405162461bcd60e51b815260040161053990612dbc565b610a4a61263b565b600054610100900460ff166119fd5760405162461bcd60e51b815260040161053990612dbc565b610a4a61266b565b600054610100900460ff16611a2c5760405162461bcd60e51b815260040161053990612dbc565b610a4a61269e565b60038101546000819003611a46575050565b815460cc54604051639bfd8d6160e01b81526001600160a01b0391821660048201526000929190911690639bfd8d6190602401602060405180830381865afa158015611a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aba9190612d59565b60cd54604051636e553f6560e01b8152600481018590523060248201529192506000916001600160a01b0390911690636e553f65906044016020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612d59565b6000600386015590508115611b5957611b53846001015482846124ef565b60018501555b50505050565b6033546001600160a01b03163314610a4a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610539565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260975403611c5d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610539565b6002609755565b60655460ff1615610a4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610539565b60005b8181101561186c576000611cc2826001612d72565b90505b82811015611d8c57838382818110611cdf57611cdf612c29565b9050602002016020810190611cf49190612a4d565b6001600160a01b0316848484818110611d0f57611d0f612c29565b9050602002016020810190611d249190612a4d565b6001600160a01b031603611d7a5760405162461bcd60e51b815260206004820152601b60248201527f42656e644e6674506f6f6c3a206475706c6963617465206e66747300000000006044820152606401610539565b80611d8481612c55565b915050611cc5565b5080611d9781612c55565b915050611cad565b60005b8181101561186c5760005b838383818110611dbf57611dbf612c29565b9050602002810190611dd19190612c6e565b9050811015611eff576000611de7826001612d72565b90505b848484818110611dfc57611dfc612c29565b9050602002810190611e0e9190612c6e565b9050811015611eec57848484818110611e2957611e29612c29565b9050602002810190611e3b9190612c6e565b82818110611e4b57611e4b612c29565b90506020020135858585818110611e6457611e64612c29565b9050602002810190611e769190612c6e565b84818110611e8657611e86612c29565b9050602002013503611eda5760405162461bcd60e51b815260206004820152601f60248201527f42656e644e6674506f6f6c3a206475706c696361746520746f6b656e496473006044820152606401610539565b80611ee481612c55565b915050611dea565b5080611ef781612c55565b915050611dad565b5080611f0a81612c55565b915050611da2565b60008060008060008060005b89811015612454576000898983818110611f3a57611f3a612c29565b9050602002810190611f4c9190612c6e565b905011611f6b5760405162461bcd60e51b815260040161053990612cb8565b8a8a82818110611f7d57611f7d612c29565b9050602002016020810190611f929190612a4d565b6001600160a01b03818116600090815260cb602052604080822060d15481549251632cf98ebd60e11b81529285166004840152949b5099509092909116906359f31d7a906024016040805180830381865afa158015611ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120199190612e07565b5090506000945061202987611a34565b60005b8a8a8481811061203e5761203e612c29565b90506020028101906120509190612c6e565b9050811015612349578a8a8481811061206b5761206b612c29565b905060200281019061207d9190612c6e565b8281811061208d5761208d612c29565b8a546040516331a9108f60e11b815260209290920293909301356004820181905299506001600160a01b0390921691636352211e9150602401602060405180830381865afa1580156120e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121079190612b80565b93508e6001600160a01b0316846001600160a01b03161415801561213357506001600160a01b03821615155b80156121505750816001600160a01b0316846001600160a01b0316145b156121c1576040516331a9108f60e11b8152600481018890526001600160a01b03831690636352211e90602401602060405180830381865afa15801561219a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121be9190612b80565b93505b8e6001600160a01b0316846001600160a01b0316146122225760405162461bcd60e51b815260206004820181905260248201527f42656e644e6674506f6f6c3a20696e76616c696420746f6b656e206f776e65726044820152606401610539565b60cc54885460405163564370c360e11b8152600481018a90526001600160a01b03928316929091169063ac86e18690602401602060405180830381865afa158015612271573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122959190612b80565b6001600160a01b0316146122f55760405162461bcd60e51b815260206004820152602160248201527f42656e644e6674506f6f6c3a20696e76616c696420746f6b656e207374616b656044820152603960f91b6064820152608401610539565b6001880154600088815260028a0160205260409020546123159190612520565b61231f9087612d72565b6001890154600089815260028b01602052604090205595508061234181612c55565b91505061202c565b508415612434578c6001600160a01b0316886001600160a01b03167faf8c97f043b1a7f3c8d7490203d9851d7bc3c504ce73389ae77baea617b7ca838c8c8681811061239757612397612c29565b90506020028101906123a99190612c6e565b60cd5460405163266d6a8360e11b8152600481018c90526001600160a01b0390911690634cdad50690602401602060405180830381865afa1580156123f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124169190612d59565b8c6001015460405161242b9493929190612e41565b60405180910390a35b61243e8585612d72565b935050808061244c90612c55565b915050611f1e565b5081156124da5760cd54604051635d043b2960e11b8152600481018490526001600160a01b038d811660248301523060448301529091169063ba087652906064016020604051808303816000875af11580156124b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d89190612d59565b505b505050505050505050505050565b6001609755565b600081612504670de0b6b3a764000085612e68565b61250e9190612e7f565b6125189085612d72565b949350505050565b60008183111561254a57670de0b6b3a764000061253d8385612ea1565b6125479190612e7f565b90505b92915050565b612558611c64565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861258d3390565b6040516001600160a01b03909116815260200160405180910390a1565b6125b26126c5565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361258d565b611b59846323b872dd60e01b85858560405160240161260493929190612cef565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261270e565b600054610100900460ff166126625760405162461bcd60e51b815260040161053990612dbc565b610a4a33611bb9565b600054610100900460ff166126925760405162461bcd60e51b815260040161053990612dbc565b6065805460ff19169055565b600054610100900460ff166124e85760405162461bcd60e51b815260040161053990612dbc565b60655460ff16610a4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610539565b6000612763826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127e09092919063ffffffff16565b80519091501561186c57808060200190518101906127819190612b9d565b61186c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610539565b6060612518848460008585600080866001600160a01b031685876040516128079190612ed8565b60006040518083038185875af1925050503d8060008114612844576040519150601f19603f3d011682016040523d82523d6000602084013e612849565b606091505b509150915061285a87838387612865565b979650505050505050565b606083156128d45782516000036128cd576001600160a01b0385163b6128cd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610539565b5081612518565b61251883838151156128e95781518083602001fd5b8060405162461bcd60e51b81526004016105399190612ef4565b6001600160a01b038116811461174657600080fd5b60008060008060006080868803121561293057600080fd5b853561293b81612903565b9450602086013561294b81612903565b935060408601359250606086013567ffffffffffffffff8082111561296f57600080fd5b818801915088601f83011261298357600080fd5b81358181111561299257600080fd5b8960208285010111156129a457600080fd5b9699959850939650602001949392505050565b600080600080600080600060e0888a0312156129d257600080fd5b87356129dd81612903565b965060208801356129ed81612903565b955060408801356129fd81612903565b94506060880135612a0d81612903565b93506080880135612a1d81612903565b925060a0880135612a2d81612903565b915060c0880135612a3d81612903565b8091505092959891949750929550565b600060208284031215612a5f57600080fd5b8135612a6a81612903565b9392505050565b60008060408385031215612a8457600080fd5b8235612a8f81612903565b946020939093013593505050565b60008083601f840112612aaf57600080fd5b50813567ffffffffffffffff811115612ac757600080fd5b6020830191508360208260051b8501011115612ae257600080fd5b9250929050565b60008060008060408587031215612aff57600080fd5b843567ffffffffffffffff80821115612b1757600080fd5b612b2388838901612a9d565b90965094506020870135915080821115612b3c57600080fd5b50612b4987828801612a9d565b95989497509550505050565b801515811461174657600080fd5b600060208284031215612b7557600080fd5b8135612a6a81612b55565b600060208284031215612b9257600080fd5b8151612a6a81612903565b600060208284031215612baf57600080fd5b8151612a6a81612b55565b60208082526014908201527342656e644e6674506f6f6c3a206e6f742061706560601b604082015260600190565b60208082526021908201527f42656e644e6674506f6f6c3a2063616c6c6572206973206e6f74207374616b656040820152603960f91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612c6757612c67612c3f565b5060010190565b6000808335601e19843603018112612c8557600080fd5b83018035915067ffffffffffffffff821115612ca057600080fd5b6020019150600581901b3603821315612ae257600080fd5b6020808252601b908201527f42656e644e6674506f6f6c3a20656d70747920746f6b656e4964730000000000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b81835260006001600160fb1b03831115612d2c57600080fd5b8260051b80836020870137939093016020019392505050565b602081526000612518602083018486612d13565b600060208284031215612d6b57600080fd5b5051919050565b8082018082111561254a5761254a612c3f565b6001600160a01b03858116825284166020820152606060408201819052600090612db29083018486612d13565b9695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008060408385031215612e1a57600080fd5b8251612e2581612903565b6020840151909250612e3681612903565b809150509250929050565b606081526000612e55606083018688612d13565b6020830194909452506040015292915050565b808202811582820484141761254a5761254a612c3f565b600082612e9c57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561254a5761254a612c3f565b60005b83811015612ecf578181015183820152602001612eb7565b50506000910152565b60008251612eea818460208701612eb4565b9190910192915050565b6020815260008251806020840152612f13816040850160208701612eb4565b601f01601f1916919091016040019291505056fea2646970667358221220bb2c8fdda0ca75c3fe07f4b11c0a8c5a9b062146737b6d204951dcaaf75abf8564736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.