Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
GreenBTC
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./libraries/FormattedStrings.sol"; import "./libraries/TransferHelper.sol"; import "./interfaces/IWETH.sol"; import "./interfaces/IGreenBTCImage.sol"; import "./interfaces/IArkreenBuilder.sol"; import "./interfaces/IArkreenRECBank.sol"; import "./interfaces/IArkreenRECToken.sol"; import "./GreenBTCType.sol"; import "./interfaces/IERC20.sol"; import "./GreenBTCStorage.sol"; contract GreenBTC is ContextUpgradeable, UUPSUpgradeable, OwnableUpgradeable, ERC721EnumerableUpgradeable, GreenBTCStorage { using Strings for uint256; using Strings for address; using FormattedStrings for uint256; event GreenBitCoin(uint256 height, uint256 ARTCount, address minter, uint8 greenType); event OpenBox(address opener, uint256 tokenID, uint256 blockNumber); event RevealBoxes(uint256[] revealList, bool[] wonList); // event Subsidy(uint256 height, uint256 ratio); modifier ensure(uint256 deadline) { require(uint32(deadline) >= block.timestamp, "GBTC: EXPIRED"); _; } modifier onlyManager(){ require(msg.sender == manager, "GBTC: Not Manager"); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } //initialize function initialize(address authority, address builder, address cART, address native) external virtual initializer { __UUPSUpgradeable_init(); __Ownable_init_unchained(); __ERC721_init_unchained(NAME, SYMBOL); DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(NAME)), keccak256(bytes(VERSION)), block.chainid, address(this) ) ); manager = owner(); authorizer = authority; arkreenBuilder = builder; tokenCART = cART; tokenNative = native; luckyRate = 5; } function _authorizeUpgrade(address newImplementation) internal virtual override onlyOwner {} function setManager(address newManager) public onlyOwner{ require(newManager != address(0), "GBTC: Zero Address"); manager = newManager; } function setAuthorizer(address newAuthAddress) public onlyOwner { require(newAuthAddress != address(0), "GBTC: Zero Address"); authorizer = newAuthAddress; } function setImageContract(address newImageContract) public onlyOwner { require(newImageContract != address(0), "GBTC: Zero Address"); greenBtcImage = newImageContract; } function setCARTContract(address newCARTToken) public onlyOwner { require(newCARTToken != address(0), "GBTC: Zero Address"); tokenCART = newCARTToken; } function setARTContract(address newSubsidyART) public onlyOwner { require(newSubsidyART != address(0), "GBTC: Zero Address"); tokenARTSubsidy = newSubsidyART; } function setGreenBTCPro(address newGreenBTCPro) public onlyOwner { require(newGreenBTCPro != address(0), "GBTC: Zero Address"); greenBTCPro = newGreenBTCPro; } function setLuckyRate(uint256 newRate) public onlyOwner { require(newRate <= 20, "GBTC: Too More"); luckyRate = newRate; } function setRatioSubsidyCap(uint256 newRatioSubsidyCap) public onlyOwner { require(newRatioSubsidyCap <= 90, "GBTC: Too More Ratio"); ratioSubsidyCap = uint8(newRatioSubsidyCap); } /** * @dev Approve the tokens which can be transferred from this GreenBTC contract by arkreenBuilder * @param tokens The token list */ function approveBuilder(address[] calldata tokens) public onlyOwner { require(arkreenBuilder != address(0), "GBTC: No Builder"); for(uint256 i = 0; i < tokens.length; i++) { TransferHelper.safeApprove(tokens[i], arkreenBuilder, type(uint256).max); } } function callGreenBTCPro (address greenBTCPro) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), greenBTCPro, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Greenize BTC with the native token * @param gbtc Bitcoin block info to be greenized * @param sig Signature of the authority to Bitcoin block info * @param badgeInfo Information that will logged in Arkreen climate badge * @param deadline LB0-LB3: The deadline to cancel the transaction, * LB7: 0x80, Open box at same time, gbtc.miner must be the caller if opening box at the same time * LB6: ratio of subsidy */ function authMintGreenBTCWithNative( GreenBTCInfo calldata gbtc, Sig calldata sig, BadgeInfo calldata badgeInfo, uint256 deadline ) public payable ensure(deadline) { _mintGreenBTC(deadline, 0x00, gbtc, sig); IWETH(tokenNative).deposit{value: msg.value}(); // Wrap MATIC to WMATIC // bit0 = 1: exact payment amount; bit1 = 1: ArkreenBank is used to get CART token; bit2 = 0: Repay to caller uint256 modeAction = 0x03; // actionBuilderBadge(address,address,uint256,uint256,uint256,uint256,(address,string,string,string)): 0x8D7FCEFD bytes memory builderCallData = abi.encodeWithSelector( 0x8D7FCEFD, tokenNative, tokenCART, msg.value, _getFullARTValue(gbtc.ARTCount), modeAction, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } function _getFullARTValue( uint256 actionValue ) internal view returns (uint256) { uint256 ratioFeeOffset = IArkreenRECToken(tokenCART).getRatioFeeOffset(); // Assum ART, cART have the save rate return (actionValue * 10000) / (10000 - ratioFeeOffset); // Add Offset fee } /** * @dev Greenize BTC with the token/amount that the user has approved * @param gbtc Bitcoin block info to be greenized * @param sig Signature of the authority to Bitcoin block info * @param badgeInfo Information that will logged in Arkreen climate badge * @param payInfo Address and amount of the token that will be used to pay for offsetting ART * @param deadline LB0-LB3: The deadline to cancel the transaction, * LB7: 0x80, Open box at same time, gbtc.miner must be the caller if opening box at the same time * LB6: ratio of subsidy */ function authMintGreenBTCWithApprove( GreenBTCInfo calldata gbtc, Sig calldata sig, BadgeInfo calldata badgeInfo, PayInfo calldata payInfo, uint256 deadline ) public ensure(deadline) { uint8 ratio = _mintGreenBTC(deadline, 0x00, gbtc, sig); TransferHelper.safeTransferFrom(payInfo.token, msg.sender, address(this), payInfo.amount); uint256 amountARTwithFee = _getFullARTValue(gbtc.ARTCount); if (ratio != 0) { uint256 amountART = (amountARTwithFee * (100 - ratio) + 99) / 100; // ART mount to pay by caller // buyARTBank(address,address,uint256,uint256,bool): 0x478A55B6 bytes memory builderCallData = abi.encodeWithSelector( 0x478A55B6, payInfo.token, tokenARTSubsidy, payInfo.amount, amountART, false); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); // actionBuilderBadgeWithART(address,uint256,uint256,(address,string,string,string)): 0x6E556DF8 builderCallData = abi.encodeWithSelector(0x6E556DF8, tokenARTSubsidy, amountARTwithFee, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } else { // bit0 = 0: exact ART amount; bit1 = 1: ArkreenBank is used to get CART token; bit2 = 0: Repay to caller uint256 modeAction = 0x02; // actionBuilderBadge(address,address,uint256,uint256,uint256,uint256,(address,string,string,string)): 0x8D7FCEFD bytes memory builderCallData = abi.encodeWithSelector( 0x8D7FCEFD, payInfo.token, tokenCART, payInfo.amount, amountARTwithFee, modeAction, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } } function _checkGBTCData(GreenBTCInfo memory gbtc, uint8 typeTarget) view internal { uint128 height = gbtc.height & ((1<<120) - 1); require(dataGBTC[height].ARTCount == 0, "GBTC: Already Minted"); require((gbtc.greenType & 0xF0) == typeTarget, "GBTC: Wrong ART Type"); } /** * @dev Greenize BTC blocks in batch with the token/amount that the user has approved * @param gbtcList List of the Bitcoin block info to be greenized * @param sig Signature of the authority to Bitcoin block info * @param badgeInfo Information that will logged in Arkreen climate badge, all climate badges use the same info * @param payInfo Address and amount of the token that will be used to pay for offsetting ART of all the GreenBTC blocks * @param deadline LB0-LB3: The deadline to cancel the transaction, LB7: bit8, Open box at same time, bit7, skip if occupied * gbtc.miner must be the caller if opening box at the same time */ function authMintGreenBTCWithApproveBatch( GreenBTCInfo[] calldata gbtcList, Sig calldata sig, BadgeInfo calldata badgeInfo, PayInfo calldata payInfo, uint256 deadline ) public ensure(deadline) { (uint256 amountARTSum, uint8 ratio) = _mintGreenBTCBatch(deadline, 0x00, gbtcList, sig); TransferHelper.safeTransferFrom(payInfo.token, msg.sender, address(this), payInfo.amount); uint256 amountARTwithFee = _getFullARTValue(amountARTSum); if (ratio != 0) { uint256 amountART = (amountARTwithFee * (100 - ratio) + 99) / 100; // ART mount to pay by caller // buyARTBank(address,address,uint256,uint256,bool): 0x478A55B6 bytes memory builderCallData = abi.encodeWithSelector( 0x478A55B6, payInfo.token, tokenARTSubsidy, payInfo.amount, amountART, false); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); // actionBuilderBadgeWithART(address,uint256,uint256,(address,string,string,string)): 0x6E556DF8 builderCallData = abi.encodeWithSelector(0x6E556DF8, tokenARTSubsidy, amountARTwithFee, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } else { // modeAction = 0x02/0x06, bit0 = 0: exact ART amount; bit1 = 1: ArkreenBank is used to get CART token; bit2 = 0: Repay to caller uint256 modeAction = 0x02; // actionBuilderBadge(address,address,uint256,uint256,uint256,uint256,(address,string,string,string)): 0x8D7FCEFD bytes memory builderCallData = abi.encodeWithSelector( 0x8D7FCEFD, payInfo.token, tokenCART, payInfo.amount, amountARTwithFee, modeAction, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); // Pay back to msg.sender already } } function _getSubsidyRatio( uint128 height ) internal view returns (uint8, uint128) { uint8 ratio = uint8(height >> 120); require (ratio <= ratioSubsidyCap, "GBTC: Wrong Ratio!"); height &= (1<<120) - 1; return (ratio, height); } /** * @dev Greenize BTC with specified ART token * @param gbtc Bitcoin block info to be greenized * @param sig Signature of the authority to Bitcoin block info * @param badgeInfo Information that will logged in Arkreen climate badge * @param tokenART Address of the ART token, which should be whitelisted in the accepted list. * @param deadline LB0-LB3: The deadline to cancel the transaction * LB7: 0x80, Open box at same time, gbtc.miner must be the caller if opening box at the same time * LB6: ratio of subsidy */ function authMintGreenBTCWithART( GreenBTCInfo calldata gbtc, Sig calldata sig, BadgeInfo calldata badgeInfo, address tokenART, uint256 deadline ) public ensure(deadline) { require(whiteARTList[tokenART], "GBTC: ART Not Accepted"); uint8 ratio = _mintGreenBTC(deadline, 0x10, gbtc, sig); uint256 amountART = _getFullARTValue(gbtc.ARTCount); TransferHelper.safeTransferFrom(tokenART, msg.sender, address(this), amountART * (100 - ratio) / 100); // actionBuilderBadgeWithART(address,uint256,uint256,(address,string,string,string)): 0x6E556DF8 bytes memory builderCallData = abi.encodeWithSelector(0x6E556DF8, tokenART, amountART, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } /** * @dev Greenize multiple BTC blocks with specified ART token * @param gbtcList Information of the Bitcoin blocks to be greenized * @param sig Signature of the authority to Bitcoin block info * @param badgeInfo Information that will logged in Arkreen climate badge, used for all the blocks * @param tokenART Address of the ART token, which should be whitelisted in the accepted list. * @param deadline The deadline to cancel the transaction * @param deadline LB0-LB3: The deadline to cancel the transaction, LB7: bit8, Open box at same time, bit7, skip if occupied * gbtc.miner must be the caller if opening box at the same time */ function authMintGreenBTCWithARTBatch( GreenBTCInfo[] calldata gbtcList, Sig calldata sig, BadgeInfo calldata badgeInfo, address tokenART, uint256 deadline ) public ensure(deadline) { require(whiteARTList[tokenART], "GBTC: ART Not Accepted"); (uint256 amountARTSum, uint8 ratio) = _mintGreenBTCBatch(deadline, 0x10, gbtcList, sig); uint256 amountART = _getFullARTValue(amountARTSum); TransferHelper.safeTransferFrom(tokenART, msg.sender, address(this), amountART * (100 - ratio) / 100); // actionBuilderBadgeWithART(address,uint256,uint256,(address,string,string,string)): 0x6E556DF8 bytes memory builderCallData = abi.encodeWithSelector(0x6E556DF8, tokenART, amountART, uint32(deadline), badgeInfo); _actionBuilderBadge(abi.encodePacked(builderCallData, _msgSender())); } /** * @dev Open the Green Bitcoin box, only thw owner of the box acceptable. * @param tokenID ID of the NFT token to be opened */ function openBox(uint256 tokenID) public { // Can not put into Pro as called locally require(msg.sender == ownerOf(tokenID), "GBTC: Not Owner"); require(dataNFT[tokenID].open == false, "GBTC: Already Opened"); OpenInfo memory openInfo = OpenInfo(uint64(tokenID), uint64(block.number)); openingBoxList.push(openInfo); dataNFT[tokenID].open = true; dataNFT[tokenID].opener = msg.sender; emit OpenBox(msg.sender, tokenID, block.number); } /** * @dev Reveal all the opened boxes stored internally. All overtime boxes will be moved to another list. * waiting for another revealing with hash value. */ function revealBoxes() public { callGreenBTCPro(greenBTCPro); } /* * @dev Reveal the overtime boxes given in the input list. * @param tokenList All the token IDs of the NFT to be revealed. * @param hashList All the hash values of the block next after to block the NFT is minted. */ // Warning is kept just for explorer decoding function revealBoxesWithHash( uint256[] calldata tokenList, uint256[] calldata hashList ) public { // onlyManager is checked in Pro _revealBoxesWithHashMute(tokenList, hashList); // To mute compilation warning callGreenBTCPro(greenBTCPro); } function _revealBoxesWithHashMute(uint256[] calldata tokenList, uint256[] calldata hashList) internal {} /** * @dev Set new caps */ function setNewCaps(uint256 newNormalCap, uint256 newOvertimeCap, uint256 newRemoveCap) public { // onlyOwner _setNewCapsMute(newNormalCap, newOvertimeCap, newRemoveCap); // To mute compilation warning callGreenBTCPro(greenBTCPro); } function _setNewCapsMute(uint256 newNormalCap, uint256 newOvertimeCap, uint256 newRemoveCap) internal {} /** * @dev Return all the boxes waiting for revealing. */ function getOpeningBoxList() public view returns (OpenInfo[] memory) { return openingBoxList; } /** * @dev Return all the boxes waiting for revealing with hash value */ function getOvertimeBoxList() public view returns (OpenInfo[] memory) { return overtimeBoxList; } /** * @dev Return the number of the opened box in the opening list to be opened. * If the return value is non-zero, need to call revealBoxes repeatly */ function getOpeningOvertimed() public view returns (uint256) { return openingBoxListOffset; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenID) public view override returns (string memory) { require(dataGBTC[tokenID].minter != address(0), "GBTC: Not Minted"); return IGreenBTCImage(greenBtcImage).getCertificateSVG(ownerOf(tokenID), dataGBTC[tokenID], dataNFT[tokenID]); } /** * @dev Return if the specified token is sold, opened and revealed */ function isUnPacking(uint256 tokenID) public view returns(bool, bool, bool) { if (dataGBTC[tokenID].ARTCount == 0) { return (false, false, false); } else{ return (true, dataNFT[tokenID].open, dataNFT[tokenID].reveal); } } /** * @dev Mint the GreenBTC NFT based on the GreenBTC info * @param gbtc Green BTC information */ function _mintNFT(GreenBTCInfo memory gbtc, uint8 ratioSubsidy) internal { require(gbtc.minter != address(0), "GBTC: Zero Minter"); dataGBTC[gbtc.height] = gbtc; NFTStatus memory nft; nft.blockHeight = uint64(gbtc.height); nft.ratioSubsidy = ratioSubsidy; dataNFT[gbtc.height] = nft; _mint(gbtc.minter, gbtc.height); emit GreenBitCoin(gbtc.height, gbtc.ARTCount, gbtc.minter, gbtc.greenType); } /** * @dev Verify the signature of authority based on the GreenBTC info * @param gbtc Green BTC information * @param sig Signature of the authority */ function _authVerify(GreenBTCInfo memory gbtc, Sig calldata sig) internal view { bytes32 greenBTCHash = keccak256(abi.encode(GREEN_BTC_TYPEHASH, gbtc.height, gbtc.energyStr, gbtc.ARTCount, gbtc.blockTime, gbtc.minter, gbtc.greenType)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, greenBTCHash)); address recoveredAddress = ecrecover(digest, sig.v, sig.r, sig.s); require(recoveredAddress == authorizer, "GBTC: Invalid Singature"); } /** * @dev Verify the signature of authority based on the GreenBTC info, and mint the BTC block NFT * @param option the option to mint GreeenBTC block, if Open simultaneouly * @param typeTarget Type of the ART token; = 0x00, cART; = 0x10, ART token * @param gbtc the Bitcoin block info to be minted * @param sig Signature of the authority */ function _mintGreenBTC( uint256 option, uint8 typeTarget, GreenBTCInfo memory gbtc, Sig calldata sig ) internal returns(uint8) { _checkGBTCData(gbtc, typeTarget); _authVerify(gbtc, sig); (uint8 ratio, uint128 height) = _getSubsidyRatio(gbtc.height); if( ratio != 0) gbtc.height = height; _mintNFT(gbtc, ratio); if((option >> 63) !=0) openBox(gbtc.height); return ratio; } /** * @dev Verify the signature of authority based on the GreenBTC info list, and mint the BTC block list * @param option the option to mint GreeenBTC block, if Open simultaneouly, if skip while occupied * @param typeTarget Type of the ART token; = 0x00, cART; = 0x01, ART token * @param gbtcList List of the Bitcoin block info to be minted * @param sig Signature of the authority */ function _mintGreenBTCBatch( uint256 option, uint8 typeTarget, GreenBTCInfo[] memory gbtcList, Sig calldata sig ) internal returns(uint256 amountARTSum, uint8 ratio) { bytes memory greenBTCData = abi.encode(GREENBTC_BATCH_TYPEHASH, gbtcList); bytes32 greenBTCHash = keccak256(greenBTCData); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, greenBTCHash)); address recoveredAddress = ecrecover(digest, sig.v, sig.r, sig.s); require(recoveredAddress == authorizer, "GBTC: Invalid Singature"); bool ifOpen = (option & (1<<63)) != 0; bool ifSkip = (option & (1<<62)) != 0; uint128 height; (ratio, height) = _getSubsidyRatio(gbtcList[0].height); if( ratio != 0) gbtcList[0].height = height; for(uint256 index = 0; index < gbtcList.length; index++) { GreenBTCInfo memory gbtc = gbtcList[index]; // skip if occupied in skipping option if(ifSkip && (dataGBTC[gbtc.height].ARTCount != 0)) continue; _checkGBTCData(gbtc, typeTarget); _mintNFT(gbtc, ratio); if(ifOpen) openBox(gbtc.height); amountARTSum += gbtcList[index].ARTCount; } require(amountARTSum != 0, "GBTC: No Block Available"); } /** * @dev Add or remove the acceptable ART tokens * @param tokenARTList ART list to add or rmeove * @param addOrRemove = 0, to remove; = 1, to add */ function mangeARTTokens(address[] calldata tokenARTList, bool addOrRemove) external { // onlyOwner _mangeARTTokensMute(tokenARTList, addOrRemove); // no code size because optimization callGreenBTCPro(greenBTCPro); } function _mangeARTTokensMute(address[] calldata tokenARTList, bool addOrRemove) internal {} /** * @dev Call arkreenBuilder with the specified calldata * @param builderCallData Call data passed to arkreenBuilder */ function _actionBuilderBadge(bytes memory builderCallData) internal { (bool success, bytes memory returndata) = arkreenBuilder.call(builderCallData); if (!success) { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert("GBTC: Error Call to actionBuilder"); } } } /** * @dev Get the price and sold amount of the specified ART versus the payment token * @param tokenART ART token * @param tokenPay Payment token */ function getPrice(address tokenART, address tokenPay) external view returns(uint128 price, uint128 received) { address artBank = IArkreenBuilder(arkreenBuilder).artBank(); (price, received) = IArkreenRECBank(artBank).saleIncome(tokenART, tokenPay); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate that the this implementation remains valid after an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @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. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` 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 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: 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 Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./GreenBTCType.sol"; abstract contract GreenBTCStorage { //keccak256("GreenBitCoin(uint256 height,string energyStr,uint256 artCount,string blockTime,address minter,uint8 greenType)"); bytes32 constant GREEN_BTC_TYPEHASH = 0xE645798FE54DB29ED50FD7F01A05DE6D1C5A65FAC8902DCFD7427B30FBD87C24; //keccak256("GreenBitCoinBatch((uint128,uint128,address,uint8,string,string)[])"); bytes32 constant GREENBTC_BATCH_TYPEHASH = 0x829ABF7A83FCBCF66649914B5A9A514ACBF6BEDA598A620AEF732202E8155D73; string constant NAME = "Green BTC Club"; string constant SYMBOL = "GBC"; string constant VERSION = "1"; bytes32 public DOMAIN_SEPARATOR; address public manager; address public authorizer; address public greenBtcImage; address public arkreenBuilder; address public tokenCART; // CART token is bought to greenize Bitcoin by default while some other token is paid. address public tokenNative; OpenInfo[] internal openingBoxList; // Box in this list could be opened internally with just a trigger command OpenInfo[] internal overtimeBoxList; // Box in this list need to be revealed with external hash information mapping (uint256 => GreenBTCInfo) public dataGBTC; mapping (uint256 => NFTStatus) public dataNFT; mapping(address => bool) public whiteARTList; // ART token -> true/false uint256 public luckyRate; uint256 internal openingBoxListOffset; uint256 public overtimeRevealCap; uint256 public normalRevealCap; uint256 public removeRevealCap; address public greenBTCPro; // Pro function of Green uint8 public ratioSubsidyCap; address public tokenARTSubsidy; // ART token for subsidy }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; struct GreenBTCInfo { uint128 height; uint128 ARTCount; address minter; // Minter of the respective NFT uint8 greenType; // High nibble: ART type: 0, CART, 1, Arkreen ART; Low nibble: mint type, 1: system, 2: user; string blockTime; // For NFT display string energyStr; // For NFT display } struct NFTStatus { address opener; uint64 blockHeight; bool open; bool reveal; bool won; uint8 ratioSubsidy; // ratio of the subsidy from GreenBTC, 0-90 in percentage uint256 seed; } struct OpenInfo { uint64 tokenID; // The token ID of the NFT opened uint64 openHeight; // The height of the block opening the NFT } struct Sig { uint8 v; bytes32 r; bytes32 s; } struct PayInfo { address token; uint256 amount; } struct BadgeInfo { address beneficiary; string offsetEntityID; string beneficiaryID; string offsetMessage; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IArkreenBuilder { function artBank() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IArkreenRECBank { struct Signature { address token; uint256 value; uint256 deadline; uint8 v; bytes32 r; bytes32 s; } function buyART( address tokenPay, address tokenART, uint256 amountPay, uint256 amountART, bool isExactPay ) external; function buyARTNative( address tokenART, uint256 amountART, bool isExactPay ) external payable; function buyARTWithPermit( address tokenART, uint256 amountART, bool isExactPay, Signature calldata permitToPay ) external; function saleIncome( address tokenART, address tokenPay ) external view returns (uint128 priceForSale, uint128 amountReceived); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IArkreenRECToken { function getRatioFeeOffset() external view returns (uint256); function commitOffset(uint256) external returns (uint256); function commitOffsetFrom(address, uint256) external returns (uint256); function offsetAndMintCertificate( address beneficiary, string calldata offsetEntityID, string calldata beneficiaryID, string calldata offsetMessage, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "../GreenBTCType.sol"; interface IGreenBTCImage { function getCertificateSVG(address owner, GreenBTCInfo calldata gbtc, NFTStatus calldata dataNFT) external pure returns(string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; function balanceOf(address) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; library FormattedStrings { /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. Base on OpenZeppelin `toString` method from `String` library */ function toFormattedString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } uint256 pos; uint256 comas = digits / 3; digits = digits + (digits % 3 == 0 ? comas - 1 : comas); bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; if (pos == 3) { buffer[digits] = ","; pos = 0; } else { buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; pos++; } } return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 0 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"height","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ARTCount","type":"uint256"},{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint8","name":"greenType","type":"uint8"}],"name":"GreenBitCoin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"opener","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"OpenBox","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":"revealList","type":"uint256[]"},{"indexed":false,"internalType":"bool[]","name":"wonList","type":"bool[]"}],"name":"RevealBoxes","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"approveBuilder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"arkreenBuilder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"internalType":"struct GreenBTCInfo","name":"gbtc","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Sig","name":"sig","type":"tuple"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"string","name":"offsetEntityID","type":"string"},{"internalType":"string","name":"beneficiaryID","type":"string"},{"internalType":"string","name":"offsetMessage","type":"string"}],"internalType":"struct BadgeInfo","name":"badgeInfo","type":"tuple"},{"internalType":"address","name":"tokenART","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"authMintGreenBTCWithART","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"internalType":"struct GreenBTCInfo[]","name":"gbtcList","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Sig","name":"sig","type":"tuple"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"string","name":"offsetEntityID","type":"string"},{"internalType":"string","name":"beneficiaryID","type":"string"},{"internalType":"string","name":"offsetMessage","type":"string"}],"internalType":"struct BadgeInfo","name":"badgeInfo","type":"tuple"},{"internalType":"address","name":"tokenART","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"authMintGreenBTCWithARTBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"internalType":"struct GreenBTCInfo","name":"gbtc","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Sig","name":"sig","type":"tuple"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"string","name":"offsetEntityID","type":"string"},{"internalType":"string","name":"beneficiaryID","type":"string"},{"internalType":"string","name":"offsetMessage","type":"string"}],"internalType":"struct BadgeInfo","name":"badgeInfo","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct PayInfo","name":"payInfo","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"authMintGreenBTCWithApprove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"internalType":"struct GreenBTCInfo[]","name":"gbtcList","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Sig","name":"sig","type":"tuple"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"string","name":"offsetEntityID","type":"string"},{"internalType":"string","name":"beneficiaryID","type":"string"},{"internalType":"string","name":"offsetMessage","type":"string"}],"internalType":"struct BadgeInfo","name":"badgeInfo","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct PayInfo","name":"payInfo","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"authMintGreenBTCWithApproveBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"internalType":"struct GreenBTCInfo","name":"gbtc","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Sig","name":"sig","type":"tuple"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"string","name":"offsetEntityID","type":"string"},{"internalType":"string","name":"beneficiaryID","type":"string"},{"internalType":"string","name":"offsetMessage","type":"string"}],"internalType":"struct BadgeInfo","name":"badgeInfo","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"authMintGreenBTCWithNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"authorizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dataGBTC","outputs":[{"internalType":"uint128","name":"height","type":"uint128"},{"internalType":"uint128","name":"ARTCount","type":"uint128"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint8","name":"greenType","type":"uint8"},{"internalType":"string","name":"blockTime","type":"string"},{"internalType":"string","name":"energyStr","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dataNFT","outputs":[{"internalType":"address","name":"opener","type":"address"},{"internalType":"uint64","name":"blockHeight","type":"uint64"},{"internalType":"bool","name":"open","type":"bool"},{"internalType":"bool","name":"reveal","type":"bool"},{"internalType":"bool","name":"won","type":"bool"},{"internalType":"uint8","name":"ratioSubsidy","type":"uint8"},{"internalType":"uint256","name":"seed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOpeningBoxList","outputs":[{"components":[{"internalType":"uint64","name":"tokenID","type":"uint64"},{"internalType":"uint64","name":"openHeight","type":"uint64"}],"internalType":"struct OpenInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOpeningOvertimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOvertimeBoxList","outputs":[{"components":[{"internalType":"uint64","name":"tokenID","type":"uint64"},{"internalType":"uint64","name":"openHeight","type":"uint64"}],"internalType":"struct OpenInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenART","type":"address"},{"internalType":"address","name":"tokenPay","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"received","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"greenBTCPro","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"greenBtcImage","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"authority","type":"address"},{"internalType":"address","name":"builder","type":"address"},{"internalType":"address","name":"cART","type":"address"},{"internalType":"address","name":"native","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"isUnPacking","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"luckyRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenARTList","type":"address[]"},{"internalType":"bool","name":"addOrRemove","type":"bool"}],"name":"mangeARTTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"normalRevealCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"openBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"overtimeRevealCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ratioSubsidyCap","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeRevealCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealBoxes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenList","type":"uint256[]"},{"internalType":"uint256[]","name":"hashList","type":"uint256[]"}],"name":"revealBoxesWithHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSubsidyART","type":"address"}],"name":"setARTContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAuthAddress","type":"address"}],"name":"setAuthorizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newCARTToken","type":"address"}],"name":"setCARTContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGreenBTCPro","type":"address"}],"name":"setGreenBTCPro","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImageContract","type":"address"}],"name":"setImageContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"setLuckyRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newNormalCap","type":"uint256"},{"internalType":"uint256","name":"newOvertimeCap","type":"uint256"},{"internalType":"uint256","name":"newRemoveCap","type":"uint256"}],"name":"setNewCaps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRatioSubsidyCap","type":"uint256"}],"name":"setRatioSubsidyCap","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenARTSubsidy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCART","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenNative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whiteARTList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051615711620001206000396000818161105d0152818161109d015281816111f10152818161123101526117c901526157116000f3fe6080604052600436106102d35760003560e01c806301ffc9a7146102d857806303e0ee241461030d578063058a628f1461033257806306d8a5881461035457806306fdde0314610367578063081812fc14610389578063095ea7b3146103c15780631719c3c2146103e157806318160ddd146103f8578063187096781461040e5780631a2b54461461042e57806323b872dd1461044f5780632de659191461046f5780632f745c59146104845780633644e515146104a45780633659cfe6146104bb57806342842e0e146104db578063481c6a75146104fb5780634ac7ceaa1461051c5780634f1ef2861461053c5780634f6ccce71461054f578063508899721461056f57806350d7b22c1461058f57806351b44baf146105af57806352d1902d146105cf57806353bf9014146105e45780636352211e146105fa578063647677ce1461061a5780636864c6b41461063157806368f50b8a1461065157806370a0823114610672578063715018a6146106925780637f9a105c146106a757806387bbc498146106c75780638b95e507146106e95780638cefb3c0146107095780638da5cb5b146107295780639526b6381461073e57806395d89b411461075e578063a22cb46514610773578063ac41865a14610793578063b1e5e2b7146107d3578063b88d4fde146107f3578063ba43b8b114610813578063bcb56ae214610828578063c0e9031714610848578063c12f51841461087c578063c360f55c1461089c578063c62c3abe146108bd578063c87b56dd146108dd578063cda4498e146108fd578063cf27fb3c14610918578063d09edf3114610949578063d0ebdbe71461096a578063e0dce49e1461098a578063e3639229146109ab578063e985e9c5146109ea578063f08380fc14610a0a578063f2fde38b14610a2b578063f54abe6f14610a4b578063f78c945814610a6c578063f8c8765e14610a9e578063fb253b3214610abe578063ff6c079214610b8c575b600080fd5b3480156102e457600080fd5b506102f86102f3366004614221565b610ba3565b60405190151581526020015b60405180910390f35b34801561031957600080fd5b5061032461016e5481565b604051908152602001610304565b34801561033e57600080fd5b5061035261034d366004614263565b610bce565b005b6103526103623660046142bc565b610c28565b34801561037357600080fd5b5061037c610d8d565b6040516103049190614390565b34801561039557600080fd5b506103a96103a43660046143a3565b610e1f565b6040516001600160a01b039091168152602001610304565b3480156103cd57600080fd5b506103526103dc3660046143bc565b610e46565b3480156103ed57600080fd5b5061032461016b5481565b34801561040457600080fd5b5061012f54610324565b34801561041a57600080fd5b506103526104293660046143e8565b610f5c565b34801561043a57600080fd5b50610171546103a9906001600160a01b031681565b34801561045b57600080fd5b5061035261046a366004614414565b610f72565b34801561047b57600080fd5b50610352610fa3565b34801561049057600080fd5b5061032461049f3660046143bc565b610fbb565b3480156104b057600080fd5b5061032461015f5481565b3480156104c757600080fd5b506103526104d6366004614263565b611052565b3480156104e757600080fd5b506103526104f6366004614414565b61111b565b34801561050757600080fd5b50610160546103a9906001600160a01b031681565b34801561052857600080fd5b506103526105373660046144a0565b611136565b61035261054a3660046145c0565b6111e6565b34801561055b57600080fd5b5061032461056a3660046143a3565b6112a0565b34801561057b57600080fd5b5061035261058a366004614621565b611335565b34801561059b57600080fd5b506103526105aa3660046146b0565b611552565b3480156105bb57600080fd5b506103526105ca366004614263565b61176b565b3480156105db57600080fd5b506103246117bc565b3480156105f057600080fd5b5061016c54610324565b34801561060657600080fd5b506103a96106153660046143a3565b61186a565b34801561062657600080fd5b5061032461016f5481565b34801561063d57600080fd5b5061035261064c366004614263565b61189f565b34801561065d57600080fd5b50610165546103a9906001600160a01b031681565b34801561067e57600080fd5b5061032461068d366004614263565b6118f0565b34801561069e57600080fd5b50610352611976565b3480156106b357600080fd5b506103526106c2366004614263565b611988565b3480156106d357600080fd5b506106dc6119d9565b6040516103049190614748565b3480156106f557600080fd5b506103526107043660046147a4565b611a50565b34801561071557600080fd5b506103526107243660046143a3565b611a6c565b34801561073557600080fd5b506103a9611add565b34801561074a57600080fd5b5061035261075936600461480f565b611aec565b34801561076a57600080fd5b5061037c611c01565b34801561077f57600080fd5b5061035261078e3660046148b7565b611c10565b34801561079f57600080fd5b506107b36107ae3660046148f0565b611c1b565b604080516001600160801b03938416815292909116602083015201610304565b3480156107df57600080fd5b506103526107ee3660046143a3565b611d37565b3480156107ff57600080fd5b5061035261080e36600461491e565b611eda565b34801561081f57600080fd5b506106dc611f0c565b34801561083457600080fd5b50610352610843366004614989565b611f79565b34801561085457600080fd5b506101705461086a90600160a01b900460ff1681565b60405160ff9091168152602001610304565b34801561088857600080fd5b506103526108973660046143a3565b612076565b3480156108a857600080fd5b50610164546103a9906001600160a01b031681565b3480156108c957600080fd5b506103526108d8366004614263565b6120c6565b3480156108e957600080fd5b5061037c6108f83660046143a3565b612117565b34801561090957600080fd5b50610352610429366004614a18565b34801561092457600080fd5b506102f8610933366004614263565b61016a6020526000908152604090205460ff1681565b34801561095557600080fd5b50610161546103a9906001600160a01b031681565b34801561097657600080fd5b50610352610985366004614263565b612221565b34801561099657600080fd5b50610163546103a9906001600160a01b031681565b3480156109b757600080fd5b506109cb6109c63660046143a3565b612272565b6040805193151584529115156020840152151590820152606001610304565b3480156109f657600080fd5b506102f8610a053660046148f0565b6122da565b348015610a1657600080fd5b50610162546103a9906001600160a01b031681565b348015610a3757600080fd5b50610352610a46366004614263565b612309565b348015610a5757600080fd5b50610170546103a9906001600160a01b031681565b348015610a7857600080fd5b50610a8c610a873660046143a3565b61237f565b60405161030496959493929190614a6e565b348015610aaa57600080fd5b50610352610ab9366004614ad1565b6124e3565b348015610aca57600080fd5b50610b3b610ad93660046143a3565b61016960205260009081526040902080546001909101546001600160a01b038216916001600160401b03600160a01b8204169160ff600160e01b8304811692600160e81b8104821692600160f01b8204831692600160f81b9092049091169087565b604080516001600160a01b0390981688526001600160401b0390961660208801529315159486019490945290151560608501521515608084015260ff90911660a083015260c082015260e001610304565b348015610b9857600080fd5b5061032461016d5481565b60006001600160e01b0319821663780e9d6360e01b1480610bc85750610bc88261278e565b92915050565b610bd66127de565b6001600160a01b038116610c055760405162461bcd60e51b8152600401610bfc90614b2d565b60405180910390fd5b61016180546001600160a01b0319166001600160a01b0392909216919091179055565b80428163ffffffff161015610c4f5760405162461bcd60e51b8152600401610bfc90614b59565b610c64826000610c5e88614c63565b8761283d565b5061016560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cb657600080fd5b505af1158015610cca573d6000803e3d6000fd5b505061016554610164546003945060009350638d7fcefd92506001600160a01b03918216911634610d12610d0460408d0160208e01614c6f565b6001600160801b03166128b3565b86898b604051602401610d2b9796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050610d8481335b604051602001610d70929190614dce565b604051602081830303815290604052612968565b50505050505050565b606060fb8054610d9c90614e00565b80601f0160208091040260200160405190810160405280929190818152602001828054610dc890614e00565b8015610e155780601f10610dea57610100808354040283529160200191610e15565b820191906000526020600020905b815481529060010190602001808311610df857829003601f168201915b5050505050905090565b6000610e2a82612a39565b50600090815260ff60205260409020546001600160a01b031690565b6000610e518261186a565b9050806001600160a01b0316836001600160a01b03161415610ebf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610bfc565b336001600160a01b0382161480610edb5750610edb81336122da565b610f4d5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610bfc565b610f578383612a5e565b505050565b61017054610f57906001600160a01b0316612acc565b610f7c3382612af0565b610f985760405162461bcd60e51b8152600401610bfc90614e35565b610f57838383612b4e565b61017054610fb9906001600160a01b0316612acc565b565b6000610fc6836118f0565b82106110285760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610bfc565b506001600160a01b0391909116600090815261012d60209081526040808320938352929052205490565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561109b5760405162461bcd60e51b8152600401610bfc90614e83565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110cd612ce3565b6001600160a01b0316146110f35760405162461bcd60e51b8152600401610bfc90614ebd565b6110fc81612cff565b6040805160008082526020820190925261111891839190612d07565b50565b610f5783838360405180602001604052806000815250611eda565b61113e6127de565b610163546001600160a01b031661118a5760405162461bcd60e51b815260206004820152601060248201526f23a12a219d10273790213ab4b63232b960811b6044820152606401610bfc565b60005b81811015610f57576111d48383838181106111aa576111aa614ef7565b90506020020160208101906111bf9190614263565b610163546001600160a01b0316600019612e81565b806111de81614f23565b91505061118d565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561122f5760405162461bcd60e51b8152600401610bfc90614e83565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611261612ce3565b6001600160a01b0316146112875760405162461bcd60e51b8152600401610bfc90614ebd565b61129082612cff565b61129c82826001612d07565b5050565b60006112ac61012f5490565b821061130f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610bfc565b61012f828154811061132357611323614ef7565b90600052602060002001549050919050565b80428163ffffffff16101561135c5760405162461bcd60e51b8152600401610bfc90614b59565b6000611372838261136c8a614c63565b8961283d565b90506113906113846020860186614263565b33308760200135612f95565b60006113a5610d0460408a0160208b01614c6f565b905060ff8216156114c157600060646113be8482614f3e565b6113cb9060ff1684614f61565b6113d6906063614f80565b6113e09190614f98565b9050600063478a55b66113f66020890189614263565b6101715460405161141f92916001600160a01b03169060208c0135908790600090602401614fba565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114578133610d5f565b61017154604051636e556df891611482916001600160a01b039091169086908a908d90602401614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114ba8133610d5f565b5050611548565b60026000638d7fcefd6114d76020890189614263565b61016460009054906101000a90046001600160a01b0316896020013586868b8e60405160240161150d9796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506115458133610d5f565b50505b5050505050505050565b80428163ffffffff1610156115795760405162461bcd60e51b8152600401610bfc90614b59565b600080611591848261158b8b8d61501e565b8a6130c5565b90925090506115b26115a66020870187614263565b33308860200135612f95565b60006115bd836128b3565b905060ff8216156116d957600060646115d68482614f3e565b6115e39060ff1684614f61565b6115ee906063614f80565b6115f89190614f98565b9050600063478a55b661160e60208a018a614263565b6101715460405161163792916001600160a01b03169060208d0135908790600090602401614fba565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061166f8133610d5f565b61017154604051636e556df89161169a916001600160a01b039091169086908b908e90602401614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506116d28133610d5f565b5050611545565b60026000638d7fcefd6116ef60208a018a614263565b61016460009054906101000a90046001600160a01b03168a6020013586868c8f6040516024016117259796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061175d8133610d5f565b505050505050505050505050565b6117736127de565b6001600160a01b0381166117995760405162461bcd60e51b8152600401610bfc90614b2d565b61016480546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118575760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610bfc565b5060008051602061569e83398151915290565b600081815260fd60205260408120546001600160a01b031680610bc85760405162461bcd60e51b8152600401610bfc906150a1565b6118a76127de565b6001600160a01b0381166118cd5760405162461bcd60e51b8152600401610bfc90614b2d565b61017180546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821661195a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610bfc565b506001600160a01b0316600090815260fe602052604090205490565b61197e6127de565b610fb96000613398565b6119906127de565b6001600160a01b0381166119b65760405162461bcd60e51b8152600401610bfc90614b2d565b61016280546001600160a01b0319166001600160a01b0392909216919091179055565b6060610166805480602002602001604051908101604052809291908181526020016000905b82821015611a4757600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b90910416818301528252600190920191016119fe565b50505050905090565b61017054611a66906001600160a01b0316612acc565b50505050565b611a746127de565b605a811115611abc5760405162461bcd60e51b8152602060048201526014602482015273474254433a20546f6f204d6f726520526174696f60601b6044820152606401610bfc565b610170805460ff909216600160a01b0260ff60a01b19909216919091179055565b6097546001600160a01b031690565b80428163ffffffff161015611b135760405162461bcd60e51b8152600401610bfc90614b59565b6001600160a01b038316600090815261016a602052604090205460ff16611b4c5760405162461bcd60e51b8152600401610bfc906150d3565b600080611b5f84601061158b8b8d61501e565b915091506000611b6e836128b3565b9050611b9e8633306064611b828782614f3e565b611b8f9060ff1687614f61565b611b999190614f98565b612f95565b6000636e556df88783888b604051602401611bbc9493929190614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050611bf48133610d5f565b5050505050505050505050565b606060fc8054610d9c90614e00565b61129c3383836133ea565b600080600061016360009054906101000a90046001600160a01b03166001600160a01b031663678aa4f36040518163ffffffff1660e01b815260040160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190615103565b604051633612cf2560e01b81526001600160a01b038781166004830152868116602483015291925090821690633612cf2590604401604080518083038186803b158015611cf357600080fd5b505afa158015611d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2b9190615120565b90969095509350505050565b611d408161186a565b6001600160a01b0316336001600160a01b031614611d925760405162461bcd60e51b815260206004820152600f60248201526e23a12a219d102737ba1027bbb732b960891b6044820152606401610bfc565b60008181526101696020526040902054600160e01b900460ff1615611df05760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e4813dc195b995960621b6044820152606401610bfc565b6040805180820182526001600160401b0383811682524380821660208085019182526101668054600181018255600091825286517fa5a4c57b7184ec73d55be4993773cb4eef681bc86a28d0285cd66efb50676a97909101805494518716600160401b026001600160801b0319909516919096161792909217909355858152610169835284902080546001600160a01b0360ff60e01b01191633908117600160e01b17909155845190815291820185905292810192909252907f66b10d9ff37b599d2105c94c297dc6149f44b851df44d93080dc0833ba8e6e919060600160405180910390a15050565b611ee43383612af0565b611f005760405162461bcd60e51b8152600401610bfc90614e35565b611a66848484846134b6565b60606101678054806020026020016040519081016040528092919081815260200160009082821015611a4757600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b90910416818301528252600190920191016119fe565b80428163ffffffff161015611fa05760405162461bcd60e51b8152600401610bfc90614b59565b6001600160a01b038316600090815261016a602052604090205460ff16611fd95760405162461bcd60e51b8152600401610bfc906150d3565b6000611fea83601061136c8a614c63565b90506000612001610d0460408a0160208b01614c6f565b90506120158533306064611b828782614f3e565b6000636e556df88683878a6040516024016120339493929190614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061206b8133610d5f565b505050505050505050565b61207e6127de565b60148111156120c05760405162461bcd60e51b815260206004820152600e60248201526d474254433a20546f6f204d6f726560901b6044820152606401610bfc565b61016b55565b6120ce6127de565b6001600160a01b0381166120f45760405162461bcd60e51b8152600401610bfc90614b2d565b61017080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815261016860205260409020600101546060906001600160a01b03166121755760405162461bcd60e51b815260206004820152601060248201526f11d09510ce88139bdd08135a5b9d195960821b6044820152606401610bfc565b610162546001600160a01b03166342aee6bb6121908461186a565b6000858152610168602090815260408083206101699092529182902091516001600160e01b031960e086901b1681526121cd9392906004016151ef565b60006040518083038186803b1580156121e557600080fd5b505afa1580156121f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bc891908101906152e1565b6122296127de565b6001600160a01b03811661224f5760405162461bcd60e51b8152600401610bfc90614b2d565b61016080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152610168602052604081205481908190600160801b90046001600160801b03166122a8575060009150819050806122d3565b5050506000818152610169602052604090205460019060ff600160e01b8204811691600160e81b9004165b9193909250565b6001600160a01b0391821660009081526101006020908152604080832093909416825291909152205460ff1690565b6123116127de565b6001600160a01b0381166123765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bfc565b61111881613398565b610168602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b90950416936001600160a01b03841693600160a01b900460ff169290916123d290614e00565b80601f01602080910402602001604051908101604052809291908181526020018280546123fe90614e00565b801561244b5780601f106124205761010080835404028352916020019161244b565b820191906000526020600020905b81548152906001019060200180831161242e57829003601f168201915b50505050509080600301805461246090614e00565b80601f016020809104026020016040519081016040528092919081815260200182805461248c90614e00565b80156124d95780601f106124ae576101008083540402835291602001916124d9565b820191906000526020600020905b8154815290600101906020018083116124bc57829003601f168201915b5050505050905086565b600054610100900460ff16158080156125035750600054600160ff909116105b806125245750612512306134e9565b158015612524575060005460ff166001145b6125875760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bfc565b6000805460ff1916600117905580156125aa576000805461ff0019166101001790555b6125b26134f8565b6125ba61351f565b6126056040518060400160405280600e81526020016d23b932b2b710212a219021b63ab160911b8152506040518060400160405280600381526020016247424360e81b81525061354f565b604080518082018252600e81526d23b932b2b710212a219021b63ab160911b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa24958b5bf039b27bb75556bcf8b8d2620327722d5e05db3d9e9f0557b49ab71818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012061015f556126e3611add565b61016080546001600160a01b03199081166001600160a01b03938416179091556101618054821688841617905561016380548216878416179055610164805482168684161790556101658054909116918416919091179055600561016b558015612787576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006001600160e01b031982166380ac58cd60e01b14806127bf57506001600160e01b03198216635b5e139f60e01b145b80610bc857506301ffc9a760e01b6001600160e01b0319831614610bc8565b336127e7611add565b6001600160a01b031614610fb95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bfc565b6000612849838561359d565b612853838361365c565b600080612863856000015161379c565b915091508160ff1660001461287f576001600160801b03811685525b612889858361380e565b603f87901c156128a75784516128a7906001600160801b0316611d37565b5090505b949350505050565b60008061016460009054906101000a90046001600160a01b03166001600160a01b0316632f0e0a726040518163ffffffff1660e01b815260040160206040518083038186803b15801561290557600080fd5b505afa158015612919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293d919061534e565b905061294b81612710615367565b61295784612710614f61565b6129619190614f98565b9392505050565b6101635460405160009182916001600160a01b039091169061298b90859061537e565b6000604051808303816000865af19150503d80600081146129c8576040519150601f19603f3d011682016040523d82523d6000602084013e6129cd565b606091505b509150915081610f57578051156129e75780518082602001fd5b60405162461bcd60e51b815260206004820152602160248201527f474254433a204572726f722043616c6c20746f20616374696f6e4275696c64656044820152603960f91b6064820152608401610bfc565b612a4281613a97565b6111185760405162461bcd60e51b8152600401610bfc906150a1565b600081815260ff6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612a938261186a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b3660008037600080366000845af43d6000803e808015612aeb573d6000f35b3d6000fd5b600080612afc8361186a565b9050806001600160a01b0316846001600160a01b03161480612b235750612b2381856122da565b806128ab5750836001600160a01b0316612b3c84610e1f565b6001600160a01b031614949350505050565b826001600160a01b0316612b618261186a565b6001600160a01b031614612bc55760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610bfc565b6001600160a01b038216612c275760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610bfc565b612c32838383613ab4565b612c3d600082612a5e565b6001600160a01b038316600090815260fe60205260408120805460019290612c66908490615367565b90915550506001600160a01b038216600090815260fe60205260408120805460019290612c94908490614f80565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206156e583398151915291a4505050565b60008051602061569e833981519152546001600160a01b031690565b6111186127de565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612d3a57610f5783613b6e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d7357600080fd5b505afa925050508015612da3575060408051601f3d908101601f19168201909252612da09181019061534e565b60015b612e065760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610bfc565b60008051602061569e8339815191528114612e755760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610bfc565b50610f57838383613c08565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691612edd919061537e565b6000604051808303816000865af19150503d8060008114612f1a576040519150601f19603f3d011682016040523d82523d6000602084013e612f1f565b606091505b5091509150818015612f49575080511580612f49575080806020019051810190612f49919061539a565b6127875760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c454400006044820152606401610bfc565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691612ff9919061537e565b6000604051808303816000865af19150503d8060008114613036576040519150601f19603f3d011682016040523d82523d6000602084013e61303b565b606091505b5091509150818015613065575080511580613065575080806020019051810190613065919061539a565b6130bd5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610bfc565b505050505050565b60008060007f829abf7a83fcbcf66649914b5a9a514acbf6beda598a620aef732202e8155d7360001b856040516020016131009291906153b7565b6040516020818303038152906040529050600081805190602001209050600061015f548260405160200161313592919061548a565b604051602081830303815290604052805190602001209050600060018288600001602081019061316591906154a5565b89602001358a604001356040516000815260200160405260405161318c94939291906154c0565b6020604051602081039080840390855afa1580156131ae573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506131eb5760405162461bcd60e51b8152600401610bfc906154de565b87516001603f1b8b161515906001603e1b8c16151590600090613229908c90839061321857613218614ef7565b60200260200101516000015161379c565b909850905060ff88161561326457808b60008151811061324b5761324b614ef7565b60209081029190910101516001600160801b0390911690525b60005b8b5181101561333f5760008c828151811061328457613284614ef7565b602002602001015190508380156132be575080516001600160801b0390811660009081526101686020526040902054600160801b90041615155b156132c9575061332d565b6132d3818f61359d565b6132dd818b61380e565b84156132f75780516132f7906001600160801b0316611d37565b8c828151811061330957613309614ef7565b6020026020010151602001516001600160801b03168b6133299190614f80565b9a50505b8061333781614f23565b915050613267565b50886133885760405162461bcd60e51b8152602060048201526018602482015277474254433a204e6f20426c6f636b20417661696c61626c6560401b6044820152606401610bfc565b5050505050505094509492505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156134485760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610bfc565b6001600160a01b0383811660008181526101006020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134c1848484612b4e565b6134cd84848484613c2d565b611a665760405162461bcd60e51b8152600401610bfc9061550f565b6001600160a01b03163b151590565b600054610100900460ff16610fb95760405162461bcd60e51b8152600401610bfc90615561565b600054610100900460ff166135465760405162461bcd60e51b8152600401610bfc90615561565b610fb933613398565b600054610100900460ff166135765760405162461bcd60e51b8152600401610bfc90615561565b81516135899060fb906020850190614172565b508051610f579060fc906020840190614172565b81516001600160781b031660008181526101686020526040902054600160801b90046001600160801b03161561360c5760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e48135a5b9d195960621b6044820152606401610bfc565b606083015160f01660ff831614610f575760405162461bcd60e51b8152602060048201526014602482015273474254433a2057726f6e6720415254205479706560601b6044820152606401610bfc565b60007fe645798fe54db29ed50fd7f01a05de6d1c5a65fac8902dcfd7427b30fbd87c2460001b83600001518460a0015185602001518660800151876040015188606001516040516020016136b697969594939291906155ac565b604051602081830303815290604052805190602001209050600061015f54826040516020016136e692919061548a565b604051602081830303815290604052805190602001209050600060018285600001602081019061371691906154a5565b866020013587604001356040516000815260200160405260405161373d94939291906154c0565b6020604051602081039080840390855afa15801561375f573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506127875760405162461bcd60e51b8152600401610bfc906154de565b61017054600090819060ff607885901c811691600160a01b9004168111156137fb5760405162461bcd60e51b8152602060048201526012602482015271474254433a2057726f6e6720526174696f2160701b6044820152606401610bfc565b936001600160781b039390931692915050565b60408201516001600160a01b031661385c5760405162461bcd60e51b815260206004820152601160248201527023a12a219d102d32b9379026b4b73a32b960791b6044820152606401610bfc565b81516001600160801b03908116600090815261016860209081526040918290208551828701518516600160801b02941693909317835590840151600183018054606087015160ff16600160a01b026001600160a81b03199091166001600160a01b0390931692909217919091179055608084015180518593926138e6926002850192910190614172565b5060a08201518051613902916003840191602090910190614172565b50506040805160e08101825260008082526020808301828152838501838152606085018481526080860185815260a0870186815260c088018781528c516001600160401b03908116875260ff8d811684528e516001600160801b039081168b52610169909952988b90208a518154985197519651955194516001600160a01b039091166001600160e01b031990991698909817600160a01b97909216969096021761ffff60e01b1916600160e01b9415159490940260ff60e81b191693909317600160e81b92151592909202919091176001600160f01b0316600160f01b911515919091026001600160f81b031617600160f81b939095169290920293909317835551600190920191909155918501518551919350613a2392909116613d3e565b825160208085015160408087015160608089015183516001600160801b03978816815296909416948601949094526001600160a01b03169084015260ff16908201527f79c8f412993c72ce60b23ac109f97d606389e44244c46ef8ca530ef920558cea9060800160405180910390a1505050565b600090815260fd60205260409020546001600160a01b0316151590565b6001600160a01b038316613b1157613b0c8161012f8054600083815261013060205260408120829055600182018355919091527f232da9e50dad2971456a78fb5cd6ff6b75019984d6e918139ce990999420f9790155565b613b34565b816001600160a01b0316836001600160a01b031614613b3457613b348382613e6a565b6001600160a01b038216613b4b57610f5781613f0c565b826001600160a01b0316826001600160a01b031614610f5757610f578282613fc1565b613b77816134e9565b613bd95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bfc565b60008051602061569e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c1183614007565b600082511180613c1e5750805b15610f5757611a668383614047565b6000613c41846001600160a01b03166134e9565b15613d3657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613c78903390899088908890600401615617565b602060405180830381600087803b158015613c9257600080fd5b505af1925050508015613cc2575060408051601f3d908101601f19168201909252613cbf9181019061564a565b60015b613d1c573d808015613cf0576040519150601f19603f3d011682016040523d82523d6000602084013e613cf5565b606091505b508051613d145760405162461bcd60e51b8152600401610bfc9061550f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128ab565b5060016128ab565b6001600160a01b038216613d945760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bfc565b613d9d81613a97565b15613de95760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610bfc565b613df560008383613ab4565b6001600160a01b038216600090815260fe60205260408120805460019290613e1e908490614f80565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206156e5833981519152908290a45050565b60006001613e77846118f0565b613e819190615367565b600083815261012e6020526040902054909150808214613ed7576001600160a01b038416600090815261012d60209081526040808320858452825280832054848452818420819055835261012e90915290208190555b50600091825261012e602090815260408084208490556001600160a01b03909416835261012d81528383209183525290812055565b61012f54600090613f1f90600190615367565b6000838152610130602052604081205461012f8054939450909284908110613f4957613f49614ef7565b906000526020600020015490508061012f8381548110613f6b57613f6b614ef7565b6000918252602080832090910192909255828152610130909152604080822084905585825281205561012f805480613fa557613fa5615667565b6001900381819060005260206000200160009055905550505050565b6000613fcc836118f0565b6001600160a01b03909316600090815261012d60209081526040808320868452825280832085905593825261012e9052919091209190915550565b61401081613b6e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060614052836134e9565b6140ad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610bfc565b600080846001600160a01b0316846040516140c8919061537e565b600060405180830381855af49150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b509150915061413082826040518060600160405280602781526020016156be60279139614139565b95945050505050565b60608315614148575081612961565b8251156141585782518084602001fd5b8160405162461bcd60e51b8152600401610bfc9190614390565b82805461417e90614e00565b90600052602060002090601f0160209004810192826141a057600085556141e6565b82601f106141b957805160ff19168380011785556141e6565b828001600101855582156141e6579182015b828111156141e65782518255916020019190600101906141cb565b506141f29291506141f6565b5090565b5b808211156141f257600081556001016141f7565b6001600160e01b03198116811461111857600080fd5b60006020828403121561423357600080fd5b81356129618161420b565b6001600160a01b038116811461111857600080fd5b803561425e8161423e565b919050565b60006020828403121561427557600080fd5b81356129618161423e565b600060c0828403121561429257600080fd5b50919050565b60006060828403121561429257600080fd5b60006080828403121561429257600080fd5b60008060008060c085870312156142d257600080fd5b84356001600160401b03808211156142e957600080fd5b6142f588838901614280565b95506143048860208901614298565b9450608087013591508082111561431a57600080fd5b50614327878288016142aa565b9497939650939460a0013593505050565b60005b8381101561435357818101518382015260200161433b565b83811115611a665750506000910152565b6000815180845261437c816020860160208601614338565b601f01601f19169290920160200192915050565b6020815260006129616020830184614364565b6000602082840312156143b557600080fd5b5035919050565b600080604083850312156143cf57600080fd5b82356143da8161423e565b946020939093013593505050565b6000806000606084860312156143fd57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561442957600080fd5b83356144348161423e565b925060208401356144448161423e565b929592945050506040919091013590565b60008083601f84011261446757600080fd5b5081356001600160401b0381111561447e57600080fd5b6020830191508360208260051b850101111561449957600080fd5b9250929050565b600080602083850312156144b357600080fd5b82356001600160401b038111156144c957600080fd5b611d2b85828601614455565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b038111828210171561450d5761450d6144d5565b60405290565b604051601f8201601f191681016001600160401b038111828210171561453b5761453b6144d5565b604052919050565b60006001600160401b0382111561455c5761455c6144d5565b50601f01601f191660200190565b600082601f83011261457b57600080fd5b813561458e61458982614543565b614513565b8181528460208386010111156145a357600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156145d357600080fd5b82356145de8161423e565b915060208301356001600160401b038111156145f957600080fd5b6146058582860161456a565b9150509250929050565b60006040828403121561429257600080fd5b6000806000806000610100868803121561463a57600080fd5b85356001600160401b038082111561465157600080fd5b61465d89838a01614280565b965061466c8960208a01614298565b9550608088013591508082111561468257600080fd5b5061468f888289016142aa565b93505061469f8760a0880161460f565b9497939650919460e0013592915050565b60008060008060008061010087890312156146ca57600080fd5b86356001600160401b03808211156146e157600080fd5b6146ed8a838b01614455565b90985096508691506147028a60208b01614298565b9550608089013591508082111561471857600080fd5b5061472589828a016142aa565b9350506147358860a0890161460f565b915060e087013590509295509295509295565b602080825282518282018190526000919060409081850190868401855b8281101561479757815180516001600160401b0390811686529087015116868501529284019290850190600101614765565b5091979650505050505050565b600080600080604085870312156147ba57600080fd5b84356001600160401b03808211156147d157600080fd5b6147dd88838901614455565b909650945060208701359150808211156147f657600080fd5b5061480387828801614455565b95989497509550505050565b60008060008060008060e0878903121561482857600080fd5b86356001600160401b038082111561483f57600080fd5b61484b8a838b01614455565b90985096508691506148608a60208b01614298565b9550608089013591508082111561487657600080fd5b5061488389828a016142aa565b93505060a08701356148948161423e565b8092505060c087013590509295509295509295565b801515811461111857600080fd5b600080604083850312156148ca57600080fd5b82356148d58161423e565b915060208301356148e5816148a9565b809150509250929050565b6000806040838503121561490357600080fd5b823561490e8161423e565b915060208301356148e58161423e565b6000806000806080858703121561493457600080fd5b843561493f8161423e565b9350602085013561494f8161423e565b92506040850135915060608501356001600160401b0381111561497157600080fd5b61497d8782880161456a565b91505092959194509250565b600080600080600060e086880312156149a157600080fd5b85356001600160401b03808211156149b857600080fd5b6149c489838a01614280565b96506149d38960208a01614298565b955060808801359150808211156149e957600080fd5b506149f6888289016142aa565b93505060a0860135614a078161423e565b9497939650919460c0013592915050565b600080600060408486031215614a2d57600080fd5b83356001600160401b03811115614a4357600080fd5b614a4f86828701614455565b9094509250506020840135614a63816148a9565b809150509250925092565b6001600160801b038781168252861660208201526001600160a01b038516604082015260ff8416606082015260c060808201819052600090614ab290830185614364565b82810360a0840152614ac48185614364565b9998505050505050505050565b60008060008060808587031215614ae757600080fd5b8435614af28161423e565b93506020850135614b028161423e565b92506040850135614b128161423e565b91506060850135614b228161423e565b939692955090935050565b602080825260129082015271474254433a205a65726f204164647265737360701b604082015260600190565b6020808252600d908201526c11d09510ce8811561412549151609a1b604082015260600190565b6001600160801b038116811461111857600080fd5b803561425e81614b80565b803560ff8116811461425e57600080fd5b600060c08284031215614bc357600080fd5b614bcb6144eb565b9050614bd682614b95565b8152614be460208301614b95565b6020820152614bf560408301614253565b6040820152614c0660608301614ba0565b606082015260808201356001600160401b0380821115614c2557600080fd5b614c318583860161456a565b608084015260a0840135915080821115614c4a57600080fd5b50614c578482850161456a565b60a08301525092915050565b6000610bc83683614bb1565b600060208284031215614c8157600080fd5b813561296181614b80565b6000808335601e19843603018112614ca357600080fd5b83016020810192503590506001600160401b03811115614cc257600080fd5b80360383131561449957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008135614d078161423e565b6001600160a01b03168352614d1f6020830183614c8c565b60806020860152614d34608086018284614cd1565b915050614d446040840184614c8c565b8583036040870152614d57838284614cd1565b92505050614d686060840184614c8c565b8583036060870152614d7b838284614cd1565b9695505050505050565b600060018060a01b03808a16835280891660208401525086604083015285606083015284608083015263ffffffff841660a083015260e060c0830152614ac460e0830184614cfa565b60008351614de0818460208801614338565b60609390931b6001600160601b0319169190920190815260140192915050565b600181811c90821680614e1457607f821691505b6020821081141561429257634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c9082015260008051602061567e83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c9082015260008051602061567e83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415614f3757614f37614f0d565b5060010190565b600060ff821660ff841680821015614f5857614f58614f0d565b90039392505050565b6000816000190483118215151615614f7b57614f7b614f0d565b500290565b60008219821115614f9357614f93614f0d565b500190565b600082614fb557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03958616815293909416602084015260408301919091526060820152901515608082015260a00190565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000614d7b6080830184614cfa565b60006001600160401b0380841115615038576150386144d5565b8360051b6020615049818301614513565b86815291850191818101903684111561506157600080fd5b865b848110156150955780358681111561507b5760008081fd5b61508736828b01614bb1565b845250918301918301615063565b50979650505050505050565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60208082526016908201527511d09510ce8810549508139bdd081058d8d95c1d195960521b604082015260600190565b60006020828403121561511557600080fd5b81516129618161423e565b6000806040838503121561513357600080fd5b825161513e81614b80565b60208401519092506148e581614b80565b8054600090600181811c908083168061516957607f831692505b602080841082141561518b57634e487b7160e01b600052602260045260246000fd5b838852602088018280156151a657600181146151b7576151e2565b60ff198716825282820197506151e2565b60008981526020902060005b878110156151dc578154848201529086019084016151c3565b83019850505b5050505050505092915050565b6001600160a01b0384811682526101206020830181905284546001600160801b0381169184019190915260801c610140830152600184015490811661016083015260a01c60ff1661018082015260c06101a082015260006152576101e083016002860161514f565b82810361011f19016101c0840152615272816003870161514f565b9150506128ab604083018480546001600160a01b038116835260a081811c6001600160401b0316602085015260e082901c60ff9081161515604086015260e883901c81161515606086015260f083901c161515608085015260f882901c90840152506001015460c09190910152565b6000602082840312156152f357600080fd5b81516001600160401b0381111561530957600080fd5b8201601f8101841361531a57600080fd5b805161532861458982614543565b81815285602083850101111561533d57600080fd5b614130826020830160208601614338565b60006020828403121561536057600080fd5b5051919050565b60008282101561537957615379614f0d565b500390565b60008251615390818460208701614338565b9190910192915050565b6000602082840312156153ac57600080fd5b8151612961816148a9565b6000604080830185845260208281860152818651808452606093508387019150838160051b88010183890160005b8381101561547a57898303605f19018552815180516001600160801b039081168552878201511687850152888101516001600160a01b0316898501528781015160ff168885015260808082015160c0828701819052919061544883880182614364565b9250505060a080830151925085820381870152506154668183614364565b9688019694505050908501906001016153e5565b50909a9950505050505050505050565b61190160f01b81526002810192909252602282015260420190565b6000602082840312156154b757600080fd5b61296182614ba0565b93845260ff9290921660208401526040830152606082015260800190565b602080825260179082015276474254433a20496e76616c69642053696e67617475726560481b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b878152600060018060801b03808916602084015260e060408401526155d460e0840189614364565b818816606085015283810360808501526155ee8188614364565b6001600160a01b039690961660a085015250505060ff9190911660c09091015295945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d7b90830184614364565b60006020828403121561565c57600080fd5b81516129618161420b565b634e487b7160e01b600052603160045260246000fdfe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000809000a
Deployed Bytecode
0x6080604052600436106102d35760003560e01c806301ffc9a7146102d857806303e0ee241461030d578063058a628f1461033257806306d8a5881461035457806306fdde0314610367578063081812fc14610389578063095ea7b3146103c15780631719c3c2146103e157806318160ddd146103f8578063187096781461040e5780631a2b54461461042e57806323b872dd1461044f5780632de659191461046f5780632f745c59146104845780633644e515146104a45780633659cfe6146104bb57806342842e0e146104db578063481c6a75146104fb5780634ac7ceaa1461051c5780634f1ef2861461053c5780634f6ccce71461054f578063508899721461056f57806350d7b22c1461058f57806351b44baf146105af57806352d1902d146105cf57806353bf9014146105e45780636352211e146105fa578063647677ce1461061a5780636864c6b41461063157806368f50b8a1461065157806370a0823114610672578063715018a6146106925780637f9a105c146106a757806387bbc498146106c75780638b95e507146106e95780638cefb3c0146107095780638da5cb5b146107295780639526b6381461073e57806395d89b411461075e578063a22cb46514610773578063ac41865a14610793578063b1e5e2b7146107d3578063b88d4fde146107f3578063ba43b8b114610813578063bcb56ae214610828578063c0e9031714610848578063c12f51841461087c578063c360f55c1461089c578063c62c3abe146108bd578063c87b56dd146108dd578063cda4498e146108fd578063cf27fb3c14610918578063d09edf3114610949578063d0ebdbe71461096a578063e0dce49e1461098a578063e3639229146109ab578063e985e9c5146109ea578063f08380fc14610a0a578063f2fde38b14610a2b578063f54abe6f14610a4b578063f78c945814610a6c578063f8c8765e14610a9e578063fb253b3214610abe578063ff6c079214610b8c575b600080fd5b3480156102e457600080fd5b506102f86102f3366004614221565b610ba3565b60405190151581526020015b60405180910390f35b34801561031957600080fd5b5061032461016e5481565b604051908152602001610304565b34801561033e57600080fd5b5061035261034d366004614263565b610bce565b005b6103526103623660046142bc565b610c28565b34801561037357600080fd5b5061037c610d8d565b6040516103049190614390565b34801561039557600080fd5b506103a96103a43660046143a3565b610e1f565b6040516001600160a01b039091168152602001610304565b3480156103cd57600080fd5b506103526103dc3660046143bc565b610e46565b3480156103ed57600080fd5b5061032461016b5481565b34801561040457600080fd5b5061012f54610324565b34801561041a57600080fd5b506103526104293660046143e8565b610f5c565b34801561043a57600080fd5b50610171546103a9906001600160a01b031681565b34801561045b57600080fd5b5061035261046a366004614414565b610f72565b34801561047b57600080fd5b50610352610fa3565b34801561049057600080fd5b5061032461049f3660046143bc565b610fbb565b3480156104b057600080fd5b5061032461015f5481565b3480156104c757600080fd5b506103526104d6366004614263565b611052565b3480156104e757600080fd5b506103526104f6366004614414565b61111b565b34801561050757600080fd5b50610160546103a9906001600160a01b031681565b34801561052857600080fd5b506103526105373660046144a0565b611136565b61035261054a3660046145c0565b6111e6565b34801561055b57600080fd5b5061032461056a3660046143a3565b6112a0565b34801561057b57600080fd5b5061035261058a366004614621565b611335565b34801561059b57600080fd5b506103526105aa3660046146b0565b611552565b3480156105bb57600080fd5b506103526105ca366004614263565b61176b565b3480156105db57600080fd5b506103246117bc565b3480156105f057600080fd5b5061016c54610324565b34801561060657600080fd5b506103a96106153660046143a3565b61186a565b34801561062657600080fd5b5061032461016f5481565b34801561063d57600080fd5b5061035261064c366004614263565b61189f565b34801561065d57600080fd5b50610165546103a9906001600160a01b031681565b34801561067e57600080fd5b5061032461068d366004614263565b6118f0565b34801561069e57600080fd5b50610352611976565b3480156106b357600080fd5b506103526106c2366004614263565b611988565b3480156106d357600080fd5b506106dc6119d9565b6040516103049190614748565b3480156106f557600080fd5b506103526107043660046147a4565b611a50565b34801561071557600080fd5b506103526107243660046143a3565b611a6c565b34801561073557600080fd5b506103a9611add565b34801561074a57600080fd5b5061035261075936600461480f565b611aec565b34801561076a57600080fd5b5061037c611c01565b34801561077f57600080fd5b5061035261078e3660046148b7565b611c10565b34801561079f57600080fd5b506107b36107ae3660046148f0565b611c1b565b604080516001600160801b03938416815292909116602083015201610304565b3480156107df57600080fd5b506103526107ee3660046143a3565b611d37565b3480156107ff57600080fd5b5061035261080e36600461491e565b611eda565b34801561081f57600080fd5b506106dc611f0c565b34801561083457600080fd5b50610352610843366004614989565b611f79565b34801561085457600080fd5b506101705461086a90600160a01b900460ff1681565b60405160ff9091168152602001610304565b34801561088857600080fd5b506103526108973660046143a3565b612076565b3480156108a857600080fd5b50610164546103a9906001600160a01b031681565b3480156108c957600080fd5b506103526108d8366004614263565b6120c6565b3480156108e957600080fd5b5061037c6108f83660046143a3565b612117565b34801561090957600080fd5b50610352610429366004614a18565b34801561092457600080fd5b506102f8610933366004614263565b61016a6020526000908152604090205460ff1681565b34801561095557600080fd5b50610161546103a9906001600160a01b031681565b34801561097657600080fd5b50610352610985366004614263565b612221565b34801561099657600080fd5b50610163546103a9906001600160a01b031681565b3480156109b757600080fd5b506109cb6109c63660046143a3565b612272565b6040805193151584529115156020840152151590820152606001610304565b3480156109f657600080fd5b506102f8610a053660046148f0565b6122da565b348015610a1657600080fd5b50610162546103a9906001600160a01b031681565b348015610a3757600080fd5b50610352610a46366004614263565b612309565b348015610a5757600080fd5b50610170546103a9906001600160a01b031681565b348015610a7857600080fd5b50610a8c610a873660046143a3565b61237f565b60405161030496959493929190614a6e565b348015610aaa57600080fd5b50610352610ab9366004614ad1565b6124e3565b348015610aca57600080fd5b50610b3b610ad93660046143a3565b61016960205260009081526040902080546001909101546001600160a01b038216916001600160401b03600160a01b8204169160ff600160e01b8304811692600160e81b8104821692600160f01b8204831692600160f81b9092049091169087565b604080516001600160a01b0390981688526001600160401b0390961660208801529315159486019490945290151560608501521515608084015260ff90911660a083015260c082015260e001610304565b348015610b9857600080fd5b5061032461016d5481565b60006001600160e01b0319821663780e9d6360e01b1480610bc85750610bc88261278e565b92915050565b610bd66127de565b6001600160a01b038116610c055760405162461bcd60e51b8152600401610bfc90614b2d565b60405180910390fd5b61016180546001600160a01b0319166001600160a01b0392909216919091179055565b80428163ffffffff161015610c4f5760405162461bcd60e51b8152600401610bfc90614b59565b610c64826000610c5e88614c63565b8761283d565b5061016560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cb657600080fd5b505af1158015610cca573d6000803e3d6000fd5b505061016554610164546003945060009350638d7fcefd92506001600160a01b03918216911634610d12610d0460408d0160208e01614c6f565b6001600160801b03166128b3565b86898b604051602401610d2b9796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050610d8481335b604051602001610d70929190614dce565b604051602081830303815290604052612968565b50505050505050565b606060fb8054610d9c90614e00565b80601f0160208091040260200160405190810160405280929190818152602001828054610dc890614e00565b8015610e155780601f10610dea57610100808354040283529160200191610e15565b820191906000526020600020905b815481529060010190602001808311610df857829003601f168201915b5050505050905090565b6000610e2a82612a39565b50600090815260ff60205260409020546001600160a01b031690565b6000610e518261186a565b9050806001600160a01b0316836001600160a01b03161415610ebf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610bfc565b336001600160a01b0382161480610edb5750610edb81336122da565b610f4d5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610bfc565b610f578383612a5e565b505050565b61017054610f57906001600160a01b0316612acc565b610f7c3382612af0565b610f985760405162461bcd60e51b8152600401610bfc90614e35565b610f57838383612b4e565b61017054610fb9906001600160a01b0316612acc565b565b6000610fc6836118f0565b82106110285760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610bfc565b506001600160a01b0391909116600090815261012d60209081526040808320938352929052205490565b306001600160a01b037f000000000000000000000000f9e8b934db91a80009e24d3ca0bf3273cdfa079c16141561109b5760405162461bcd60e51b8152600401610bfc90614e83565b7f000000000000000000000000f9e8b934db91a80009e24d3ca0bf3273cdfa079c6001600160a01b03166110cd612ce3565b6001600160a01b0316146110f35760405162461bcd60e51b8152600401610bfc90614ebd565b6110fc81612cff565b6040805160008082526020820190925261111891839190612d07565b50565b610f5783838360405180602001604052806000815250611eda565b61113e6127de565b610163546001600160a01b031661118a5760405162461bcd60e51b815260206004820152601060248201526f23a12a219d10273790213ab4b63232b960811b6044820152606401610bfc565b60005b81811015610f57576111d48383838181106111aa576111aa614ef7565b90506020020160208101906111bf9190614263565b610163546001600160a01b0316600019612e81565b806111de81614f23565b91505061118d565b306001600160a01b037f000000000000000000000000f9e8b934db91a80009e24d3ca0bf3273cdfa079c16141561122f5760405162461bcd60e51b8152600401610bfc90614e83565b7f000000000000000000000000f9e8b934db91a80009e24d3ca0bf3273cdfa079c6001600160a01b0316611261612ce3565b6001600160a01b0316146112875760405162461bcd60e51b8152600401610bfc90614ebd565b61129082612cff565b61129c82826001612d07565b5050565b60006112ac61012f5490565b821061130f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610bfc565b61012f828154811061132357611323614ef7565b90600052602060002001549050919050565b80428163ffffffff16101561135c5760405162461bcd60e51b8152600401610bfc90614b59565b6000611372838261136c8a614c63565b8961283d565b90506113906113846020860186614263565b33308760200135612f95565b60006113a5610d0460408a0160208b01614c6f565b905060ff8216156114c157600060646113be8482614f3e565b6113cb9060ff1684614f61565b6113d6906063614f80565b6113e09190614f98565b9050600063478a55b66113f66020890189614263565b6101715460405161141f92916001600160a01b03169060208c0135908790600090602401614fba565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114578133610d5f565b61017154604051636e556df891611482916001600160a01b039091169086908a908d90602401614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114ba8133610d5f565b5050611548565b60026000638d7fcefd6114d76020890189614263565b61016460009054906101000a90046001600160a01b0316896020013586868b8e60405160240161150d9796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506115458133610d5f565b50505b5050505050505050565b80428163ffffffff1610156115795760405162461bcd60e51b8152600401610bfc90614b59565b600080611591848261158b8b8d61501e565b8a6130c5565b90925090506115b26115a66020870187614263565b33308860200135612f95565b60006115bd836128b3565b905060ff8216156116d957600060646115d68482614f3e565b6115e39060ff1684614f61565b6115ee906063614f80565b6115f89190614f98565b9050600063478a55b661160e60208a018a614263565b6101715460405161163792916001600160a01b03169060208d0135908790600090602401614fba565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061166f8133610d5f565b61017154604051636e556df89161169a916001600160a01b039091169086908b908e90602401614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506116d28133610d5f565b5050611545565b60026000638d7fcefd6116ef60208a018a614263565b61016460009054906101000a90046001600160a01b03168a6020013586868c8f6040516024016117259796959493929190614d85565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061175d8133610d5f565b505050505050505050505050565b6117736127de565b6001600160a01b0381166117995760405162461bcd60e51b8152600401610bfc90614b2d565b61016480546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000f9e8b934db91a80009e24d3ca0bf3273cdfa079c16146118575760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610bfc565b5060008051602061569e83398151915290565b600081815260fd60205260408120546001600160a01b031680610bc85760405162461bcd60e51b8152600401610bfc906150a1565b6118a76127de565b6001600160a01b0381166118cd5760405162461bcd60e51b8152600401610bfc90614b2d565b61017180546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821661195a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610bfc565b506001600160a01b0316600090815260fe602052604090205490565b61197e6127de565b610fb96000613398565b6119906127de565b6001600160a01b0381166119b65760405162461bcd60e51b8152600401610bfc90614b2d565b61016280546001600160a01b0319166001600160a01b0392909216919091179055565b6060610166805480602002602001604051908101604052809291908181526020016000905b82821015611a4757600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b90910416818301528252600190920191016119fe565b50505050905090565b61017054611a66906001600160a01b0316612acc565b50505050565b611a746127de565b605a811115611abc5760405162461bcd60e51b8152602060048201526014602482015273474254433a20546f6f204d6f726520526174696f60601b6044820152606401610bfc565b610170805460ff909216600160a01b0260ff60a01b19909216919091179055565b6097546001600160a01b031690565b80428163ffffffff161015611b135760405162461bcd60e51b8152600401610bfc90614b59565b6001600160a01b038316600090815261016a602052604090205460ff16611b4c5760405162461bcd60e51b8152600401610bfc906150d3565b600080611b5f84601061158b8b8d61501e565b915091506000611b6e836128b3565b9050611b9e8633306064611b828782614f3e565b611b8f9060ff1687614f61565b611b999190614f98565b612f95565b6000636e556df88783888b604051602401611bbc9493929190614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050611bf48133610d5f565b5050505050505050505050565b606060fc8054610d9c90614e00565b61129c3383836133ea565b600080600061016360009054906101000a90046001600160a01b03166001600160a01b031663678aa4f36040518163ffffffff1660e01b815260040160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190615103565b604051633612cf2560e01b81526001600160a01b038781166004830152868116602483015291925090821690633612cf2590604401604080518083038186803b158015611cf357600080fd5b505afa158015611d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2b9190615120565b90969095509350505050565b611d408161186a565b6001600160a01b0316336001600160a01b031614611d925760405162461bcd60e51b815260206004820152600f60248201526e23a12a219d102737ba1027bbb732b960891b6044820152606401610bfc565b60008181526101696020526040902054600160e01b900460ff1615611df05760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e4813dc195b995960621b6044820152606401610bfc565b6040805180820182526001600160401b0383811682524380821660208085019182526101668054600181018255600091825286517fa5a4c57b7184ec73d55be4993773cb4eef681bc86a28d0285cd66efb50676a97909101805494518716600160401b026001600160801b0319909516919096161792909217909355858152610169835284902080546001600160a01b0360ff60e01b01191633908117600160e01b17909155845190815291820185905292810192909252907f66b10d9ff37b599d2105c94c297dc6149f44b851df44d93080dc0833ba8e6e919060600160405180910390a15050565b611ee43383612af0565b611f005760405162461bcd60e51b8152600401610bfc90614e35565b611a66848484846134b6565b60606101678054806020026020016040519081016040528092919081815260200160009082821015611a4757600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b90910416818301528252600190920191016119fe565b80428163ffffffff161015611fa05760405162461bcd60e51b8152600401610bfc90614b59565b6001600160a01b038316600090815261016a602052604090205460ff16611fd95760405162461bcd60e51b8152600401610bfc906150d3565b6000611fea83601061136c8a614c63565b90506000612001610d0460408a0160208b01614c6f565b90506120158533306064611b828782614f3e565b6000636e556df88683878a6040516024016120339493929190614feb565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061206b8133610d5f565b505050505050505050565b61207e6127de565b60148111156120c05760405162461bcd60e51b815260206004820152600e60248201526d474254433a20546f6f204d6f726560901b6044820152606401610bfc565b61016b55565b6120ce6127de565b6001600160a01b0381166120f45760405162461bcd60e51b8152600401610bfc90614b2d565b61017080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815261016860205260409020600101546060906001600160a01b03166121755760405162461bcd60e51b815260206004820152601060248201526f11d09510ce88139bdd08135a5b9d195960821b6044820152606401610bfc565b610162546001600160a01b03166342aee6bb6121908461186a565b6000858152610168602090815260408083206101699092529182902091516001600160e01b031960e086901b1681526121cd9392906004016151ef565b60006040518083038186803b1580156121e557600080fd5b505afa1580156121f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bc891908101906152e1565b6122296127de565b6001600160a01b03811661224f5760405162461bcd60e51b8152600401610bfc90614b2d565b61016080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152610168602052604081205481908190600160801b90046001600160801b03166122a8575060009150819050806122d3565b5050506000818152610169602052604090205460019060ff600160e01b8204811691600160e81b9004165b9193909250565b6001600160a01b0391821660009081526101006020908152604080832093909416825291909152205460ff1690565b6123116127de565b6001600160a01b0381166123765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bfc565b61111881613398565b610168602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b90950416936001600160a01b03841693600160a01b900460ff169290916123d290614e00565b80601f01602080910402602001604051908101604052809291908181526020018280546123fe90614e00565b801561244b5780601f106124205761010080835404028352916020019161244b565b820191906000526020600020905b81548152906001019060200180831161242e57829003601f168201915b50505050509080600301805461246090614e00565b80601f016020809104026020016040519081016040528092919081815260200182805461248c90614e00565b80156124d95780601f106124ae576101008083540402835291602001916124d9565b820191906000526020600020905b8154815290600101906020018083116124bc57829003601f168201915b5050505050905086565b600054610100900460ff16158080156125035750600054600160ff909116105b806125245750612512306134e9565b158015612524575060005460ff166001145b6125875760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bfc565b6000805460ff1916600117905580156125aa576000805461ff0019166101001790555b6125b26134f8565b6125ba61351f565b6126056040518060400160405280600e81526020016d23b932b2b710212a219021b63ab160911b8152506040518060400160405280600381526020016247424360e81b81525061354f565b604080518082018252600e81526d23b932b2b710212a219021b63ab160911b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa24958b5bf039b27bb75556bcf8b8d2620327722d5e05db3d9e9f0557b49ab71818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012061015f556126e3611add565b61016080546001600160a01b03199081166001600160a01b03938416179091556101618054821688841617905561016380548216878416179055610164805482168684161790556101658054909116918416919091179055600561016b558015612787576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006001600160e01b031982166380ac58cd60e01b14806127bf57506001600160e01b03198216635b5e139f60e01b145b80610bc857506301ffc9a760e01b6001600160e01b0319831614610bc8565b336127e7611add565b6001600160a01b031614610fb95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bfc565b6000612849838561359d565b612853838361365c565b600080612863856000015161379c565b915091508160ff1660001461287f576001600160801b03811685525b612889858361380e565b603f87901c156128a75784516128a7906001600160801b0316611d37565b5090505b949350505050565b60008061016460009054906101000a90046001600160a01b03166001600160a01b0316632f0e0a726040518163ffffffff1660e01b815260040160206040518083038186803b15801561290557600080fd5b505afa158015612919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293d919061534e565b905061294b81612710615367565b61295784612710614f61565b6129619190614f98565b9392505050565b6101635460405160009182916001600160a01b039091169061298b90859061537e565b6000604051808303816000865af19150503d80600081146129c8576040519150601f19603f3d011682016040523d82523d6000602084013e6129cd565b606091505b509150915081610f57578051156129e75780518082602001fd5b60405162461bcd60e51b815260206004820152602160248201527f474254433a204572726f722043616c6c20746f20616374696f6e4275696c64656044820152603960f91b6064820152608401610bfc565b612a4281613a97565b6111185760405162461bcd60e51b8152600401610bfc906150a1565b600081815260ff6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612a938261186a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b3660008037600080366000845af43d6000803e808015612aeb573d6000f35b3d6000fd5b600080612afc8361186a565b9050806001600160a01b0316846001600160a01b03161480612b235750612b2381856122da565b806128ab5750836001600160a01b0316612b3c84610e1f565b6001600160a01b031614949350505050565b826001600160a01b0316612b618261186a565b6001600160a01b031614612bc55760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610bfc565b6001600160a01b038216612c275760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610bfc565b612c32838383613ab4565b612c3d600082612a5e565b6001600160a01b038316600090815260fe60205260408120805460019290612c66908490615367565b90915550506001600160a01b038216600090815260fe60205260408120805460019290612c94908490614f80565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206156e583398151915291a4505050565b60008051602061569e833981519152546001600160a01b031690565b6111186127de565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612d3a57610f5783613b6e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d7357600080fd5b505afa925050508015612da3575060408051601f3d908101601f19168201909252612da09181019061534e565b60015b612e065760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610bfc565b60008051602061569e8339815191528114612e755760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610bfc565b50610f57838383613c08565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691612edd919061537e565b6000604051808303816000865af19150503d8060008114612f1a576040519150601f19603f3d011682016040523d82523d6000602084013e612f1f565b606091505b5091509150818015612f49575080511580612f49575080806020019051810190612f49919061539a565b6127875760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c454400006044820152606401610bfc565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691612ff9919061537e565b6000604051808303816000865af19150503d8060008114613036576040519150601f19603f3d011682016040523d82523d6000602084013e61303b565b606091505b5091509150818015613065575080511580613065575080806020019051810190613065919061539a565b6130bd5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610bfc565b505050505050565b60008060007f829abf7a83fcbcf66649914b5a9a514acbf6beda598a620aef732202e8155d7360001b856040516020016131009291906153b7565b6040516020818303038152906040529050600081805190602001209050600061015f548260405160200161313592919061548a565b604051602081830303815290604052805190602001209050600060018288600001602081019061316591906154a5565b89602001358a604001356040516000815260200160405260405161318c94939291906154c0565b6020604051602081039080840390855afa1580156131ae573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506131eb5760405162461bcd60e51b8152600401610bfc906154de565b87516001603f1b8b161515906001603e1b8c16151590600090613229908c90839061321857613218614ef7565b60200260200101516000015161379c565b909850905060ff88161561326457808b60008151811061324b5761324b614ef7565b60209081029190910101516001600160801b0390911690525b60005b8b5181101561333f5760008c828151811061328457613284614ef7565b602002602001015190508380156132be575080516001600160801b0390811660009081526101686020526040902054600160801b90041615155b156132c9575061332d565b6132d3818f61359d565b6132dd818b61380e565b84156132f75780516132f7906001600160801b0316611d37565b8c828151811061330957613309614ef7565b6020026020010151602001516001600160801b03168b6133299190614f80565b9a50505b8061333781614f23565b915050613267565b50886133885760405162461bcd60e51b8152602060048201526018602482015277474254433a204e6f20426c6f636b20417661696c61626c6560401b6044820152606401610bfc565b5050505050505094509492505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156134485760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610bfc565b6001600160a01b0383811660008181526101006020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134c1848484612b4e565b6134cd84848484613c2d565b611a665760405162461bcd60e51b8152600401610bfc9061550f565b6001600160a01b03163b151590565b600054610100900460ff16610fb95760405162461bcd60e51b8152600401610bfc90615561565b600054610100900460ff166135465760405162461bcd60e51b8152600401610bfc90615561565b610fb933613398565b600054610100900460ff166135765760405162461bcd60e51b8152600401610bfc90615561565b81516135899060fb906020850190614172565b508051610f579060fc906020840190614172565b81516001600160781b031660008181526101686020526040902054600160801b90046001600160801b03161561360c5760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e48135a5b9d195960621b6044820152606401610bfc565b606083015160f01660ff831614610f575760405162461bcd60e51b8152602060048201526014602482015273474254433a2057726f6e6720415254205479706560601b6044820152606401610bfc565b60007fe645798fe54db29ed50fd7f01a05de6d1c5a65fac8902dcfd7427b30fbd87c2460001b83600001518460a0015185602001518660800151876040015188606001516040516020016136b697969594939291906155ac565b604051602081830303815290604052805190602001209050600061015f54826040516020016136e692919061548a565b604051602081830303815290604052805190602001209050600060018285600001602081019061371691906154a5565b866020013587604001356040516000815260200160405260405161373d94939291906154c0565b6020604051602081039080840390855afa15801561375f573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506127875760405162461bcd60e51b8152600401610bfc906154de565b61017054600090819060ff607885901c811691600160a01b9004168111156137fb5760405162461bcd60e51b8152602060048201526012602482015271474254433a2057726f6e6720526174696f2160701b6044820152606401610bfc565b936001600160781b039390931692915050565b60408201516001600160a01b031661385c5760405162461bcd60e51b815260206004820152601160248201527023a12a219d102d32b9379026b4b73a32b960791b6044820152606401610bfc565b81516001600160801b03908116600090815261016860209081526040918290208551828701518516600160801b02941693909317835590840151600183018054606087015160ff16600160a01b026001600160a81b03199091166001600160a01b0390931692909217919091179055608084015180518593926138e6926002850192910190614172565b5060a08201518051613902916003840191602090910190614172565b50506040805160e08101825260008082526020808301828152838501838152606085018481526080860185815260a0870186815260c088018781528c516001600160401b03908116875260ff8d811684528e516001600160801b039081168b52610169909952988b90208a518154985197519651955194516001600160a01b039091166001600160e01b031990991698909817600160a01b97909216969096021761ffff60e01b1916600160e01b9415159490940260ff60e81b191693909317600160e81b92151592909202919091176001600160f01b0316600160f01b911515919091026001600160f81b031617600160f81b939095169290920293909317835551600190920191909155918501518551919350613a2392909116613d3e565b825160208085015160408087015160608089015183516001600160801b03978816815296909416948601949094526001600160a01b03169084015260ff16908201527f79c8f412993c72ce60b23ac109f97d606389e44244c46ef8ca530ef920558cea9060800160405180910390a1505050565b600090815260fd60205260409020546001600160a01b0316151590565b6001600160a01b038316613b1157613b0c8161012f8054600083815261013060205260408120829055600182018355919091527f232da9e50dad2971456a78fb5cd6ff6b75019984d6e918139ce990999420f9790155565b613b34565b816001600160a01b0316836001600160a01b031614613b3457613b348382613e6a565b6001600160a01b038216613b4b57610f5781613f0c565b826001600160a01b0316826001600160a01b031614610f5757610f578282613fc1565b613b77816134e9565b613bd95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bfc565b60008051602061569e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c1183614007565b600082511180613c1e5750805b15610f5757611a668383614047565b6000613c41846001600160a01b03166134e9565b15613d3657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613c78903390899088908890600401615617565b602060405180830381600087803b158015613c9257600080fd5b505af1925050508015613cc2575060408051601f3d908101601f19168201909252613cbf9181019061564a565b60015b613d1c573d808015613cf0576040519150601f19603f3d011682016040523d82523d6000602084013e613cf5565b606091505b508051613d145760405162461bcd60e51b8152600401610bfc9061550f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128ab565b5060016128ab565b6001600160a01b038216613d945760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610bfc565b613d9d81613a97565b15613de95760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610bfc565b613df560008383613ab4565b6001600160a01b038216600090815260fe60205260408120805460019290613e1e908490614f80565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206156e5833981519152908290a45050565b60006001613e77846118f0565b613e819190615367565b600083815261012e6020526040902054909150808214613ed7576001600160a01b038416600090815261012d60209081526040808320858452825280832054848452818420819055835261012e90915290208190555b50600091825261012e602090815260408084208490556001600160a01b03909416835261012d81528383209183525290812055565b61012f54600090613f1f90600190615367565b6000838152610130602052604081205461012f8054939450909284908110613f4957613f49614ef7565b906000526020600020015490508061012f8381548110613f6b57613f6b614ef7565b6000918252602080832090910192909255828152610130909152604080822084905585825281205561012f805480613fa557613fa5615667565b6001900381819060005260206000200160009055905550505050565b6000613fcc836118f0565b6001600160a01b03909316600090815261012d60209081526040808320868452825280832085905593825261012e9052919091209190915550565b61401081613b6e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060614052836134e9565b6140ad5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610bfc565b600080846001600160a01b0316846040516140c8919061537e565b600060405180830381855af49150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b509150915061413082826040518060600160405280602781526020016156be60279139614139565b95945050505050565b60608315614148575081612961565b8251156141585782518084602001fd5b8160405162461bcd60e51b8152600401610bfc9190614390565b82805461417e90614e00565b90600052602060002090601f0160209004810192826141a057600085556141e6565b82601f106141b957805160ff19168380011785556141e6565b828001600101855582156141e6579182015b828111156141e65782518255916020019190600101906141cb565b506141f29291506141f6565b5090565b5b808211156141f257600081556001016141f7565b6001600160e01b03198116811461111857600080fd5b60006020828403121561423357600080fd5b81356129618161420b565b6001600160a01b038116811461111857600080fd5b803561425e8161423e565b919050565b60006020828403121561427557600080fd5b81356129618161423e565b600060c0828403121561429257600080fd5b50919050565b60006060828403121561429257600080fd5b60006080828403121561429257600080fd5b60008060008060c085870312156142d257600080fd5b84356001600160401b03808211156142e957600080fd5b6142f588838901614280565b95506143048860208901614298565b9450608087013591508082111561431a57600080fd5b50614327878288016142aa565b9497939650939460a0013593505050565b60005b8381101561435357818101518382015260200161433b565b83811115611a665750506000910152565b6000815180845261437c816020860160208601614338565b601f01601f19169290920160200192915050565b6020815260006129616020830184614364565b6000602082840312156143b557600080fd5b5035919050565b600080604083850312156143cf57600080fd5b82356143da8161423e565b946020939093013593505050565b6000806000606084860312156143fd57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561442957600080fd5b83356144348161423e565b925060208401356144448161423e565b929592945050506040919091013590565b60008083601f84011261446757600080fd5b5081356001600160401b0381111561447e57600080fd5b6020830191508360208260051b850101111561449957600080fd5b9250929050565b600080602083850312156144b357600080fd5b82356001600160401b038111156144c957600080fd5b611d2b85828601614455565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b038111828210171561450d5761450d6144d5565b60405290565b604051601f8201601f191681016001600160401b038111828210171561453b5761453b6144d5565b604052919050565b60006001600160401b0382111561455c5761455c6144d5565b50601f01601f191660200190565b600082601f83011261457b57600080fd5b813561458e61458982614543565b614513565b8181528460208386010111156145a357600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156145d357600080fd5b82356145de8161423e565b915060208301356001600160401b038111156145f957600080fd5b6146058582860161456a565b9150509250929050565b60006040828403121561429257600080fd5b6000806000806000610100868803121561463a57600080fd5b85356001600160401b038082111561465157600080fd5b61465d89838a01614280565b965061466c8960208a01614298565b9550608088013591508082111561468257600080fd5b5061468f888289016142aa565b93505061469f8760a0880161460f565b9497939650919460e0013592915050565b60008060008060008061010087890312156146ca57600080fd5b86356001600160401b03808211156146e157600080fd5b6146ed8a838b01614455565b90985096508691506147028a60208b01614298565b9550608089013591508082111561471857600080fd5b5061472589828a016142aa565b9350506147358860a0890161460f565b915060e087013590509295509295509295565b602080825282518282018190526000919060409081850190868401855b8281101561479757815180516001600160401b0390811686529087015116868501529284019290850190600101614765565b5091979650505050505050565b600080600080604085870312156147ba57600080fd5b84356001600160401b03808211156147d157600080fd5b6147dd88838901614455565b909650945060208701359150808211156147f657600080fd5b5061480387828801614455565b95989497509550505050565b60008060008060008060e0878903121561482857600080fd5b86356001600160401b038082111561483f57600080fd5b61484b8a838b01614455565b90985096508691506148608a60208b01614298565b9550608089013591508082111561487657600080fd5b5061488389828a016142aa565b93505060a08701356148948161423e565b8092505060c087013590509295509295509295565b801515811461111857600080fd5b600080604083850312156148ca57600080fd5b82356148d58161423e565b915060208301356148e5816148a9565b809150509250929050565b6000806040838503121561490357600080fd5b823561490e8161423e565b915060208301356148e58161423e565b6000806000806080858703121561493457600080fd5b843561493f8161423e565b9350602085013561494f8161423e565b92506040850135915060608501356001600160401b0381111561497157600080fd5b61497d8782880161456a565b91505092959194509250565b600080600080600060e086880312156149a157600080fd5b85356001600160401b03808211156149b857600080fd5b6149c489838a01614280565b96506149d38960208a01614298565b955060808801359150808211156149e957600080fd5b506149f6888289016142aa565b93505060a0860135614a078161423e565b9497939650919460c0013592915050565b600080600060408486031215614a2d57600080fd5b83356001600160401b03811115614a4357600080fd5b614a4f86828701614455565b9094509250506020840135614a63816148a9565b809150509250925092565b6001600160801b038781168252861660208201526001600160a01b038516604082015260ff8416606082015260c060808201819052600090614ab290830185614364565b82810360a0840152614ac48185614364565b9998505050505050505050565b60008060008060808587031215614ae757600080fd5b8435614af28161423e565b93506020850135614b028161423e565b92506040850135614b128161423e565b91506060850135614b228161423e565b939692955090935050565b602080825260129082015271474254433a205a65726f204164647265737360701b604082015260600190565b6020808252600d908201526c11d09510ce8811561412549151609a1b604082015260600190565b6001600160801b038116811461111857600080fd5b803561425e81614b80565b803560ff8116811461425e57600080fd5b600060c08284031215614bc357600080fd5b614bcb6144eb565b9050614bd682614b95565b8152614be460208301614b95565b6020820152614bf560408301614253565b6040820152614c0660608301614ba0565b606082015260808201356001600160401b0380821115614c2557600080fd5b614c318583860161456a565b608084015260a0840135915080821115614c4a57600080fd5b50614c578482850161456a565b60a08301525092915050565b6000610bc83683614bb1565b600060208284031215614c8157600080fd5b813561296181614b80565b6000808335601e19843603018112614ca357600080fd5b83016020810192503590506001600160401b03811115614cc257600080fd5b80360383131561449957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008135614d078161423e565b6001600160a01b03168352614d1f6020830183614c8c565b60806020860152614d34608086018284614cd1565b915050614d446040840184614c8c565b8583036040870152614d57838284614cd1565b92505050614d686060840184614c8c565b8583036060870152614d7b838284614cd1565b9695505050505050565b600060018060a01b03808a16835280891660208401525086604083015285606083015284608083015263ffffffff841660a083015260e060c0830152614ac460e0830184614cfa565b60008351614de0818460208801614338565b60609390931b6001600160601b0319169190920190815260140192915050565b600181811c90821680614e1457607f821691505b6020821081141561429257634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c9082015260008051602061567e83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c9082015260008051602061567e83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415614f3757614f37614f0d565b5060010190565b600060ff821660ff841680821015614f5857614f58614f0d565b90039392505050565b6000816000190483118215151615614f7b57614f7b614f0d565b500290565b60008219821115614f9357614f93614f0d565b500190565b600082614fb557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03958616815293909416602084015260408301919091526060820152901515608082015260a00190565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000614d7b6080830184614cfa565b60006001600160401b0380841115615038576150386144d5565b8360051b6020615049818301614513565b86815291850191818101903684111561506157600080fd5b865b848110156150955780358681111561507b5760008081fd5b61508736828b01614bb1565b845250918301918301615063565b50979650505050505050565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60208082526016908201527511d09510ce8810549508139bdd081058d8d95c1d195960521b604082015260600190565b60006020828403121561511557600080fd5b81516129618161423e565b6000806040838503121561513357600080fd5b825161513e81614b80565b60208401519092506148e581614b80565b8054600090600181811c908083168061516957607f831692505b602080841082141561518b57634e487b7160e01b600052602260045260246000fd5b838852602088018280156151a657600181146151b7576151e2565b60ff198716825282820197506151e2565b60008981526020902060005b878110156151dc578154848201529086019084016151c3565b83019850505b5050505050505092915050565b6001600160a01b0384811682526101206020830181905284546001600160801b0381169184019190915260801c610140830152600184015490811661016083015260a01c60ff1661018082015260c06101a082015260006152576101e083016002860161514f565b82810361011f19016101c0840152615272816003870161514f565b9150506128ab604083018480546001600160a01b038116835260a081811c6001600160401b0316602085015260e082901c60ff9081161515604086015260e883901c81161515606086015260f083901c161515608085015260f882901c90840152506001015460c09190910152565b6000602082840312156152f357600080fd5b81516001600160401b0381111561530957600080fd5b8201601f8101841361531a57600080fd5b805161532861458982614543565b81815285602083850101111561533d57600080fd5b614130826020830160208601614338565b60006020828403121561536057600080fd5b5051919050565b60008282101561537957615379614f0d565b500390565b60008251615390818460208701614338565b9190910192915050565b6000602082840312156153ac57600080fd5b8151612961816148a9565b6000604080830185845260208281860152818651808452606093508387019150838160051b88010183890160005b8381101561547a57898303605f19018552815180516001600160801b039081168552878201511687850152888101516001600160a01b0316898501528781015160ff168885015260808082015160c0828701819052919061544883880182614364565b9250505060a080830151925085820381870152506154668183614364565b9688019694505050908501906001016153e5565b50909a9950505050505050505050565b61190160f01b81526002810192909252602282015260420190565b6000602082840312156154b757600080fd5b61296182614ba0565b93845260ff9290921660208401526040830152606082015260800190565b602080825260179082015276474254433a20496e76616c69642053696e67617475726560481b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b878152600060018060801b03808916602084015260e060408401526155d460e0840189614364565b818816606085015283810360808501526155ee8188614364565b6001600160a01b039690961660a085015250505060ff9190911660c09091015295945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d7b90830184614364565b60006020828403121561565c57600080fd5b81516129618161420b565b634e487b7160e01b600052603160045260246000fdfe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000809000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.