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 <= 99, "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 { // 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 { struct BadgeInfo { address beneficiary; string offsetEntityID; string beneficiaryID; string offsetMessage; } function artBank() external view returns (address); function actionBuilderBadgeWithART( address tokenART, uint256 amountART, uint256 deadline, BadgeInfo calldata badgeInfo ) external; }
// 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 returns (uint256); function buyARTNative( address tokenART, uint256 amountART, bool isExactPay ) external payable returns (uint256); function buyARTWithPermit( address tokenART, uint256 amountART, bool isExactPay, Signature calldata permitToPay ) external returns (uint256); 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
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805161571e620001206000396000818161106a015281816110aa015281816111fe0152818161123e01526117d6015261571e6000f3fe6080604052600436106102d35760003560e01c806301ffc9a7146102d857806303e0ee241461030d578063058a628f1461033257806306d8a5881461035457806306fdde0314610367578063081812fc14610389578063095ea7b3146103c15780631719c3c2146103e157806318160ddd146103f8578063187096781461040e5780631a2b54461461042e57806323b872dd1461044f5780632de659191461046f5780632f745c59146104845780633644e515146104a45780633659cfe6146104bb57806342842e0e146104db578063481c6a75146104fb5780634ac7ceaa1461051c5780634f1ef2861461053c5780634f6ccce71461054f578063508899721461056f57806350d7b22c1461058f57806351b44baf146105af57806352d1902d146105cf57806353bf9014146105e45780636352211e146105fa578063647677ce1461061a5780636864c6b41461063157806368f50b8a1461065157806370a0823114610672578063715018a6146106925780637f9a105c146106a757806387bbc498146106c75780638b95e507146106e95780638cefb3c0146107095780638da5cb5b146107295780639526b6381461073e57806395d89b411461075e578063a22cb46514610773578063ac41865a14610793578063b1e5e2b7146107d3578063b88d4fde146107f3578063ba43b8b114610813578063bcb56ae214610828578063c0e9031714610848578063c12f51841461087c578063c360f55c1461089c578063c62c3abe146108bd578063c87b56dd146108dd578063cda4498e146108fd578063cf27fb3c1461091d578063d09edf311461094e578063d0ebdbe71461096f578063e0dce49e1461098f578063e3639229146109b0578063e985e9c5146109ef578063f08380fc14610a0f578063f2fde38b14610a30578063f54abe6f14610a50578063f78c945814610a71578063f8c8765e14610aa3578063fb253b3214610ac3578063ff6c079214610b91575b600080fd5b3480156102e457600080fd5b506102f86102f336600461422e565b610ba8565b60405190151581526020015b60405180910390f35b34801561031957600080fd5b5061032461016e5481565b604051908152602001610304565b34801561033e57600080fd5b5061035261034d366004614270565b610bd3565b005b6103526103623660046142c9565b610c2d565b34801561037357600080fd5b5061037c610d92565b604051610304919061439d565b34801561039557600080fd5b506103a96103a43660046143b0565b610e24565b6040516001600160a01b039091168152602001610304565b3480156103cd57600080fd5b506103526103dc3660046143c9565b610e4b565b3480156103ed57600080fd5b5061032461016b5481565b34801561040457600080fd5b5061012f54610324565b34801561041a57600080fd5b506103526104293660046143f5565b610f61565b34801561043a57600080fd5b50610171546103a9906001600160a01b031681565b34801561045b57600080fd5b5061035261046a366004614421565b610f7f565b34801561047b57600080fd5b50610352610fb0565b34801561049057600080fd5b5061032461049f3660046143c9565b610fc8565b3480156104b057600080fd5b5061032461015f5481565b3480156104c757600080fd5b506103526104d6366004614270565b61105f565b3480156104e757600080fd5b506103526104f6366004614421565b611128565b34801561050757600080fd5b50610160546103a9906001600160a01b031681565b34801561052857600080fd5b506103526105373660046144ad565b611143565b61035261054a3660046145cd565b6111f3565b34801561055b57600080fd5b5061032461056a3660046143b0565b6112ad565b34801561057b57600080fd5b5061035261058a36600461462e565b611342565b34801561059b57600080fd5b506103526105aa3660046146bd565b61155f565b3480156105bb57600080fd5b506103526105ca366004614270565b611778565b3480156105db57600080fd5b506103246117c9565b3480156105f057600080fd5b5061016c54610324565b34801561060657600080fd5b506103a96106153660046143b0565b611877565b34801561062657600080fd5b5061032461016f5481565b34801561063d57600080fd5b5061035261064c366004614270565b6118ac565b34801561065d57600080fd5b50610165546103a9906001600160a01b031681565b34801561067e57600080fd5b5061032461068d366004614270565b6118fd565b34801561069e57600080fd5b50610352611983565b3480156106b357600080fd5b506103526106c2366004614270565b611995565b3480156106d357600080fd5b506106dc6119e6565b6040516103049190614755565b3480156106f557600080fd5b506103526107043660046147b1565b611a5d565b34801561071557600080fd5b506103526107243660046143b0565b611a79565b34801561073557600080fd5b506103a9611aea565b34801561074a57600080fd5b5061035261075936600461481c565b611af9565b34801561076a57600080fd5b5061037c611c0e565b34801561077f57600080fd5b5061035261078e3660046148c4565b611c1d565b34801561079f57600080fd5b506107b36107ae3660046148fd565b611c28565b604080516001600160801b03938416815292909116602083015201610304565b3480156107df57600080fd5b506103526107ee3660046143b0565b611d44565b3480156107ff57600080fd5b5061035261080e36600461492b565b611ee7565b34801561081f57600080fd5b506106dc611f19565b34801561083457600080fd5b50610352610843366004614996565b611f86565b34801561085457600080fd5b506101705461086a90600160a01b900460ff1681565b60405160ff9091168152602001610304565b34801561088857600080fd5b506103526108973660046143b0565b612083565b3480156108a857600080fd5b50610164546103a9906001600160a01b031681565b3480156108c957600080fd5b506103526108d8366004614270565b6120d3565b3480156108e957600080fd5b5061037c6108f83660046143b0565b612124565b34801561090957600080fd5b50610352610918366004614a25565b610f69565b34801561092957600080fd5b506102f8610938366004614270565b61016a6020526000908152604090205460ff1681565b34801561095a57600080fd5b50610161546103a9906001600160a01b031681565b34801561097b57600080fd5b5061035261098a366004614270565b61222e565b34801561099b57600080fd5b50610163546103a9906001600160a01b031681565b3480156109bc57600080fd5b506109d06109cb3660046143b0565b61227f565b6040805193151584529115156020840152151590820152606001610304565b3480156109fb57600080fd5b506102f8610a0a3660046148fd565b6122e7565b348015610a1b57600080fd5b50610162546103a9906001600160a01b031681565b348015610a3c57600080fd5b50610352610a4b366004614270565b612316565b348015610a5c57600080fd5b50610170546103a9906001600160a01b031681565b348015610a7d57600080fd5b50610a91610a8c3660046143b0565b61238c565b60405161030496959493929190614a7b565b348015610aaf57600080fd5b50610352610abe366004614ade565b6124f0565b348015610acf57600080fd5b50610b40610ade3660046143b0565b61016960205260009081526040902080546001909101546001600160a01b038216916001600160401b03600160a01b8204169160ff600160e01b8304811692600160e81b8104821692600160f01b8204831692600160f81b9092049091169087565b604080516001600160a01b0390981688526001600160401b0390961660208801529315159486019490945290151560608501521515608084015260ff90911660a083015260c082015260e001610304565b348015610b9d57600080fd5b5061032461016d5481565b60006001600160e01b0319821663780e9d6360e01b1480610bcd5750610bcd8261279b565b92915050565b610bdb6127eb565b6001600160a01b038116610c0a5760405162461bcd60e51b8152600401610c0190614b3a565b60405180910390fd5b61016180546001600160a01b0319166001600160a01b0392909216919091179055565b80428163ffffffff161015610c545760405162461bcd60e51b8152600401610c0190614b66565b610c69826000610c6388614c70565b8761284a565b5061016560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505061016554610164546003945060009350638d7fcefd92506001600160a01b03918216911634610d17610d0960408d0160208e01614c7c565b6001600160801b03166128c0565b86898b604051602401610d309796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050610d8981335b604051602001610d75929190614ddb565b604051602081830303815290604052612975565b50505050505050565b606060fb8054610da190614e0d565b80601f0160208091040260200160405190810160405280929190818152602001828054610dcd90614e0d565b8015610e1a5780601f10610def57610100808354040283529160200191610e1a565b820191906000526020600020905b815481529060010190602001808311610dfd57829003601f168201915b5050505050905090565b6000610e2f82612a46565b50600090815260ff60205260409020546001600160a01b031690565b6000610e5682611877565b9050806001600160a01b0316836001600160a01b03161415610ec45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c01565b336001600160a01b0382161480610ee05750610ee081336122e7565b610f525760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c01565b610f5c8383612a6b565b505050565b610f696127eb565b61017054610f5c906001600160a01b0316612ad9565b610f893382612afd565b610fa55760405162461bcd60e51b8152600401610c0190614e42565b610f5c838383612b5b565b61017054610fc6906001600160a01b0316612ad9565b565b6000610fd3836118fd565b82106110355760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c01565b506001600160a01b0391909116600090815261012d60209081526040808320938352929052205490565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156110a85760405162461bcd60e51b8152600401610c0190614e90565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110da612cf0565b6001600160a01b0316146111005760405162461bcd60e51b8152600401610c0190614eca565b61110981612d0c565b6040805160008082526020820190925261112591839190612d14565b50565b610f5c83838360405180602001604052806000815250611ee7565b61114b6127eb565b610163546001600160a01b03166111975760405162461bcd60e51b815260206004820152601060248201526f23a12a219d10273790213ab4b63232b960811b6044820152606401610c01565b60005b81811015610f5c576111e18383838181106111b7576111b7614f04565b90506020020160208101906111cc9190614270565b610163546001600160a01b0316600019612e8e565b806111eb81614f30565b91505061119a565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561123c5760405162461bcd60e51b8152600401610c0190614e90565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661126e612cf0565b6001600160a01b0316146112945760405162461bcd60e51b8152600401610c0190614eca565b61129d82612d0c565b6112a982826001612d14565b5050565b60006112b961012f5490565b821061131c5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c01565b61012f828154811061133057611330614f04565b90600052602060002001549050919050565b80428163ffffffff1610156113695760405162461bcd60e51b8152600401610c0190614b66565b600061137f83826113798a614c70565b8961284a565b905061139d6113916020860186614270565b33308760200135612fa2565b60006113b2610d0960408a0160208b01614c7c565b905060ff8216156114ce57600060646113cb8482614f4b565b6113d89060ff1684614f6e565b6113e3906063614f8d565b6113ed9190614fa5565b9050600063478a55b66114036020890189614270565b6101715460405161142c92916001600160a01b03169060208c0135908790600090602401614fc7565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114648133610d64565b61017154604051636e556df89161148f916001600160a01b039091169086908a908d90602401614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114c78133610d64565b5050611555565b60026000638d7fcefd6114e46020890189614270565b61016460009054906101000a90046001600160a01b0316896020013586868b8e60405160240161151a9796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506115528133610d64565b50505b5050505050505050565b80428163ffffffff1610156115865760405162461bcd60e51b8152600401610c0190614b66565b60008061159e84826115988b8d61502b565b8a6130d2565b90925090506115bf6115b36020870187614270565b33308860200135612fa2565b60006115ca836128c0565b905060ff8216156116e657600060646115e38482614f4b565b6115f09060ff1684614f6e565b6115fb906063614f8d565b6116059190614fa5565b9050600063478a55b661161b60208a018a614270565b6101715460405161164492916001600160a01b03169060208d0135908790600090602401614fc7565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061167c8133610d64565b61017154604051636e556df8916116a7916001600160a01b039091169086908b908e90602401614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506116df8133610d64565b5050611552565b60026000638d7fcefd6116fc60208a018a614270565b61016460009054906101000a90046001600160a01b03168a6020013586868c8f6040516024016117329796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061176a8133610d64565b505050505050505050505050565b6117806127eb565b6001600160a01b0381166117a65760405162461bcd60e51b8152600401610c0190614b3a565b61016480546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118645760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610c01565b506000805160206156ab83398151915290565b600081815260fd60205260408120546001600160a01b031680610bcd5760405162461bcd60e51b8152600401610c01906150ae565b6118b46127eb565b6001600160a01b0381166118da5760405162461bcd60e51b8152600401610c0190614b3a565b61017180546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166119675760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610c01565b506001600160a01b0316600090815260fe602052604090205490565b61198b6127eb565b610fc660006133a5565b61199d6127eb565b6001600160a01b0381166119c35760405162461bcd60e51b8152600401610c0190614b3a565b61016280546001600160a01b0319166001600160a01b0392909216919091179055565b6060610166805480602002602001604051908101604052809291908181526020016000905b82821015611a5457600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b9091041681830152825260019092019101611a0b565b50505050905090565b61017054611a73906001600160a01b0316612ad9565b50505050565b611a816127eb565b6063811115611ac95760405162461bcd60e51b8152602060048201526014602482015273474254433a20546f6f204d6f726520526174696f60601b6044820152606401610c01565b610170805460ff909216600160a01b0260ff60a01b19909216919091179055565b6097546001600160a01b031690565b80428163ffffffff161015611b205760405162461bcd60e51b8152600401610c0190614b66565b6001600160a01b038316600090815261016a602052604090205460ff16611b595760405162461bcd60e51b8152600401610c01906150e0565b600080611b6c8460106115988b8d61502b565b915091506000611b7b836128c0565b9050611bab8633306064611b8f8782614f4b565b611b9c9060ff1687614f6e565b611ba69190614fa5565b612fa2565b6000636e556df88783888b604051602401611bc99493929190614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050611c018133610d64565b5050505050505050505050565b606060fc8054610da190614e0d565b6112a93383836133f7565b600080600061016360009054906101000a90046001600160a01b03166001600160a01b031663678aa4f36040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7c57600080fd5b505afa158015611c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb49190615110565b604051633612cf2560e01b81526001600160a01b038781166004830152868116602483015291925090821690633612cf2590604401604080518083038186803b158015611d0057600080fd5b505afa158015611d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d38919061512d565b90969095509350505050565b611d4d81611877565b6001600160a01b0316336001600160a01b031614611d9f5760405162461bcd60e51b815260206004820152600f60248201526e23a12a219d102737ba1027bbb732b960891b6044820152606401610c01565b60008181526101696020526040902054600160e01b900460ff1615611dfd5760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e4813dc195b995960621b6044820152606401610c01565b6040805180820182526001600160401b0383811682524380821660208085019182526101668054600181018255600091825286517fa5a4c57b7184ec73d55be4993773cb4eef681bc86a28d0285cd66efb50676a97909101805494518716600160401b026001600160801b0319909516919096161792909217909355858152610169835284902080546001600160a01b0360ff60e01b01191633908117600160e01b17909155845190815291820185905292810192909252907f66b10d9ff37b599d2105c94c297dc6149f44b851df44d93080dc0833ba8e6e919060600160405180910390a15050565b611ef13383612afd565b611f0d5760405162461bcd60e51b8152600401610c0190614e42565b611a73848484846134c3565b60606101678054806020026020016040519081016040528092919081815260200160009082821015611a5457600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b9091041681830152825260019092019101611a0b565b80428163ffffffff161015611fad5760405162461bcd60e51b8152600401610c0190614b66565b6001600160a01b038316600090815261016a602052604090205460ff16611fe65760405162461bcd60e51b8152600401610c01906150e0565b6000611ff78360106113798a614c70565b9050600061200e610d0960408a0160208b01614c7c565b90506120228533306064611b8f8782614f4b565b6000636e556df88683878a6040516024016120409493929190614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506120788133610d64565b505050505050505050565b61208b6127eb565b60148111156120cd5760405162461bcd60e51b815260206004820152600e60248201526d474254433a20546f6f204d6f726560901b6044820152606401610c01565b61016b55565b6120db6127eb565b6001600160a01b0381166121015760405162461bcd60e51b8152600401610c0190614b3a565b61017080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815261016860205260409020600101546060906001600160a01b03166121825760405162461bcd60e51b815260206004820152601060248201526f11d09510ce88139bdd08135a5b9d195960821b6044820152606401610c01565b610162546001600160a01b03166342aee6bb61219d84611877565b6000858152610168602090815260408083206101699092529182902091516001600160e01b031960e086901b1681526121da9392906004016151fc565b60006040518083038186803b1580156121f257600080fd5b505afa158015612206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bcd91908101906152ee565b6122366127eb565b6001600160a01b03811661225c5760405162461bcd60e51b8152600401610c0190614b3a565b61016080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152610168602052604081205481908190600160801b90046001600160801b03166122b5575060009150819050806122e0565b5050506000818152610169602052604090205460019060ff600160e01b8204811691600160e81b9004165b9193909250565b6001600160a01b0391821660009081526101006020908152604080832093909416825291909152205460ff1690565b61231e6127eb565b6001600160a01b0381166123835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c01565b611125816133a5565b610168602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b90950416936001600160a01b03841693600160a01b900460ff169290916123df90614e0d565b80601f016020809104026020016040519081016040528092919081815260200182805461240b90614e0d565b80156124585780601f1061242d57610100808354040283529160200191612458565b820191906000526020600020905b81548152906001019060200180831161243b57829003601f168201915b50505050509080600301805461246d90614e0d565b80601f016020809104026020016040519081016040528092919081815260200182805461249990614e0d565b80156124e65780601f106124bb576101008083540402835291602001916124e6565b820191906000526020600020905b8154815290600101906020018083116124c957829003601f168201915b5050505050905086565b600054610100900460ff16158080156125105750600054600160ff909116105b80612531575061251f306134f6565b158015612531575060005460ff166001145b6125945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c01565b6000805460ff1916600117905580156125b7576000805461ff0019166101001790555b6125bf613505565b6125c761352c565b6126126040518060400160405280600e81526020016d23b932b2b710212a219021b63ab160911b8152506040518060400160405280600381526020016247424360e81b81525061355c565b604080518082018252600e81526d23b932b2b710212a219021b63ab160911b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa24958b5bf039b27bb75556bcf8b8d2620327722d5e05db3d9e9f0557b49ab71818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012061015f556126f0611aea565b61016080546001600160a01b03199081166001600160a01b03938416179091556101618054821688841617905561016380548216878416179055610164805482168684161790556101658054909116918416919091179055600561016b558015612794576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006001600160e01b031982166380ac58cd60e01b14806127cc57506001600160e01b03198216635b5e139f60e01b145b80610bcd57506301ffc9a760e01b6001600160e01b0319831614610bcd565b336127f4611aea565b6001600160a01b031614610fc65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c01565b600061285683856135aa565b6128608383613669565b60008061287085600001516137a9565b915091508160ff1660001461288c576001600160801b03811685525b612896858361381b565b603f87901c156128b45784516128b4906001600160801b0316611d44565b5090505b949350505050565b60008061016460009054906101000a90046001600160a01b03166001600160a01b0316632f0e0a726040518163ffffffff1660e01b815260040160206040518083038186803b15801561291257600080fd5b505afa158015612926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294a919061535b565b905061295881612710615374565b61296484612710614f6e565b61296e9190614fa5565b9392505050565b6101635460405160009182916001600160a01b039091169061299890859061538b565b6000604051808303816000865af19150503d80600081146129d5576040519150601f19603f3d011682016040523d82523d6000602084013e6129da565b606091505b509150915081610f5c578051156129f45780518082602001fd5b60405162461bcd60e51b815260206004820152602160248201527f474254433a204572726f722043616c6c20746f20616374696f6e4275696c64656044820152603960f91b6064820152608401610c01565b612a4f81613aa4565b6111255760405162461bcd60e51b8152600401610c01906150ae565b600081815260ff6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612aa082611877565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b3660008037600080366000845af43d6000803e808015612af8573d6000f35b3d6000fd5b600080612b0983611877565b9050806001600160a01b0316846001600160a01b03161480612b305750612b3081856122e7565b806128b85750836001600160a01b0316612b4984610e24565b6001600160a01b031614949350505050565b826001600160a01b0316612b6e82611877565b6001600160a01b031614612bd25760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c01565b6001600160a01b038216612c345760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c01565b612c3f838383613ac1565b612c4a600082612a6b565b6001600160a01b038316600090815260fe60205260408120805460019290612c73908490615374565b90915550506001600160a01b038216600090815260fe60205260408120805460019290612ca1908490614f8d565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206156f283398151915291a4505050565b6000805160206156ab833981519152546001600160a01b031690565b6111256127eb565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612d4757610f5c83613b7b565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8057600080fd5b505afa925050508015612db0575060408051601f3d908101601f19168201909252612dad9181019061535b565b60015b612e135760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c01565b6000805160206156ab8339815191528114612e825760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c01565b50610f5c838383613c15565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691612eea919061538b565b6000604051808303816000865af19150503d8060008114612f27576040519150601f19603f3d011682016040523d82523d6000602084013e612f2c565b606091505b5091509150818015612f56575080511580612f56575080806020019051810190612f5691906153a7565b6127945760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c454400006044820152606401610c01565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691613006919061538b565b6000604051808303816000865af19150503d8060008114613043576040519150601f19603f3d011682016040523d82523d6000602084013e613048565b606091505b509150915081801561307257508051158061307257508080602001905181019061307291906153a7565b6130ca5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610c01565b505050505050565b60008060007f829abf7a83fcbcf66649914b5a9a514acbf6beda598a620aef732202e8155d7360001b8560405160200161310d9291906153c4565b6040516020818303038152906040529050600081805190602001209050600061015f5482604051602001613142929190615497565b604051602081830303815290604052805190602001209050600060018288600001602081019061317291906154b2565b89602001358a604001356040516000815260200160405260405161319994939291906154cd565b6020604051602081039080840390855afa1580156131bb573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506131f85760405162461bcd60e51b8152600401610c01906154eb565b87516001603f1b8b161515906001603e1b8c16151590600090613236908c90839061322557613225614f04565b6020026020010151600001516137a9565b909850905060ff88161561327157808b60008151811061325857613258614f04565b60209081029190910101516001600160801b0390911690525b60005b8b5181101561334c5760008c828151811061329157613291614f04565b602002602001015190508380156132cb575080516001600160801b0390811660009081526101686020526040902054600160801b90041615155b156132d6575061333a565b6132e0818f6135aa565b6132ea818b61381b565b8415613304578051613304906001600160801b0316611d44565b8c828151811061331657613316614f04565b6020026020010151602001516001600160801b03168b6133369190614f8d565b9a50505b8061334481614f30565b915050613274565b50886133955760405162461bcd60e51b8152602060048201526018602482015277474254433a204e6f20426c6f636b20417661696c61626c6560401b6044820152606401610c01565b5050505050505094509492505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156134555760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610c01565b6001600160a01b0383811660008181526101006020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134ce848484612b5b565b6134da84848484613c3a565b611a735760405162461bcd60e51b8152600401610c019061551c565b6001600160a01b03163b151590565b600054610100900460ff16610fc65760405162461bcd60e51b8152600401610c019061556e565b600054610100900460ff166135535760405162461bcd60e51b8152600401610c019061556e565b610fc6336133a5565b600054610100900460ff166135835760405162461bcd60e51b8152600401610c019061556e565b81516135969060fb90602085019061417f565b508051610f5c9060fc90602084019061417f565b81516001600160781b031660008181526101686020526040902054600160801b90046001600160801b0316156136195760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e48135a5b9d195960621b6044820152606401610c01565b606083015160f01660ff831614610f5c5760405162461bcd60e51b8152602060048201526014602482015273474254433a2057726f6e6720415254205479706560601b6044820152606401610c01565b60007fe645798fe54db29ed50fd7f01a05de6d1c5a65fac8902dcfd7427b30fbd87c2460001b83600001518460a0015185602001518660800151876040015188606001516040516020016136c397969594939291906155b9565b604051602081830303815290604052805190602001209050600061015f54826040516020016136f3929190615497565b604051602081830303815290604052805190602001209050600060018285600001602081019061372391906154b2565b866020013587604001356040516000815260200160405260405161374a94939291906154cd565b6020604051602081039080840390855afa15801561376c573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506127945760405162461bcd60e51b8152600401610c01906154eb565b61017054600090819060ff607885901c811691600160a01b9004168111156138085760405162461bcd60e51b8152602060048201526012602482015271474254433a2057726f6e6720526174696f2160701b6044820152606401610c01565b936001600160781b039390931692915050565b60408201516001600160a01b03166138695760405162461bcd60e51b815260206004820152601160248201527023a12a219d102d32b9379026b4b73a32b960791b6044820152606401610c01565b81516001600160801b03908116600090815261016860209081526040918290208551828701518516600160801b02941693909317835590840151600183018054606087015160ff16600160a01b026001600160a81b03199091166001600160a01b0390931692909217919091179055608084015180518593926138f392600285019291019061417f565b5060a0820151805161390f91600384019160209091019061417f565b50506040805160e08101825260008082526020808301828152838501838152606085018481526080860185815260a0870186815260c088018781528c516001600160401b03908116875260ff8d811684528e516001600160801b039081168b52610169909952988b90208a518154985197519651955194516001600160a01b039091166001600160e01b031990991698909817600160a01b97909216969096021761ffff60e01b1916600160e01b9415159490940260ff60e81b191693909317600160e81b92151592909202919091176001600160f01b0316600160f01b911515919091026001600160f81b031617600160f81b939095169290920293909317835551600190920191909155918501518551919350613a3092909116613d4b565b825160208085015160408087015160608089015183516001600160801b03978816815296909416948601949094526001600160a01b03169084015260ff16908201527f79c8f412993c72ce60b23ac109f97d606389e44244c46ef8ca530ef920558cea9060800160405180910390a1505050565b600090815260fd60205260409020546001600160a01b0316151590565b6001600160a01b038316613b1e57613b198161012f8054600083815261013060205260408120829055600182018355919091527f232da9e50dad2971456a78fb5cd6ff6b75019984d6e918139ce990999420f9790155565b613b41565b816001600160a01b0316836001600160a01b031614613b4157613b418382613e77565b6001600160a01b038216613b5857610f5c81613f19565b826001600160a01b0316826001600160a01b031614610f5c57610f5c8282613fce565b613b84816134f6565b613be65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c01565b6000805160206156ab83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c1e83614014565b600082511180613c2b5750805b15610f5c57611a738383614054565b6000613c4e846001600160a01b03166134f6565b15613d4357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613c85903390899088908890600401615624565b602060405180830381600087803b158015613c9f57600080fd5b505af1925050508015613ccf575060408051601f3d908101601f19168201909252613ccc91810190615657565b60015b613d29573d808015613cfd576040519150601f19603f3d011682016040523d82523d6000602084013e613d02565b606091505b508051613d215760405162461bcd60e51b8152600401610c019061551c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128b8565b5060016128b8565b6001600160a01b038216613da15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c01565b613daa81613aa4565b15613df65760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610c01565b613e0260008383613ac1565b6001600160a01b038216600090815260fe60205260408120805460019290613e2b908490614f8d565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206156f2833981519152908290a45050565b60006001613e84846118fd565b613e8e9190615374565b600083815261012e6020526040902054909150808214613ee4576001600160a01b038416600090815261012d60209081526040808320858452825280832054848452818420819055835261012e90915290208190555b50600091825261012e602090815260408084208490556001600160a01b03909416835261012d81528383209183525290812055565b61012f54600090613f2c90600190615374565b6000838152610130602052604081205461012f8054939450909284908110613f5657613f56614f04565b906000526020600020015490508061012f8381548110613f7857613f78614f04565b6000918252602080832090910192909255828152610130909152604080822084905585825281205561012f805480613fb257613fb2615674565b6001900381819060005260206000200160009055905550505050565b6000613fd9836118fd565b6001600160a01b03909316600090815261012d60209081526040808320868452825280832085905593825261012e9052919091209190915550565b61401d81613b7b565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061405f836134f6565b6140ba5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c01565b600080846001600160a01b0316846040516140d5919061538b565b600060405180830381855af49150503d8060008114614110576040519150601f19603f3d011682016040523d82523d6000602084013e614115565b606091505b509150915061413d82826040518060600160405280602781526020016156cb60279139614146565b95945050505050565b6060831561415557508161296e565b8251156141655782518084602001fd5b8160405162461bcd60e51b8152600401610c01919061439d565b82805461418b90614e0d565b90600052602060002090601f0160209004810192826141ad57600085556141f3565b82601f106141c657805160ff19168380011785556141f3565b828001600101855582156141f3579182015b828111156141f35782518255916020019190600101906141d8565b506141ff929150614203565b5090565b5b808211156141ff5760008155600101614204565b6001600160e01b03198116811461112557600080fd5b60006020828403121561424057600080fd5b813561296e81614218565b6001600160a01b038116811461112557600080fd5b803561426b8161424b565b919050565b60006020828403121561428257600080fd5b813561296e8161424b565b600060c0828403121561429f57600080fd5b50919050565b60006060828403121561429f57600080fd5b60006080828403121561429f57600080fd5b60008060008060c085870312156142df57600080fd5b84356001600160401b03808211156142f657600080fd5b6143028883890161428d565b955061431188602089016142a5565b9450608087013591508082111561432757600080fd5b50614334878288016142b7565b9497939650939460a0013593505050565b60005b83811015614360578181015183820152602001614348565b83811115611a735750506000910152565b60008151808452614389816020860160208601614345565b601f01601f19169290920160200192915050565b60208152600061296e6020830184614371565b6000602082840312156143c257600080fd5b5035919050565b600080604083850312156143dc57600080fd5b82356143e78161424b565b946020939093013593505050565b60008060006060848603121561440a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561443657600080fd5b83356144418161424b565b925060208401356144518161424b565b929592945050506040919091013590565b60008083601f84011261447457600080fd5b5081356001600160401b0381111561448b57600080fd5b6020830191508360208260051b85010111156144a657600080fd5b9250929050565b600080602083850312156144c057600080fd5b82356001600160401b038111156144d657600080fd5b611d3885828601614462565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b038111828210171561451a5761451a6144e2565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614548576145486144e2565b604052919050565b60006001600160401b03821115614569576145696144e2565b50601f01601f191660200190565b600082601f83011261458857600080fd5b813561459b61459682614550565b614520565b8181528460208386010111156145b057600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156145e057600080fd5b82356145eb8161424b565b915060208301356001600160401b0381111561460657600080fd5b61461285828601614577565b9150509250929050565b60006040828403121561429f57600080fd5b6000806000806000610100868803121561464757600080fd5b85356001600160401b038082111561465e57600080fd5b61466a89838a0161428d565b96506146798960208a016142a5565b9550608088013591508082111561468f57600080fd5b5061469c888289016142b7565b9350506146ac8760a0880161461c565b9497939650919460e0013592915050565b60008060008060008061010087890312156146d757600080fd5b86356001600160401b03808211156146ee57600080fd5b6146fa8a838b01614462565b909850965086915061470f8a60208b016142a5565b9550608089013591508082111561472557600080fd5b5061473289828a016142b7565b9350506147428860a0890161461c565b915060e087013590509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156147a457815180516001600160401b0390811686529087015116868501529284019290850190600101614772565b5091979650505050505050565b600080600080604085870312156147c757600080fd5b84356001600160401b03808211156147de57600080fd5b6147ea88838901614462565b9096509450602087013591508082111561480357600080fd5b5061481087828801614462565b95989497509550505050565b60008060008060008060e0878903121561483557600080fd5b86356001600160401b038082111561484c57600080fd5b6148588a838b01614462565b909850965086915061486d8a60208b016142a5565b9550608089013591508082111561488357600080fd5b5061489089828a016142b7565b93505060a08701356148a18161424b565b8092505060c087013590509295509295509295565b801515811461112557600080fd5b600080604083850312156148d757600080fd5b82356148e28161424b565b915060208301356148f2816148b6565b809150509250929050565b6000806040838503121561491057600080fd5b823561491b8161424b565b915060208301356148f28161424b565b6000806000806080858703121561494157600080fd5b843561494c8161424b565b9350602085013561495c8161424b565b92506040850135915060608501356001600160401b0381111561497e57600080fd5b61498a87828801614577565b91505092959194509250565b600080600080600060e086880312156149ae57600080fd5b85356001600160401b03808211156149c557600080fd5b6149d189838a0161428d565b96506149e08960208a016142a5565b955060808801359150808211156149f657600080fd5b50614a03888289016142b7565b93505060a0860135614a148161424b565b9497939650919460c0013592915050565b600080600060408486031215614a3a57600080fd5b83356001600160401b03811115614a5057600080fd5b614a5c86828701614462565b9094509250506020840135614a70816148b6565b809150509250925092565b6001600160801b038781168252861660208201526001600160a01b038516604082015260ff8416606082015260c060808201819052600090614abf90830185614371565b82810360a0840152614ad18185614371565b9998505050505050505050565b60008060008060808587031215614af457600080fd5b8435614aff8161424b565b93506020850135614b0f8161424b565b92506040850135614b1f8161424b565b91506060850135614b2f8161424b565b939692955090935050565b602080825260129082015271474254433a205a65726f204164647265737360701b604082015260600190565b6020808252600d908201526c11d09510ce8811561412549151609a1b604082015260600190565b6001600160801b038116811461112557600080fd5b803561426b81614b8d565b803560ff8116811461426b57600080fd5b600060c08284031215614bd057600080fd5b614bd86144f8565b9050614be382614ba2565b8152614bf160208301614ba2565b6020820152614c0260408301614260565b6040820152614c1360608301614bad565b606082015260808201356001600160401b0380821115614c3257600080fd5b614c3e85838601614577565b608084015260a0840135915080821115614c5757600080fd5b50614c6484828501614577565b60a08301525092915050565b6000610bcd3683614bbe565b600060208284031215614c8e57600080fd5b813561296e81614b8d565b6000808335601e19843603018112614cb057600080fd5b83016020810192503590506001600160401b03811115614ccf57600080fd5b8036038313156144a657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008135614d148161424b565b6001600160a01b03168352614d2c6020830183614c99565b60806020860152614d41608086018284614cde565b915050614d516040840184614c99565b8583036040870152614d64838284614cde565b92505050614d756060840184614c99565b8583036060870152614d88838284614cde565b9695505050505050565b600060018060a01b03808a16835280891660208401525086604083015285606083015284608083015263ffffffff841660a083015260e060c0830152614ad160e0830184614d07565b60008351614ded818460208801614345565b60609390931b6001600160601b0319169190920190815260140192915050565b600181811c90821680614e2157607f821691505b6020821081141561429f57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c9082015260008051602061568b83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c9082015260008051602061568b83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415614f4457614f44614f1a565b5060010190565b600060ff821660ff841680821015614f6557614f65614f1a565b90039392505050565b6000816000190483118215151615614f8857614f88614f1a565b500290565b60008219821115614fa057614fa0614f1a565b500190565b600082614fc257634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03958616815293909416602084015260408301919091526060820152901515608082015260a00190565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000614d886080830184614d07565b60006001600160401b0380841115615045576150456144e2565b8360051b6020615056818301614520565b86815291850191818101903684111561506e57600080fd5b865b848110156150a2578035868111156150885760008081fd5b61509436828b01614bbe565b845250918301918301615070565b50979650505050505050565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60208082526016908201527511d09510ce8810549508139bdd081058d8d95c1d195960521b604082015260600190565b60006020828403121561512257600080fd5b815161296e8161424b565b6000806040838503121561514057600080fd5b825161514b81614b8d565b60208401519092506148f281614b8d565b8054600090600181811c908083168061517657607f831692505b602080841082141561519857634e487b7160e01b600052602260045260246000fd5b838852602088018280156151b357600181146151c4576151ef565b60ff198716825282820197506151ef565b60008981526020902060005b878110156151e9578154848201529086019084016151d0565b83019850505b5050505050505092915050565b6001600160a01b0384811682526101206020830181905284546001600160801b0381169184019190915260801c610140830152600184015490811661016083015260a01c60ff1661018082015260c06101a082015260006152646101e083016002860161515c565b82810361011f19016101c084015261527f816003870161515c565b9150506128b8604083018480546001600160a01b038116835260a081811c6001600160401b0316602085015260e082901c60ff9081161515604086015260e883901c81161515606086015260f083901c161515608085015260f882901c90840152506001015460c09190910152565b60006020828403121561530057600080fd5b81516001600160401b0381111561531657600080fd5b8201601f8101841361532757600080fd5b805161533561459682614550565b81815285602083850101111561534a57600080fd5b61413d826020830160208601614345565b60006020828403121561536d57600080fd5b5051919050565b60008282101561538657615386614f1a565b500390565b6000825161539d818460208701614345565b9190910192915050565b6000602082840312156153b957600080fd5b815161296e816148b6565b6000604080830185845260208281860152818651808452606093508387019150838160051b88010183890160005b8381101561548757898303605f19018552815180516001600160801b039081168552878201511687850152888101516001600160a01b0316898501528781015160ff168885015260808082015160c0828701819052919061545583880182614371565b9250505060a080830151925085820381870152506154738183614371565b9688019694505050908501906001016153f2565b50909a9950505050505050505050565b61190160f01b81526002810192909252602282015260420190565b6000602082840312156154c457600080fd5b61296e82614bad565b93845260ff9290921660208401526040830152606082015260800190565b602080825260179082015276474254433a20496e76616c69642053696e67617475726560481b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b878152600060018060801b03808916602084015260e060408401526155e160e0840189614371565b818816606085015283810360808501526155fb8188614371565b6001600160a01b039690961660a085015250505060ff9190911660c09091015295945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d8890830184614371565b60006020828403121561566957600080fd5b815161296e81614218565b634e487b7160e01b600052603160045260246000fdfe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000809000a
Deployed Bytecode
0x6080604052600436106102d35760003560e01c806301ffc9a7146102d857806303e0ee241461030d578063058a628f1461033257806306d8a5881461035457806306fdde0314610367578063081812fc14610389578063095ea7b3146103c15780631719c3c2146103e157806318160ddd146103f8578063187096781461040e5780631a2b54461461042e57806323b872dd1461044f5780632de659191461046f5780632f745c59146104845780633644e515146104a45780633659cfe6146104bb57806342842e0e146104db578063481c6a75146104fb5780634ac7ceaa1461051c5780634f1ef2861461053c5780634f6ccce71461054f578063508899721461056f57806350d7b22c1461058f57806351b44baf146105af57806352d1902d146105cf57806353bf9014146105e45780636352211e146105fa578063647677ce1461061a5780636864c6b41461063157806368f50b8a1461065157806370a0823114610672578063715018a6146106925780637f9a105c146106a757806387bbc498146106c75780638b95e507146106e95780638cefb3c0146107095780638da5cb5b146107295780639526b6381461073e57806395d89b411461075e578063a22cb46514610773578063ac41865a14610793578063b1e5e2b7146107d3578063b88d4fde146107f3578063ba43b8b114610813578063bcb56ae214610828578063c0e9031714610848578063c12f51841461087c578063c360f55c1461089c578063c62c3abe146108bd578063c87b56dd146108dd578063cda4498e146108fd578063cf27fb3c1461091d578063d09edf311461094e578063d0ebdbe71461096f578063e0dce49e1461098f578063e3639229146109b0578063e985e9c5146109ef578063f08380fc14610a0f578063f2fde38b14610a30578063f54abe6f14610a50578063f78c945814610a71578063f8c8765e14610aa3578063fb253b3214610ac3578063ff6c079214610b91575b600080fd5b3480156102e457600080fd5b506102f86102f336600461422e565b610ba8565b60405190151581526020015b60405180910390f35b34801561031957600080fd5b5061032461016e5481565b604051908152602001610304565b34801561033e57600080fd5b5061035261034d366004614270565b610bd3565b005b6103526103623660046142c9565b610c2d565b34801561037357600080fd5b5061037c610d92565b604051610304919061439d565b34801561039557600080fd5b506103a96103a43660046143b0565b610e24565b6040516001600160a01b039091168152602001610304565b3480156103cd57600080fd5b506103526103dc3660046143c9565b610e4b565b3480156103ed57600080fd5b5061032461016b5481565b34801561040457600080fd5b5061012f54610324565b34801561041a57600080fd5b506103526104293660046143f5565b610f61565b34801561043a57600080fd5b50610171546103a9906001600160a01b031681565b34801561045b57600080fd5b5061035261046a366004614421565b610f7f565b34801561047b57600080fd5b50610352610fb0565b34801561049057600080fd5b5061032461049f3660046143c9565b610fc8565b3480156104b057600080fd5b5061032461015f5481565b3480156104c757600080fd5b506103526104d6366004614270565b61105f565b3480156104e757600080fd5b506103526104f6366004614421565b611128565b34801561050757600080fd5b50610160546103a9906001600160a01b031681565b34801561052857600080fd5b506103526105373660046144ad565b611143565b61035261054a3660046145cd565b6111f3565b34801561055b57600080fd5b5061032461056a3660046143b0565b6112ad565b34801561057b57600080fd5b5061035261058a36600461462e565b611342565b34801561059b57600080fd5b506103526105aa3660046146bd565b61155f565b3480156105bb57600080fd5b506103526105ca366004614270565b611778565b3480156105db57600080fd5b506103246117c9565b3480156105f057600080fd5b5061016c54610324565b34801561060657600080fd5b506103a96106153660046143b0565b611877565b34801561062657600080fd5b5061032461016f5481565b34801561063d57600080fd5b5061035261064c366004614270565b6118ac565b34801561065d57600080fd5b50610165546103a9906001600160a01b031681565b34801561067e57600080fd5b5061032461068d366004614270565b6118fd565b34801561069e57600080fd5b50610352611983565b3480156106b357600080fd5b506103526106c2366004614270565b611995565b3480156106d357600080fd5b506106dc6119e6565b6040516103049190614755565b3480156106f557600080fd5b506103526107043660046147b1565b611a5d565b34801561071557600080fd5b506103526107243660046143b0565b611a79565b34801561073557600080fd5b506103a9611aea565b34801561074a57600080fd5b5061035261075936600461481c565b611af9565b34801561076a57600080fd5b5061037c611c0e565b34801561077f57600080fd5b5061035261078e3660046148c4565b611c1d565b34801561079f57600080fd5b506107b36107ae3660046148fd565b611c28565b604080516001600160801b03938416815292909116602083015201610304565b3480156107df57600080fd5b506103526107ee3660046143b0565b611d44565b3480156107ff57600080fd5b5061035261080e36600461492b565b611ee7565b34801561081f57600080fd5b506106dc611f19565b34801561083457600080fd5b50610352610843366004614996565b611f86565b34801561085457600080fd5b506101705461086a90600160a01b900460ff1681565b60405160ff9091168152602001610304565b34801561088857600080fd5b506103526108973660046143b0565b612083565b3480156108a857600080fd5b50610164546103a9906001600160a01b031681565b3480156108c957600080fd5b506103526108d8366004614270565b6120d3565b3480156108e957600080fd5b5061037c6108f83660046143b0565b612124565b34801561090957600080fd5b50610352610918366004614a25565b610f69565b34801561092957600080fd5b506102f8610938366004614270565b61016a6020526000908152604090205460ff1681565b34801561095a57600080fd5b50610161546103a9906001600160a01b031681565b34801561097b57600080fd5b5061035261098a366004614270565b61222e565b34801561099b57600080fd5b50610163546103a9906001600160a01b031681565b3480156109bc57600080fd5b506109d06109cb3660046143b0565b61227f565b6040805193151584529115156020840152151590820152606001610304565b3480156109fb57600080fd5b506102f8610a0a3660046148fd565b6122e7565b348015610a1b57600080fd5b50610162546103a9906001600160a01b031681565b348015610a3c57600080fd5b50610352610a4b366004614270565b612316565b348015610a5c57600080fd5b50610170546103a9906001600160a01b031681565b348015610a7d57600080fd5b50610a91610a8c3660046143b0565b61238c565b60405161030496959493929190614a7b565b348015610aaf57600080fd5b50610352610abe366004614ade565b6124f0565b348015610acf57600080fd5b50610b40610ade3660046143b0565b61016960205260009081526040902080546001909101546001600160a01b038216916001600160401b03600160a01b8204169160ff600160e01b8304811692600160e81b8104821692600160f01b8204831692600160f81b9092049091169087565b604080516001600160a01b0390981688526001600160401b0390961660208801529315159486019490945290151560608501521515608084015260ff90911660a083015260c082015260e001610304565b348015610b9d57600080fd5b5061032461016d5481565b60006001600160e01b0319821663780e9d6360e01b1480610bcd5750610bcd8261279b565b92915050565b610bdb6127eb565b6001600160a01b038116610c0a5760405162461bcd60e51b8152600401610c0190614b3a565b60405180910390fd5b61016180546001600160a01b0319166001600160a01b0392909216919091179055565b80428163ffffffff161015610c545760405162461bcd60e51b8152600401610c0190614b66565b610c69826000610c6388614c70565b8761284a565b5061016560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505061016554610164546003945060009350638d7fcefd92506001600160a01b03918216911634610d17610d0960408d0160208e01614c7c565b6001600160801b03166128c0565b86898b604051602401610d309796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050610d8981335b604051602001610d75929190614ddb565b604051602081830303815290604052612975565b50505050505050565b606060fb8054610da190614e0d565b80601f0160208091040260200160405190810160405280929190818152602001828054610dcd90614e0d565b8015610e1a5780601f10610def57610100808354040283529160200191610e1a565b820191906000526020600020905b815481529060010190602001808311610dfd57829003601f168201915b5050505050905090565b6000610e2f82612a46565b50600090815260ff60205260409020546001600160a01b031690565b6000610e5682611877565b9050806001600160a01b0316836001600160a01b03161415610ec45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c01565b336001600160a01b0382161480610ee05750610ee081336122e7565b610f525760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c01565b610f5c8383612a6b565b505050565b610f696127eb565b61017054610f5c906001600160a01b0316612ad9565b610f893382612afd565b610fa55760405162461bcd60e51b8152600401610c0190614e42565b610f5c838383612b5b565b61017054610fc6906001600160a01b0316612ad9565b565b6000610fd3836118fd565b82106110355760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c01565b506001600160a01b0391909116600090815261012d60209081526040808320938352929052205490565b306001600160a01b037f00000000000000000000000012c44ff98a175401202569b6b2d0457997cea8cd1614156110a85760405162461bcd60e51b8152600401610c0190614e90565b7f00000000000000000000000012c44ff98a175401202569b6b2d0457997cea8cd6001600160a01b03166110da612cf0565b6001600160a01b0316146111005760405162461bcd60e51b8152600401610c0190614eca565b61110981612d0c565b6040805160008082526020820190925261112591839190612d14565b50565b610f5c83838360405180602001604052806000815250611ee7565b61114b6127eb565b610163546001600160a01b03166111975760405162461bcd60e51b815260206004820152601060248201526f23a12a219d10273790213ab4b63232b960811b6044820152606401610c01565b60005b81811015610f5c576111e18383838181106111b7576111b7614f04565b90506020020160208101906111cc9190614270565b610163546001600160a01b0316600019612e8e565b806111eb81614f30565b91505061119a565b306001600160a01b037f00000000000000000000000012c44ff98a175401202569b6b2d0457997cea8cd16141561123c5760405162461bcd60e51b8152600401610c0190614e90565b7f00000000000000000000000012c44ff98a175401202569b6b2d0457997cea8cd6001600160a01b031661126e612cf0565b6001600160a01b0316146112945760405162461bcd60e51b8152600401610c0190614eca565b61129d82612d0c565b6112a982826001612d14565b5050565b60006112b961012f5490565b821061131c5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c01565b61012f828154811061133057611330614f04565b90600052602060002001549050919050565b80428163ffffffff1610156113695760405162461bcd60e51b8152600401610c0190614b66565b600061137f83826113798a614c70565b8961284a565b905061139d6113916020860186614270565b33308760200135612fa2565b60006113b2610d0960408a0160208b01614c7c565b905060ff8216156114ce57600060646113cb8482614f4b565b6113d89060ff1684614f6e565b6113e3906063614f8d565b6113ed9190614fa5565b9050600063478a55b66114036020890189614270565b6101715460405161142c92916001600160a01b03169060208c0135908790600090602401614fc7565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114648133610d64565b61017154604051636e556df89161148f916001600160a01b039091169086908a908d90602401614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506114c78133610d64565b5050611555565b60026000638d7fcefd6114e46020890189614270565b61016460009054906101000a90046001600160a01b0316896020013586868b8e60405160240161151a9796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506115528133610d64565b50505b5050505050505050565b80428163ffffffff1610156115865760405162461bcd60e51b8152600401610c0190614b66565b60008061159e84826115988b8d61502b565b8a6130d2565b90925090506115bf6115b36020870187614270565b33308860200135612fa2565b60006115ca836128c0565b905060ff8216156116e657600060646115e38482614f4b565b6115f09060ff1684614f6e565b6115fb906063614f8d565b6116059190614fa5565b9050600063478a55b661161b60208a018a614270565b6101715460405161164492916001600160a01b03169060208d0135908790600090602401614fc7565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061167c8133610d64565b61017154604051636e556df8916116a7916001600160a01b039091169086908b908e90602401614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506116df8133610d64565b5050611552565b60026000638d7fcefd6116fc60208a018a614270565b61016460009054906101000a90046001600160a01b03168a6020013586868c8f6040516024016117329796959493929190614d92565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b92909217909152905061176a8133610d64565b505050505050505050505050565b6117806127eb565b6001600160a01b0381166117a65760405162461bcd60e51b8152600401610c0190614b3a565b61016480546001600160a01b0319166001600160a01b0392909216919091179055565b6000306001600160a01b037f00000000000000000000000012c44ff98a175401202569b6b2d0457997cea8cd16146118645760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610c01565b506000805160206156ab83398151915290565b600081815260fd60205260408120546001600160a01b031680610bcd5760405162461bcd60e51b8152600401610c01906150ae565b6118b46127eb565b6001600160a01b0381166118da5760405162461bcd60e51b8152600401610c0190614b3a565b61017180546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166119675760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610c01565b506001600160a01b0316600090815260fe602052604090205490565b61198b6127eb565b610fc660006133a5565b61199d6127eb565b6001600160a01b0381166119c35760405162461bcd60e51b8152600401610c0190614b3a565b61016280546001600160a01b0319166001600160a01b0392909216919091179055565b6060610166805480602002602001604051908101604052809291908181526020016000905b82821015611a5457600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b9091041681830152825260019092019101611a0b565b50505050905090565b61017054611a73906001600160a01b0316612ad9565b50505050565b611a816127eb565b6063811115611ac95760405162461bcd60e51b8152602060048201526014602482015273474254433a20546f6f204d6f726520526174696f60601b6044820152606401610c01565b610170805460ff909216600160a01b0260ff60a01b19909216919091179055565b6097546001600160a01b031690565b80428163ffffffff161015611b205760405162461bcd60e51b8152600401610c0190614b66565b6001600160a01b038316600090815261016a602052604090205460ff16611b595760405162461bcd60e51b8152600401610c01906150e0565b600080611b6c8460106115988b8d61502b565b915091506000611b7b836128c0565b9050611bab8633306064611b8f8782614f4b565b611b9c9060ff1687614f6e565b611ba69190614fa5565b612fa2565b6000636e556df88783888b604051602401611bc99493929190614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b929092179091529050611c018133610d64565b5050505050505050505050565b606060fc8054610da190614e0d565b6112a93383836133f7565b600080600061016360009054906101000a90046001600160a01b03166001600160a01b031663678aa4f36040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7c57600080fd5b505afa158015611c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb49190615110565b604051633612cf2560e01b81526001600160a01b038781166004830152868116602483015291925090821690633612cf2590604401604080518083038186803b158015611d0057600080fd5b505afa158015611d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d38919061512d565b90969095509350505050565b611d4d81611877565b6001600160a01b0316336001600160a01b031614611d9f5760405162461bcd60e51b815260206004820152600f60248201526e23a12a219d102737ba1027bbb732b960891b6044820152606401610c01565b60008181526101696020526040902054600160e01b900460ff1615611dfd5760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e4813dc195b995960621b6044820152606401610c01565b6040805180820182526001600160401b0383811682524380821660208085019182526101668054600181018255600091825286517fa5a4c57b7184ec73d55be4993773cb4eef681bc86a28d0285cd66efb50676a97909101805494518716600160401b026001600160801b0319909516919096161792909217909355858152610169835284902080546001600160a01b0360ff60e01b01191633908117600160e01b17909155845190815291820185905292810192909252907f66b10d9ff37b599d2105c94c297dc6149f44b851df44d93080dc0833ba8e6e919060600160405180910390a15050565b611ef13383612afd565b611f0d5760405162461bcd60e51b8152600401610c0190614e42565b611a73848484846134c3565b60606101678054806020026020016040519081016040528092919081815260200160009082821015611a5457600084815260209081902060408051808201909152908401546001600160401b038082168352600160401b9091041681830152825260019092019101611a0b565b80428163ffffffff161015611fad5760405162461bcd60e51b8152600401610c0190614b66565b6001600160a01b038316600090815261016a602052604090205460ff16611fe65760405162461bcd60e51b8152600401610c01906150e0565b6000611ff78360106113798a614c70565b9050600061200e610d0960408a0160208b01614c7c565b90506120228533306064611b8f8782614f4b565b6000636e556df88683878a6040516024016120409493929190614ff8565b60408051601f198184030181529190526020810180516001600160e01b031660e09390931b9290921790915290506120788133610d64565b505050505050505050565b61208b6127eb565b60148111156120cd5760405162461bcd60e51b815260206004820152600e60248201526d474254433a20546f6f204d6f726560901b6044820152606401610c01565b61016b55565b6120db6127eb565b6001600160a01b0381166121015760405162461bcd60e51b8152600401610c0190614b3a565b61017080546001600160a01b0319166001600160a01b0392909216919091179055565b600081815261016860205260409020600101546060906001600160a01b03166121825760405162461bcd60e51b815260206004820152601060248201526f11d09510ce88139bdd08135a5b9d195960821b6044820152606401610c01565b610162546001600160a01b03166342aee6bb61219d84611877565b6000858152610168602090815260408083206101699092529182902091516001600160e01b031960e086901b1681526121da9392906004016151fc565b60006040518083038186803b1580156121f257600080fd5b505afa158015612206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bcd91908101906152ee565b6122366127eb565b6001600160a01b03811661225c5760405162461bcd60e51b8152600401610c0190614b3a565b61016080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152610168602052604081205481908190600160801b90046001600160801b03166122b5575060009150819050806122e0565b5050506000818152610169602052604090205460019060ff600160e01b8204811691600160e81b9004165b9193909250565b6001600160a01b0391821660009081526101006020908152604080832093909416825291909152205460ff1690565b61231e6127eb565b6001600160a01b0381166123835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c01565b611125816133a5565b610168602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b90950416936001600160a01b03841693600160a01b900460ff169290916123df90614e0d565b80601f016020809104026020016040519081016040528092919081815260200182805461240b90614e0d565b80156124585780601f1061242d57610100808354040283529160200191612458565b820191906000526020600020905b81548152906001019060200180831161243b57829003601f168201915b50505050509080600301805461246d90614e0d565b80601f016020809104026020016040519081016040528092919081815260200182805461249990614e0d565b80156124e65780601f106124bb576101008083540402835291602001916124e6565b820191906000526020600020905b8154815290600101906020018083116124c957829003601f168201915b5050505050905086565b600054610100900460ff16158080156125105750600054600160ff909116105b80612531575061251f306134f6565b158015612531575060005460ff166001145b6125945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c01565b6000805460ff1916600117905580156125b7576000805461ff0019166101001790555b6125bf613505565b6125c761352c565b6126126040518060400160405280600e81526020016d23b932b2b710212a219021b63ab160911b8152506040518060400160405280600381526020016247424360e81b81525061355c565b604080518082018252600e81526d23b932b2b710212a219021b63ab160911b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa24958b5bf039b27bb75556bcf8b8d2620327722d5e05db3d9e9f0557b49ab71818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012061015f556126f0611aea565b61016080546001600160a01b03199081166001600160a01b03938416179091556101618054821688841617905561016380548216878416179055610164805482168684161790556101658054909116918416919091179055600561016b558015612794576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006001600160e01b031982166380ac58cd60e01b14806127cc57506001600160e01b03198216635b5e139f60e01b145b80610bcd57506301ffc9a760e01b6001600160e01b0319831614610bcd565b336127f4611aea565b6001600160a01b031614610fc65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c01565b600061285683856135aa565b6128608383613669565b60008061287085600001516137a9565b915091508160ff1660001461288c576001600160801b03811685525b612896858361381b565b603f87901c156128b45784516128b4906001600160801b0316611d44565b5090505b949350505050565b60008061016460009054906101000a90046001600160a01b03166001600160a01b0316632f0e0a726040518163ffffffff1660e01b815260040160206040518083038186803b15801561291257600080fd5b505afa158015612926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294a919061535b565b905061295881612710615374565b61296484612710614f6e565b61296e9190614fa5565b9392505050565b6101635460405160009182916001600160a01b039091169061299890859061538b565b6000604051808303816000865af19150503d80600081146129d5576040519150601f19603f3d011682016040523d82523d6000602084013e6129da565b606091505b509150915081610f5c578051156129f45780518082602001fd5b60405162461bcd60e51b815260206004820152602160248201527f474254433a204572726f722043616c6c20746f20616374696f6e4275696c64656044820152603960f91b6064820152608401610c01565b612a4f81613aa4565b6111255760405162461bcd60e51b8152600401610c01906150ae565b600081815260ff6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612aa082611877565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b3660008037600080366000845af43d6000803e808015612af8573d6000f35b3d6000fd5b600080612b0983611877565b9050806001600160a01b0316846001600160a01b03161480612b305750612b3081856122e7565b806128b85750836001600160a01b0316612b4984610e24565b6001600160a01b031614949350505050565b826001600160a01b0316612b6e82611877565b6001600160a01b031614612bd25760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c01565b6001600160a01b038216612c345760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c01565b612c3f838383613ac1565b612c4a600082612a6b565b6001600160a01b038316600090815260fe60205260408120805460019290612c73908490615374565b90915550506001600160a01b038216600090815260fe60205260408120805460019290612ca1908490614f8d565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716916000805160206156f283398151915291a4505050565b6000805160206156ab833981519152546001600160a01b031690565b6111256127eb565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612d4757610f5c83613b7b565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8057600080fd5b505afa925050508015612db0575060408051601f3d908101601f19168201909252612dad9181019061535b565b60015b612e135760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c01565b6000805160206156ab8339815191528114612e825760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c01565b50610f5c838383613c15565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691612eea919061538b565b6000604051808303816000865af19150503d8060008114612f27576040519150601f19603f3d011682016040523d82523d6000602084013e612f2c565b606091505b5091509150818015612f56575080511580612f56575080806020019051810190612f5691906153a7565b6127945760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c454400006044820152606401610c01565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691613006919061538b565b6000604051808303816000865af19150503d8060008114613043576040519150601f19603f3d011682016040523d82523d6000602084013e613048565b606091505b509150915081801561307257508051158061307257508080602001905181019061307291906153a7565b6130ca5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610c01565b505050505050565b60008060007f829abf7a83fcbcf66649914b5a9a514acbf6beda598a620aef732202e8155d7360001b8560405160200161310d9291906153c4565b6040516020818303038152906040529050600081805190602001209050600061015f5482604051602001613142929190615497565b604051602081830303815290604052805190602001209050600060018288600001602081019061317291906154b2565b89602001358a604001356040516000815260200160405260405161319994939291906154cd565b6020604051602081039080840390855afa1580156131bb573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506131f85760405162461bcd60e51b8152600401610c01906154eb565b87516001603f1b8b161515906001603e1b8c16151590600090613236908c90839061322557613225614f04565b6020026020010151600001516137a9565b909850905060ff88161561327157808b60008151811061325857613258614f04565b60209081029190910101516001600160801b0390911690525b60005b8b5181101561334c5760008c828151811061329157613291614f04565b602002602001015190508380156132cb575080516001600160801b0390811660009081526101686020526040902054600160801b90041615155b156132d6575061333a565b6132e0818f6135aa565b6132ea818b61381b565b8415613304578051613304906001600160801b0316611d44565b8c828151811061331657613316614f04565b6020026020010151602001516001600160801b03168b6133369190614f8d565b9a50505b8061334481614f30565b915050613274565b50886133955760405162461bcd60e51b8152602060048201526018602482015277474254433a204e6f20426c6f636b20417661696c61626c6560401b6044820152606401610c01565b5050505050505094509492505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156134555760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610c01565b6001600160a01b0383811660008181526101006020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134ce848484612b5b565b6134da84848484613c3a565b611a735760405162461bcd60e51b8152600401610c019061551c565b6001600160a01b03163b151590565b600054610100900460ff16610fc65760405162461bcd60e51b8152600401610c019061556e565b600054610100900460ff166135535760405162461bcd60e51b8152600401610c019061556e565b610fc6336133a5565b600054610100900460ff166135835760405162461bcd60e51b8152600401610c019061556e565b81516135969060fb90602085019061417f565b508051610f5c9060fc90602084019061417f565b81516001600160781b031660008181526101686020526040902054600160801b90046001600160801b0316156136195760405162461bcd60e51b815260206004820152601460248201527311d09510ce88105b1c9958591e48135a5b9d195960621b6044820152606401610c01565b606083015160f01660ff831614610f5c5760405162461bcd60e51b8152602060048201526014602482015273474254433a2057726f6e6720415254205479706560601b6044820152606401610c01565b60007fe645798fe54db29ed50fd7f01a05de6d1c5a65fac8902dcfd7427b30fbd87c2460001b83600001518460a0015185602001518660800151876040015188606001516040516020016136c397969594939291906155b9565b604051602081830303815290604052805190602001209050600061015f54826040516020016136f3929190615497565b604051602081830303815290604052805190602001209050600060018285600001602081019061372391906154b2565b866020013587604001356040516000815260200160405260405161374a94939291906154cd565b6020604051602081039080840390855afa15801561376c573d6000803e3d6000fd5b5050604051601f190151610161549092506001600160a01b0380841691161490506127945760405162461bcd60e51b8152600401610c01906154eb565b61017054600090819060ff607885901c811691600160a01b9004168111156138085760405162461bcd60e51b8152602060048201526012602482015271474254433a2057726f6e6720526174696f2160701b6044820152606401610c01565b936001600160781b039390931692915050565b60408201516001600160a01b03166138695760405162461bcd60e51b815260206004820152601160248201527023a12a219d102d32b9379026b4b73a32b960791b6044820152606401610c01565b81516001600160801b03908116600090815261016860209081526040918290208551828701518516600160801b02941693909317835590840151600183018054606087015160ff16600160a01b026001600160a81b03199091166001600160a01b0390931692909217919091179055608084015180518593926138f392600285019291019061417f565b5060a0820151805161390f91600384019160209091019061417f565b50506040805160e08101825260008082526020808301828152838501838152606085018481526080860185815260a0870186815260c088018781528c516001600160401b03908116875260ff8d811684528e516001600160801b039081168b52610169909952988b90208a518154985197519651955194516001600160a01b039091166001600160e01b031990991698909817600160a01b97909216969096021761ffff60e01b1916600160e01b9415159490940260ff60e81b191693909317600160e81b92151592909202919091176001600160f01b0316600160f01b911515919091026001600160f81b031617600160f81b939095169290920293909317835551600190920191909155918501518551919350613a3092909116613d4b565b825160208085015160408087015160608089015183516001600160801b03978816815296909416948601949094526001600160a01b03169084015260ff16908201527f79c8f412993c72ce60b23ac109f97d606389e44244c46ef8ca530ef920558cea9060800160405180910390a1505050565b600090815260fd60205260409020546001600160a01b0316151590565b6001600160a01b038316613b1e57613b198161012f8054600083815261013060205260408120829055600182018355919091527f232da9e50dad2971456a78fb5cd6ff6b75019984d6e918139ce990999420f9790155565b613b41565b816001600160a01b0316836001600160a01b031614613b4157613b418382613e77565b6001600160a01b038216613b5857610f5c81613f19565b826001600160a01b0316826001600160a01b031614610f5c57610f5c8282613fce565b613b84816134f6565b613be65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c01565b6000805160206156ab83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c1e83614014565b600082511180613c2b5750805b15610f5c57611a738383614054565b6000613c4e846001600160a01b03166134f6565b15613d4357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613c85903390899088908890600401615624565b602060405180830381600087803b158015613c9f57600080fd5b505af1925050508015613ccf575060408051601f3d908101601f19168201909252613ccc91810190615657565b60015b613d29573d808015613cfd576040519150601f19603f3d011682016040523d82523d6000602084013e613d02565b606091505b508051613d215760405162461bcd60e51b8152600401610c019061551c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128b8565b5060016128b8565b6001600160a01b038216613da15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c01565b613daa81613aa4565b15613df65760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610c01565b613e0260008383613ac1565b6001600160a01b038216600090815260fe60205260408120805460019290613e2b908490614f8d565b9091555050600081815260fd602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392906000805160206156f2833981519152908290a45050565b60006001613e84846118fd565b613e8e9190615374565b600083815261012e6020526040902054909150808214613ee4576001600160a01b038416600090815261012d60209081526040808320858452825280832054848452818420819055835261012e90915290208190555b50600091825261012e602090815260408084208490556001600160a01b03909416835261012d81528383209183525290812055565b61012f54600090613f2c90600190615374565b6000838152610130602052604081205461012f8054939450909284908110613f5657613f56614f04565b906000526020600020015490508061012f8381548110613f7857613f78614f04565b6000918252602080832090910192909255828152610130909152604080822084905585825281205561012f805480613fb257613fb2615674565b6001900381819060005260206000200160009055905550505050565b6000613fd9836118fd565b6001600160a01b03909316600090815261012d60209081526040808320868452825280832085905593825261012e9052919091209190915550565b61401d81613b7b565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061405f836134f6565b6140ba5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c01565b600080846001600160a01b0316846040516140d5919061538b565b600060405180830381855af49150503d8060008114614110576040519150601f19603f3d011682016040523d82523d6000602084013e614115565b606091505b509150915061413d82826040518060600160405280602781526020016156cb60279139614146565b95945050505050565b6060831561415557508161296e565b8251156141655782518084602001fd5b8160405162461bcd60e51b8152600401610c01919061439d565b82805461418b90614e0d565b90600052602060002090601f0160209004810192826141ad57600085556141f3565b82601f106141c657805160ff19168380011785556141f3565b828001600101855582156141f3579182015b828111156141f35782518255916020019190600101906141d8565b506141ff929150614203565b5090565b5b808211156141ff5760008155600101614204565b6001600160e01b03198116811461112557600080fd5b60006020828403121561424057600080fd5b813561296e81614218565b6001600160a01b038116811461112557600080fd5b803561426b8161424b565b919050565b60006020828403121561428257600080fd5b813561296e8161424b565b600060c0828403121561429f57600080fd5b50919050565b60006060828403121561429f57600080fd5b60006080828403121561429f57600080fd5b60008060008060c085870312156142df57600080fd5b84356001600160401b03808211156142f657600080fd5b6143028883890161428d565b955061431188602089016142a5565b9450608087013591508082111561432757600080fd5b50614334878288016142b7565b9497939650939460a0013593505050565b60005b83811015614360578181015183820152602001614348565b83811115611a735750506000910152565b60008151808452614389816020860160208601614345565b601f01601f19169290920160200192915050565b60208152600061296e6020830184614371565b6000602082840312156143c257600080fd5b5035919050565b600080604083850312156143dc57600080fd5b82356143e78161424b565b946020939093013593505050565b60008060006060848603121561440a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561443657600080fd5b83356144418161424b565b925060208401356144518161424b565b929592945050506040919091013590565b60008083601f84011261447457600080fd5b5081356001600160401b0381111561448b57600080fd5b6020830191508360208260051b85010111156144a657600080fd5b9250929050565b600080602083850312156144c057600080fd5b82356001600160401b038111156144d657600080fd5b611d3885828601614462565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b038111828210171561451a5761451a6144e2565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614548576145486144e2565b604052919050565b60006001600160401b03821115614569576145696144e2565b50601f01601f191660200190565b600082601f83011261458857600080fd5b813561459b61459682614550565b614520565b8181528460208386010111156145b057600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156145e057600080fd5b82356145eb8161424b565b915060208301356001600160401b0381111561460657600080fd5b61461285828601614577565b9150509250929050565b60006040828403121561429f57600080fd5b6000806000806000610100868803121561464757600080fd5b85356001600160401b038082111561465e57600080fd5b61466a89838a0161428d565b96506146798960208a016142a5565b9550608088013591508082111561468f57600080fd5b5061469c888289016142b7565b9350506146ac8760a0880161461c565b9497939650919460e0013592915050565b60008060008060008061010087890312156146d757600080fd5b86356001600160401b03808211156146ee57600080fd5b6146fa8a838b01614462565b909850965086915061470f8a60208b016142a5565b9550608089013591508082111561472557600080fd5b5061473289828a016142b7565b9350506147428860a0890161461c565b915060e087013590509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156147a457815180516001600160401b0390811686529087015116868501529284019290850190600101614772565b5091979650505050505050565b600080600080604085870312156147c757600080fd5b84356001600160401b03808211156147de57600080fd5b6147ea88838901614462565b9096509450602087013591508082111561480357600080fd5b5061481087828801614462565b95989497509550505050565b60008060008060008060e0878903121561483557600080fd5b86356001600160401b038082111561484c57600080fd5b6148588a838b01614462565b909850965086915061486d8a60208b016142a5565b9550608089013591508082111561488357600080fd5b5061489089828a016142b7565b93505060a08701356148a18161424b565b8092505060c087013590509295509295509295565b801515811461112557600080fd5b600080604083850312156148d757600080fd5b82356148e28161424b565b915060208301356148f2816148b6565b809150509250929050565b6000806040838503121561491057600080fd5b823561491b8161424b565b915060208301356148f28161424b565b6000806000806080858703121561494157600080fd5b843561494c8161424b565b9350602085013561495c8161424b565b92506040850135915060608501356001600160401b0381111561497e57600080fd5b61498a87828801614577565b91505092959194509250565b600080600080600060e086880312156149ae57600080fd5b85356001600160401b03808211156149c557600080fd5b6149d189838a0161428d565b96506149e08960208a016142a5565b955060808801359150808211156149f657600080fd5b50614a03888289016142b7565b93505060a0860135614a148161424b565b9497939650919460c0013592915050565b600080600060408486031215614a3a57600080fd5b83356001600160401b03811115614a5057600080fd5b614a5c86828701614462565b9094509250506020840135614a70816148b6565b809150509250925092565b6001600160801b038781168252861660208201526001600160a01b038516604082015260ff8416606082015260c060808201819052600090614abf90830185614371565b82810360a0840152614ad18185614371565b9998505050505050505050565b60008060008060808587031215614af457600080fd5b8435614aff8161424b565b93506020850135614b0f8161424b565b92506040850135614b1f8161424b565b91506060850135614b2f8161424b565b939692955090935050565b602080825260129082015271474254433a205a65726f204164647265737360701b604082015260600190565b6020808252600d908201526c11d09510ce8811561412549151609a1b604082015260600190565b6001600160801b038116811461112557600080fd5b803561426b81614b8d565b803560ff8116811461426b57600080fd5b600060c08284031215614bd057600080fd5b614bd86144f8565b9050614be382614ba2565b8152614bf160208301614ba2565b6020820152614c0260408301614260565b6040820152614c1360608301614bad565b606082015260808201356001600160401b0380821115614c3257600080fd5b614c3e85838601614577565b608084015260a0840135915080821115614c5757600080fd5b50614c6484828501614577565b60a08301525092915050565b6000610bcd3683614bbe565b600060208284031215614c8e57600080fd5b813561296e81614b8d565b6000808335601e19843603018112614cb057600080fd5b83016020810192503590506001600160401b03811115614ccf57600080fd5b8036038313156144a657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008135614d148161424b565b6001600160a01b03168352614d2c6020830183614c99565b60806020860152614d41608086018284614cde565b915050614d516040840184614c99565b8583036040870152614d64838284614cde565b92505050614d756060840184614c99565b8583036060870152614d88838284614cde565b9695505050505050565b600060018060a01b03808a16835280891660208401525086604083015285606083015284608083015263ffffffff841660a083015260e060c0830152614ad160e0830184614d07565b60008351614ded818460208801614345565b60609390931b6001600160601b0319169190920190815260140192915050565b600181811c90821680614e2157607f821691505b6020821081141561429f57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602c9082015260008051602061568b83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c9082015260008051602061568b83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415614f4457614f44614f1a565b5060010190565b600060ff821660ff841680821015614f6557614f65614f1a565b90039392505050565b6000816000190483118215151615614f8857614f88614f1a565b500290565b60008219821115614fa057614fa0614f1a565b500190565b600082614fc257634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03958616815293909416602084015260408301919091526060820152901515608082015260a00190565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000614d886080830184614d07565b60006001600160401b0380841115615045576150456144e2565b8360051b6020615056818301614520565b86815291850191818101903684111561506e57600080fd5b865b848110156150a2578035868111156150885760008081fd5b61509436828b01614bbe565b845250918301918301615070565b50979650505050505050565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60208082526016908201527511d09510ce8810549508139bdd081058d8d95c1d195960521b604082015260600190565b60006020828403121561512257600080fd5b815161296e8161424b565b6000806040838503121561514057600080fd5b825161514b81614b8d565b60208401519092506148f281614b8d565b8054600090600181811c908083168061517657607f831692505b602080841082141561519857634e487b7160e01b600052602260045260246000fd5b838852602088018280156151b357600181146151c4576151ef565b60ff198716825282820197506151ef565b60008981526020902060005b878110156151e9578154848201529086019084016151d0565b83019850505b5050505050505092915050565b6001600160a01b0384811682526101206020830181905284546001600160801b0381169184019190915260801c610140830152600184015490811661016083015260a01c60ff1661018082015260c06101a082015260006152646101e083016002860161515c565b82810361011f19016101c084015261527f816003870161515c565b9150506128b8604083018480546001600160a01b038116835260a081811c6001600160401b0316602085015260e082901c60ff9081161515604086015260e883901c81161515606086015260f083901c161515608085015260f882901c90840152506001015460c09190910152565b60006020828403121561530057600080fd5b81516001600160401b0381111561531657600080fd5b8201601f8101841361532757600080fd5b805161533561459682614550565b81815285602083850101111561534a57600080fd5b61413d826020830160208601614345565b60006020828403121561536d57600080fd5b5051919050565b60008282101561538657615386614f1a565b500390565b6000825161539d818460208701614345565b9190910192915050565b6000602082840312156153b957600080fd5b815161296e816148b6565b6000604080830185845260208281860152818651808452606093508387019150838160051b88010183890160005b8381101561548757898303605f19018552815180516001600160801b039081168552878201511687850152888101516001600160a01b0316898501528781015160ff168885015260808082015160c0828701819052919061545583880182614371565b9250505060a080830151925085820381870152506154738183614371565b9688019694505050908501906001016153f2565b50909a9950505050505050505050565b61190160f01b81526002810192909252602282015260420190565b6000602082840312156154c457600080fd5b61296e82614bad565b93845260ff9290921660208401526040830152606082015260800190565b602080825260179082015276474254433a20496e76616c69642053696e67617475726560481b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b878152600060018060801b03808916602084015260e060408401526155e160e0840189614371565b818816606085015283810360808501526155fb8188614371565b6001600160a01b039690961660a085015250505060ff9190911660c09091015295945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614d8890830184614371565b60006020828403121561566957600080fd5b815161296e81614218565b634e487b7160e01b600052603160045260246000fdfe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000809000a
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.