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 Source Code Verified (Exact Match)
Contract Name:
NFTXVaultUpgradeable
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./util/OwnableUpgradeable.sol"; import "./util/ReentrancyGuardUpgradeable.sol"; import "./util/EnumerableSetUpgradeable.sol"; import "./token/ERC20FlashMintUpgradeable.sol"; import "./token/ERC721SafeHolderUpgradeable.sol"; import "./token/ERC1155SafeHolderUpgradeable.sol"; import "./token/IERC1155Upgradeable.sol"; import "./token/IERC721Upgradeable.sol"; import "./interface/INFTXVault.sol"; import "./interface/INFTXEligibilityManager.sol"; import "./interface/INFTXFeeDistributor.sol"; import {IERC1271} from "./interface/IERC1271.sol"; import {SignatureChecker} from "./util/SignatureChecker.sol"; // Authors: @apoorvlathey, @0xKiwi_ and @alexgausman. contract NFTXVaultUpgradeable is OwnableUpgradeable, ERC20FlashMintUpgradeable, ReentrancyGuardUpgradeable, ERC721SafeHolderUpgradeable, ERC1155SafeHolderUpgradeable, INFTXVault, IERC1271 { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet; uint256 constant base = 10 ** 18; uint256 public override vaultId; address public override manager; address public override assetAddress; INFTXVaultFactory public override vaultFactory; INFTXEligibility public override eligibilityStorage; uint256 randNonce; uint256 private UNUSED_FEE1; uint256 private UNUSED_FEE2; uint256 private UNUSED_FEE3; bool public override is1155; bool public override allowAllItems; bool public override enableMint; bool public override enableRandomRedeem; bool public override enableTargetRedeem; EnumerableSetUpgradeable.UintSet holdings; mapping(uint256 => uint256) quantity1155; bool public override enableRandomSwap; bool public override enableTargetSwap; event VaultShutdown( address assetAddress, uint256 numItems, address recipient ); event MetaDataChange( string oldName, string oldSymbol, string newName, string newSymbol ); function __NFTXVault_init( string memory _name, string memory _symbol, address _assetAddress, bool _is1155, bool _allowAllItems ) public virtual override initializer { __Ownable_init(); __ERC20_init(_name, _symbol); require(_assetAddress != address(0), "Asset != address(0)"); assetAddress = _assetAddress; vaultFactory = INFTXVaultFactory(msg.sender); vaultId = vaultFactory.numVaults(); is1155 = _is1155; allowAllItems = _allowAllItems; emit VaultInit(vaultId, _assetAddress, _is1155, _allowAllItems); setVaultFeatures( true /*enableMint*/, true /*enableRandomRedeem*/, true /*enableTargetRedeem*/, true /*enableRandomSwap*/, true /*enableTargetSwap*/ ); } function finalizeVault() external virtual override { setManager(address(0)); } // Added in v1.0.3. function setVaultMetadata( string calldata name_, string calldata symbol_ ) external virtual override { onlyPrivileged(); emit MetaDataChange(name(), symbol(), name_, symbol_); _setMetadata(name_, symbol_); } function setVaultFeatures( bool _enableMint, bool _enableRandomRedeem, bool _enableTargetRedeem, bool _enableRandomSwap, bool _enableTargetSwap ) public virtual override { onlyPrivileged(); enableMint = _enableMint; enableRandomRedeem = _enableRandomRedeem; enableTargetRedeem = _enableTargetRedeem; enableRandomSwap = _enableRandomSwap; enableTargetSwap = _enableTargetSwap; emit EnableMintUpdated(_enableMint); emit EnableRandomRedeemUpdated(_enableRandomRedeem); emit EnableTargetRedeemUpdated(_enableTargetRedeem); emit EnableRandomSwapUpdated(_enableRandomSwap); emit EnableTargetSwapUpdated(_enableTargetSwap); } function setFees( uint256 _mintFee, uint256 _randomRedeemFee, uint256 _targetRedeemFee, uint256 _randomSwapFee, uint256 _targetSwapFee ) public virtual override { onlyPrivileged(); vaultFactory.setVaultFees( vaultId, _mintFee, _randomRedeemFee, _targetRedeemFee, _randomSwapFee, _targetSwapFee ); } function disableVaultFees() public virtual override { onlyPrivileged(); vaultFactory.disableVaultFees(vaultId); } // This function allows for an easy setup of any eligibility module contract from the EligibilityManager. // It takes in ABI encoded parameters for the desired module. This is to make sure they can all follow // a similar interface. function deployEligibilityStorage( uint256 moduleIndex, bytes calldata initData ) external virtual override returns (address) { onlyPrivileged(); require( address(eligibilityStorage) == address(0), "NFTXVault: eligibility already set" ); INFTXEligibilityManager eligManager = INFTXEligibilityManager( vaultFactory.eligibilityManager() ); address _eligibility = eligManager.deployEligibility( moduleIndex, initData ); eligibilityStorage = INFTXEligibility(_eligibility); // Toggle this to let the contract know to check eligibility now. allowAllItems = false; emit EligibilityDeployed(moduleIndex, _eligibility); return _eligibility; } // // This function allows for the manager to set their own arbitrary eligibility contract. // // Once eligiblity is set, it cannot be unset or changed. // Disabled for launch. // function setEligibilityStorage(address _newEligibility) public virtual { // onlyPrivileged(); // require( // address(eligibilityStorage) == address(0), // "NFTXVault: eligibility already set" // ); // eligibilityStorage = INFTXEligibility(_newEligibility); // // Toggle this to let the contract know to check eligibility now. // allowAllItems = false; // emit CustomEligibilityDeployed(address(_newEligibility)); // } // The manager has control over options like fees and features function setManager(address _manager) public virtual override { onlyPrivileged(); manager = _manager; emit ManagerSet(_manager); } function mint( uint256[] calldata tokenIds, uint256[] calldata amounts /* ignored for ERC721 vaults */ ) external virtual override returns (uint256) { return mintTo(tokenIds, amounts, msg.sender); } function mintTo( uint256[] memory tokenIds, uint256[] memory amounts /* ignored for ERC721 vaults */, address to ) public virtual override nonReentrant returns (uint256) { onlyOwnerIfPaused(1); checkAddressOnDenyList(msg.sender); require(enableMint, "Minting not enabled"); // Take the NFTs. uint256 count = receiveNFTs(tokenIds, amounts); // Mint to the user. _mint(to, base * count); uint256 totalFee = mintFee() * count; _chargeAndDistributeFees(to, totalFee); emit Minted(tokenIds, amounts, to); return count; } function redeem( uint256 amount, uint256[] calldata specificIds ) external virtual override returns (uint256[] memory) { return redeemTo(amount, specificIds, msg.sender); } function redeemTo( uint256 amount, uint256[] memory specificIds, address to ) public virtual override nonReentrant returns (uint256[] memory) { onlyOwnerIfPaused(2); checkAddressOnDenyList(msg.sender); require( amount == specificIds.length || enableRandomRedeem, "NFTXVault: Random redeem not enabled" ); require( specificIds.length == 0 || enableTargetRedeem, "NFTXVault: Target redeem not enabled" ); // We burn all from sender and mint to fee receiver to reduce costs. _burn(msg.sender, base * amount); // Pay the tokens + toll. ( , uint256 _randomRedeemFee, uint256 _targetRedeemFee, , ) = vaultFees(); uint256 totalFee = (_targetRedeemFee * specificIds.length) + (_randomRedeemFee * (amount - specificIds.length)); _chargeAndDistributeFees(msg.sender, totalFee); // Withdraw from vault. uint256[] memory redeemedIds = withdrawNFTsTo(amount, specificIds, to); emit Redeemed(redeemedIds, specificIds, to); return redeemedIds; } function swap( uint256[] calldata tokenIds, uint256[] calldata amounts /* ignored for ERC721 vaults */, uint256[] calldata specificIds ) external virtual override returns (uint256[] memory) { return swapTo(tokenIds, amounts, specificIds, msg.sender); } function swapTo( uint256[] memory tokenIds, uint256[] memory amounts /* ignored for ERC721 vaults */, uint256[] memory specificIds, address to ) public virtual override nonReentrant returns (uint256[] memory) { onlyOwnerIfPaused(3); checkAddressOnDenyList(msg.sender); uint256 count; if (is1155) { for (uint256 i; i < tokenIds.length; ++i) { uint256 amount = amounts[i]; require(amount != 0, "NFTXVault: transferring < 1"); count += amount; } } else { count = tokenIds.length; } require( count == specificIds.length || enableRandomSwap, "NFTXVault: Random swap disabled" ); require( specificIds.length == 0 || enableTargetSwap, "NFTXVault: Target swap disabled" ); (, , , uint256 _randomSwapFee, uint256 _targetSwapFee) = vaultFees(); uint256 totalFee = (_targetSwapFee * specificIds.length) + (_randomSwapFee * (count - specificIds.length)); _chargeAndDistributeFees(msg.sender, totalFee); // Give the NFTs first, so the user wont get the same thing back, just to be nice. uint256[] memory ids = withdrawNFTsTo(count, specificIds, to); receiveNFTs(tokenIds, amounts); emit Swapped(tokenIds, amounts, specificIds, ids, to); return ids; } function flashLoan( IERC3156FlashBorrowerUpgradeable receiver, address token, uint256 amount, bytes memory data ) public virtual override returns (bool) { onlyOwnerIfPaused(4); return super.flashLoan(receiver, token, amount, data); } function mintFee() public view virtual override returns (uint256) { (uint256 _mintFee, , , , ) = vaultFactory.vaultFees(vaultId); return _mintFee; } function randomRedeemFee() public view virtual override returns (uint256) { (, uint256 _randomRedeemFee, , , ) = vaultFactory.vaultFees(vaultId); return _randomRedeemFee; } function targetRedeemFee() public view virtual override returns (uint256) { (, , uint256 _targetRedeemFee, , ) = vaultFactory.vaultFees(vaultId); return _targetRedeemFee; } function randomSwapFee() public view virtual override returns (uint256) { (, , , uint256 _randomSwapFee, ) = vaultFactory.vaultFees(vaultId); return _randomSwapFee; } function targetSwapFee() public view virtual override returns (uint256) { (, , , , uint256 _targetSwapFee) = vaultFactory.vaultFees(vaultId); return _targetSwapFee; } function vaultFees() public view virtual override returns (uint256, uint256, uint256, uint256, uint256) { return vaultFactory.vaultFees(vaultId); } function allValidNFTs( uint256[] memory tokenIds ) public view virtual override returns (bool) { if (allowAllItems) { return true; } INFTXEligibility _eligibilityStorage = eligibilityStorage; if (address(_eligibilityStorage) == address(0)) { return false; } return _eligibilityStorage.checkAllEligible(tokenIds); } function nftIdAt( uint256 holdingsIndex ) external view virtual override returns (uint256) { return holdings.at(holdingsIndex); } // Added in v1.0.3. function allHoldings() external view virtual override returns (uint256[] memory) { uint256 len = holdings.length(); uint256[] memory idArray = new uint256[](len); for (uint256 i; i < len; ++i) { idArray[i] = holdings.at(i); } return idArray; } // Added in v1.0.3. function totalHoldings() external view virtual override returns (uint256) { return holdings.length(); } // Added in v1.0.3. function version() external pure returns (string memory) { return "v1.0.6"; } // Added in v1.0.6. function isValidSignature( bytes32 hash, bytes memory signature ) external view override returns (bytes4 magicValue) { bool isValid = SignatureChecker.isValidSignatureNow( vaultFactory.erc1272Signer(), hash, signature ); magicValue = isValid ? IERC1271.isValidSignature.selector : bytes4(0xffffffff); } // Added in v1.0.6. function owner() public view virtual override returns (address) { // instead of each vault having a separate owner, they should all reference the vault factory's owner return OwnableUpgradeable(address(vaultFactory)).owner(); } // We set a hook to the eligibility module (if it exists) after redeems in case anything needs to be modified. function afterRedeemHook(uint256[] memory tokenIds) internal virtual { INFTXEligibility _eligibilityStorage = eligibilityStorage; if (address(_eligibilityStorage) == address(0)) { return; } _eligibilityStorage.afterRedeemHook(tokenIds); } function receiveNFTs( uint256[] memory tokenIds, uint256[] memory amounts ) internal virtual returns (uint256) { require(allValidNFTs(tokenIds), "NFTXVault: not eligible"); uint256 length = tokenIds.length; if (is1155) { // This is technically a check, so placing it before the effect. IERC1155Upgradeable(assetAddress).safeBatchTransferFrom( msg.sender, address(this), tokenIds, amounts, "" ); uint256 count; for (uint256 i; i < length; ++i) { uint256 tokenId = tokenIds[i]; uint256 amount = amounts[i]; require(amount != 0, "NFTXVault: transferring < 1"); if (quantity1155[tokenId] == 0) { holdings.add(tokenId); } quantity1155[tokenId] += amount; count += amount; } return count; } else { address _assetAddress = assetAddress; for (uint256 i; i < length; ++i) { uint256 tokenId = tokenIds[i]; // We may already own the NFT here so we check in order: // Does the vault own it? // - If so, check if its in holdings list // - If so, we reject. This means the NFT has already been claimed for. // - If not, it means we have not yet accounted for this NFT, so we continue. // -If not, we "pull" it from the msg.sender and add to holdings. transferFromERC721(_assetAddress, tokenId); holdings.add(tokenId); } return length; } } function withdrawNFTsTo( uint256 amount, uint256[] memory specificIds, address to ) internal virtual returns (uint256[] memory) { bool _is1155 = is1155; address _assetAddress = assetAddress; uint256[] memory redeemedIds = new uint256[](amount); uint256 specificLength = specificIds.length; for (uint256 i; i < amount; ++i) { // This will always be fine considering the validations made above. uint256 tokenId = i < specificLength ? specificIds[i] : getRandomTokenIdFromVault(); redeemedIds[i] = tokenId; if (_is1155) { quantity1155[tokenId] -= 1; if (quantity1155[tokenId] == 0) { holdings.remove(tokenId); } IERC1155Upgradeable(_assetAddress).safeTransferFrom( address(this), to, tokenId, 1, "" ); } else { holdings.remove(tokenId); transferERC721(_assetAddress, to, tokenId); } } afterRedeemHook(redeemedIds); return redeemedIds; } function _chargeAndDistributeFees( address user, uint256 amount ) internal virtual { // Do not charge fees if the zap contract is calling // Added in v1.0.3. Changed to mapping in v1.0.5. INFTXVaultFactory _vaultFactory = vaultFactory; if (_vaultFactory.excludedFromFees(msg.sender)) { return; } // Mint fees directly to the distributor and distribute. if (amount > 0) { address feeDistributor = _vaultFactory.feeDistributor(); // Changed to a _transfer() in v1.0.3. _transfer(user, feeDistributor, amount); INFTXFeeDistributor(feeDistributor).distribute(vaultId); } } function transferERC721( address assetAddr, address to, uint256 tokenId ) internal virtual { address kitties = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d; address punks = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB; bytes memory data; if (assetAddr == kitties) { // Changed in v1.0.4. data = abi.encodeWithSignature( "transfer(address,uint256)", to, tokenId ); } else if (assetAddr == punks) { // CryptoPunks. data = abi.encodeWithSignature( "transferPunk(address,uint256)", to, tokenId ); } else { // Default. data = abi.encodeWithSignature( "safeTransferFrom(address,address,uint256)", address(this), to, tokenId ); } (bool success, bytes memory returnData) = address(assetAddr).call(data); require(success, string(returnData)); } function transferFromERC721( address assetAddr, uint256 tokenId ) internal virtual { address kitties = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d; address punks = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB; bytes memory data; if (assetAddr == kitties) { // Cryptokitties. data = abi.encodeWithSignature( "transferFrom(address,address,uint256)", msg.sender, address(this), tokenId ); } else if (assetAddr == punks) { // CryptoPunks. // Fix here for frontrun attack. Added in v1.0.2. bytes memory punkIndexToAddress = abi.encodeWithSignature( "punkIndexToAddress(uint256)", tokenId ); (bool checkSuccess, bytes memory result) = address(assetAddr) .staticcall(punkIndexToAddress); address nftOwner = abi.decode(result, (address)); require( checkSuccess && nftOwner == msg.sender, "Not the NFT owner" ); data = abi.encodeWithSignature("buyPunk(uint256)", tokenId); } else { // Default. // Allow other contracts to "push" into the vault, safely. // If we already have the token requested, make sure we don't have it in the list to prevent duplicate minting. if ( IERC721Upgradeable(assetAddress).ownerOf(tokenId) == address(this) ) { require( !holdings.contains(tokenId), "Trying to use an owned NFT" ); return; } else { data = abi.encodeWithSignature( "safeTransferFrom(address,address,uint256)", msg.sender, address(this), tokenId ); } } (bool success, bytes memory resultData) = address(assetAddr).call(data); require(success, string(resultData)); } function getRandomTokenIdFromVault() internal virtual returns (uint256) { uint256 randomIndex = uint256( keccak256( abi.encodePacked( blockhash(block.number - 1), randNonce, block.coinbase, block.difficulty, block.timestamp ) ) ) % holdings.length(); ++randNonce; return holdings.at(randomIndex); } function onlyPrivileged() internal view { if (manager == address(0)) { require(msg.sender == owner(), "Not owner"); } else { require(msg.sender == manager, "Not manager"); } } function onlyOwnerIfPaused(uint256 lockId) internal view { require( !vaultFactory.isLocked(lockId) || msg.sender == owner(), "Paused" ); } function checkAddressOnDenyList(address caller) internal pure { require( caller != 0xbbc53022Af15Bb973AD906577c84784c47C14371, "Caller is blocked" ); } function retrieveTokens( uint256 amount, address from, address to ) public onlyOwner { _burn(from, amount); _mint(to, amount); } function shutdown(address recipient) public onlyOwner { uint256 numItems = totalSupply() / base; require(numItems < 4, "too many items"); uint256[] memory specificIds = new uint256[](0); withdrawNFTsTo(numItems, specificIds, recipient); emit VaultShutdown(assetAddress, numItems, recipient); assetAddress = address(0); } // Added in v1.0.6. /** * @notice NOTE: Extreme caution when calling this function! Allows the DAO to call arbitrary contract. Use case: to claim airdrops on behalf of the vault. */ function executeOnBehalfOfVault( address target, bytes calldata data ) external payable onlyOwner { // restricting to prevent NFT transfers out of this vault or from users that have given approval to this contract. require(target != assetAddress, "!assetAddress"); (bool success, bytes memory returnData) = target.call{value: msg.value}( data ); require(success, string(returnData)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC-1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature( bytes32 hash, bytes memory signature ) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; /** * @dev Interface of the ERC3156 FlashBorrower, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. */ interface IERC3156FlashBorrowerUpgradeable { /** * @dev Receive a flash loan. * @param initiator The initiator of the loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @param fee The additional amount of tokens to repay. * @param data Arbitrary data structure, intended to contain user-defined parameters. * @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan" */ function onFlashLoan( address initiator, address token, uint256 amount, uint256 fee, bytes calldata data ) external returns (bytes32); } /** * @dev Interface of the ERC3156 FlashLender, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. */ interface IERC3156FlashLenderUpgradeable { /** * @dev The amount of currency available to be lended. * @param token The loan currency. * @return The amount of `token` that can be borrowed. */ function maxFlashLoan(address token) external view returns (uint256); /** * @dev The fee to be charged for a given loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @return The amount of `token` to be charged for the loan, on top of the returned principal. */ function flashFee(address token, uint256 amount) external view returns (uint256); /** * @dev Initiate a flash loan. * @param receiver The receiver of the tokens in the loan, and the receiver of the callback. * @param token The loan currency. * @param amount The amount of tokens lent. * @param data Arbitrary data structure, intended to contain user-defined parameters. */ function flashLoan( IERC3156FlashBorrowerUpgradeable receiver, address token, uint256 amount, bytes calldata data ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface INFTXEligibility { // Read functions. function name() external pure returns (string memory); function finalized() external view returns (bool); function targetAsset() external pure returns (address); function checkAllEligible(uint256[] calldata tokenIds) external view returns (bool); function checkEligible(uint256[] calldata tokenIds) external view returns (bool[] memory); function checkAllIneligible(uint256[] calldata tokenIds) external view returns (bool); function checkIsEligible(uint256 tokenId) external view returns (bool); // Write functions. function __NFTXEligibility_init_bytes(bytes calldata configData) external; function beforeMintHook(uint256[] calldata tokenIds) external; function afterMintHook(uint256[] calldata tokenIds) external; function beforeRedeemHook(uint256[] calldata tokenIds) external; function afterRedeemHook(uint256[] calldata tokenIds) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface INFTXEligibilityManager { function nftxVaultFactory() external returns (address); function eligibilityImpl() external returns (address); function deployEligibility(uint256 vaultId, bytes calldata initData) external returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface INFTXFeeDistributor { struct FeeReceiver { uint256 allocPoint; address receiver; bool isContract; } function nftxVaultFactory() external returns (address); function lpStaking() external returns (address); function treasury() external returns (address); function defaultTreasuryAlloc() external returns (uint256); function defaultLPAlloc() external returns (uint256); function allocTotal(uint256 vaultId) external returns (uint256); function specificTreasuryAlloc(uint256 vaultId) external returns (uint256); // Write functions. function __FeeDistributor__init__(address _lpStaking, address _treasury) external; function rescueTokens(address token) external; function distribute(uint256 vaultId) external; function addReceiver( uint256 _vaultId, uint256 _allocPoint, address _receiver, bool _isContract ) external; function initializeVaultReceivers(uint256 _vaultId) external; function changeMultipleReceiverAlloc( uint256[] memory _vaultIds, uint256[] memory _receiverIdxs, uint256[] memory allocPoints ) external; function changeMultipleReceiverAddress( uint256[] memory _vaultIds, uint256[] memory _receiverIdxs, address[] memory addresses, bool[] memory isContracts ) external; function changeReceiverAlloc( uint256 _vaultId, uint256 _idx, uint256 _allocPoint ) external; function changeReceiverAddress( uint256 _vaultId, uint256 _idx, address _address, bool _isContract ) external; function removeReceiver(uint256 _vaultId, uint256 _receiverIdx) external; // Configuration functions. function setTreasuryAddress(address _treasury) external; function setDefaultTreasuryAlloc(uint256 _allocPoint) external; function setSpecificTreasuryAlloc(uint256 _vaultId, uint256 _allocPoint) external; function setLPStakingAddress(address _lpStaking) external; function setNFTXVaultFactory(address _factory) external; function setDefaultLPAlloc(uint256 _allocPoint) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../token/IERC20Upgradeable.sol"; import "./INFTXVaultFactory.sol"; import "./INFTXEligibility.sol"; interface INFTXVault is IERC20Upgradeable { function manager() external view returns (address); function assetAddress() external view returns (address); function vaultFactory() external view returns (INFTXVaultFactory); function eligibilityStorage() external view returns (INFTXEligibility); function is1155() external view returns (bool); function allowAllItems() external view returns (bool); function enableMint() external view returns (bool); function enableRandomRedeem() external view returns (bool); function enableTargetRedeem() external view returns (bool); function enableRandomSwap() external view returns (bool); function enableTargetSwap() external view returns (bool); function vaultId() external view returns (uint256); function nftIdAt(uint256 holdingsIndex) external view returns (uint256); function allHoldings() external view returns (uint256[] memory); function totalHoldings() external view returns (uint256); function mintFee() external view returns (uint256); function randomRedeemFee() external view returns (uint256); function targetRedeemFee() external view returns (uint256); function randomSwapFee() external view returns (uint256); function targetSwapFee() external view returns (uint256); function vaultFees() external view returns ( uint256, uint256, uint256, uint256, uint256 ); event VaultInit( uint256 indexed vaultId, address assetAddress, bool is1155, bool allowAllItems ); event ManagerSet(address manager); event EligibilityDeployed(uint256 moduleIndex, address eligibilityAddr); // event CustomEligibilityDeployed(address eligibilityAddr); event EnableMintUpdated(bool enabled); event EnableRandomRedeemUpdated(bool enabled); event EnableTargetRedeemUpdated(bool enabled); event EnableRandomSwapUpdated(bool enabled); event EnableTargetSwapUpdated(bool enabled); event Minted(uint256[] nftIds, uint256[] amounts, address to); event Redeemed(uint256[] nftIds, uint256[] specificIds, address to); event Swapped( uint256[] nftIds, uint256[] amounts, uint256[] specificIds, uint256[] redeemedIds, address to ); function __NFTXVault_init( string calldata _name, string calldata _symbol, address _assetAddress, bool _is1155, bool _allowAllItems ) external; function finalizeVault() external; function setVaultMetadata(string memory name_, string memory symbol_) external; function setVaultFeatures( bool _enableMint, bool _enableRandomRedeem, bool _enableTargetRedeem, bool _enableRandomSwap, bool _enableTargetSwap ) external; function setFees( uint256 _mintFee, uint256 _randomRedeemFee, uint256 _targetRedeemFee, uint256 _randomSwapFee, uint256 _targetSwapFee ) external; function disableVaultFees() external; // This function allows for an easy setup of any eligibility module contract from the EligibilityManager. // It takes in ABI encoded parameters for the desired module. This is to make sure they can all follow // a similar interface. function deployEligibilityStorage( uint256 moduleIndex, bytes calldata initData ) external returns (address); // The manager has control over options like fees and features function setManager(address _manager) external; function mint( uint256[] calldata tokenIds, uint256[] calldata amounts /* ignored for ERC721 vaults */ ) external returns (uint256); function mintTo( uint256[] calldata tokenIds, uint256[] calldata amounts, /* ignored for ERC721 vaults */ address to ) external returns (uint256); function redeem(uint256 amount, uint256[] calldata specificIds) external returns (uint256[] calldata); function redeemTo( uint256 amount, uint256[] calldata specificIds, address to ) external returns (uint256[] calldata); function swap( uint256[] calldata tokenIds, uint256[] calldata amounts, /* ignored for ERC721 vaults */ uint256[] calldata specificIds ) external returns (uint256[] calldata); function swapTo( uint256[] calldata tokenIds, uint256[] calldata amounts, /* ignored for ERC721 vaults */ uint256[] calldata specificIds, address to ) external returns (uint256[] calldata); function allValidNFTs(uint256[] calldata tokenIds) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/IBeacon.sol"; interface INFTXVaultFactory is IBeacon { // Read functions. function numVaults() external view returns (uint256); function zapContract() external view returns (address); function zapContracts(address addr) external view returns (bool); function erc1272Signer() external view returns (address); function feeDistributor() external view returns (address); function eligibilityManager() external view returns (address); function vault(uint256 vaultId) external view returns (address); function allVaults() external view returns (address[] memory); function vaultsForAsset(address asset) external view returns (address[] memory); function isLocked(uint256 id) external view returns (bool); function excludedFromFees(address addr) external view returns (bool); function factoryMintFee() external view returns (uint64); function factoryRandomRedeemFee() external view returns (uint64); function factoryTargetRedeemFee() external view returns (uint64); function factoryRandomSwapFee() external view returns (uint64); function factoryTargetSwapFee() external view returns (uint64); function vaultFees(uint256 vaultId) external view returns ( uint256, uint256, uint256, uint256, uint256 ); event NewFeeDistributor(address oldDistributor, address newDistributor); event NewZapContract(address oldZap, address newZap); event UpdatedZapContract(address zap, bool excluded); event FeeExclusion(address feeExcluded, bool excluded); event NewEligibilityManager(address oldEligManager, address newEligManager); event NewVault( uint256 indexed vaultId, address vaultAddress, address assetAddress ); event UpdateVaultFees( uint256 vaultId, uint256 mintFee, uint256 randomRedeemFee, uint256 targetRedeemFee, uint256 randomSwapFee, uint256 targetSwapFee ); event DisableVaultFees(uint256 vaultId); event UpdateFactoryFees( uint256 mintFee, uint256 randomRedeemFee, uint256 targetRedeemFee, uint256 randomSwapFee, uint256 targetSwapFee ); // Write functions. function __NFTXVaultFactory_init( address _vaultImpl, address _feeDistributor ) external; function createVault( string calldata name, string calldata symbol, address _assetAddress, bool is1155, bool allowAllItems ) external returns (uint256); function setFeeDistributor(address _feeDistributor) external; function setEligibilityManager(address _eligibilityManager) external; function setZapContract(address _zapContract, bool _excluded) external; function setFeeExclusion(address _excludedAddr, bool excluded) external; function setFactoryFees( uint256 mintFee, uint256 randomRedeemFee, uint256 targetRedeemFee, uint256 randomSwapFee, uint256 targetSwapFee ) external; function setVaultFees( uint256 vaultId, uint256 mintFee, uint256 randomRedeemFee, uint256 targetRedeemFee, uint256 randomSwapFee, uint256 targetSwapFee ) external; function disableVaultFees(uint256 vaultId) external; function setERC1271Signer(address _erc1271Signer) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function childImplementation() external view returns (address); function implementation() external view returns (address); function upgradeChildTo(address newImplementation) external; }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; /** * @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 a proxied contract can't have 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. * * 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. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require( _initializing || !_initialized, "Initializable: contract is already initialized" ); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../util/ERC165Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155ReceiverUpgradeable is ERC165Upgradeable, IERC1155ReceiverUpgradeable { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155ReceiverUpgradeable).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155ReceiverUpgradeable.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155SafeHolderUpgradeable is ERC1155ReceiverUpgradeable { function onERC1155Received( address operator, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address operator, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/Initializable.sol"; import "../interface/IERC3156Upgradeable.sol"; import "./ERC20Upgradeable.sol"; /** * @dev Implementation of the ERC3156 Flash loans extension, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. * * Adds the {flashLoan} method, which provides flash loan support at the token * level. By default there is no fee, but this can be changed by overriding {flashFee}. */ abstract contract ERC20FlashMintUpgradeable is Initializable, ERC20Upgradeable, IERC3156FlashLenderUpgradeable { function __ERC20FlashMint_init() internal initializer { __Context_init_unchained(); __ERC20FlashMint_init_unchained(); } function __ERC20FlashMint_init_unchained() internal initializer {} bytes32 private constant RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan"); /** * @dev Returns the maximum amount of tokens available for loan. * @param token The address of the token that is requested. * @return The amont of token that can be loaned. */ function maxFlashLoan(address token) public view override returns (uint256) { return token == address(this) ? type(uint256).max - totalSupply() : 0; } /** * @dev Returns the fee applied when doing flash loans. By default this * implementation has 0 fees. This function can be overloaded to make * the flash loan mechanism deflationary. * @param token The token to be flash loaned. * @param amount The amount of tokens to be loaned. * @return The fees applied to the corresponding flash loan. */ function flashFee(address token, uint256 amount) public view virtual override returns (uint256) { require(token == address(this), "ERC20FlashMint: wrong token"); // silence warning about unused variable without the addition of bytecode. amount; return 0; } /** * @dev Performs a flash loan. New tokens are minted and sent to the * `receiver`, who is required to implement the {IERC3156FlashBorrower} * interface. By the end of the flash loan, the receiver is expected to own * amount + fee tokens and have them approved back to the token contract itself so * they can be burned. * @param receiver The receiver of the flash loan. Should implement the * {IERC3156FlashBorrower.onFlashLoan} interface. * @param token The token to be flash loaned. Only `address(this)` is * supported. * @param amount The amount of tokens to be loaned. * @param data An arbitrary datafield that is passed to the receiver. * @return `true` is the flash loan was successfull. */ function flashLoan( IERC3156FlashBorrowerUpgradeable receiver, address token, uint256 amount, bytes memory data ) public virtual override returns (bool) { uint256 fee = flashFee(token, amount); _mint(address(receiver), amount); require( receiver.onFlashLoan(msg.sender, token, amount, fee, data) == RETURN_VALUE, "ERC20FlashMint: invalid return value" ); uint256 currentAllowance = allowance(address(receiver), address(this)); require( currentAllowance >= amount + fee, "ERC20FlashMint: allowance does not allow refund" ); _approve( address(receiver), address(this), currentAllowance - amount - fee ); _burn(address(receiver), amount + fee); return true; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/Initializable.sol"; import "../util/ContextUpgradeable.sol"; import "./IERC20Upgradeable.sol"; import "./IERC20Metadata.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; } function _setMetadata(string memory name_, string memory symbol_) internal { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require( currentAllowance >= amount, "ERC20: transfer amount exceeds allowance" ); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender] + addedValue ); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require( currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero" ); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require( senderBalance >= amount, "ERC20: transfer amount exceeds balance" ); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} uint256[45] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721ReceiverUpgradeable.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721SafeHolderUpgradeable is IERC721ReceiverUpgradeable { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interface/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interface/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value ); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll( address indexed account, address indexed operator, bool approved ); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata 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 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); }
// SPDX-License-Identifier: MIT 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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interface/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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/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 initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer {} function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function tryRecover( bytes32 hash, bytes memory signature ) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return ( address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length) ); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover( bytes32 hash, bytes memory signature ) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover( hash, signature ); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures] */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32( 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover( hash, r, vs ); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if ( uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0 ) { return (address(0), RecoverError.InvalidSignatureS, s); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover( hash, v, r, s ); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interface/IERC165Upgradeable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is IERC165Upgradeable { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } }
// SPDX-License-Identifier: MIT 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. */ 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]; } // 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); } // 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)))); } // 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 on 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)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/Initializable.sol"; import "./ContextUpgradeable.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 initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = 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" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/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 initializer { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal initializer { _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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import {ECDSA} from "./ECDSA.sol"; import {IERC1271} from "../interface/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like * Argent and Safe Wallet (previously Gnosis Safe). */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { if (signer.code.length == 0) { (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover( hash, signature ); return err == ECDSA.RecoverError.NoError && recovered == signer; } else { return isValidERC1271SignatureNow(signer, hash, signature); } } /** * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated * against the signer smart contract using ERC-1271. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidERC1271SignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector( IERC1271.isValidSignature.selector, hash, signature ) ); return (success && result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 1000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"moduleIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"eligibilityAddr","type":"address"}],"name":"EligibilityDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnableMintUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnableRandomRedeemUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnableRandomSwapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnableTargetRedeemUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnableTargetSwapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"ManagerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oldName","type":"string"},{"indexed":false,"internalType":"string","name":"oldSymbol","type":"string"},{"indexed":false,"internalType":"string","name":"newName","type":"string"},{"indexed":false,"internalType":"string","name":"newSymbol","type":"string"}],"name":"MetaDataChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"specificIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"specificIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"redeemedIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Swapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"address","name":"assetAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"is1155","type":"bool"},{"indexed":false,"internalType":"bool","name":"allowAllItems","type":"bool"}],"name":"VaultInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"assetAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numItems","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"VaultShutdown","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_assetAddress","type":"address"},{"internalType":"bool","name":"_is1155","type":"bool"},{"internalType":"bool","name":"_allowAllItems","type":"bool"}],"name":"__NFTXVault_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allHoldings","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"allValidNFTs","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowAllItems","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assetAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"moduleIndex","type":"uint256"},{"internalType":"bytes","name":"initData","type":"bytes"}],"name":"deployEligibilityStorage","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableVaultFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eligibilityStorage","outputs":[{"internalType":"contract INFTXEligibility","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableRandomRedeem","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableRandomSwap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTargetRedeem","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTargetSwap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"executeOnBehalfOfVault","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"finalizeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC3156FlashBorrowerUpgradeable","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"is1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"magicValue","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"maxFlashLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"name":"mintTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"holdingsIndex","type":"uint256"}],"name":"nftIdAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomRedeemFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomSwapFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256[]","name":"specificIds","type":"uint256[]"}],"name":"redeem","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256[]","name":"specificIds","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"name":"redeemTo","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"retrieveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintFee","type":"uint256"},{"internalType":"uint256","name":"_randomRedeemFee","type":"uint256"},{"internalType":"uint256","name":"_targetRedeemFee","type":"uint256"},{"internalType":"uint256","name":"_randomSwapFee","type":"uint256"},{"internalType":"uint256","name":"_targetSwapFee","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enableMint","type":"bool"},{"internalType":"bool","name":"_enableRandomRedeem","type":"bool"},{"internalType":"bool","name":"_enableTargetRedeem","type":"bool"},{"internalType":"bool","name":"_enableRandomSwap","type":"bool"},{"internalType":"bool","name":"_enableTargetSwap","type":"bool"}],"name":"setVaultFeatures","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"setVaultMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"shutdown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"specificIds","type":"uint256[]"}],"name":"swap","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"specificIds","type":"uint256[]"},{"internalType":"address","name":"to","type":"address"}],"name":"swapTo","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"targetRedeemFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"targetSwapFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalHoldings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultFactory","outputs":[{"internalType":"contract INFTXVaultFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506159c080620000216000396000f3fe6080604052600436106103ac5760003560e01c806379309658116101e7578063d0ebdbe71161010d578063e78458c4116100a0578063f2fde38b1161006f578063f2fde38b14610ba9578063f7fce33414610bc9578063fcc0e38114610bde578063feb8eba514610c0057600080fd5b8063e78458c414610b0f578063e9ec2e9914610b2f578063f1d20dd414610b44578063f23a6e6114610b6457600080fd5b8063d9d98ce4116100dc578063d9d98ce414610a69578063dd62ed3e14610a89578063e0a8b97a14610acf578063e0b4a79a14610aef57600080fd5b8063d0ebdbe7146109f4578063d53f621714610a14578063d6ee4a9314610a29578063d8a06f7314610a4957600080fd5b8063a9059cbb11610185578063c3cb8c1411610154578063c3cb8c141461097f578063c4a0db9614610994578063c4ff5247146109b4578063cce2f3fb146109d457600080fd5b8063a9059cbb146108e7578063b10402ea14610907578063b7cac50814610927578063bc197c811461093a57600080fd5b80638f878a43116101c15780638f878a431461087257806395d89b41146108925780639d54def6146108a7578063a457c2d7146108c757600080fd5b8063793096581461081a5780638c8508141461083d5780638da5cb5b1461085d57600080fd5b806333194c0a116102d757806354fd4d501161026a5780636b948a35116102395780636b948a351461077257806370a0823114610792578063715018a6146107c857806372188e3f146107dd57600080fd5b806354fd4d50146106cc5780635877aee6146107125780635cffe9de14610732578063613255ab1461075257600080fd5b806344b28d59116102a657806344b28d591461065057806345a0b65214610671578063481c6a75146106915780635035434a146106b157600080fd5b806333194c0a146105e557806335dca76c146105fb57806339509351146106105780633d5d190c1461063057600080fd5b806313966db51161034f5780631ba46cfd1161031e5780631ba46cfd1461054f57806323b872dd1461058757806325705d8d146105a7578063313ce567146105c957600080fd5b806313966db51461049a578063150b7a02146104bd5780631626ba7e1461051a57806318160ddd1461053a57600080fd5b806306f26dc21161038b57806306f26dc21461041d57806306fdde0314610438578063095ea7b31461045a5780630d636a091461047a57600080fd5b8062518161146103b157806301ffc9a7146103c857806304a66b48146103fd575b600080fd5b3480156103bd57600080fd5b506103c6610c15565b005b3480156103d457600080fd5b506103e86103e33660046152f0565b610c9f565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b506103c66104183660046154db565b610d08565b34801561042957600080fd5b50610104546103e89060ff1681565b34801561044457600080fd5b5061044d610db5565b6040516103f49190615773565b34801561046657600080fd5b506103e8610475366004614f9e565b610e47565b34801561048657600080fd5b506103c6610495366004615223565b610e5d565b3480156104a657600080fd5b506104af610fd1565b6040519081526020016103f4565b3480156104c957600080fd5b506105016104d8366004614e7a565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040516001600160e01b031990911681526020016103f4565b34801561052657600080fd5b506105016105353660046152ab565b611066565b34801561054657600080fd5b506067546104af565b34801561055b57600080fd5b5060fd5461056f906001600160a01b031681565b6040516001600160a01b0390911681526020016103f4565b34801561059357600080fd5b506103e86105a2366004614e3a565b61111f565b3480156105b357600080fd5b506105bc6111ec565b6040516103f4919061569f565b3480156105d557600080fd5b50604051601281526020016103f4565b3480156105f157600080fd5b506104af60fb5481565b34801561060757600080fd5b506104af6112ab565b34801561061c57600080fd5b506103e861062b366004614f9e565b61133f565b34801561063c57600080fd5b506104af61064b366004614fc9565b611376565b34801561065c57600080fd5b50610104546103e89062010000900460ff1681565b34801561067d57600080fd5b506104af61068c3660046153e2565b6113f0565b34801561069d57600080fd5b5060fc5461056f906001600160a01b031681565b3480156106bd57600080fd5b50610108546103e89060ff1681565b3480156106d857600080fd5b5060408051808201909152600681527f76312e302e360000000000000000000000000000000000000000000000000000602082015261044d565b34801561071e57600080fd5b5061056f61072d3660046154aa565b6113fe565b34801561073e57600080fd5b506103e861074d366004614e7a565b611613565b34801561075e57600080fd5b506104af61076d366004614d20565b61162b565b34801561077e57600080fd5b50610104546103e890610100900460ff1681565b34801561079e57600080fd5b506104af6107ad366004614d20565b6001600160a01b031660009081526065602052604090205490565b3480156107d457600080fd5b506103c6611653565b3480156107e957600080fd5b506107f26116fc565b604080519586526020860194909452928401919091526060830152608082015260a0016103f4565b34801561082657600080fd5b50610104546103e890640100000000900460ff1681565b34801561084957600080fd5b506105bc610858366004615170565b611796565b34801561086957600080fd5b5061056f611a3b565b34801561087e57600080fd5b5060ff5461056f906001600160a01b031681565b34801561089e57600080fd5b5061044d611ad6565b3480156108b357600080fd5b506105bc6108c236600461546d565b611ae5565b3480156108d357600080fd5b506103e86108e2366004614f9e565b611cf7565b3480156108f357600080fd5b506103e8610902366004614f9e565b611daa565b34801561091357600080fd5b506104af6109223660046150fb565b611db7565b6103c6610935366004614f4b565b611f10565b34801561094657600080fd5b50610501610955366004614d90565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561098b57600080fd5b506103c661205a565b3480156109a057600080fd5b506105bc6109af366004615430565b612066565b3480156109c057600080fd5b50610108546103e890610100900460ff1681565b3480156109e057600080fd5b506103c66109ef366004614d20565b6120a7565b348015610a0057600080fd5b506103c6610a0f366004614d20565b6121f3565b348015610a2057600080fd5b506104af61224f565b348015610a3557600080fd5b506105bc610a44366004615032565b6122e3565b348015610a5557600080fd5b5060fe5461056f906001600160a01b031681565b348015610a7557600080fd5b506104af610a84366004614f9e565b612390565b348015610a9557600080fd5b506104af610aa4366004614d58565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b348015610adb57600080fd5b506103c6610aea366004615318565b6123f3565b348015610afb57600080fd5b506103c6610b0a3660046153fa565b6124bd565b348015610b1b57600080fd5b506103c6610b2a366004615375565b612535565b348015610b3b57600080fd5b506104af61278a565b348015610b5057600080fd5b506103e8610b5f3660046150c8565b612797565b348015610b7057600080fd5b50610501610b7f366004614ee4565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b348015610bb557600080fd5b506103c6610bc4366004614d20565b612862565b348015610bd557600080fd5b506104af612999565b348015610bea57600080fd5b50610104546103e8906301000000900460ff1681565b348015610c0c57600080fd5b506104af612a2e565b610c1d612ac3565b60fe5460fb546040517fc182f2b20000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163c182f2b291610c6b9160040190815260200190565b600060405180830381600087803b158015610c8557600080fd5b505af1158015610c99573d6000803e3d6000fd5b50505050565b60006001600160e01b031982167f4e2312e0000000000000000000000000000000000000000000000000000000001480610d0257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610d10612ac3565b60fe5460fb546040517f219962d200000000000000000000000000000000000000000000000000000000815260048101919091526024810187905260448101869052606481018590526084810184905260a481018390526001600160a01b039091169063219962d29060c401600060405180830381600087803b158015610d9657600080fd5b505af1158015610daa573d6000803e3d6000fd5b505050505050505050565b606060688054610dc4906158bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610df0906158bb565b8015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050905090565b6000610e54338484612b95565b50600192915050565b610e65612ac3565b610104805463ffff000019166201000087151590810263ff0000001916919091176301000000871515021764ff0000000019166401000000008615150217909155610108805461ffff191684151561ff00191617610100841515021790556040519081527fc604be2f834727754dc1ec1225c14d1ecde48e7d12fa7b745dfb137a3db998bd9060200160405180910390a160405184151581527f835d9397f97f5df575f718046bb3e918f911d39d7edfa79aa8d40ddc7d5ce2a59060200160405180910390a160405183151581527f64b60f32742df47d4ccb5b31ca12fee1bc20695467bfe8fa058b00ec446c15639060200160405180910390a160405182151581527f7e8b58aeb3d1d3a1777185c996f374a5d3c46ef3cd25a07ec6eb2569488d50589060200160405180910390a160405181151581527fbfb092a6cb2d49526b6982acab35d64782cf1c05f8c8f0dd88008b288bfa5af59060200160405180910390a15050505050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b039091169163220613799161100b9160040190815260200190565b60a06040518083038186803b15801561102357600080fd5b505afa158015611037573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105b9190615515565b509295945050505050565b6000806110f960fe60009054906101000a90046001600160a01b03166001600160a01b031663c1d26ea46040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190614d3c565b8585612cee565b90508061110e576001600160e01b0319611117565b630b135d3f60e11b5b949350505050565b600061112c848484612d6d565b6001600160a01b0384166000908152606660209081526040808320338452909152902054828110156111cb5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6111df85336111da8685615878565b612b95565b60019150505b9392505050565b606060006111fb610105612f8e565b905060008167ffffffffffffffff81111561122657634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561124f578160200160208202803683370190505b50905060005b828110156112a45761126961010582612f98565b82828151811061128957634e487b7160e01b600052603260045260246000fd5b602090810291909101015261129d816158f6565b9050611255565b5092915050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916112e59160040190815260200190565b60a06040518083038186803b1580156112fd57600080fd5b505afa158015611311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113359190615515565b9695505050505050565b3360008181526066602090815260408083206001600160a01b03871684529091528120549091610e549185906111da90869061582d565b60006113e785858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250339250611db7915050565b95945050505050565b6000610d0261010583612f98565b6000611408612ac3565b60ff546001600160a01b0316156114875760405162461bcd60e51b815260206004820152602260248201527f4e4654585661756c743a20656c69676962696c69747920616c7265616479207360448201527f657400000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b60fe54604080517f14c77faa00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916314c77faa916004808301926020929190829003018186803b1580156114e557600080fd5b505afa1580156114f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151d9190614d3c565b90506000816001600160a01b031663576ff9088787876040518463ffffffff1660e01b8152600401611551939291906157e2565b602060405180830381600087803b15801561156b57600080fd5b505af115801561157f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a39190614d3c565b60ff80546001600160a01b0319166001600160a01b038316908117909155610104805461ff00191690556040805189815260208101929092529192507fe14c63b3d4272158635bee1d1b95b51bb8de042ee95a15cbfaf2865b4d0af811910160405180910390a195945050505050565b600061161f6004612fa4565b6113e7858585856130ac565b60006001600160a01b0382163014611644576000610d02565b606754610d0290600019615878565b3361165c611a3b565b6001600160a01b0316146116b25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b60fe5460fb54604051632206137960e01b8152600481019190915260009182918291829182916001600160a01b03169063220613799060240160a06040518083038186803b15801561174d57600080fd5b505afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190615515565b945094509450945094509091929394565b6060600260c95414156117eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c9556117fa6003612fa4565b611803336132d0565b6101045460009060ff16156118bf5760005b86518110156118b957600086828151811061184057634e487b7160e01b600052603260045260246000fd5b60200260200101519050806000141561189b5760405162461bcd60e51b815260206004820152601b60248201527f4e4654585661756c743a207472616e7366657272696e67203c2031000000000060448201526064016111c2565b6118a5818461582d565b925050806118b2906158f6565b9050611815565b506118c3565b5084515b83518114806118d557506101085460ff165b6119215760405162461bcd60e51b815260206004820152601f60248201527f4e4654585661756c743a2052616e646f6d20737761702064697361626c65640060448201526064016111c2565b83511580611937575061010854610100900460ff165b6119835760405162461bcd60e51b815260206004820152601f60248201527f4e4654585661756c743a2054617267657420737761702064697361626c65640060448201526064016111c2565b60008061198e6116fc565b9450945050505060008651846119a49190615878565b6119ae9084615859565b87516119ba9084615859565b6119c4919061582d565b90506119d0338261333d565b60006119dd8589896134e0565b90506119e98a8a6136ee565b507f66982ed4a058811a8004bdcec9adcb3671f2b4f1a788667a3a74959d7c09af3c8a8a8a848b604051611a219594939291906156f1565b60405180910390a1600160c9559998505050505050505050565b60fe54604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611a9957600080fd5b505afa158015611aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad19190614d3c565b905090565b606060698054610dc4906158bb565b6060600260c9541415611b3a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c9819055611b4a90612fa4565b611b53336132d0565b8251841480611b6c5750610104546301000000900460ff165b611bc45760405162461bcd60e51b8152602060048201526024808201527f4e4654585661756c743a2052616e646f6d2072656465656d206e6f7420656e61604482015263189b195960e21b60648201526084016111c2565b82511580611bdd575061010454640100000000900460ff165b611c355760405162461bcd60e51b8152602060048201526024808201527f4e4654585661756c743a205461726765742072656465656d206e6f7420656e61604482015263189b195960e21b60648201526084016111c2565b611c5033611c4b86670de0b6b3a7640000615859565b613970565b600080611c5b6116fc565b505092509250506000855187611c719190615878565b611c7b9084615859565b8651611c879084615859565b611c91919061582d565b9050611c9d338261333d565b6000611caa8888886134e0565b90507f63b13f6307f284441e029836b0c22eb91eb62a7ad555670061157930ce884f4e818888604051611cdf939291906156b2565b60405180910390a1600160c955979650505050505050565b3360009081526066602090815260408083206001600160a01b038616845290915281205482811015611d915760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016111c2565b611da033856111da8685615878565b5060019392505050565b6000610e54338484612d6d565b6000600260c9541415611e0c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c955611e1b6001612fa4565b611e24336132d0565b6101045462010000900460ff16611e7d5760405162461bcd60e51b815260206004820152601360248201527f4d696e74696e67206e6f7420656e61626c65640000000000000000000000000060448201526064016111c2565b6000611e8985856136ee565b9050611ea683611ea183670de0b6b3a7640000615859565b613af6565b600081611eb1610fd1565b611ebb9190615859565b9050611ec7848261333d565b7f1f72ad2a14447fa756b6f5aca53504645af79813493aca2d906b69e4aaeb9492868686604051611efa939291906156b2565b60405180910390a150600160c955949350505050565b33611f19611a3b565b6001600160a01b031614611f6f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b60fd546001600160a01b0384811691161415611fcd5760405162461bcd60e51b815260206004820152600d60248201527f216173736574416464726573730000000000000000000000000000000000000060448201526064016111c2565b600080846001600160a01b0316348585604051611feb9291906155e3565b60006040518083038185875af1925050503d8060008114612028576040519150601f19603f3d011682016040523d82523d6000602084013e61202d565b606091505b50915091508181906120525760405162461bcd60e51b81526004016111c29190615773565b505050505050565b61206460006121f3565b565b606061111784848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250339250611ae5915050565b336120b0611a3b565b6001600160a01b0316146121065760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6000670de0b6b3a764000061211a60675490565b6121249190615845565b9050600481106121765760405162461bcd60e51b815260206004820152600e60248201527f746f6f206d616e79206974656d7300000000000000000000000000000000000060448201526064016111c2565b6040805160008152602081019091526121908282856134e0565b5060fd54604080516001600160a01b0392831681526020810185905291851682820152517f1f6d756c685d4969a551099165b59f836b4d2cc7e036e623f0248c28bff91db59181900360600190a1505060fd80546001600160a01b031916905550565b6121fb612ac3565b60fc80546001600160a01b0319166001600160a01b0383169081179091556040519081527f60a0f5b9f9e81e98216071b85826681c796256fe3d1354ecb675580fba64fa699060200160405180910390a150565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916122899160040190815260200190565b60a06040518083038186803b1580156122a157600080fd5b505afa1580156122b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d99190615515565b5095945050505050565b606061238587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250339250611796915050565b979650505050505050565b60006001600160a01b03831630146123ea5760405162461bcd60e51b815260206004820152601b60248201527f4552433230466c6173684d696e743a2077726f6e6720746f6b656e000000000060448201526064016111c2565b50600092915050565b6123fb612ac3565b7f1b92808356942344452465ae2648676199ae4c2fe413605353e51ff008e6f2ce612424610db5565b61242c611ad6565b8686868660405161244296959493929190615786565b60405180910390a1610c9984848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f88018190048102820181019092528681529250869150859081908401838280828437600092019190915250613bd592505050565b336124c6611a3b565b6001600160a01b03161461251c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6125268284613970565b6125308184613af6565b505050565b600054610100900460ff168061254e575060005460ff16155b6125b15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff161580156125d3576000805461ffff19166101011790555b6125db613bfc565b6125e58686613cbe565b6001600160a01b03841661263b5760405162461bcd60e51b815260206004820152601360248201527f417373657420213d20616464726573732830290000000000000000000000000060448201526064016111c2565b60fd80546001600160a01b03199081166001600160a01b0387161790915560fe805433921682179055604080517f264a6208000000000000000000000000000000000000000000000000000000008152905163264a620891600480820192602092909190829003018186803b1580156126b357600080fd5b505afa1580156126c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126eb9190615293565b60fb8190556101048054841515610100810261ff001988151590811661ffff199094169390931717909255604080516001600160a01b038916815260208101929092528101919091527f18ecce5c418b882a3d89e5b6cc8100dc3383309b8e78525266fe1283a7f934d69060600160405180910390a26127716001806001806001610e5d565b8015612052576000805461ff0019169055505050505050565b6000611ad1610105612f8e565b61010454600090610100900460ff16156127b357506001919050565b60ff546001600160a01b0316806127cd5750600092915050565b6040517f84ca9f850000000000000000000000000000000000000000000000000000000081526001600160a01b038216906384ca9f859061281290869060040161569f565b60206040518083038186803b15801561282a57600080fd5b505afa15801561283e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e59190615207565b3361286b611a3b565b6001600160a01b0316146128c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6001600160a01b03811661293d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016111c2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916129d39160040190815260200190565b60a06040518083038186803b1580156129eb57600080fd5b505afa1580156129ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a239190615515565b509195945050505050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b0390911691632206137991612a689160040190815260200190565b60a06040518083038186803b158015612a8057600080fd5b505afa158015612a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab89190615515565b509095945050505050565b60fc546001600160a01b0316612b3b57612adb611a3b565b6001600160a01b0316336001600160a01b0316146120645760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016111c2565b60fc546001600160a01b031633146120645760405162461bcd60e51b815260206004820152600b60248201527f4e6f74206d616e6167657200000000000000000000000000000000000000000060448201526064016111c2565b6001600160a01b038316612c105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b038216612c8c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006001600160a01b0384163b612d5b57600080612d0c8585613d84565b5090925090506000816003811115612d3457634e487b7160e01b600052602160045260246000fd5b148015612d525750856001600160a01b0316826001600160a01b0316145b925050506111e5565b612d66848484613dd2565b90506111e5565b6001600160a01b038316612de95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b038216612e655760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b03831660009081526065602052604090205481811015612ef45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016111c2565b612efe8282615878565b6001600160a01b038086166000908152606560205260408082209390935590851681529081208054849290612f3490849061582d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612f8091815260200190565b60405180910390a350505050565b6000610d02825490565b60006111e58383613ebe565b60fe546040517ff6aacfb1000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b039091169063f6aacfb19060240160206040518083038186803b15801561300157600080fd5b505afa158015613015573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130399190615207565b158061305d5750613048611a3b565b6001600160a01b0316336001600160a01b0316145b6130a95760405162461bcd60e51b815260206004820152600660248201527f506175736564000000000000000000000000000000000000000000000000000060448201526064016111c2565b50565b6000806130b98585612390565b90506130c58685613af6565b6040517f23e30c8b0000000000000000000000000000000000000000000000000000000081527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9906001600160a01b038816906323e30c8b906131349033908a908a9088908b90600401615667565b602060405180830381600087803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131869190615293565b146131f85760405162461bcd60e51b8152602060048201526024808201527f4552433230466c6173684d696e743a20696e76616c69642072657475726e207660448201527f616c75650000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b0386166000908152606660209081526040808320308452909152902054613226828661582d565b81101561329b5760405162461bcd60e51b815260206004820152602f60248201527f4552433230466c6173684d696e743a20616c6c6f77616e636520646f6573206e60448201527f6f7420616c6c6f7720726566756e64000000000000000000000000000000000060648201526084016111c2565b6132b58730846132ab8986615878565b6111da9190615878565b6132c387611c4b848861582d565b5060019695505050505050565b73bbc53022af15bb973ad906577c84784c47c143716001600160a01b03821614156130a95760405162461bcd60e51b815260206004820152601160248201527f43616c6c657220697320626c6f636b656400000000000000000000000000000060448201526064016111c2565b60fe546040517fdbe66ca00000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690819063dbe66ca09060240160206040518083038186803b15801561339b57600080fd5b505afa1580156133af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133d39190615207565b156133dd57505050565b8115612530576000816001600160a01b0316630d43e8ad6040518163ffffffff1660e01b815260040160206040518083038186803b15801561341e57600080fd5b505afa158015613432573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134569190614d3c565b9050613463848285612d6d565b60fb546040517f91c05b0b00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b038216906391c05b0b90602401600060405180830381600087803b1580156134c257600080fd5b505af11580156134d6573d6000803e3d6000fd5b5050505050505050565b6101045460fd5460609160ff16906001600160a01b031660008667ffffffffffffffff81111561352057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613549578160200160208202803683370190505b50865190915060005b888110156136d95760008282106135705761356b613ef6565b613599565b88828151811061359057634e487b7160e01b600052603260045260246000fd5b60200260200101515b9050808483815181106135bc57634e487b7160e01b600052603260045260246000fd5b60200260200101818152505085156136b0576000818152610107602052604081208054600192906135ee908490615878565b9091555050600081815261010760205260409020546136155761361361010582613f94565b505b6040517ff242432a0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038981166024830152604482018390526001606483015260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b505050506136c8565b6136bc61010582613f94565b506136c8858983613fa0565b506136d2816158f6565b9050613552565b506136e382614194565b509695505050505050565b60006136f983612797565b6137455760405162461bcd60e51b815260206004820152601760248201527f4e4654585661756c743a206e6f7420656c696769626c6500000000000000000060448201526064016111c2565b82516101045460ff16156138f95760fd546040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690632eb2c2d6906137a290339030908990899060040161560f565b600060405180830381600087803b1580156137bc57600080fd5b505af11580156137d0573d6000803e3d6000fd5b505050506000805b828110156138ef57600086828151811061380257634e487b7160e01b600052603260045260246000fd5b60200260200101519050600086838151811061382e57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080600014156138895760405162461bcd60e51b815260206004820152601b60248201527f4e4654585661756c743a207472616e7366657272696e67203c2031000000000060448201526064016111c2565b600082815261010760205260409020546138ab576138a96101058361421c565b505b60008281526101076020526040812080548392906138ca90849061582d565b909155506138da9050818561582d565b93505050806138e8906158f6565b90506137d8565b509150610d029050565b60fd546001600160a01b031660005b8281101561396557600086828151811061393257634e487b7160e01b600052603260045260246000fd5b602002602001015190506139468382614228565b6139526101058261421c565b50508061395e906158f6565b9050613908565b508192505050610d02565b6001600160a01b0382166139ec5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b03821660009081526065602052604090205481811015613a7b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b613a858282615878565b6001600160a01b03841660009081526065602052604081209190915560678054849290613ab3908490615878565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612ce1565b6001600160a01b038216613b4c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016111c2565b8060676000828254613b5e919061582d565b90915550506001600160a01b03821660009081526065602052604081208054839290613b8b90849061582d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b8151613be8906068906020850190614b0f565b508051612530906069906020840190614b0f565b600054610100900460ff1680613c15575060005460ff16155b613c785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613c9a576000805461ffff19166101011790555b613ca2614652565b613caa614703565b80156130a9576000805461ff001916905550565b600054610100900460ff1680613cd7575060005460ff16155b613d3a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613d5c576000805461ffff19166101011790555b613d64614652565b613d6e83836147f8565b8015612530576000805461ff0019169055505050565b6000806000835160411415613dbf5760208401516040850151606086015160001a613db1888285856148d4565b955095509550505050613dcb565b50508151600091506002905b9250925092565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401613dfc92919061575a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051613e3a91906155f3565b600060405180830381855afa9150503d8060008114613e75576040519150601f19603f3d011682016040523d82523d6000602084013e613e7a565b606091505b5091509150818015613e8e57506020815110155b801561133557508051630b135d3f60e11b90613eb39083016020908101908401615293565b149695505050505050565b6000826000018281548110613ee357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b600080613f04610105612f8e565b613f0f600143615878565b61010054604080519240602084015282015241606090811b6bffffffffffffffffffffffff19169082015244607482015242609482015260b4016040516020818303038152906040528051906020012060001c613f6c9190615911565b905061010060008154613f7e906158f6565b90915550613f8e61010582612f98565b91505090565b60006111e583836149a3565b7306012c8cf97bead5deae237070f9587f8e7a266d73b47e3cd837ddf8e4c57f05d70ab865de6e193bbb60606001600160a01b038616831415614043576040516001600160a01b03861660248201526044810185905260640160408051601f198184030181529190526020810180516001600160e01b03167fa9059cbb000000000000000000000000000000000000000000000000000000001790529050614112565b816001600160a01b0316866001600160a01b031614156140c3576040516001600160a01b03861660248201526044810185905260640160408051601f198184030181529190526020810180516001600160e01b03167f8b72a2ec000000000000000000000000000000000000000000000000000000001790529050614112565b6040513060248201526001600160a01b03861660448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080876001600160a01b03168360405161412d91906155f3565b6000604051808303816000865af19150503d806000811461416a576040519150601f19603f3d011682016040523d82523d6000602084013e61416f565b606091505b5091509150818190610daa5760405162461bcd60e51b81526004016111c29190615773565b60ff546001600160a01b0316806141a9575050565b6040517f5e2f9b520000000000000000000000000000000000000000000000000000000081526001600160a01b03821690635e2f9b52906141ee90859060040161569f565b600060405180830381600087803b15801561420857600080fd5b505af1158015612052573d6000803e3d6000fd5b60006111e58383614ac0565b7306012c8cf97bead5deae237070f9587f8e7a266d73b47e3cd837ddf8e4c57f05d70ab865de6e193bbb60606001600160a01b0385168314156142c8576040513360248201523060448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905290506145d0565b816001600160a01b0316856001600160a01b03161415614473576000846040516024016142f791815260200190565b60408051601f198184030181529181526020820180516001600160e01b03167f58178168000000000000000000000000000000000000000000000000000000001790525190915060009081906001600160a01b038916906143599085906155f3565b600060405180830381855afa9150503d8060008114614394576040519150601f19603f3d011682016040523d82523d6000602084013e614399565b606091505b50915091506000818060200190518101906143b49190614d3c565b90508280156143cb57506001600160a01b03811633145b6144175760405162461bcd60e51b815260206004820152601160248201527f4e6f7420746865204e4654206f776e657200000000000000000000000000000060448201526064016111c2565b6040516024810189905260440160408051601f198184030181529190526020810180516001600160e01b03167f8264fe980000000000000000000000000000000000000000000000000000000017905294506145d09350505050565b60fd546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810186905230916001600160a01b031690636352211e9060240160206040518083038186803b1580156144d057600080fd5b505afa1580156144e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145089190614d3c565b6001600160a01b0316141561458a5761453661010585600081815260018301602052604081205415156111e5565b156145835760405162461bcd60e51b815260206004820152601a60248201527f547279696e6720746f2075736520616e206f776e6564204e465400000000000060448201526064016111c2565b5050505050565b6040513360248201523060448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080866001600160a01b0316836040516145eb91906155f3565b6000604051808303816000865af19150503d8060008114614628576040519150601f19603f3d011682016040523d82523d6000602084013e61462d565b606091505b50915091508181906134d65760405162461bcd60e51b81526004016111c29190615773565b600054610100900460ff168061466b575060005460ff16155b6146ce5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613caa576000805461ffff191661010117905580156130a9576000805461ff001916905550565b600054610100900460ff168061471c575060005460ff16155b61477f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff161580156147a1576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156130a9576000805461ff001916905550565b600054610100900460ff1680614811575060005460ff16155b6148745760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015614896576000805461ffff19166101011790555b82516148a9906068906020860190614b0f565b5081516148bd906069906020850190614b0f565b508015612530576000805461ff0019169055505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561490f5750600091506003905082614999565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614963573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661498f57506000925060019150829050614999565b9250600091508190505b9450945094915050565b60008181526001830160205260408120548015614ab65760006149c7600183615878565b85549091506000906149db90600190615878565b9050818114614a5c576000866000018281548110614a0957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080876000018481548110614a3a57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614a7b57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d02565b6000915050610d02565b6000818152600183016020526040812054614b0757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d02565b506000610d02565b828054614b1b906158bb565b90600052602060002090601f016020900481019282614b3d5760008555614b83565b82601f10614b5657805160ff1916838001178555614b83565b82800160010185558215614b83579182015b82811115614b83578251825591602001919060010190614b68565b50614b8f929150614b93565b5090565b5b80821115614b8f5760008155600101614b94565b60008083601f840112614bb9578182fd5b50813567ffffffffffffffff811115614bd0578182fd5b6020830191508360208260051b8501011115614beb57600080fd5b9250929050565b600082601f830112614c02578081fd5b8135602067ffffffffffffffff821115614c1e57614c1e615951565b8160051b614c2d8282016157fc565b838152828101908684018388018501891015614c47578687fd5b8693505b85841015614c69578035835260019390930192918401918401614c4b565b50979650505050505050565b60008083601f840112614c86578182fd5b50813567ffffffffffffffff811115614c9d578182fd5b602083019150836020828501011115614beb57600080fd5b600082601f830112614cc5578081fd5b813567ffffffffffffffff811115614cdf57614cdf615951565b614cf2601f8201601f19166020016157fc565b818152846020838601011115614d06578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215614d31578081fd5b81356111e581615967565b600060208284031215614d4d578081fd5b81516111e581615967565b60008060408385031215614d6a578081fd5b8235614d7581615967565b91506020830135614d8581615967565b809150509250929050565b600080600080600060a08688031215614da7578081fd5b8535614db281615967565b94506020860135614dc281615967565b9350604086013567ffffffffffffffff80821115614dde578283fd5b614dea89838a01614bf2565b94506060880135915080821115614dff578283fd5b614e0b89838a01614bf2565b93506080880135915080821115614e20578283fd5b50614e2d88828901614cb5565b9150509295509295909350565b600080600060608486031215614e4e578283fd5b8335614e5981615967565b92506020840135614e6981615967565b929592945050506040919091013590565b60008060008060808587031215614e8f578182fd5b8435614e9a81615967565b93506020850135614eaa81615967565b925060408501359150606085013567ffffffffffffffff811115614ecc578182fd5b614ed887828801614cb5565b91505092959194509250565b600080600080600060a08688031215614efb578283fd5b8535614f0681615967565b94506020860135614f1681615967565b93506040860135925060608601359150608086013567ffffffffffffffff811115614f3f578182fd5b614e2d88828901614cb5565b600080600060408486031215614f5f578081fd5b8335614f6a81615967565b9250602084013567ffffffffffffffff811115614f85578182fd5b614f9186828701614c75565b9497909650939450505050565b60008060408385031215614fb0578182fd5b8235614fbb81615967565b946020939093013593505050565b60008060008060408587031215614fde578182fd5b843567ffffffffffffffff80821115614ff5578384fd5b61500188838901614ba8565b90965094506020870135915080821115615019578384fd5b5061502687828801614ba8565b95989497509550505050565b6000806000806000806060878903121561504a578384fd5b863567ffffffffffffffff80821115615061578586fd5b61506d8a838b01614ba8565b90985096506020890135915080821115615085578586fd5b6150918a838b01614ba8565b909650945060408901359150808211156150a9578283fd5b506150b689828a01614ba8565b979a9699509497509295939492505050565b6000602082840312156150d9578081fd5b813567ffffffffffffffff8111156150ef578182fd5b61111784828501614bf2565b60008060006060848603121561510f578081fd5b833567ffffffffffffffff80821115615126578283fd5b61513287838801614bf2565b94506020860135915080821115615147578283fd5b5061515486828701614bf2565b925050604084013561516581615967565b809150509250925092565b60008060008060808587031215615185578182fd5b843567ffffffffffffffff8082111561519c578384fd5b6151a888838901614bf2565b955060208701359150808211156151bd578384fd5b6151c988838901614bf2565b945060408701359150808211156151de578384fd5b506151eb87828801614bf2565b92505060608501356151fc81615967565b939692955090935050565b600060208284031215615218578081fd5b81516111e58161597c565b600080600080600060a0868803121561523a578283fd5b85356152458161597c565b945060208601356152558161597c565b935060408601356152658161597c565b925060608601356152758161597c565b915060808601356152858161597c565b809150509295509295909350565b6000602082840312156152a4578081fd5b5051919050565b600080604083850312156152bd578182fd5b82359150602083013567ffffffffffffffff8111156152da578182fd5b6152e685828601614cb5565b9150509250929050565b600060208284031215615301578081fd5b81356001600160e01b0319811681146111e5578182fd5b6000806000806040858703121561532d578182fd5b843567ffffffffffffffff80821115615344578384fd5b61535088838901614c75565b90965094506020870135915080821115615368578384fd5b5061502687828801614c75565b600080600080600060a0868803121561538c578283fd5b853567ffffffffffffffff808211156153a3578485fd5b6153af89838a01614cb5565b965060208801359150808211156153c4578485fd5b506153d188828901614cb5565b945050604086013561526581615967565b6000602082840312156153f3578081fd5b5035919050565b60008060006060848603121561540e578081fd5b83359250602084013561542081615967565b9150604084013561516581615967565b600080600060408486031215615444578081fd5b83359250602084013567ffffffffffffffff811115615461578182fd5b614f9186828701614ba8565b600080600060608486031215615481578081fd5b83359250602084013567ffffffffffffffff81111561549e578182fd5b61515486828701614bf2565b6000806000604084860312156154be578081fd5b83359250602084013567ffffffffffffffff811115614f85578182fd5b600080600080600060a086880312156154f2578283fd5b505083359560208501359550604085013594606081013594506080013592509050565b600080600080600060a0868803121561552c578283fd5b5050835160208501516040860151606087015160809097015192989197509594509092509050565b6000815180845260208085019450808401835b8381101561558357815187529582019590820190600101615567565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526155cf81602086016020860161588f565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6000825161560581846020870161588f565b9190910192915050565b60006001600160a01b03808716835280861660208401525060a0604083015261563b60a0830185615554565b828103606084015261564d8185615554565b838103608090940193909352508152602001949350505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261238560a08301846155b7565b6020815260006111e56020830184615554565b6060815260006156c56060830186615554565b82810360208401526156d78186615554565b9150506001600160a01b0383166040830152949350505050565b60a08152600061570460a0830188615554565b82810360208401526157168188615554565b9050828103604084015261572a8187615554565b9050828103606084015261573e8186615554565b9150506001600160a01b03831660808301529695505050505050565b82815260406020820152600061111760408301846155b7565b6020815260006111e560208301846155b7565b60808152600061579960808301896155b7565b82810360208401526157ab81896155b7565b905082810360408401526157c081878961558e565b905082810360608401526157d581858761558e565b9998505050505050505050565b8381526040602082015260006113e760408301848661558e565b604051601f8201601f1916810167ffffffffffffffff8111828210171561582557615825615951565b604052919050565b6000821982111561584057615840615925565b500190565b6000826158545761585461593b565b500490565b600081600019048311821515161561587357615873615925565b500290565b60008282101561588a5761588a615925565b500390565b60005b838110156158aa578181015183820152602001615892565b83811115610c995750506000910152565b600181811c908216806158cf57607f821691505b602082108114156158f057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561590a5761590a615925565b5060010190565b6000826159205761592061593b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146130a957600080fd5b80151581146130a957600080fdfea26469706673582212206c705bbb40ace4d821db1729e286979dbcc34a2a2f564b07100f9dd9c007a3ca64736f6c63430008040033
Deployed Bytecode
0x6080604052600436106103ac5760003560e01c806379309658116101e7578063d0ebdbe71161010d578063e78458c4116100a0578063f2fde38b1161006f578063f2fde38b14610ba9578063f7fce33414610bc9578063fcc0e38114610bde578063feb8eba514610c0057600080fd5b8063e78458c414610b0f578063e9ec2e9914610b2f578063f1d20dd414610b44578063f23a6e6114610b6457600080fd5b8063d9d98ce4116100dc578063d9d98ce414610a69578063dd62ed3e14610a89578063e0a8b97a14610acf578063e0b4a79a14610aef57600080fd5b8063d0ebdbe7146109f4578063d53f621714610a14578063d6ee4a9314610a29578063d8a06f7314610a4957600080fd5b8063a9059cbb11610185578063c3cb8c1411610154578063c3cb8c141461097f578063c4a0db9614610994578063c4ff5247146109b4578063cce2f3fb146109d457600080fd5b8063a9059cbb146108e7578063b10402ea14610907578063b7cac50814610927578063bc197c811461093a57600080fd5b80638f878a43116101c15780638f878a431461087257806395d89b41146108925780639d54def6146108a7578063a457c2d7146108c757600080fd5b8063793096581461081a5780638c8508141461083d5780638da5cb5b1461085d57600080fd5b806333194c0a116102d757806354fd4d501161026a5780636b948a35116102395780636b948a351461077257806370a0823114610792578063715018a6146107c857806372188e3f146107dd57600080fd5b806354fd4d50146106cc5780635877aee6146107125780635cffe9de14610732578063613255ab1461075257600080fd5b806344b28d59116102a657806344b28d591461065057806345a0b65214610671578063481c6a75146106915780635035434a146106b157600080fd5b806333194c0a146105e557806335dca76c146105fb57806339509351146106105780633d5d190c1461063057600080fd5b806313966db51161034f5780631ba46cfd1161031e5780631ba46cfd1461054f57806323b872dd1461058757806325705d8d146105a7578063313ce567146105c957600080fd5b806313966db51461049a578063150b7a02146104bd5780631626ba7e1461051a57806318160ddd1461053a57600080fd5b806306f26dc21161038b57806306f26dc21461041d57806306fdde0314610438578063095ea7b31461045a5780630d636a091461047a57600080fd5b8062518161146103b157806301ffc9a7146103c857806304a66b48146103fd575b600080fd5b3480156103bd57600080fd5b506103c6610c15565b005b3480156103d457600080fd5b506103e86103e33660046152f0565b610c9f565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b506103c66104183660046154db565b610d08565b34801561042957600080fd5b50610104546103e89060ff1681565b34801561044457600080fd5b5061044d610db5565b6040516103f49190615773565b34801561046657600080fd5b506103e8610475366004614f9e565b610e47565b34801561048657600080fd5b506103c6610495366004615223565b610e5d565b3480156104a657600080fd5b506104af610fd1565b6040519081526020016103f4565b3480156104c957600080fd5b506105016104d8366004614e7a565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040516001600160e01b031990911681526020016103f4565b34801561052657600080fd5b506105016105353660046152ab565b611066565b34801561054657600080fd5b506067546104af565b34801561055b57600080fd5b5060fd5461056f906001600160a01b031681565b6040516001600160a01b0390911681526020016103f4565b34801561059357600080fd5b506103e86105a2366004614e3a565b61111f565b3480156105b357600080fd5b506105bc6111ec565b6040516103f4919061569f565b3480156105d557600080fd5b50604051601281526020016103f4565b3480156105f157600080fd5b506104af60fb5481565b34801561060757600080fd5b506104af6112ab565b34801561061c57600080fd5b506103e861062b366004614f9e565b61133f565b34801561063c57600080fd5b506104af61064b366004614fc9565b611376565b34801561065c57600080fd5b50610104546103e89062010000900460ff1681565b34801561067d57600080fd5b506104af61068c3660046153e2565b6113f0565b34801561069d57600080fd5b5060fc5461056f906001600160a01b031681565b3480156106bd57600080fd5b50610108546103e89060ff1681565b3480156106d857600080fd5b5060408051808201909152600681527f76312e302e360000000000000000000000000000000000000000000000000000602082015261044d565b34801561071e57600080fd5b5061056f61072d3660046154aa565b6113fe565b34801561073e57600080fd5b506103e861074d366004614e7a565b611613565b34801561075e57600080fd5b506104af61076d366004614d20565b61162b565b34801561077e57600080fd5b50610104546103e890610100900460ff1681565b34801561079e57600080fd5b506104af6107ad366004614d20565b6001600160a01b031660009081526065602052604090205490565b3480156107d457600080fd5b506103c6611653565b3480156107e957600080fd5b506107f26116fc565b604080519586526020860194909452928401919091526060830152608082015260a0016103f4565b34801561082657600080fd5b50610104546103e890640100000000900460ff1681565b34801561084957600080fd5b506105bc610858366004615170565b611796565b34801561086957600080fd5b5061056f611a3b565b34801561087e57600080fd5b5060ff5461056f906001600160a01b031681565b34801561089e57600080fd5b5061044d611ad6565b3480156108b357600080fd5b506105bc6108c236600461546d565b611ae5565b3480156108d357600080fd5b506103e86108e2366004614f9e565b611cf7565b3480156108f357600080fd5b506103e8610902366004614f9e565b611daa565b34801561091357600080fd5b506104af6109223660046150fb565b611db7565b6103c6610935366004614f4b565b611f10565b34801561094657600080fd5b50610501610955366004614d90565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561098b57600080fd5b506103c661205a565b3480156109a057600080fd5b506105bc6109af366004615430565b612066565b3480156109c057600080fd5b50610108546103e890610100900460ff1681565b3480156109e057600080fd5b506103c66109ef366004614d20565b6120a7565b348015610a0057600080fd5b506103c6610a0f366004614d20565b6121f3565b348015610a2057600080fd5b506104af61224f565b348015610a3557600080fd5b506105bc610a44366004615032565b6122e3565b348015610a5557600080fd5b5060fe5461056f906001600160a01b031681565b348015610a7557600080fd5b506104af610a84366004614f9e565b612390565b348015610a9557600080fd5b506104af610aa4366004614d58565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b348015610adb57600080fd5b506103c6610aea366004615318565b6123f3565b348015610afb57600080fd5b506103c6610b0a3660046153fa565b6124bd565b348015610b1b57600080fd5b506103c6610b2a366004615375565b612535565b348015610b3b57600080fd5b506104af61278a565b348015610b5057600080fd5b506103e8610b5f3660046150c8565b612797565b348015610b7057600080fd5b50610501610b7f366004614ee4565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b348015610bb557600080fd5b506103c6610bc4366004614d20565b612862565b348015610bd557600080fd5b506104af612999565b348015610bea57600080fd5b50610104546103e8906301000000900460ff1681565b348015610c0c57600080fd5b506104af612a2e565b610c1d612ac3565b60fe5460fb546040517fc182f2b20000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163c182f2b291610c6b9160040190815260200190565b600060405180830381600087803b158015610c8557600080fd5b505af1158015610c99573d6000803e3d6000fd5b50505050565b60006001600160e01b031982167f4e2312e0000000000000000000000000000000000000000000000000000000001480610d0257507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610d10612ac3565b60fe5460fb546040517f219962d200000000000000000000000000000000000000000000000000000000815260048101919091526024810187905260448101869052606481018590526084810184905260a481018390526001600160a01b039091169063219962d29060c401600060405180830381600087803b158015610d9657600080fd5b505af1158015610daa573d6000803e3d6000fd5b505050505050505050565b606060688054610dc4906158bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610df0906158bb565b8015610e3d5780601f10610e1257610100808354040283529160200191610e3d565b820191906000526020600020905b815481529060010190602001808311610e2057829003601f168201915b5050505050905090565b6000610e54338484612b95565b50600192915050565b610e65612ac3565b610104805463ffff000019166201000087151590810263ff0000001916919091176301000000871515021764ff0000000019166401000000008615150217909155610108805461ffff191684151561ff00191617610100841515021790556040519081527fc604be2f834727754dc1ec1225c14d1ecde48e7d12fa7b745dfb137a3db998bd9060200160405180910390a160405184151581527f835d9397f97f5df575f718046bb3e918f911d39d7edfa79aa8d40ddc7d5ce2a59060200160405180910390a160405183151581527f64b60f32742df47d4ccb5b31ca12fee1bc20695467bfe8fa058b00ec446c15639060200160405180910390a160405182151581527f7e8b58aeb3d1d3a1777185c996f374a5d3c46ef3cd25a07ec6eb2569488d50589060200160405180910390a160405181151581527fbfb092a6cb2d49526b6982acab35d64782cf1c05f8c8f0dd88008b288bfa5af59060200160405180910390a15050505050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b039091169163220613799161100b9160040190815260200190565b60a06040518083038186803b15801561102357600080fd5b505afa158015611037573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105b9190615515565b509295945050505050565b6000806110f960fe60009054906101000a90046001600160a01b03166001600160a01b031663c1d26ea46040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190614d3c565b8585612cee565b90508061110e576001600160e01b0319611117565b630b135d3f60e11b5b949350505050565b600061112c848484612d6d565b6001600160a01b0384166000908152606660209081526040808320338452909152902054828110156111cb5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6111df85336111da8685615878565b612b95565b60019150505b9392505050565b606060006111fb610105612f8e565b905060008167ffffffffffffffff81111561122657634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561124f578160200160208202803683370190505b50905060005b828110156112a45761126961010582612f98565b82828151811061128957634e487b7160e01b600052603260045260246000fd5b602090810291909101015261129d816158f6565b9050611255565b5092915050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916112e59160040190815260200190565b60a06040518083038186803b1580156112fd57600080fd5b505afa158015611311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113359190615515565b9695505050505050565b3360008181526066602090815260408083206001600160a01b03871684529091528120549091610e549185906111da90869061582d565b60006113e785858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250339250611db7915050565b95945050505050565b6000610d0261010583612f98565b6000611408612ac3565b60ff546001600160a01b0316156114875760405162461bcd60e51b815260206004820152602260248201527f4e4654585661756c743a20656c69676962696c69747920616c7265616479207360448201527f657400000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b60fe54604080517f14c77faa00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916314c77faa916004808301926020929190829003018186803b1580156114e557600080fd5b505afa1580156114f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151d9190614d3c565b90506000816001600160a01b031663576ff9088787876040518463ffffffff1660e01b8152600401611551939291906157e2565b602060405180830381600087803b15801561156b57600080fd5b505af115801561157f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a39190614d3c565b60ff80546001600160a01b0319166001600160a01b038316908117909155610104805461ff00191690556040805189815260208101929092529192507fe14c63b3d4272158635bee1d1b95b51bb8de042ee95a15cbfaf2865b4d0af811910160405180910390a195945050505050565b600061161f6004612fa4565b6113e7858585856130ac565b60006001600160a01b0382163014611644576000610d02565b606754610d0290600019615878565b3361165c611a3b565b6001600160a01b0316146116b25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b60fe5460fb54604051632206137960e01b8152600481019190915260009182918291829182916001600160a01b03169063220613799060240160a06040518083038186803b15801561174d57600080fd5b505afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190615515565b945094509450945094509091929394565b6060600260c95414156117eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c9556117fa6003612fa4565b611803336132d0565b6101045460009060ff16156118bf5760005b86518110156118b957600086828151811061184057634e487b7160e01b600052603260045260246000fd5b60200260200101519050806000141561189b5760405162461bcd60e51b815260206004820152601b60248201527f4e4654585661756c743a207472616e7366657272696e67203c2031000000000060448201526064016111c2565b6118a5818461582d565b925050806118b2906158f6565b9050611815565b506118c3565b5084515b83518114806118d557506101085460ff165b6119215760405162461bcd60e51b815260206004820152601f60248201527f4e4654585661756c743a2052616e646f6d20737761702064697361626c65640060448201526064016111c2565b83511580611937575061010854610100900460ff165b6119835760405162461bcd60e51b815260206004820152601f60248201527f4e4654585661756c743a2054617267657420737761702064697361626c65640060448201526064016111c2565b60008061198e6116fc565b9450945050505060008651846119a49190615878565b6119ae9084615859565b87516119ba9084615859565b6119c4919061582d565b90506119d0338261333d565b60006119dd8589896134e0565b90506119e98a8a6136ee565b507f66982ed4a058811a8004bdcec9adcb3671f2b4f1a788667a3a74959d7c09af3c8a8a8a848b604051611a219594939291906156f1565b60405180910390a1600160c9559998505050505050505050565b60fe54604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b158015611a9957600080fd5b505afa158015611aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad19190614d3c565b905090565b606060698054610dc4906158bb565b6060600260c9541415611b3a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c9819055611b4a90612fa4565b611b53336132d0565b8251841480611b6c5750610104546301000000900460ff165b611bc45760405162461bcd60e51b8152602060048201526024808201527f4e4654585661756c743a2052616e646f6d2072656465656d206e6f7420656e61604482015263189b195960e21b60648201526084016111c2565b82511580611bdd575061010454640100000000900460ff165b611c355760405162461bcd60e51b8152602060048201526024808201527f4e4654585661756c743a205461726765742072656465656d206e6f7420656e61604482015263189b195960e21b60648201526084016111c2565b611c5033611c4b86670de0b6b3a7640000615859565b613970565b600080611c5b6116fc565b505092509250506000855187611c719190615878565b611c7b9084615859565b8651611c879084615859565b611c91919061582d565b9050611c9d338261333d565b6000611caa8888886134e0565b90507f63b13f6307f284441e029836b0c22eb91eb62a7ad555670061157930ce884f4e818888604051611cdf939291906156b2565b60405180910390a1600160c955979650505050505050565b3360009081526066602090815260408083206001600160a01b038616845290915281205482811015611d915760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016111c2565b611da033856111da8685615878565b5060019392505050565b6000610e54338484612d6d565b6000600260c9541415611e0c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016111c2565b600260c955611e1b6001612fa4565b611e24336132d0565b6101045462010000900460ff16611e7d5760405162461bcd60e51b815260206004820152601360248201527f4d696e74696e67206e6f7420656e61626c65640000000000000000000000000060448201526064016111c2565b6000611e8985856136ee565b9050611ea683611ea183670de0b6b3a7640000615859565b613af6565b600081611eb1610fd1565b611ebb9190615859565b9050611ec7848261333d565b7f1f72ad2a14447fa756b6f5aca53504645af79813493aca2d906b69e4aaeb9492868686604051611efa939291906156b2565b60405180910390a150600160c955949350505050565b33611f19611a3b565b6001600160a01b031614611f6f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b60fd546001600160a01b0384811691161415611fcd5760405162461bcd60e51b815260206004820152600d60248201527f216173736574416464726573730000000000000000000000000000000000000060448201526064016111c2565b600080846001600160a01b0316348585604051611feb9291906155e3565b60006040518083038185875af1925050503d8060008114612028576040519150601f19603f3d011682016040523d82523d6000602084013e61202d565b606091505b50915091508181906120525760405162461bcd60e51b81526004016111c29190615773565b505050505050565b61206460006121f3565b565b606061111784848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250339250611ae5915050565b336120b0611a3b565b6001600160a01b0316146121065760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6000670de0b6b3a764000061211a60675490565b6121249190615845565b9050600481106121765760405162461bcd60e51b815260206004820152600e60248201527f746f6f206d616e79206974656d7300000000000000000000000000000000000060448201526064016111c2565b6040805160008152602081019091526121908282856134e0565b5060fd54604080516001600160a01b0392831681526020810185905291851682820152517f1f6d756c685d4969a551099165b59f836b4d2cc7e036e623f0248c28bff91db59181900360600190a1505060fd80546001600160a01b031916905550565b6121fb612ac3565b60fc80546001600160a01b0319166001600160a01b0383169081179091556040519081527f60a0f5b9f9e81e98216071b85826681c796256fe3d1354ecb675580fba64fa699060200160405180910390a150565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916122899160040190815260200190565b60a06040518083038186803b1580156122a157600080fd5b505afa1580156122b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d99190615515565b5095945050505050565b606061238587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250339250611796915050565b979650505050505050565b60006001600160a01b03831630146123ea5760405162461bcd60e51b815260206004820152601b60248201527f4552433230466c6173684d696e743a2077726f6e6720746f6b656e000000000060448201526064016111c2565b50600092915050565b6123fb612ac3565b7f1b92808356942344452465ae2648676199ae4c2fe413605353e51ff008e6f2ce612424610db5565b61242c611ad6565b8686868660405161244296959493929190615786565b60405180910390a1610c9984848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f88018190048102820181019092528681529250869150859081908401838280828437600092019190915250613bd592505050565b336124c6611a3b565b6001600160a01b03161461251c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6125268284613970565b6125308184613af6565b505050565b600054610100900460ff168061254e575060005460ff16155b6125b15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff161580156125d3576000805461ffff19166101011790555b6125db613bfc565b6125e58686613cbe565b6001600160a01b03841661263b5760405162461bcd60e51b815260206004820152601360248201527f417373657420213d20616464726573732830290000000000000000000000000060448201526064016111c2565b60fd80546001600160a01b03199081166001600160a01b0387161790915560fe805433921682179055604080517f264a6208000000000000000000000000000000000000000000000000000000008152905163264a620891600480820192602092909190829003018186803b1580156126b357600080fd5b505afa1580156126c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126eb9190615293565b60fb8190556101048054841515610100810261ff001988151590811661ffff199094169390931717909255604080516001600160a01b038916815260208101929092528101919091527f18ecce5c418b882a3d89e5b6cc8100dc3383309b8e78525266fe1283a7f934d69060600160405180910390a26127716001806001806001610e5d565b8015612052576000805461ff0019169055505050505050565b6000611ad1610105612f8e565b61010454600090610100900460ff16156127b357506001919050565b60ff546001600160a01b0316806127cd5750600092915050565b6040517f84ca9f850000000000000000000000000000000000000000000000000000000081526001600160a01b038216906384ca9f859061281290869060040161569f565b60206040518083038186803b15801561282a57600080fd5b505afa15801561283e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e59190615207565b3361286b611a3b565b6001600160a01b0316146128c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016111c2565b6001600160a01b03811661293d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016111c2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b03909116916322061379916129d39160040190815260200190565b60a06040518083038186803b1580156129eb57600080fd5b505afa1580156129ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a239190615515565b509195945050505050565b60fe5460fb54604051632206137960e01b815260009283926001600160a01b0390911691632206137991612a689160040190815260200190565b60a06040518083038186803b158015612a8057600080fd5b505afa158015612a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab89190615515565b509095945050505050565b60fc546001600160a01b0316612b3b57612adb611a3b565b6001600160a01b0316336001600160a01b0316146120645760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016111c2565b60fc546001600160a01b031633146120645760405162461bcd60e51b815260206004820152600b60248201527f4e6f74206d616e6167657200000000000000000000000000000000000000000060448201526064016111c2565b6001600160a01b038316612c105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b038216612c8c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006001600160a01b0384163b612d5b57600080612d0c8585613d84565b5090925090506000816003811115612d3457634e487b7160e01b600052602160045260246000fd5b148015612d525750856001600160a01b0316826001600160a01b0316145b925050506111e5565b612d66848484613dd2565b90506111e5565b6001600160a01b038316612de95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b038216612e655760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b03831660009081526065602052604090205481811015612ef45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016111c2565b612efe8282615878565b6001600160a01b038086166000908152606560205260408082209390935590851681529081208054849290612f3490849061582d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612f8091815260200190565b60405180910390a350505050565b6000610d02825490565b60006111e58383613ebe565b60fe546040517ff6aacfb1000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b039091169063f6aacfb19060240160206040518083038186803b15801561300157600080fd5b505afa158015613015573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130399190615207565b158061305d5750613048611a3b565b6001600160a01b0316336001600160a01b0316145b6130a95760405162461bcd60e51b815260206004820152600660248201527f506175736564000000000000000000000000000000000000000000000000000060448201526064016111c2565b50565b6000806130b98585612390565b90506130c58685613af6565b6040517f23e30c8b0000000000000000000000000000000000000000000000000000000081527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9906001600160a01b038816906323e30c8b906131349033908a908a9088908b90600401615667565b602060405180830381600087803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131869190615293565b146131f85760405162461bcd60e51b8152602060048201526024808201527f4552433230466c6173684d696e743a20696e76616c69642072657475726e207660448201527f616c75650000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b0386166000908152606660209081526040808320308452909152902054613226828661582d565b81101561329b5760405162461bcd60e51b815260206004820152602f60248201527f4552433230466c6173684d696e743a20616c6c6f77616e636520646f6573206e60448201527f6f7420616c6c6f7720726566756e64000000000000000000000000000000000060648201526084016111c2565b6132b58730846132ab8986615878565b6111da9190615878565b6132c387611c4b848861582d565b5060019695505050505050565b73bbc53022af15bb973ad906577c84784c47c143716001600160a01b03821614156130a95760405162461bcd60e51b815260206004820152601160248201527f43616c6c657220697320626c6f636b656400000000000000000000000000000060448201526064016111c2565b60fe546040517fdbe66ca00000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690819063dbe66ca09060240160206040518083038186803b15801561339b57600080fd5b505afa1580156133af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133d39190615207565b156133dd57505050565b8115612530576000816001600160a01b0316630d43e8ad6040518163ffffffff1660e01b815260040160206040518083038186803b15801561341e57600080fd5b505afa158015613432573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134569190614d3c565b9050613463848285612d6d565b60fb546040517f91c05b0b00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b038216906391c05b0b90602401600060405180830381600087803b1580156134c257600080fd5b505af11580156134d6573d6000803e3d6000fd5b5050505050505050565b6101045460fd5460609160ff16906001600160a01b031660008667ffffffffffffffff81111561352057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613549578160200160208202803683370190505b50865190915060005b888110156136d95760008282106135705761356b613ef6565b613599565b88828151811061359057634e487b7160e01b600052603260045260246000fd5b60200260200101515b9050808483815181106135bc57634e487b7160e01b600052603260045260246000fd5b60200260200101818152505085156136b0576000818152610107602052604081208054600192906135ee908490615878565b9091555050600081815261010760205260409020546136155761361361010582613f94565b505b6040517ff242432a0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038981166024830152604482018390526001606483015260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b505050506136c8565b6136bc61010582613f94565b506136c8858983613fa0565b506136d2816158f6565b9050613552565b506136e382614194565b509695505050505050565b60006136f983612797565b6137455760405162461bcd60e51b815260206004820152601760248201527f4e4654585661756c743a206e6f7420656c696769626c6500000000000000000060448201526064016111c2565b82516101045460ff16156138f95760fd546040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690632eb2c2d6906137a290339030908990899060040161560f565b600060405180830381600087803b1580156137bc57600080fd5b505af11580156137d0573d6000803e3d6000fd5b505050506000805b828110156138ef57600086828151811061380257634e487b7160e01b600052603260045260246000fd5b60200260200101519050600086838151811061382e57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080600014156138895760405162461bcd60e51b815260206004820152601b60248201527f4e4654585661756c743a207472616e7366657272696e67203c2031000000000060448201526064016111c2565b600082815261010760205260409020546138ab576138a96101058361421c565b505b60008281526101076020526040812080548392906138ca90849061582d565b909155506138da9050818561582d565b93505050806138e8906158f6565b90506137d8565b509150610d029050565b60fd546001600160a01b031660005b8281101561396557600086828151811061393257634e487b7160e01b600052603260045260246000fd5b602002602001015190506139468382614228565b6139526101058261421c565b50508061395e906158f6565b9050613908565b508192505050610d02565b6001600160a01b0382166139ec5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b6001600160a01b03821660009081526065602052604090205481811015613a7b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016111c2565b613a858282615878565b6001600160a01b03841660009081526065602052604081209190915560678054849290613ab3908490615878565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612ce1565b6001600160a01b038216613b4c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016111c2565b8060676000828254613b5e919061582d565b90915550506001600160a01b03821660009081526065602052604081208054839290613b8b90849061582d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b8151613be8906068906020850190614b0f565b508051612530906069906020840190614b0f565b600054610100900460ff1680613c15575060005460ff16155b613c785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613c9a576000805461ffff19166101011790555b613ca2614652565b613caa614703565b80156130a9576000805461ff001916905550565b600054610100900460ff1680613cd7575060005460ff16155b613d3a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613d5c576000805461ffff19166101011790555b613d64614652565b613d6e83836147f8565b8015612530576000805461ff0019169055505050565b6000806000835160411415613dbf5760208401516040850151606086015160001a613db1888285856148d4565b955095509550505050613dcb565b50508151600091506002905b9250925092565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401613dfc92919061575a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051613e3a91906155f3565b600060405180830381855afa9150503d8060008114613e75576040519150601f19603f3d011682016040523d82523d6000602084013e613e7a565b606091505b5091509150818015613e8e57506020815110155b801561133557508051630b135d3f60e11b90613eb39083016020908101908401615293565b149695505050505050565b6000826000018281548110613ee357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b600080613f04610105612f8e565b613f0f600143615878565b61010054604080519240602084015282015241606090811b6bffffffffffffffffffffffff19169082015244607482015242609482015260b4016040516020818303038152906040528051906020012060001c613f6c9190615911565b905061010060008154613f7e906158f6565b90915550613f8e61010582612f98565b91505090565b60006111e583836149a3565b7306012c8cf97bead5deae237070f9587f8e7a266d73b47e3cd837ddf8e4c57f05d70ab865de6e193bbb60606001600160a01b038616831415614043576040516001600160a01b03861660248201526044810185905260640160408051601f198184030181529190526020810180516001600160e01b03167fa9059cbb000000000000000000000000000000000000000000000000000000001790529050614112565b816001600160a01b0316866001600160a01b031614156140c3576040516001600160a01b03861660248201526044810185905260640160408051601f198184030181529190526020810180516001600160e01b03167f8b72a2ec000000000000000000000000000000000000000000000000000000001790529050614112565b6040513060248201526001600160a01b03861660448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080876001600160a01b03168360405161412d91906155f3565b6000604051808303816000865af19150503d806000811461416a576040519150601f19603f3d011682016040523d82523d6000602084013e61416f565b606091505b5091509150818190610daa5760405162461bcd60e51b81526004016111c29190615773565b60ff546001600160a01b0316806141a9575050565b6040517f5e2f9b520000000000000000000000000000000000000000000000000000000081526001600160a01b03821690635e2f9b52906141ee90859060040161569f565b600060405180830381600087803b15801561420857600080fd5b505af1158015612052573d6000803e3d6000fd5b60006111e58383614ac0565b7306012c8cf97bead5deae237070f9587f8e7a266d73b47e3cd837ddf8e4c57f05d70ab865de6e193bbb60606001600160a01b0385168314156142c8576040513360248201523060448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905290506145d0565b816001600160a01b0316856001600160a01b03161415614473576000846040516024016142f791815260200190565b60408051601f198184030181529181526020820180516001600160e01b03167f58178168000000000000000000000000000000000000000000000000000000001790525190915060009081906001600160a01b038916906143599085906155f3565b600060405180830381855afa9150503d8060008114614394576040519150601f19603f3d011682016040523d82523d6000602084013e614399565b606091505b50915091506000818060200190518101906143b49190614d3c565b90508280156143cb57506001600160a01b03811633145b6144175760405162461bcd60e51b815260206004820152601160248201527f4e6f7420746865204e4654206f776e657200000000000000000000000000000060448201526064016111c2565b6040516024810189905260440160408051601f198184030181529190526020810180516001600160e01b03167f8264fe980000000000000000000000000000000000000000000000000000000017905294506145d09350505050565b60fd546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810186905230916001600160a01b031690636352211e9060240160206040518083038186803b1580156144d057600080fd5b505afa1580156144e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145089190614d3c565b6001600160a01b0316141561458a5761453661010585600081815260018301602052604081205415156111e5565b156145835760405162461bcd60e51b815260206004820152601a60248201527f547279696e6720746f2075736520616e206f776e6564204e465400000000000060448201526064016111c2565b5050505050565b6040513360248201523060448201526064810185905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080866001600160a01b0316836040516145eb91906155f3565b6000604051808303816000865af19150503d8060008114614628576040519150601f19603f3d011682016040523d82523d6000602084013e61462d565b606091505b50915091508181906134d65760405162461bcd60e51b81526004016111c29190615773565b600054610100900460ff168061466b575060005460ff16155b6146ce5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015613caa576000805461ffff191661010117905580156130a9576000805461ff001916905550565b600054610100900460ff168061471c575060005460ff16155b61477f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff161580156147a1576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156130a9576000805461ff001916905550565b600054610100900460ff1680614811575060005460ff16155b6148745760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111c2565b600054610100900460ff16158015614896576000805461ffff19166101011790555b82516148a9906068906020860190614b0f565b5081516148bd906069906020850190614b0f565b508015612530576000805461ff0019169055505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561490f5750600091506003905082614999565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015614963573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661498f57506000925060019150829050614999565b9250600091508190505b9450945094915050565b60008181526001830160205260408120548015614ab65760006149c7600183615878565b85549091506000906149db90600190615878565b9050818114614a5c576000866000018281548110614a0957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080876000018481548110614a3a57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614a7b57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d02565b6000915050610d02565b6000818152600183016020526040812054614b0757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d02565b506000610d02565b828054614b1b906158bb565b90600052602060002090601f016020900481019282614b3d5760008555614b83565b82601f10614b5657805160ff1916838001178555614b83565b82800160010185558215614b83579182015b82811115614b83578251825591602001919060010190614b68565b50614b8f929150614b93565b5090565b5b80821115614b8f5760008155600101614b94565b60008083601f840112614bb9578182fd5b50813567ffffffffffffffff811115614bd0578182fd5b6020830191508360208260051b8501011115614beb57600080fd5b9250929050565b600082601f830112614c02578081fd5b8135602067ffffffffffffffff821115614c1e57614c1e615951565b8160051b614c2d8282016157fc565b838152828101908684018388018501891015614c47578687fd5b8693505b85841015614c69578035835260019390930192918401918401614c4b565b50979650505050505050565b60008083601f840112614c86578182fd5b50813567ffffffffffffffff811115614c9d578182fd5b602083019150836020828501011115614beb57600080fd5b600082601f830112614cc5578081fd5b813567ffffffffffffffff811115614cdf57614cdf615951565b614cf2601f8201601f19166020016157fc565b818152846020838601011115614d06578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215614d31578081fd5b81356111e581615967565b600060208284031215614d4d578081fd5b81516111e581615967565b60008060408385031215614d6a578081fd5b8235614d7581615967565b91506020830135614d8581615967565b809150509250929050565b600080600080600060a08688031215614da7578081fd5b8535614db281615967565b94506020860135614dc281615967565b9350604086013567ffffffffffffffff80821115614dde578283fd5b614dea89838a01614bf2565b94506060880135915080821115614dff578283fd5b614e0b89838a01614bf2565b93506080880135915080821115614e20578283fd5b50614e2d88828901614cb5565b9150509295509295909350565b600080600060608486031215614e4e578283fd5b8335614e5981615967565b92506020840135614e6981615967565b929592945050506040919091013590565b60008060008060808587031215614e8f578182fd5b8435614e9a81615967565b93506020850135614eaa81615967565b925060408501359150606085013567ffffffffffffffff811115614ecc578182fd5b614ed887828801614cb5565b91505092959194509250565b600080600080600060a08688031215614efb578283fd5b8535614f0681615967565b94506020860135614f1681615967565b93506040860135925060608601359150608086013567ffffffffffffffff811115614f3f578182fd5b614e2d88828901614cb5565b600080600060408486031215614f5f578081fd5b8335614f6a81615967565b9250602084013567ffffffffffffffff811115614f85578182fd5b614f9186828701614c75565b9497909650939450505050565b60008060408385031215614fb0578182fd5b8235614fbb81615967565b946020939093013593505050565b60008060008060408587031215614fde578182fd5b843567ffffffffffffffff80821115614ff5578384fd5b61500188838901614ba8565b90965094506020870135915080821115615019578384fd5b5061502687828801614ba8565b95989497509550505050565b6000806000806000806060878903121561504a578384fd5b863567ffffffffffffffff80821115615061578586fd5b61506d8a838b01614ba8565b90985096506020890135915080821115615085578586fd5b6150918a838b01614ba8565b909650945060408901359150808211156150a9578283fd5b506150b689828a01614ba8565b979a9699509497509295939492505050565b6000602082840312156150d9578081fd5b813567ffffffffffffffff8111156150ef578182fd5b61111784828501614bf2565b60008060006060848603121561510f578081fd5b833567ffffffffffffffff80821115615126578283fd5b61513287838801614bf2565b94506020860135915080821115615147578283fd5b5061515486828701614bf2565b925050604084013561516581615967565b809150509250925092565b60008060008060808587031215615185578182fd5b843567ffffffffffffffff8082111561519c578384fd5b6151a888838901614bf2565b955060208701359150808211156151bd578384fd5b6151c988838901614bf2565b945060408701359150808211156151de578384fd5b506151eb87828801614bf2565b92505060608501356151fc81615967565b939692955090935050565b600060208284031215615218578081fd5b81516111e58161597c565b600080600080600060a0868803121561523a578283fd5b85356152458161597c565b945060208601356152558161597c565b935060408601356152658161597c565b925060608601356152758161597c565b915060808601356152858161597c565b809150509295509295909350565b6000602082840312156152a4578081fd5b5051919050565b600080604083850312156152bd578182fd5b82359150602083013567ffffffffffffffff8111156152da578182fd5b6152e685828601614cb5565b9150509250929050565b600060208284031215615301578081fd5b81356001600160e01b0319811681146111e5578182fd5b6000806000806040858703121561532d578182fd5b843567ffffffffffffffff80821115615344578384fd5b61535088838901614c75565b90965094506020870135915080821115615368578384fd5b5061502687828801614c75565b600080600080600060a0868803121561538c578283fd5b853567ffffffffffffffff808211156153a3578485fd5b6153af89838a01614cb5565b965060208801359150808211156153c4578485fd5b506153d188828901614cb5565b945050604086013561526581615967565b6000602082840312156153f3578081fd5b5035919050565b60008060006060848603121561540e578081fd5b83359250602084013561542081615967565b9150604084013561516581615967565b600080600060408486031215615444578081fd5b83359250602084013567ffffffffffffffff811115615461578182fd5b614f9186828701614ba8565b600080600060608486031215615481578081fd5b83359250602084013567ffffffffffffffff81111561549e578182fd5b61515486828701614bf2565b6000806000604084860312156154be578081fd5b83359250602084013567ffffffffffffffff811115614f85578182fd5b600080600080600060a086880312156154f2578283fd5b505083359560208501359550604085013594606081013594506080013592509050565b600080600080600060a0868803121561552c578283fd5b5050835160208501516040860151606087015160809097015192989197509594509092509050565b6000815180845260208085019450808401835b8381101561558357815187529582019590820190600101615567565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526155cf81602086016020860161588f565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6000825161560581846020870161588f565b9190910192915050565b60006001600160a01b03808716835280861660208401525060a0604083015261563b60a0830185615554565b828103606084015261564d8185615554565b838103608090940193909352508152602001949350505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261238560a08301846155b7565b6020815260006111e56020830184615554565b6060815260006156c56060830186615554565b82810360208401526156d78186615554565b9150506001600160a01b0383166040830152949350505050565b60a08152600061570460a0830188615554565b82810360208401526157168188615554565b9050828103604084015261572a8187615554565b9050828103606084015261573e8186615554565b9150506001600160a01b03831660808301529695505050505050565b82815260406020820152600061111760408301846155b7565b6020815260006111e560208301846155b7565b60808152600061579960808301896155b7565b82810360208401526157ab81896155b7565b905082810360408401526157c081878961558e565b905082810360608401526157d581858761558e565b9998505050505050505050565b8381526040602082015260006113e760408301848661558e565b604051601f8201601f1916810167ffffffffffffffff8111828210171561582557615825615951565b604052919050565b6000821982111561584057615840615925565b500190565b6000826158545761585461593b565b500490565b600081600019048311821515161561587357615873615925565b500290565b60008282101561588a5761588a615925565b500390565b60005b838110156158aa578181015183820152602001615892565b83811115610c995750506000910152565b600181811c908216806158cf57607f821691505b602082108114156158f057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561590a5761590a615925565b5060010190565b6000826159205761592061593b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146130a957600080fd5b80151581146130a957600080fdfea26469706673582212206c705bbb40ace4d821db1729e286979dbcc34a2a2f564b07100f9dd9c007a3ca64736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.