Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
LandSaleETH
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IRouterClient} from "@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol"; import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol"; import {CCIPReceiver} from "@chainlink/contracts-ccip/src/v0.8/ccip/applications/CCIPReceiver.sol"; import "@unification-com/xfund-router/contracts/lib/ConsumerBase.sol"; import "./interfaces/ILandRegistry.sol"; import "./interfaces/ILandAuction.sol"; /** * @title LandSaleETH * @dev Implementation of land sale system on Ethereum with CCIP integration. * Supports both ETH and SHIB payments with oracle-based price conversion. */ contract LandSaleETH is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, UUPSUpgradeable, ConsumerBase, CCIPReceiver { // Constants uint32 constant clearLow = 0xffff0000; uint32 constant clearHigh = 0x0000ffff; uint32 constant factor = 0x10000; int16 public constant xLow = -96; int16 public constant yLow = -99; int16 public constant xHigh = 96; int16 public constant yHigh = 99; // Custom errors error NotEnoughBalance(uint256 currentBalance, uint256 calculatedFees); error InvalidAddress(); error NoMessageToSend(); error MessageSendFailed(); // Structs enum Stage { Default, PublicSale } struct Purchase { uint256 amount; address buyer; bool isShib; } struct MintStatusUpdate { uint256 id; bool status; } // State variables ILandRegistry public landRegistry; ILandAuction public auctionV1; Stage public currentStage; bool public multiMintEnabled; IERC20 public SHIB; uint256 public ethToShib; address public moderator; // CCIP configuration uint64 public shibariumChainSelector; address public shibariumSaleContract; // Storage mapping(uint256 => bool) public mintedOnShibarium; mapping(int16 => mapping(int16 => Purchase)) public purchases; mapping(address => uint32[]) private _allPurchasesOf; // Events event StageSet(Stage stage); event MultiMintToggled(bool newValue); event LandBought( address indexed user, uint32 indexed encXY, int16 x, int16 y, uint256 price, bool isShib, uint256 time ); event MintStatusUpdated(uint256 indexed id, bool isMinted); /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( ILandRegistry _landRegistry, ILandAuction _auctionV1, IERC20 _shib, uint64 _shibariumChainSelector, IERC20_Ex _xfund, IRouter _router, address _ccipRouter ) public initializer { __Ownable_init(msg.sender); __ReentrancyGuard_init(); __UUPSUpgradeable_init(); moderator = msg.sender; i_ccipRouter = _ccipRouter; landRegistry = _landRegistry; auctionV1 = _auctionV1; SHIB = _shib; shibariumChainSelector = _shibariumChainSelector; xFUND = _xfund; router = _router; } // Modifiers modifier onlyValid(int16 x, int16 y) { require(xLow <= x && x <= xHigh, "ERR_X_OUT_OF_RANGE"); require(yLow <= y && y <= yHigh, "ERR_Y_OUT_OF_RANGE"); _; } modifier onlyStage(Stage s) { require(currentStage == s, "ERR_SALE_NOT_ACTIVE"); _; } modifier onlyModerator() { require(msg.sender == moderator, "ERR_ONLY_MODERATOR"); _; } // Public view functions function getCategory(int16 x, int16 y) public view returns (int8) { return auctionV1.getCategory(x, y); } function getPriceInEth(int16 x, int16 y) public view returns (uint256) { return auctionV1.getReservePrice(x, y); } function getPriceInShib(int16 x, int16 y) public view returns (uint256) { uint256 ethPrice = getPriceInEth(x, y); uint256 shibPrice = (ethToShib * ethPrice) / 1 ether; require(shibPrice > 0, "ERR_INVALID_PRICE_CONVERSION"); return shibPrice; } function getMessageFee( MintStatusUpdate[] memory updates ) public view returns (uint256) { bytes memory message = abi.encode(updates); Client.EVM2AnyMessage memory evm2AnyMessage = _buildCCIPMessage( message, address(0) ); IRouterClient router = IRouterClient(this.getRouter()); return router.getFee(shibariumChainSelector, evm2AnyMessage); } // Mint functions function mintPublic( int16 x, int16 y ) external payable onlyStage(Stage.PublicSale) nonReentrant { uint32 encXY = _encodeXY(x, y); require(!landRegistry.exists(uint256(encXY)), "ERR_ALREADY_MINTED"); require(!mintedOnShibarium[encXY], "ERR_MINTED_ON_SHIBARIUM"); (uint256 amount, address bidder) = auctionV1.getCurrentBid(x, y); require(bidder == address(0), "ERR_HAS_WINNING_BIDDER"); uint256 price = getPriceInEth(x, y); Purchase storage purchase = purchases[x][y]; require(purchase.amount == 0, "ERR_ALREADY_PURCHASED"); // Prepare single update MintStatusUpdate[] memory updates = new MintStatusUpdate[](1); updates[0] = MintStatusUpdate({id: encXY, status: true}); uint256 messageFee = getMessageFee(updates); require(msg.value >= price + messageFee, "ERR_INSUFFICIENT_PAYMENT"); _processPurchase(x, y, price, false); _sendMintStatus(updates); uint256 excess = msg.value - (price + messageFee); if (excess > 0) { payable(msg.sender).transfer(excess); } } function mintPublicMulti( int16[] calldata xs, int16[] calldata ys ) external payable onlyStage(Stage.PublicSale) nonReentrant { require(multiMintEnabled, "ERR_MULTI_MINT_DISABLED"); uint256 length = xs.length; require(length == ys.length, "ERR_LENGTH_MISMATCH"); uint256 totalPrice = 0; MintStatusUpdate[] memory updates = new MintStatusUpdate[](length); // Validate and calculate total price for (uint256 i = 0; i < length; i++) { uint32 encXY = _encodeXY(xs[i], ys[i]); require(!landRegistry.exists(uint256(encXY)), "ERR_ALREADY_MINTED"); require(!mintedOnShibarium[encXY], "ERR_MINTED_ON_SHIBARIUM"); (uint256 amount, address bidder) = auctionV1.getCurrentBid( xs[i], ys[i] ); require(bidder == address(0), "ERR_HAS_WINNING_BIDDER"); Purchase storage purchase = purchases[xs[i]][ys[i]]; require(purchase.amount == 0, "ERR_ALREADY_PURCHASED"); updates[i] = MintStatusUpdate({id: encXY, status: true}); totalPrice += getPriceInEth(xs[i], ys[i]); } uint256 messageFee = getMessageFee(updates); require( msg.value >= totalPrice + messageFee, "ERR_INSUFFICIENT_PAYMENT" ); // Process purchases for (uint256 i = 0; i < length; i++) { uint256 price = getPriceInEth(xs[i], ys[i]); _processPurchase(xs[i], ys[i], price, false); } _sendMintStatus(updates); uint256 excess = msg.value - (totalPrice + messageFee); if (excess > 0) { payable(msg.sender).transfer(excess); } } function mintPublicWithShib( int16 x, int16 y ) external payable onlyStage(Stage.PublicSale) nonReentrant { uint32 encXY = _encodeXY(x, y); require(!landRegistry.exists(uint256(encXY)), "ERR_ALREADY_MINTED"); require(!mintedOnShibarium[encXY], "ERR_MINTED_ON_SHIBARIUM"); (uint256 amount, address bidder) = auctionV1.getCurrentBid(x, y); require(bidder == address(0), "ERR_HAS_WINNING_BIDDER"); uint256 price = getPriceInShib(x, y); Purchase storage purchase = purchases[x][y]; require(purchase.amount == 0, "ERR_ALREADY_PURCHASED"); // Prepare single update MintStatusUpdate[] memory updates = new MintStatusUpdate[](1); updates[0] = MintStatusUpdate({id: encXY, status: true}); uint256 messageFee = getMessageFee(updates); require(msg.value >= messageFee, "ERR_INSUFFICIENT_PAYMENT"); SHIB.transferFrom(msg.sender, address(this), price); _processPurchase(x, y, price, true); _sendMintStatus(updates); uint256 excess = msg.value - messageFee; if (excess > 0) { payable(msg.sender).transfer(excess); } } function mintPublicWithShibMulti( int16[] calldata xs, int16[] calldata ys ) external payable onlyStage(Stage.PublicSale) nonReentrant { require(multiMintEnabled, "ERR_MULTI_MINT_DISABLED"); uint256 length = xs.length; require(length == ys.length, "ERR_LENGTH_MISMATCH"); uint256 totalShibPrice = 0; MintStatusUpdate[] memory updates = new MintStatusUpdate[](length); // Calculate total price and validate for (uint256 i = 0; i < length; i++) { uint32 encXY = _encodeXY(xs[i], ys[i]); require(!landRegistry.exists(uint256(encXY)), "ERR_ALREADY_MINTED"); require(!mintedOnShibarium[encXY], "ERR_MINTED_ON_SHIBARIUM"); (uint256 amount, address bidder) = auctionV1.getCurrentBid( xs[i], ys[i] ); require(bidder == address(0), "ERR_HAS_WINNING_BIDDER"); Purchase storage purchase = purchases[xs[i]][ys[i]]; require(purchase.amount == 0, "ERR_ALREADY_PURCHASED"); updates[i] = MintStatusUpdate({id: encXY, status: true}); totalShibPrice += getPriceInShib(xs[i], ys[i]); } uint256 messageFee = getMessageFee(updates); require(msg.value >= messageFee, "ERR_INSUFFICIENT_PAYMENT"); SHIB.transferFrom(msg.sender, address(this), totalShibPrice); // Process purchases for (uint256 i = 0; i < length; i++) { uint256 price = getPriceInShib(xs[i], ys[i]); _processPurchase(xs[i], ys[i], price, true); } _sendMintStatus(updates); uint256 excess = msg.value - messageFee; if (excess > 0) { payable(msg.sender).transfer(excess); } } function mintWinningBid( int16[] calldata xs, int16[] calldata ys ) external payable nonReentrant { uint256 length = xs.length; require(length == ys.length, "ERR_LENGTH_MISMATCH"); MintStatusUpdate[] memory updates = new MintStatusUpdate[](length); for (uint256 i = 0; i < length; i++) { uint32 encXY = _encodeXY(xs[i], ys[i]); require(!landRegistry.exists(uint256(encXY)), "ERR_ALREADY_MINTED"); require(!mintedOnShibarium[encXY], "ERR_MINTED_ON_SHIBARIUM"); (uint256 amount, address bidder) = auctionV1.getCurrentBid( xs[i], ys[i] ); require(bidder == msg.sender, "ERR_NOT_WINNING_BIDDER"); updates[i] = MintStatusUpdate({id: encXY, status: true}); } uint256 messageFee = getMessageFee(updates); require(msg.value >= messageFee, "ERR_INSUFFICIENT_MESSAGE_FEE"); // Process all mints for (uint256 i = 0; i < length; i++) { uint32 encXY = _encodeXY(xs[i], ys[i]); // Record purchase with 0 amount since payment was made during bidding Purchase storage purchase = purchases[xs[i]][ys[i]]; purchase.amount = 0; purchase.buyer = msg.sender; purchase.isShib = false; _allPurchasesOf[msg.sender].push(encXY); // Mint the NFT landRegistry.mint(msg.sender, xs[i], ys[i]); emit LandBought( msg.sender, encXY, xs[i], ys[i], 0, // Amount is 0 as payment was made during bidding false, block.timestamp ); } _sendMintStatus(updates); uint256 excess = msg.value - messageFee; if (excess > 0) { payable(msg.sender).transfer(excess); } } // Admin functions function setShibariumSaleContract( address _saleContract ) external onlyOwner { if (_saleContract == address(0)) revert InvalidAddress(); shibariumSaleContract = _saleContract; } function setStage(Stage stage) external onlyOwner { currentStage = stage; emit StageSet(stage); } function setLandRegistry(ILandRegistry _landRegistry) external onlyOwner { if (address(_landRegistry) == address(0)) revert InvalidAddress(); landRegistry = _landRegistry; } function setAuctionV1(ILandAuction _auctionV1) external onlyOwner { if (address(_auctionV1) == address(0)) revert InvalidAddress(); auctionV1 = _auctionV1; } function setMultiMint(bool enabled) external onlyOwner { require(multiMintEnabled != enabled, "ERR_NO_CHANGE"); multiMintEnabled = enabled; emit MultiMintToggled(enabled); } function setModerator(address _moderator) external onlyOwner { require(_moderator != address(0), "ERR_ZERO_ADDRESS"); moderator = _moderator; } // Withdrawal functions function withdraw() external onlyOwner { uint256 balance = address(this).balance; require(balance > 0, "ERR_NO_BALANCE"); payable(owner()).transfer(balance); } function withdrawXFund() external onlyOwner { uint256 balance = xFUND.balanceOf(address(this)); require(balance > 0, "ERR_NO_BALANCE"); xFUND.transfer(owner(), balance); } function withdrawShib() external onlyOwner { SHIB.transfer(owner(), SHIB.balanceOf(address(this))); } // Internal functions function _processPurchase( int16 x, int16 y, uint256 amount, bool isShib ) internal { Purchase storage purchase = purchases[x][y]; purchase.amount = amount; purchase.buyer = msg.sender; purchase.isShib = isShib; uint32 encXY = _encodeXY(x, y); _allPurchasesOf[msg.sender].push(encXY); landRegistry.mint(msg.sender, x, y); emit LandBought( msg.sender, encXY, x, y, amount, isShib, block.timestamp ); } function _sendMintStatus(MintStatusUpdate[] memory updates) internal { uint256 fees = getMessageFee(updates); if (fees > msg.value) revert NotEnoughBalance(msg.value, fees); bytes memory message = abi.encode(updates); Client.EVM2AnyMessage memory evm2AnyMessage = _buildCCIPMessage( message, address(0) ); IRouterClient router = IRouterClient(this.getRouter()); router.ccipSend{value: fees}(shibariumChainSelector, evm2AnyMessage); } function _buildCCIPMessage( bytes memory _message, address _feeTokenAddress ) internal view returns (Client.EVM2AnyMessage memory) { return Client.EVM2AnyMessage({ receiver: abi.encode(shibariumSaleContract), data: _message, tokenAmounts: new Client.EVMTokenAmount[](0), extraArgs: Client._argsToBytes( Client.EVMExtraArgsV2({ gasLimit: 500_000, allowOutOfOrderExecution: true }) ), feeToken: _feeTokenAddress }); } function _ccipReceive( Client.Any2EVMMessage memory message ) internal override { require( message.sourceChainSelector == shibariumChainSelector, "Wrong chain selector" ); require( abi.decode(message.sender, (address)) == shibariumSaleContract, "Invalid sender" ); MintStatusUpdate[] memory updates = abi.decode( message.data, (MintStatusUpdate[]) ); for (uint256 i = 0; i < updates.length; i++) { mintedOnShibarium[updates[i].id] = updates[i].status; emit MintStatusUpdated(updates[i].id, updates[i].status); } } function _transformXY( int16 x, int16 y ) internal pure onlyValid(x, y) returns (uint16, uint16) { return (uint16(x + 97), uint16(100 - y)); } function _encodeXY(int16 x, int16 y) internal pure returns (uint32) { return ((uint32(uint16(x)) * factor) & clearLow) | (uint32(uint16(y)) & clearHigh); } function _authorizeUpgrade( address newImplementation ) internal override onlyOwner {} // Oracle functions function receiveData(uint256 _price, bytes32) internal override { ethToShib = _price; } function getData( address _provider, uint256 _fee ) external onlyModerator returns (bytes32) { bytes32 data = 0x574554482e534849422e41440000000000000000000000000000000000000000; // WETH.SHIB.AD return _requestData(_provider, _fee, data); } function increaseRouterAllowance(uint256 _amount) external onlyModerator { require(_increaseRouterAllowance(_amount), "ERR_FAILED_TO_INCREASE"); } receive() external payable {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; import {Client} from "../libraries/Client.sol"; import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; /// @title CCIPReceiver - Base contract for CCIP applications that can receive messages. abstract contract CCIPReceiver is IAny2EVMMessageReceiver, IERC165 { address internal i_ccipRouter; constructor() { } /// @notice IERC165 supports an interfaceId /// @param interfaceId The interfaceId to check /// @return true if the interfaceId is supported /// @dev Should indicate whether the contract implements IAny2EVMMessageReceiver /// e.g. return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId /// This allows CCIP to check if ccipReceive is available before calling it. /// If this returns false or reverts, only tokens are transferred to the receiver. /// If this returns true, tokens are transferred and ccipReceive is called atomically. /// Additionally, if the receiver address does not have code associated with /// it at the time of execution (EXTCODESIZE returns 0), only tokens will be transferred. function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; } /// @inheritdoc IAny2EVMMessageReceiver function ccipReceive(Client.Any2EVMMessage calldata message) external virtual override onlyRouter { _ccipReceive(message); } /// @notice Override this function in your implementation. /// @param message Any2EVMMessage function _ccipReceive(Client.Any2EVMMessage memory message) internal virtual; ///////////////////////////////////////////////////////////////////// // Plumbing ///////////////////////////////////////////////////////////////////// /// @notice Return the current router /// @return CCIP router address function getRouter() public view virtual returns (address) { return address(i_ccipRouter); } error InvalidRouter(address router); /// @dev only calls from the set router are accepted. modifier onlyRouter() { if (msg.sender != getRouter()) revert InvalidRouter(msg.sender); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Client} from "../libraries/Client.sol"; /// @notice Application contracts that intend to receive messages from /// the router should implement this interface. interface IAny2EVMMessageReceiver { /// @notice Called by the Router to deliver a message. /// If this reverts, any token transfers also revert. The message /// will move to a FAILED state and become available for manual execution. /// @param message CCIP Message /// @dev Note ensure you check the msg.sender is the OffRampRouter function ccipReceive(Client.Any2EVMMessage calldata message) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {Client} from "../libraries/Client.sol"; interface IRouterClient { error UnsupportedDestinationChain(uint64 destChainSelector); error InsufficientFeeTokenAmount(); error InvalidMsgValue(); /// @notice Checks if the given chain ID is supported for sending/receiving. /// @param destChainSelector The chain to check. /// @return supported is true if it is supported, false if not. function isChainSupported(uint64 destChainSelector) external view returns (bool supported); /// @param destinationChainSelector The destination chainSelector /// @param message The cross-chain CCIP message including data and/or tokens /// @return fee returns execution fee for the message /// delivery to destination chain, denominated in the feeToken specified in the message. /// @dev Reverts with appropriate reason upon invalid message. function getFee( uint64 destinationChainSelector, Client.EVM2AnyMessage memory message ) external view returns (uint256 fee); /// @notice Request a message to be sent to the destination chain /// @param destinationChainSelector The destination chain ID /// @param message The cross-chain CCIP message including data and/or tokens /// @return messageId The message ID /// @dev Note if msg.value is larger than the required fee (from getFee) we accept /// the overpayment with no refund. /// @dev Reverts with appropriate reason upon invalid message. function ccipSend( uint64 destinationChainSelector, Client.EVM2AnyMessage calldata message ) external payable returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // End consumer library. library Client { /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. struct EVMTokenAmount { address token; // token address on the local chain. uint256 amount; // Amount of tokens. } struct Any2EVMMessage { bytes32 messageId; // MessageId corresponding to ccipSend on source. uint64 sourceChainSelector; // Source chain selector. bytes sender; // abi.decode(sender) if coming from an EVM chain. bytes data; // payload sent in original message. EVMTokenAmount[] destTokenAmounts; // Tokens and their amounts in their destination chain representation. } // If extraArgs is empty bytes, the default is 200k gas limit. struct EVM2AnyMessage { bytes receiver; // abi.encode(receiver address) for dest EVM chains bytes data; // Data payload EVMTokenAmount[] tokenAmounts; // Token transfers address feeToken; // Address of feeToken. address(0) means you will send msg.value. bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV2) } // bytes4(keccak256("CCIP EVMExtraArgsV1")); bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9; struct EVMExtraArgsV1 { uint256 gasLimit; } function _argsToBytes(EVMExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) { return abi.encodeWithSelector(EVM_EXTRA_ARGS_V1_TAG, extraArgs); } // bytes4(keccak256("CCIP EVMExtraArgsV2")); bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10; /// @param gasLimit: gas limit for the callback on the destination chain. /// @param allowOutOfOrderExecution: if true, it indicates that the message can be executed in any order relative to other messages from the same sender. /// This value's default varies by chain. On some chains, a particular value is enforced, meaning if the expected value /// is not set, the message request will revert. struct EVMExtraArgsV2 { uint256 gasLimit; bool allowOutOfOrderExecution; } function _argsToBytes(EVMExtraArgsV2 memory extraArgs) internal pure returns (bytes memory bts) { return abi.encodeWithSelector(EVM_EXTRA_ARGS_V2_TAG, extraArgs); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../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. * * The initial owner is set to the address provided by the deployer. 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 { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @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] * ```solidity * 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 Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._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() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.20; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; import {Initializable} from "./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. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @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 ERC-1967) 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 ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @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() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing 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 notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC-1967 compliant implementation pointing to self. * See {_onlyProxy}. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC-1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // On the first call to nonReentrant, _status will be NOT_ENTERED if ($._status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail $._status = ENTERED; } function _nonReentrantAfter() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) $._status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.20; /** * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @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 v5.0.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.20; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. */ interface IERC1967 { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.20; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.21; import {IBeacon} from "../beacon/IBeacon.sol"; import {IERC1967} from "../../interfaces/IERC1967.sol"; import {Address} from "../../utils/Address.sol"; import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This library provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots. */ library ERC1967Utils { /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the ERC-1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit IERC1967.Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the ERC-1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit IERC1967.AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the ERC-1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit IERC1967.BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @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 ERC-1967 implementation slot: * ```solidity * contract ERC1967 { * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot. * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * TIP: Consider using this library along with {SlotDerivation}. */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct Int256Slot { int256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Int256Slot` with member `value` located at `slot`. */ function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } /** * @dev Returns a `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20_Ex { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) external returns (bool); /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IRouter { function initialiseRequest(address, uint256, bytes32) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../vendor/OOOSafeMath.sol"; import "../interfaces/IERC20_Ex.sol"; import "../interfaces/IRouter.sol"; import "./RequestIdBase.sol"; /** * @title ConsumerBase smart contract * * @dev This contract can be imported by any smart contract wishing to include * off-chain data or data from a different network within it. * * The consumer initiates a data request by forwarding the request to the Router * smart contract, from where the data provider(s) pick up and process the * data request, and forward it back to the specified callback function. * */ abstract contract ConsumerBase is RequestIdBase { using OOOSafeMath for uint256; /* * STATE VARIABLES */ // nonces for generating requestIds. Must be in sync with the // nonces defined in Router.sol. mapping(address => uint256) private nonces; IERC20_Ex internal xFUND; IRouter internal router; /* * WRITE FUNCTIONS */ constructor() { } /** * @notice _setRouter is a helper function to allow changing the router contract address * Allows updating the router address. Future proofing for potential Router upgrades * NOTE: it is advisable to wrap this around a function that uses, for example, OpenZeppelin's * onlyOwner modifier * * @param _router address of the deployed Router smart contract */ function _setRouter(address _router) internal returns (bool) { require(_router != address(0), "router cannot be the zero address"); router = IRouter(_router); return true; } /** * @notice _increaseRouterAllowance is a helper function to increase token allowance for * the xFUND Router * Allows this contract to increase the xFUND allowance for the Router contract * enabling it to pay request fees on behalf of this contract. * NOTE: it is advisable to wrap this around a function that uses, for example, OpenZeppelin's * onlyOwner modifier * * @param _amount uint256 amount to increase allowance by */ function _increaseRouterAllowance(uint256 _amount) internal returns (bool) { // The context of msg.sender is this contract's address require(xFUND.increaseAllowance(address(router), _amount), "failed to increase allowance"); return true; } /** * @dev _requestData - initialises a data request. forwards the request to the deployed * Router smart contract. * * @param _dataProvider payable address of the data provider * @param _fee uint256 fee to be paid * @param _data bytes32 value of data being requested, e.g. PRICE.BTC.USD.AVG requests * average price for BTC/USD pair * @return requestId bytes32 request ID which can be used to track or cancel the request */ function _requestData(address _dataProvider, uint256 _fee, bytes32 _data) internal returns (bytes32) { bytes32 requestId = makeRequestId(address(this), _dataProvider, address(router), nonces[_dataProvider], _data); // call the underlying ConsumerLib.sol lib's submitDataRequest function require(router.initialiseRequest(_dataProvider, _fee, _data)); nonces[_dataProvider] = nonces[_dataProvider].safeAdd(1); return requestId; } /** * @dev rawReceiveData - Called by the Router's fulfillRequest function * in order to fulfil a data request. Data providers call the Router's fulfillRequest function * The request is validated to ensure it has indeed been sent via the Router. * * The Router will only call rawReceiveData once it has validated the origin of the data fulfillment. * rawReceiveData then calls the user defined receiveData function to finalise the fulfilment. * Contract developers will need to override the abstract receiveData function defined below. * * @param _price uint256 result being sent * @param _requestId bytes32 request ID of the request being fulfilled * has sent the data */ function rawReceiveData( uint256 _price, bytes32 _requestId) external { // validate it came from the router require(msg.sender == address(router), "only Router can call"); // call override function in end-user's contract receiveData(_price, _requestId); } /** * @dev receiveData - should be overridden by contract developers to process the * data fulfilment in their own contract. * * @param _price uint256 result being sent * @param _requestId bytes32 request ID of the request being fulfilled */ function receiveData( uint256 _price, bytes32 _requestId ) internal virtual; /* * READ FUNCTIONS */ /** * @dev getRouterAddress returns the address of the Router smart contract being used * * @return address */ function getRouterAddress() external view returns (address) { return address(router); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title RequestIdBase * * @dev A contract used by ConsumerBase and Router to generate requestIds * */ contract RequestIdBase { /** * @dev makeRequestId generates a requestId * * @param _dataConsumer address of consumer contract * @param _dataProvider address of provider * @param _router address of Router contract * @param _requestNonce uint256 request nonce * @param _data bytes32 hex encoded data endpoint * * @return bytes32 requestId */ function makeRequestId( address _dataConsumer, address _dataProvider, address _router, uint256 _requestNonce, bytes32 _data) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_dataConsumer, _dataProvider, _router, _requestNonce, _data)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library OOOSafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function saveDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function safeMod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; /** * @title ILandAuction * @dev Interface for LandAuction contract, exposing only getCurrentBid functionality */ interface ILandAuction { /** * @dev Returns the current bid for given coordinates * @param x X-coordinate of the land * @param y Y-coordinate of the land * @return amount The bid amount * @return bidder The address of the bidder */ function getCurrentBid( int16 x, int16 y ) external view returns (uint256 amount, address bidder); /** * @dev Returns the category for given coordinates */ function getCategory(int16 x, int16 y) external view returns (int8); /** * @dev Returns the reserve price for given coordinates */ function getReservePrice(int16 x, int16 y) external view returns (uint256); }
//SPDX-License-Identifier: MIT pragma solidity 0.8.22; /** * @title ILandRegistry * @dev Interface for LandRegistry contract, defining core land management functions */ interface ILandRegistry { /** * @dev Mints a new land token at specified coordinates * @param user Address to receive the token * @param x X-coordinate of the land * @param y Y-coordinate of the land */ function mint( address user, int16 x, int16 y ) external; /** * @dev Checks if a token exists by tokenId * @param tokenId The token identifier * @return bool indicating if the token exists */ function exists(uint256 tokenId) external view returns (bool); /** * @dev Checks if a token exists at specific coordinates * @param x X-coordinate of the land * @param y Y-coordinate of the land * @return bool indicating if the token exists */ function exists(int16 x, int16 y) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[{"internalType":"address","name":"router","type":"address"}],"name":"InvalidRouter","type":"error"},{"inputs":[],"name":"MessageSendFailed","type":"error"},{"inputs":[],"name":"NoMessageToSend","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentBalance","type":"uint256"},{"internalType":"uint256","name":"calculatedFees","type":"uint256"}],"name":"NotEnoughBalance","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"encXY","type":"uint32"},{"indexed":false,"internalType":"int16","name":"x","type":"int16"},{"indexed":false,"internalType":"int16","name":"y","type":"int16"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isShib","type":"bool"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"LandBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isMinted","type":"bool"}],"name":"MintStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"newValue","type":"bool"}],"name":"MultiMintToggled","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":"enum LandSaleETH.Stage","name":"stage","type":"uint8"}],"name":"StageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"SHIB","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionV1","outputs":[{"internalType":"contract ILandAuction","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"messageId","type":"bytes32"},{"internalType":"uint64","name":"sourceChainSelector","type":"uint64"},{"internalType":"bytes","name":"sender","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Client.EVMTokenAmount[]","name":"destTokenAmounts","type":"tuple[]"}],"internalType":"struct Client.Any2EVMMessage","name":"message","type":"tuple"}],"name":"ccipReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentStage","outputs":[{"internalType":"enum LandSaleETH.Stage","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethToShib","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"x","type":"int16"},{"internalType":"int16","name":"y","type":"int16"}],"name":"getCategory","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_provider","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"getData","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"}],"internalType":"struct LandSaleETH.MintStatusUpdate[]","name":"updates","type":"tuple[]"}],"name":"getMessageFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"x","type":"int16"},{"internalType":"int16","name":"y","type":"int16"}],"name":"getPriceInEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"x","type":"int16"},{"internalType":"int16","name":"y","type":"int16"}],"name":"getPriceInShib","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRouterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseRouterAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILandRegistry","name":"_landRegistry","type":"address"},{"internalType":"contract ILandAuction","name":"_auctionV1","type":"address"},{"internalType":"contract IERC20","name":"_shib","type":"address"},{"internalType":"uint64","name":"_shibariumChainSelector","type":"uint64"},{"internalType":"contract IERC20_Ex","name":"_xfund","type":"address"},{"internalType":"contract IRouter","name":"_router","type":"address"},{"internalType":"address","name":"_ccipRouter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"landRegistry","outputs":[{"internalType":"contract ILandRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"x","type":"int16"},{"internalType":"int16","name":"y","type":"int16"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int16[]","name":"xs","type":"int16[]"},{"internalType":"int16[]","name":"ys","type":"int16[]"}],"name":"mintPublicMulti","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int16","name":"x","type":"int16"},{"internalType":"int16","name":"y","type":"int16"}],"name":"mintPublicWithShib","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int16[]","name":"xs","type":"int16[]"},{"internalType":"int16[]","name":"ys","type":"int16[]"}],"name":"mintPublicWithShibMulti","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int16[]","name":"xs","type":"int16[]"},{"internalType":"int16[]","name":"ys","type":"int16[]"}],"name":"mintWinningBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedOnShibarium","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moderator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiMintEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"","type":"int16"},{"internalType":"int16","name":"","type":"int16"}],"name":"purchases","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"buyer","type":"address"},{"internalType":"bool","name":"isShib","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes32","name":"_requestId","type":"bytes32"}],"name":"rawReceiveData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILandAuction","name":"_auctionV1","type":"address"}],"name":"setAuctionV1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILandRegistry","name":"_landRegistry","type":"address"}],"name":"setLandRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_moderator","type":"address"}],"name":"setModerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setMultiMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleContract","type":"address"}],"name":"setShibariumSaleContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum LandSaleETH.Stage","name":"stage","type":"uint8"}],"name":"setStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shibariumChainSelector","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shibariumSaleContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","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":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawShib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawXFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xHigh","outputs":[{"internalType":"int16","name":"","type":"int16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xLow","outputs":[{"internalType":"int16","name":"","type":"int16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yHigh","outputs":[{"internalType":"int16","name":"","type":"int16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yLow","outputs":[{"internalType":"int16","name":"","type":"int16"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000da565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000775760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d75780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805161487162000104600039600081816134710152818161349a01526135db01526148716000f3fe60806040526004361061028c5760003560e01c80638da5cb5b1161015a578063ce3cd997116100c1578063e24b85e71161007a578063e24b85e71461080d578063e45d1cf81461082d578063f1e2bf5414610840578063f2fde38b14610860578063f7eeae6214610880578063fd49dc5e146108b357600080fd5b8063ce3cd99714610754578063d1b5cd1514610774578063d54f7d5e146107a4578063d598c9e9146107c2578063d5ed9cba146107d7578063dfc1a731146107f757600080fd5b8063b0f479a111610113578063b0f479a1146106a3578063b3a6807c146106c1578063bd4dc024146106e1578063c1864d6c14610701578063c78daced14610721578063cacee6211461074157600080fd5b80638da5cb5b146105f1578063969890e414610606578063a4e756e714610626578063ad3cb1cc14610639578063afadcda614610677578063afc01ac31461068d57600080fd5b80634f1ef286116101fe57806375bba189116101b757806375bba189146104b857806379aaba3e146104d85780637c54e2521461055157806380ca56a31461059057806385572ffb146105b15780638a37a379146105d157600080fd5b80634f1ef2861461041857806352d1902d1461042b5780635bf5d54c14610440578063609af8ca1461046e5780636991cf8914610483578063715018a6146104a357600080fd5b80633874390411610250578063387439041461035d5780633ccfd60b1461039557806340f19a6a146103aa57806347c3593f146103bd5780634ae44563146103e55780634c83c4231461040557600080fd5b806301ffc9a7146102985780630e459224146102cd5780631f166bb9146102ef5780631f960cb51461030f5780632979d0251461033d57600080fd5b3661029357005b600080fd5b3480156102a457600080fd5b506102b86102b3366004613c0d565b6108c8565b60405190151581526020015b60405180910390f35b3480156102d957600080fd5b506102ed6102e8366004613c4c565b6108ff565b005b3480156102fb57600080fd5b506102ed61030a366004613c85565b610950565b34801561031b57600080fd5b5061032f61032a366004613d2b565b610bac565b6040519081526020016102c4565b34801561034957600080fd5b5061032f610358366004613d5e565b610c2c565b34801561036957600080fd5b5060085461037d906001600160a01b031681565b6040516001600160a01b0390911681526020016102c4565b3480156103a157600080fd5b506102ed610ca6565b6102ed6103b8366004613d2b565b610d31565b3480156103c957600080fd5b506103d2606381565b60405160019190910b81526020016102c4565b3480156103f157600080fd5b5061032f610400366004613e4b565b6110ea565b6102ed610413366004613f5a565b611210565b6102ed610426366004614034565b611863565b34801561043757600080fd5b5061032f61187e565b34801561044c57600080fd5b5060055461046190600160a01b900460ff1681565b6040516102c49190614099565b34801561047a57600080fd5b506102ed61189b565b34801561048f57600080fd5b506102ed61049e3660046140c1565b61199a565b3480156104af57600080fd5b506102ed611a37565b3480156104c457600080fd5b506102ed6104d3366004613c4c565b611a4b565b3480156104e457600080fd5b5061052c6104f3366004613d2b565b600b602090815260009283526040808420909152908252902080546001909101546001600160a01b03811690600160a01b900460ff1683565b604080519384526001600160a01b0390921660208401521515908201526060016102c4565b34801561055d57600080fd5b5060085461057890600160a01b90046001600160401b031681565b6040516001600160401b0390911681526020016102c4565b34801561059c57600080fd5b506005546102b890600160a81b900460ff1681565b3480156105bd57600080fd5b506102ed6105cc3660046140da565b611abe565b3480156105dd57600080fd5b506102ed6105ec366004613c4c565b611afc565b3480156105fd57600080fd5b5061037d611b4d565b34801561061257600080fd5b506102ed610621366004614114565b611b7b565b6102ed610634366004613f5a565b611bd5565b34801561064557600080fd5b5061066a604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516102c49190614186565b34801561068357600080fd5b5061032f60075481565b34801561069957600080fd5b506103d260621981565b3480156106af57600080fd5b506003546001600160a01b031661037d565b3480156106cd57600080fd5b5060055461037d906001600160a01b031681565b3480156106ed57600080fd5b5060045461037d906001600160a01b031681565b34801561070d57600080fd5b5060095461037d906001600160a01b031681565b34801561072d57600080fd5b506102ed61073c366004614199565b612124565b6102ed61074f366004613d2b565b6121d6565b34801561076057600080fd5b506102ed61076f3660046141b6565b6124cb565b34801561078057600080fd5b506102b861078f3660046140c1565b600a6020526000908152604090205460ff1681565b3480156107b057600080fd5b506002546001600160a01b031661037d565b3480156107ce57600080fd5b506103d2606081565b3480156107e357600080fd5b506102ed6107f2366004613c4c565b61252c565b34801561080357600080fd5b506103d2605f1981565b34801561081957600080fd5b5060065461037d906001600160a01b031681565b6102ed61083b366004613f5a565b61257d565b34801561084c57600080fd5b5061032f61085b366004613d2b565b612c0e565b34801561086c57600080fd5b506102ed61087b366004613c4c565b612c92565b34801561088c57600080fd5b506108a061089b366004613d2b565b612ccd565b60405160009190910b81526020016102c4565b3480156108bf57600080fd5b506102ed612d46565b60006001600160e01b031982166385572ffb60e01b14806108f957506001600160e01b031982166301ffc9a760e01b145b92915050565b610907612e88565b6001600160a01b03811661092e5760405163e6c4247b60e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156109955750825b90506000826001600160401b031660011480156109b15750303b155b9050811580156109bf575080155b156109dd5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a0757845460ff60401b1916600160401b1785555b610a1033612eba565b610a18612ecb565b610a20612edb565b33600860006101000a8154816001600160a01b0302191690836001600160a01b0316021790555085600360006101000a8154816001600160a01b0302191690836001600160a01b031602179055508b600460006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a600560006101000a8154816001600160a01b0302191690836001600160a01b0316021790555089600660006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600860146101000a8154816001600160401b0302191690836001600160401b0316021790555087600160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086600260006101000a8154816001600160a01b0302191690836001600160a01b031602179055508315610b9e57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6005546040516324d4c0b360e21b8152600184810b600483015283900b60248201526000916001600160a01b03169063935302cc90604401602060405180830381865afa158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906141d7565b9392505050565b6008546000906001600160a01b03163314610c835760405162461bcd60e51b815260206004820152601260248201527122a9292fa7a7262cafa6a7a222a920aa27a960711b60448201526064015b60405180910390fd5b6b15d155120b94d212508b905160a21b610c9e848483612ee3565b949350505050565b610cae612e88565b4780610ced5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4e4f5f42414c414e434560901b6044820152606401610c7a565b610cf5611b4d565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610d2d573d6000803e3d6000fd5b5050565b600180600554600160a01b900460ff166001811115610d5257610d52614083565b14610d6f5760405162461bcd60e51b8152600401610c7a906141f0565b610d7761302c565b6000610d838484613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e7991610dbd9163ffffffff8616910190815260200190565b602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe919061421d565b15610e1b5760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff1615610e515760405162461bcd60e51b8152600401610c7a90614266565b60055460405163aaf5ddcd60e01b8152600186810b600483015285900b602482015260009182916001600160a01b039091169063aaf5ddcd906044016040805180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd919061429d565b90925090506001600160a01b03811615610ef95760405162461bcd60e51b8152600401610c7a906142cd565b6000610f058787612c0e565b600188810b6000908152600b60209081526040808320938b900b83529290522080549192509015610f485760405162461bcd60e51b8152600401610c7a906142fd565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610f5f57905050905060405180604001604052808763ffffffff1681526020016001151581525081600081518110610fb957610fb961432c565b60200260200101819052506000610fcf826110ea565b905080341015610ff15760405162461bcd60e51b8152600401610c7a90614342565b6006546040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106c919061421d565b5061107a8a8a866001613090565b611083826131fe565b600061108f823461438f565b905080156110c657604051339082156108fc029083906000818181858888f193505050501580156110c4573d6000803e3d6000fd5b505b50505050505050506110e5600160008051602061481c83398151915255565b505050565b600080826040516020016110fe91906143a2565b6040516020818303038152906040529050600061111c826000613370565b90506000306001600160a01b031663b0f479a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118291906143fb565b6008546040516320487ded60e01b81529192506001600160a01b038316916320487ded916111c691600160a01b9091046001600160401b0316908690600401614418565b602060405180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906141d7565b95945050505050565b600180600554600160a01b900460ff16600181111561123157611231614083565b1461124e5760405162461bcd60e51b8152600401610c7a906141f0565b61125661302c565b600554600160a81b900460ff166112a95760405162461bcd60e51b815260206004820152601760248201527611549497d35553151257d352539517d11254d050931151604a1b6044820152606401610c7a565b838281146112c95760405162461bcd60e51b8152600401610c7a906144f4565b600080826001600160401b038111156112e4576112e4613d8a565b60405190808252806020026020018201604052801561132957816020015b60408051808201909152600080825260208201528152602001906001900390816113025790505b50905060005b8381101561169c57600061138f8a8a8481811061134e5761134e61432c565b90506020020160208101906113639190614521565b8989858181106113755761137561432c565b905060200201602081019061138a9190614521565b613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e79916113c99163ffffffff8616910190815260200190565b602060405180830381865afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a919061421d565b156114275760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff161561145d5760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8d8d878181106114855761148561432c565b905060200201602081019061149a9190614521565b8c8c888181106114ac576114ac61432c565b90506020020160208101906114c19190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa158015611505573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611529919061429d565b90925090506001600160a01b038116156115555760405162461bcd60e51b8152600401610c7a906142cd565b6000600b60008e8e8881811061156d5761156d61432c565b90506020020160208101906115829190614521565b60010b60010b815260200190815260200160002060008c8c888181106115aa576115aa61432c565b90506020020160208101906115bf9190614521565b60010b815260208101919091526040016000208054909150156115f45760405162461bcd60e51b8152600401610c7a906142fd565b60405180604001604052808563ffffffff168152602001600115158152508686815181106116245761162461432c565b60200260200101819052506116808d8d878181106116445761164461432c565b90506020020160208101906116599190614521565b8c8c8881811061166b5761166b61432c565b905060200201602081019061085b9190614521565b61168a908861453c565b9650506001909301925061132f915050565b5060006116a8826110ea565b9050803410156116ca5760405162461bcd60e51b8152600401610c7a90614342565b6006546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611721573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611745919061421d565b5060005b848110156117f357600061178f8b8b848181106117685761176861432c565b905060200201602081019061177d9190614521565b8a8a8581811061166b5761166b61432c565b90506117ea8b8b848181106117a6576117a661432c565b90506020020160208101906117bb9190614521565b8a8a858181106117cd576117cd61432c565b90506020020160208101906117e29190614521565b836001613090565b50600101611749565b506117fd826131fe565b6000611809823461438f565b9050801561184057604051339082156108fc029083906000818181858888f1935050505015801561183e573d6000803e3d6000fd5b505b505050505061185c600160008051602061481c83398151915255565b5050505050565b61186b613466565b6118748261350b565b610d2d8282613513565b60006118886135d0565b506000805160206147fc83398151915290565b6118a3612e88565b6006546001600160a01b031663a9059cbb6118bc611b4d565b6006546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611904573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192891906141d7565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611973573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611997919061421d565b50565b6008546001600160a01b031633146119e95760405162461bcd60e51b815260206004820152601260248201527122a9292fa7a7262cafa6a7a222a920aa27a960711b6044820152606401610c7a565b6119f281613619565b6119975760405162461bcd60e51b81526020600482015260166024820152754552525f4641494c45445f544f5f494e43524541534560501b6044820152606401610c7a565b611a3f612e88565b611a4960006136eb565b565b611a53612e88565b6001600160a01b038116611a9c5760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b6044820152606401610c7a565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b03163314611aeb576040516335fdcccd60e21b8152336004820152602401610c7a565b611997611af7826145e2565b61375c565b611b04612e88565b6001600160a01b038116611b2b5760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6002546001600160a01b03163314611bcc5760405162461bcd60e51b81526020600482015260146024820152731bdb9b1e48149bdd5d195c8818d85b8818d85b1b60621b6044820152606401610c7a565b610d2d82600755565b600180600554600160a01b900460ff166001811115611bf657611bf6614083565b14611c135760405162461bcd60e51b8152600401610c7a906141f0565b611c1b61302c565b600554600160a81b900460ff16611c6e5760405162461bcd60e51b815260206004820152601760248201527611549497d35553151257d352539517d11254d050931151604a1b6044820152606401610c7a565b83828114611c8e5760405162461bcd60e51b8152600401610c7a906144f4565b600080826001600160401b03811115611ca957611ca9613d8a565b604051908082528060200260200182016040528015611cee57816020015b6040805180820190915260008082526020820152815260200190600190039081611cc75790505b50905060005b83811015612020576000611d138a8a8481811061134e5761134e61432c565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e7991611d4d9163ffffffff8616910190815260200190565b602060405180830381865afa158015611d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8e919061421d565b15611dab5760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff1615611de15760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8d8d87818110611e0957611e0961432c565b9050602002016020810190611e1e9190614521565b8c8c88818110611e3057611e3061432c565b9050602002016020810190611e459190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa158015611e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ead919061429d565b90925090506001600160a01b03811615611ed95760405162461bcd60e51b8152600401610c7a906142cd565b6000600b60008e8e88818110611ef157611ef161432c565b9050602002016020810190611f069190614521565b60010b60010b815260200190815260200160002060008c8c88818110611f2e57611f2e61432c565b9050602002016020810190611f439190614521565b60010b81526020810191909152604001600020805490915015611f785760405162461bcd60e51b8152600401610c7a906142fd565b60405180604001604052808563ffffffff16815260200160011515815250868681518110611fa857611fa861432c565b60200260200101819052506120048d8d87818110611fc857611fc861432c565b9050602002016020810190611fdd9190614521565b8c8c88818110611fef57611fef61432c565b905060200201602081019061032a9190614521565b61200e908861453c565b96505060019093019250611cf4915050565b50600061202c826110ea565b9050612038818461453c565b3410156120575760405162461bcd60e51b8152600401610c7a90614342565b60005b848110156121045760006120a08b8b848181106120795761207961432c565b905060200201602081019061208e9190614521565b8a8a85818110611fef57611fef61432c565b90506120fb8b8b848181106120b7576120b761432c565b90506020020160208101906120cc9190614521565b8a8a858181106120de576120de61432c565b90506020020160208101906120f39190614521565b836000613090565b5060010161205a565b5061210e826131fe565b600061211a828561453c565b611809903461438f565b61212c612e88565b801515600560159054906101000a900460ff1615150361217e5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f5f4348414e474560981b6044820152606401610c7a565b60058054821515600160a81b0260ff60a81b199091161790556040517fd8373d79d93cdfd438ab7d1911510595c9674c7e25171cb08f3b9673081ced18906121cb90831515815260200190565b60405180910390a150565b600180600554600160a01b900460ff1660018111156121f7576121f7614083565b146122145760405162461bcd60e51b8152600401610c7a906141f0565b61221c61302c565b60006122288484613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e79916122629163ffffffff8616910190815260200190565b602060405180830381865afa15801561227f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a3919061421d565b156122c05760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff16156122f65760405162461bcd60e51b8152600401610c7a90614266565b60055460405163aaf5ddcd60e01b8152600186810b600483015285900b602482015260009182916001600160a01b039091169063aaf5ddcd906044016040805180830381865afa15801561234e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612372919061429d565b90925090506001600160a01b0381161561239e5760405162461bcd60e51b8152600401610c7a906142cd565b60006123aa8787610bac565b600188810b6000908152600b60209081526040808320938b900b835292905220805491925090156123ed5760405162461bcd60e51b8152600401610c7a906142fd565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161240457905050905060405180604001604052808763ffffffff168152602001600115158152508160008151811061245e5761245e61432c565b60200260200101819052506000612474826110ea565b9050612480818561453c565b34101561249f5760405162461bcd60e51b8152600401610c7a90614342565b6124ac8a8a866000613090565b6124b5826131fe565b60006124c1828661453c565b61108f903461438f565b6124d3612e88565b6005805482919060ff60a01b1916600160a01b8360018111156124f8576124f8614083565b02179055507f4ff5ebba87c29de84b67e21a40cf0f57ae9a017da902f978ed57d591852e849c816040516121cb9190614099565b612534612e88565b6001600160a01b03811661255b5760405163e6c4247b60e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61258561302c565b828181146125a55760405162461bcd60e51b8152600401610c7a906144f4565b6000816001600160401b038111156125bf576125bf613d8a565b60405190808252806020026020018201604052801561260457816020015b60408051808201909152600080825260208201528152602001906001900390816125dd5790505b50905060005b828110156128865760006126508888848181106126295761262961432c565b905060200201602081019061263e9190614521565b8787858181106113755761137561432c565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e799161268a9163ffffffff8616910190815260200190565b602060405180830381865afa1580156126a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cb919061421d565b156126e85760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff161561271e5760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8b8b878181106127465761274661432c565b905060200201602081019061275b9190614521565b8a8a8881811061276d5761276d61432c565b90506020020160208101906127829190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa1580156127c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ea919061429d565b90925090506001600160a01b03811633146128405760405162461bcd60e51b815260206004820152601660248201527522a9292fa727aa2faba4a72724a723afa124a22222a960511b6044820152606401610c7a565b60405180604001604052808463ffffffff168152602001600115158152508585815181106128705761287061432c565b602090810291909101015250505060010161260a565b506000612892826110ea565b9050803410156128e45760405162461bcd60e51b815260206004820152601c60248201527f4552525f494e53554646494349454e545f4d4553534147455f464545000000006044820152606401610c7a565b60005b83811015612ba057600061292d8989848181106129065761290661432c565b905060200201602081019061291b9190614521565b8888858181106113755761137561432c565b90506000600b60008b8b868181106129475761294761432c565b905060200201602081019061295c9190614521565b60010b60010b815260200190815260200160002060008989868181106129845761298461432c565b90506020020160208101906129999190614521565b600190810b82526020808301939093526040918201600090812081815580830180546001600160a81b0319163360ff60a01b19811691909117909155808352600c865293822080549384018155825293902060088204018054600790921660049081026101000a63ffffffff8181021990941693881602929092179055549192506001600160a01b03909116906376e61180908c8c87818110612a3e57612a3e61432c565b9050602002016020810190612a539190614521565b8b8b88818110612a6557612a6561432c565b9050602002016020810190612a7a9190614521565b6040516001600160e01b031960e086901b1681526001600160a01b039093166004840152600191820b6024840152900b6044820152606401600060405180830381600087803b158015612acc57600080fd5b505af1158015612ae0573d6000803e3d6000fd5b505050508163ffffffff16336001600160a01b03167fca96251beb7865c082fa77d85f923fbfdec44a8c053cd6b2e6546113d320e6ad8c8c87818110612b2857612b2861432c565b9050602002016020810190612b3d9190614521565b8b8b88818110612b4f57612b4f61432c565b9050602002016020810190612b649190614521565b60408051600193840b81529190920b60208201526000818301819052606082015242608082015290519081900360a00190a350506001016128e7565b50612baa826131fe565b6000612bb6823461438f565b90508015612bed57604051339082156108fc029083906000818181858888f19350505050158015612beb573d6000803e3d6000fd5b505b50505050612c08600160008051602061481c83398151915255565b50505050565b600080612c1b8484610bac565b90506000670de0b6b3a764000082600754612c36919061468e565b612c4091906146a5565b905060008111610c9e5760405162461bcd60e51b815260206004820152601c60248201527f4552525f494e56414c49445f50524943455f434f4e56455253494f4e000000006044820152606401610c7a565b612c9a612e88565b6001600160a01b038116612cc457604051631e4fbdf760e01b815260006004820152602401610c7a565b611997816136eb565b600554604051637bf7573160e11b8152600184810b600483015283900b60248201526000916001600160a01b03169063f7eeae6290604401602060405180830381865afa158015612d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906146c7565b612d4e612e88565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dbb91906141d7565b905060008111612dfe5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4e4f5f42414c414e434560901b6044820152606401610c7a565b6001546001600160a01b031663a9059cbb612e17611b4d565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015612e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d919061421d565b33612e91611b4d565b6001600160a01b031614611a495760405163118cdaa760e01b8152336004820152602401610c7a565b612ec2613936565b6119978161397f565b612ed3613936565b611a49613987565b611a49613936565b6002546001600160a01b03841660009081526020818152604080832054815130606090811b6bffffffffffffffffffffffff19908116838701528a821b8116603484015296901b9095166048860152605c850152607c80850186905281518086039091018152609c9094019052825192019190912081906002546040516001620fb3e960e11b031981526001600160a01b038881166004830152602482018890526044820187905292935091169063ffe0982e906064016020604051808303816000875af1158015612fb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fdd919061421d565b612fe657600080fd5b6001600160a01b03851660009081526020819052604090205461300a90600161398f565b6001600160a01b03861660009081526020819052604090205590509392505050565b60008051602061481c83398151915280546001190161305e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b600061ffff8261ffff161663ffff0000620100008561ffff1661308791906146ea565b16179392505050565b600184810b6000908152600b6020908152604080832087850b8452909152812084815591820180546001600160a81b0319163360ff60a01b191617600160a01b851515021790556130e18686613064565b336000818152600c60209081526040808320805460018082018355918552929093206008830401805463ffffffff8781166004600790961686026101000a9081029102199091161790558154905162edcc2360e71b81529182019390935289820b60248201529088900b60448201529192506001600160a01b0316906376e6118090606401600060405180830381600087803b15801561318057600080fd5b505af1158015613194573d6000803e3d6000fd5b50506040805160018a810b825289900b6020820152908101879052851515606082015242608082015263ffffffff841692503391507fca96251beb7865c082fa77d85f923fbfdec44a8c053cd6b2e6546113d320e6ad9060a00160405180910390a3505050505050565b6000613209826110ea565b90503481111561323557604051634787a10360e11b815234600482015260248101829052604401610c7a565b60008260405160200161324891906143a2565b60405160208183030381529060405290506000613266826000613370565b90506000306001600160a01b031663b0f479a16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132cc91906143fb565b6008546040516396f4e9f960e01b81529192506001600160a01b038316916396f4e9f991879161331191600160a01b90046001600160401b0316908790600401614418565b60206040518083038185885af115801561332f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061335491906141d7565b505050505050565b600160008051602061481c83398151915255565b6133ab6040518060a0016040528060608152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b6040805160a081019091526009546001600160a01b031660c08201528060e0810160408051808303601f190181529181529082526020808301879052815160008082529181018352929091019190613425565b60408051808201909152600080825260208201528152602001906001900390816133fe5790505b508152602001836001600160a01b0316815260200161345d60405180604001604052806207a1208152602001600115158152506139ee565b90529392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806134ed57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166134e16000805160206147fc833981519152546001600160a01b031690565b6001600160a01b031614155b15611a495760405163703e46dd60e11b815260040160405180910390fd5b611997612e88565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561356d575060408051601f3d908101601f1916820190925261356a918101906141d7565b60015b61359557604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610c7a565b6000805160206147fc83398151915281146135c657604051632a87526960e21b815260048101829052602401610c7a565b6110e58383613a41565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611a495760405163703e46dd60e11b815260040160405180910390fd5b600154600254604051633950935160e01b81526001600160a01b0391821660048201526024810184905260009291909116906339509351906044016020604051808303816000875af1158015613673573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613697919061421d565b6136e35760405162461bcd60e51b815260206004820152601c60248201527f6661696c656420746f20696e63726561736520616c6c6f77616e6365000000006044820152606401610c7a565b506001919050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60085460208201516001600160401b03908116600160a01b90920416146137bc5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339031b430b4b71039b2b632b1ba37b960611b6044820152606401610c7a565b600954604082015180516001600160a01b03909216916137e4916020918101820191016143fb565b6001600160a01b03161461382b5760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039b2b73232b960911b6044820152606401610c7a565b600081606001518060200190518101906138459190614712565b905060005b81518110156110e5578181815181106138655761386561432c565b602002602001015160200151600a60008484815181106138875761388761432c565b602002602001015160000151815260200190815260200160002060006101000a81548160ff0219169083151502179055508181815181106138ca576138ca61432c565b6020026020010151600001517f0d3b9e836525256429ec72234733d4c5e98c2050ed60a3a617b60d1c9a428b8c8383815181106139095761390961432c565b602002602001015160200151604051613926911515815260200190565b60405180910390a260010161384a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611a4957604051631afcd79f60e31b815260040160405180910390fd5b612c9a613936565b61335c613936565b60008061399c838561453c565b905083811015610c255760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610c7a565b606063181dcf1060e01b82604051602401613a0991906147c6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b613a4a82613a97565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115613a8f576110e58282613afc565b610d2d613b69565b806001600160a01b03163b600003613acd57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610c7a565b6000805160206147fc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051613b1991906147df565b600060405180830381855af49150503d8060008114613b54576040519150601f19603f3d011682016040523d82523d6000602084013e613b59565b606091505b5091509150611207858383613b88565b3415611a495760405163b398979f60e01b815260040160405180910390fd5b606082613b9d57613b9882613be4565b610c25565b8151158015613bb457506001600160a01b0384163b155b15613bdd57604051639996b31560e01b81526001600160a01b0385166004820152602401610c7a565b5080610c25565b805115613bf45780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b600060208284031215613c1f57600080fd5b81356001600160e01b031981168114610c2557600080fd5b6001600160a01b038116811461199757600080fd5b600060208284031215613c5e57600080fd5b8135610c2581613c37565b80356001600160401b0381168114613c8057600080fd5b919050565b600080600080600080600060e0888a031215613ca057600080fd5b8735613cab81613c37565b96506020880135613cbb81613c37565b95506040880135613ccb81613c37565b9450613cd960608901613c69565b93506080880135613ce981613c37565b925060a0880135613cf981613c37565b915060c0880135613d0981613c37565b8091505092959891949750929550565b8035600181900b8114613c8057600080fd5b60008060408385031215613d3e57600080fd5b613d4783613d19565b9150613d5560208401613d19565b90509250929050565b60008060408385031215613d7157600080fd5b8235613d7c81613c37565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613dc257613dc2613d8a565b60405290565b60405160a081016001600160401b0381118282101715613dc257613dc2613d8a565b604051601f8201601f191681016001600160401b0381118282101715613e1257613e12613d8a565b604052919050565b60006001600160401b03821115613e3357613e33613d8a565b5060051b60200190565b801515811461199757600080fd5b60006020808385031215613e5e57600080fd5b82356001600160401b03811115613e7457600080fd5b8301601f81018513613e8557600080fd5b8035613e98613e9382613e1a565b613dea565b81815260069190911b82018301908381019087831115613eb757600080fd5b928401925b82841015613f045760408489031215613ed55760008081fd5b613edd613da0565b8435815285850135613eee81613e3d565b8187015282526040939093019290840190613ebc565b979650505050505050565b60008083601f840112613f2157600080fd5b5081356001600160401b03811115613f3857600080fd5b6020830191508360208260051b8501011115613f5357600080fd5b9250929050565b60008060008060408587031215613f7057600080fd5b84356001600160401b0380821115613f8757600080fd5b613f9388838901613f0f565b90965094506020870135915080821115613fac57600080fd5b50613fb987828801613f0f565b95989497509550505050565b600082601f830112613fd657600080fd5b81356001600160401b03811115613fef57613fef613d8a565b614002601f8201601f1916602001613dea565b81815284602083860101111561401757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561404757600080fd5b823561405281613c37565b915060208301356001600160401b0381111561406d57600080fd5b61407985828601613fc5565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106140bb57634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156140d357600080fd5b5035919050565b6000602082840312156140ec57600080fd5b81356001600160401b0381111561410257600080fd5b820160a08185031215610c2557600080fd5b6000806040838503121561412757600080fd5b50508035926020909101359150565b60005b83811015614151578181015183820152602001614139565b50506000910152565b60008151808452614172816020860160208601614136565b601f01601f19169290920160200192915050565b602081526000610c25602083018461415a565b6000602082840312156141ab57600080fd5b8135610c2581613e3d565b6000602082840312156141c857600080fd5b813560028110610c2557600080fd5b6000602082840312156141e957600080fd5b5051919050565b6020808252601390820152724552525f53414c455f4e4f545f41435449564560681b604082015260600190565b60006020828403121561422f57600080fd5b8151610c2581613e3d565b60208082526012908201527111549497d053149150511657d3525395115160721b604082015260600190565b60208082526017908201527f4552525f4d494e5445445f4f4e5f53484942415249554d000000000000000000604082015260600190565b600080604083850312156142b057600080fd5b8251915060208301516142c281613c37565b809150509250929050565b60208082526016908201527522a9292fa420a9afaba4a72724a723afa124a22222a960511b604082015260600190565b60208082526015908201527411549497d053149150511657d4155490d21054d151605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60208082526018908201527f4552525f494e53554646494349454e545f5041594d454e540000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156108f9576108f9614379565b602080825282518282018190526000919060409081850190868401855b828110156143ee576143de848351805182526020908101511515910152565b92840192908501906001016143bf565b5091979650505050505050565b60006020828403121561440d57600080fd5b8151610c2581613c37565b600060406001600160401b03851683526020604081850152845160a0604086015261444660e086018261415a565b905081860151603f1980878403016060880152614463838361415a565b6040890151888203830160808a01528051808352908601945060009350908501905b808410156144b757845180516001600160a01b0316835286015186830152938501936001939093019290860190614485565b5060608901516001600160a01b031660a08901526080890151888203830160c08a015295506144e6818761415a565b9a9950505050505050505050565b60208082526013908201527208aa4a4be988a9c8ea890be9a92a69a82a8869606b1b604082015260600190565b60006020828403121561453357600080fd5b610c2582613d19565b808201808211156108f9576108f9614379565b600082601f83011261456057600080fd5b81356020614570613e9383613e1a565b82815260069290921b8401810191818101908684111561458f57600080fd5b8286015b848110156145d757604081890312156145ac5760008081fd5b6145b4613da0565b81356145bf81613c37565b81528185013585820152835291830191604001614593565b509695505050505050565b600060a082360312156145f457600080fd5b6145fc613dc8565b8235815261460c60208401613c69565b602082015260408301356001600160401b038082111561462b57600080fd5b61463736838701613fc5565b6040840152606085013591508082111561465057600080fd5b61465c36838701613fc5565b6060840152608085013591508082111561467557600080fd5b506146823682860161454f565b60808301525092915050565b80820281158282048414176108f9576108f9614379565b6000826146c257634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156146d957600080fd5b81518060000b8114610c2557600080fd5b63ffffffff81811683821602808216919082811461470a5761470a614379565b505092915050565b6000602080838503121561472557600080fd5b82516001600160401b0381111561473b57600080fd5b8301601f8101851361474c57600080fd5b805161475a613e9382613e1a565b81815260069190911b8201830190838101908783111561477957600080fd5b928401925b82841015613f0457604084890312156147975760008081fd5b61479f613da0565b84518152858501516147b081613e3d565b818701528252604093909301929084019061477e565b81518152602080830151151590820152604081016108f9565b600082516147f1818460208701614136565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220f06f5e3eb37504de1e660f50cfbe9c4960ca035d0f4fe28017aea514eb7b41c464736f6c63430008160033
Deployed Bytecode
0x60806040526004361061028c5760003560e01c80638da5cb5b1161015a578063ce3cd997116100c1578063e24b85e71161007a578063e24b85e71461080d578063e45d1cf81461082d578063f1e2bf5414610840578063f2fde38b14610860578063f7eeae6214610880578063fd49dc5e146108b357600080fd5b8063ce3cd99714610754578063d1b5cd1514610774578063d54f7d5e146107a4578063d598c9e9146107c2578063d5ed9cba146107d7578063dfc1a731146107f757600080fd5b8063b0f479a111610113578063b0f479a1146106a3578063b3a6807c146106c1578063bd4dc024146106e1578063c1864d6c14610701578063c78daced14610721578063cacee6211461074157600080fd5b80638da5cb5b146105f1578063969890e414610606578063a4e756e714610626578063ad3cb1cc14610639578063afadcda614610677578063afc01ac31461068d57600080fd5b80634f1ef286116101fe57806375bba189116101b757806375bba189146104b857806379aaba3e146104d85780637c54e2521461055157806380ca56a31461059057806385572ffb146105b15780638a37a379146105d157600080fd5b80634f1ef2861461041857806352d1902d1461042b5780635bf5d54c14610440578063609af8ca1461046e5780636991cf8914610483578063715018a6146104a357600080fd5b80633874390411610250578063387439041461035d5780633ccfd60b1461039557806340f19a6a146103aa57806347c3593f146103bd5780634ae44563146103e55780634c83c4231461040557600080fd5b806301ffc9a7146102985780630e459224146102cd5780631f166bb9146102ef5780631f960cb51461030f5780632979d0251461033d57600080fd5b3661029357005b600080fd5b3480156102a457600080fd5b506102b86102b3366004613c0d565b6108c8565b60405190151581526020015b60405180910390f35b3480156102d957600080fd5b506102ed6102e8366004613c4c565b6108ff565b005b3480156102fb57600080fd5b506102ed61030a366004613c85565b610950565b34801561031b57600080fd5b5061032f61032a366004613d2b565b610bac565b6040519081526020016102c4565b34801561034957600080fd5b5061032f610358366004613d5e565b610c2c565b34801561036957600080fd5b5060085461037d906001600160a01b031681565b6040516001600160a01b0390911681526020016102c4565b3480156103a157600080fd5b506102ed610ca6565b6102ed6103b8366004613d2b565b610d31565b3480156103c957600080fd5b506103d2606381565b60405160019190910b81526020016102c4565b3480156103f157600080fd5b5061032f610400366004613e4b565b6110ea565b6102ed610413366004613f5a565b611210565b6102ed610426366004614034565b611863565b34801561043757600080fd5b5061032f61187e565b34801561044c57600080fd5b5060055461046190600160a01b900460ff1681565b6040516102c49190614099565b34801561047a57600080fd5b506102ed61189b565b34801561048f57600080fd5b506102ed61049e3660046140c1565b61199a565b3480156104af57600080fd5b506102ed611a37565b3480156104c457600080fd5b506102ed6104d3366004613c4c565b611a4b565b3480156104e457600080fd5b5061052c6104f3366004613d2b565b600b602090815260009283526040808420909152908252902080546001909101546001600160a01b03811690600160a01b900460ff1683565b604080519384526001600160a01b0390921660208401521515908201526060016102c4565b34801561055d57600080fd5b5060085461057890600160a01b90046001600160401b031681565b6040516001600160401b0390911681526020016102c4565b34801561059c57600080fd5b506005546102b890600160a81b900460ff1681565b3480156105bd57600080fd5b506102ed6105cc3660046140da565b611abe565b3480156105dd57600080fd5b506102ed6105ec366004613c4c565b611afc565b3480156105fd57600080fd5b5061037d611b4d565b34801561061257600080fd5b506102ed610621366004614114565b611b7b565b6102ed610634366004613f5a565b611bd5565b34801561064557600080fd5b5061066a604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516102c49190614186565b34801561068357600080fd5b5061032f60075481565b34801561069957600080fd5b506103d260621981565b3480156106af57600080fd5b506003546001600160a01b031661037d565b3480156106cd57600080fd5b5060055461037d906001600160a01b031681565b3480156106ed57600080fd5b5060045461037d906001600160a01b031681565b34801561070d57600080fd5b5060095461037d906001600160a01b031681565b34801561072d57600080fd5b506102ed61073c366004614199565b612124565b6102ed61074f366004613d2b565b6121d6565b34801561076057600080fd5b506102ed61076f3660046141b6565b6124cb565b34801561078057600080fd5b506102b861078f3660046140c1565b600a6020526000908152604090205460ff1681565b3480156107b057600080fd5b506002546001600160a01b031661037d565b3480156107ce57600080fd5b506103d2606081565b3480156107e357600080fd5b506102ed6107f2366004613c4c565b61252c565b34801561080357600080fd5b506103d2605f1981565b34801561081957600080fd5b5060065461037d906001600160a01b031681565b6102ed61083b366004613f5a565b61257d565b34801561084c57600080fd5b5061032f61085b366004613d2b565b612c0e565b34801561086c57600080fd5b506102ed61087b366004613c4c565b612c92565b34801561088c57600080fd5b506108a061089b366004613d2b565b612ccd565b60405160009190910b81526020016102c4565b3480156108bf57600080fd5b506102ed612d46565b60006001600160e01b031982166385572ffb60e01b14806108f957506001600160e01b031982166301ffc9a760e01b145b92915050565b610907612e88565b6001600160a01b03811661092e5760405163e6c4247b60e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156109955750825b90506000826001600160401b031660011480156109b15750303b155b9050811580156109bf575080155b156109dd5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a0757845460ff60401b1916600160401b1785555b610a1033612eba565b610a18612ecb565b610a20612edb565b33600860006101000a8154816001600160a01b0302191690836001600160a01b0316021790555085600360006101000a8154816001600160a01b0302191690836001600160a01b031602179055508b600460006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a600560006101000a8154816001600160a01b0302191690836001600160a01b0316021790555089600660006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600860146101000a8154816001600160401b0302191690836001600160401b0316021790555087600160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086600260006101000a8154816001600160a01b0302191690836001600160a01b031602179055508315610b9e57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6005546040516324d4c0b360e21b8152600184810b600483015283900b60248201526000916001600160a01b03169063935302cc90604401602060405180830381865afa158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906141d7565b9392505050565b6008546000906001600160a01b03163314610c835760405162461bcd60e51b815260206004820152601260248201527122a9292fa7a7262cafa6a7a222a920aa27a960711b60448201526064015b60405180910390fd5b6b15d155120b94d212508b905160a21b610c9e848483612ee3565b949350505050565b610cae612e88565b4780610ced5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4e4f5f42414c414e434560901b6044820152606401610c7a565b610cf5611b4d565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610d2d573d6000803e3d6000fd5b5050565b600180600554600160a01b900460ff166001811115610d5257610d52614083565b14610d6f5760405162461bcd60e51b8152600401610c7a906141f0565b610d7761302c565b6000610d838484613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e7991610dbd9163ffffffff8616910190815260200190565b602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe919061421d565b15610e1b5760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff1615610e515760405162461bcd60e51b8152600401610c7a90614266565b60055460405163aaf5ddcd60e01b8152600186810b600483015285900b602482015260009182916001600160a01b039091169063aaf5ddcd906044016040805180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd919061429d565b90925090506001600160a01b03811615610ef95760405162461bcd60e51b8152600401610c7a906142cd565b6000610f058787612c0e565b600188810b6000908152600b60209081526040808320938b900b83529290522080549192509015610f485760405162461bcd60e51b8152600401610c7a906142fd565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610f5f57905050905060405180604001604052808763ffffffff1681526020016001151581525081600081518110610fb957610fb961432c565b60200260200101819052506000610fcf826110ea565b905080341015610ff15760405162461bcd60e51b8152600401610c7a90614342565b6006546040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106c919061421d565b5061107a8a8a866001613090565b611083826131fe565b600061108f823461438f565b905080156110c657604051339082156108fc029083906000818181858888f193505050501580156110c4573d6000803e3d6000fd5b505b50505050505050506110e5600160008051602061481c83398151915255565b505050565b600080826040516020016110fe91906143a2565b6040516020818303038152906040529050600061111c826000613370565b90506000306001600160a01b031663b0f479a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118291906143fb565b6008546040516320487ded60e01b81529192506001600160a01b038316916320487ded916111c691600160a01b9091046001600160401b0316908690600401614418565b602060405180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906141d7565b95945050505050565b600180600554600160a01b900460ff16600181111561123157611231614083565b1461124e5760405162461bcd60e51b8152600401610c7a906141f0565b61125661302c565b600554600160a81b900460ff166112a95760405162461bcd60e51b815260206004820152601760248201527611549497d35553151257d352539517d11254d050931151604a1b6044820152606401610c7a565b838281146112c95760405162461bcd60e51b8152600401610c7a906144f4565b600080826001600160401b038111156112e4576112e4613d8a565b60405190808252806020026020018201604052801561132957816020015b60408051808201909152600080825260208201528152602001906001900390816113025790505b50905060005b8381101561169c57600061138f8a8a8481811061134e5761134e61432c565b90506020020160208101906113639190614521565b8989858181106113755761137561432c565b905060200201602081019061138a9190614521565b613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e79916113c99163ffffffff8616910190815260200190565b602060405180830381865afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a919061421d565b156114275760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff161561145d5760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8d8d878181106114855761148561432c565b905060200201602081019061149a9190614521565b8c8c888181106114ac576114ac61432c565b90506020020160208101906114c19190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa158015611505573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611529919061429d565b90925090506001600160a01b038116156115555760405162461bcd60e51b8152600401610c7a906142cd565b6000600b60008e8e8881811061156d5761156d61432c565b90506020020160208101906115829190614521565b60010b60010b815260200190815260200160002060008c8c888181106115aa576115aa61432c565b90506020020160208101906115bf9190614521565b60010b815260208101919091526040016000208054909150156115f45760405162461bcd60e51b8152600401610c7a906142fd565b60405180604001604052808563ffffffff168152602001600115158152508686815181106116245761162461432c565b60200260200101819052506116808d8d878181106116445761164461432c565b90506020020160208101906116599190614521565b8c8c8881811061166b5761166b61432c565b905060200201602081019061085b9190614521565b61168a908861453c565b9650506001909301925061132f915050565b5060006116a8826110ea565b9050803410156116ca5760405162461bcd60e51b8152600401610c7a90614342565b6006546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611721573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611745919061421d565b5060005b848110156117f357600061178f8b8b848181106117685761176861432c565b905060200201602081019061177d9190614521565b8a8a8581811061166b5761166b61432c565b90506117ea8b8b848181106117a6576117a661432c565b90506020020160208101906117bb9190614521565b8a8a858181106117cd576117cd61432c565b90506020020160208101906117e29190614521565b836001613090565b50600101611749565b506117fd826131fe565b6000611809823461438f565b9050801561184057604051339082156108fc029083906000818181858888f1935050505015801561183e573d6000803e3d6000fd5b505b505050505061185c600160008051602061481c83398151915255565b5050505050565b61186b613466565b6118748261350b565b610d2d8282613513565b60006118886135d0565b506000805160206147fc83398151915290565b6118a3612e88565b6006546001600160a01b031663a9059cbb6118bc611b4d565b6006546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611904573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192891906141d7565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611973573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611997919061421d565b50565b6008546001600160a01b031633146119e95760405162461bcd60e51b815260206004820152601260248201527122a9292fa7a7262cafa6a7a222a920aa27a960711b6044820152606401610c7a565b6119f281613619565b6119975760405162461bcd60e51b81526020600482015260166024820152754552525f4641494c45445f544f5f494e43524541534560501b6044820152606401610c7a565b611a3f612e88565b611a4960006136eb565b565b611a53612e88565b6001600160a01b038116611a9c5760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b6044820152606401610c7a565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b03163314611aeb576040516335fdcccd60e21b8152336004820152602401610c7a565b611997611af7826145e2565b61375c565b611b04612e88565b6001600160a01b038116611b2b5760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6002546001600160a01b03163314611bcc5760405162461bcd60e51b81526020600482015260146024820152731bdb9b1e48149bdd5d195c8818d85b8818d85b1b60621b6044820152606401610c7a565b610d2d82600755565b600180600554600160a01b900460ff166001811115611bf657611bf6614083565b14611c135760405162461bcd60e51b8152600401610c7a906141f0565b611c1b61302c565b600554600160a81b900460ff16611c6e5760405162461bcd60e51b815260206004820152601760248201527611549497d35553151257d352539517d11254d050931151604a1b6044820152606401610c7a565b83828114611c8e5760405162461bcd60e51b8152600401610c7a906144f4565b600080826001600160401b03811115611ca957611ca9613d8a565b604051908082528060200260200182016040528015611cee57816020015b6040805180820190915260008082526020820152815260200190600190039081611cc75790505b50905060005b83811015612020576000611d138a8a8481811061134e5761134e61432c565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e7991611d4d9163ffffffff8616910190815260200190565b602060405180830381865afa158015611d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8e919061421d565b15611dab5760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff1615611de15760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8d8d87818110611e0957611e0961432c565b9050602002016020810190611e1e9190614521565b8c8c88818110611e3057611e3061432c565b9050602002016020810190611e459190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa158015611e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ead919061429d565b90925090506001600160a01b03811615611ed95760405162461bcd60e51b8152600401610c7a906142cd565b6000600b60008e8e88818110611ef157611ef161432c565b9050602002016020810190611f069190614521565b60010b60010b815260200190815260200160002060008c8c88818110611f2e57611f2e61432c565b9050602002016020810190611f439190614521565b60010b81526020810191909152604001600020805490915015611f785760405162461bcd60e51b8152600401610c7a906142fd565b60405180604001604052808563ffffffff16815260200160011515815250868681518110611fa857611fa861432c565b60200260200101819052506120048d8d87818110611fc857611fc861432c565b9050602002016020810190611fdd9190614521565b8c8c88818110611fef57611fef61432c565b905060200201602081019061032a9190614521565b61200e908861453c565b96505060019093019250611cf4915050565b50600061202c826110ea565b9050612038818461453c565b3410156120575760405162461bcd60e51b8152600401610c7a90614342565b60005b848110156121045760006120a08b8b848181106120795761207961432c565b905060200201602081019061208e9190614521565b8a8a85818110611fef57611fef61432c565b90506120fb8b8b848181106120b7576120b761432c565b90506020020160208101906120cc9190614521565b8a8a858181106120de576120de61432c565b90506020020160208101906120f39190614521565b836000613090565b5060010161205a565b5061210e826131fe565b600061211a828561453c565b611809903461438f565b61212c612e88565b801515600560159054906101000a900460ff1615150361217e5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f5f4348414e474560981b6044820152606401610c7a565b60058054821515600160a81b0260ff60a81b199091161790556040517fd8373d79d93cdfd438ab7d1911510595c9674c7e25171cb08f3b9673081ced18906121cb90831515815260200190565b60405180910390a150565b600180600554600160a01b900460ff1660018111156121f7576121f7614083565b146122145760405162461bcd60e51b8152600401610c7a906141f0565b61221c61302c565b60006122288484613064565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e79916122629163ffffffff8616910190815260200190565b602060405180830381865afa15801561227f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a3919061421d565b156122c05760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff16156122f65760405162461bcd60e51b8152600401610c7a90614266565b60055460405163aaf5ddcd60e01b8152600186810b600483015285900b602482015260009182916001600160a01b039091169063aaf5ddcd906044016040805180830381865afa15801561234e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612372919061429d565b90925090506001600160a01b0381161561239e5760405162461bcd60e51b8152600401610c7a906142cd565b60006123aa8787610bac565b600188810b6000908152600b60209081526040808320938b900b835292905220805491925090156123ed5760405162461bcd60e51b8152600401610c7a906142fd565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161240457905050905060405180604001604052808763ffffffff168152602001600115158152508160008151811061245e5761245e61432c565b60200260200101819052506000612474826110ea565b9050612480818561453c565b34101561249f5760405162461bcd60e51b8152600401610c7a90614342565b6124ac8a8a866000613090565b6124b5826131fe565b60006124c1828661453c565b61108f903461438f565b6124d3612e88565b6005805482919060ff60a01b1916600160a01b8360018111156124f8576124f8614083565b02179055507f4ff5ebba87c29de84b67e21a40cf0f57ae9a017da902f978ed57d591852e849c816040516121cb9190614099565b612534612e88565b6001600160a01b03811661255b5760405163e6c4247b60e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61258561302c565b828181146125a55760405162461bcd60e51b8152600401610c7a906144f4565b6000816001600160401b038111156125bf576125bf613d8a565b60405190808252806020026020018201604052801561260457816020015b60408051808201909152600080825260208201528152602001906001900390816125dd5790505b50905060005b828110156128865760006126508888848181106126295761262961432c565b905060200201602081019061263e9190614521565b8787858181106113755761137561432c565b60048054604051634f558e7960e01b81529293506001600160a01b031691634f558e799161268a9163ffffffff8616910190815260200190565b602060405180830381865afa1580156126a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cb919061421d565b156126e85760405162461bcd60e51b8152600401610c7a9061423a565b63ffffffff81166000908152600a602052604090205460ff161561271e5760405162461bcd60e51b8152600401610c7a90614266565b60055460009081906001600160a01b031663aaf5ddcd8b8b878181106127465761274661432c565b905060200201602081019061275b9190614521565b8a8a8881811061276d5761276d61432c565b90506020020160208101906127829190614521565b6040516001600160e01b031960e085901b168152600192830b6004820152910b60248201526044016040805180830381865afa1580156127c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ea919061429d565b90925090506001600160a01b03811633146128405760405162461bcd60e51b815260206004820152601660248201527522a9292fa727aa2faba4a72724a723afa124a22222a960511b6044820152606401610c7a565b60405180604001604052808463ffffffff168152602001600115158152508585815181106128705761287061432c565b602090810291909101015250505060010161260a565b506000612892826110ea565b9050803410156128e45760405162461bcd60e51b815260206004820152601c60248201527f4552525f494e53554646494349454e545f4d4553534147455f464545000000006044820152606401610c7a565b60005b83811015612ba057600061292d8989848181106129065761290661432c565b905060200201602081019061291b9190614521565b8888858181106113755761137561432c565b90506000600b60008b8b868181106129475761294761432c565b905060200201602081019061295c9190614521565b60010b60010b815260200190815260200160002060008989868181106129845761298461432c565b90506020020160208101906129999190614521565b600190810b82526020808301939093526040918201600090812081815580830180546001600160a81b0319163360ff60a01b19811691909117909155808352600c865293822080549384018155825293902060088204018054600790921660049081026101000a63ffffffff8181021990941693881602929092179055549192506001600160a01b03909116906376e61180908c8c87818110612a3e57612a3e61432c565b9050602002016020810190612a539190614521565b8b8b88818110612a6557612a6561432c565b9050602002016020810190612a7a9190614521565b6040516001600160e01b031960e086901b1681526001600160a01b039093166004840152600191820b6024840152900b6044820152606401600060405180830381600087803b158015612acc57600080fd5b505af1158015612ae0573d6000803e3d6000fd5b505050508163ffffffff16336001600160a01b03167fca96251beb7865c082fa77d85f923fbfdec44a8c053cd6b2e6546113d320e6ad8c8c87818110612b2857612b2861432c565b9050602002016020810190612b3d9190614521565b8b8b88818110612b4f57612b4f61432c565b9050602002016020810190612b649190614521565b60408051600193840b81529190920b60208201526000818301819052606082015242608082015290519081900360a00190a350506001016128e7565b50612baa826131fe565b6000612bb6823461438f565b90508015612bed57604051339082156108fc029083906000818181858888f19350505050158015612beb573d6000803e3d6000fd5b505b50505050612c08600160008051602061481c83398151915255565b50505050565b600080612c1b8484610bac565b90506000670de0b6b3a764000082600754612c36919061468e565b612c4091906146a5565b905060008111610c9e5760405162461bcd60e51b815260206004820152601c60248201527f4552525f494e56414c49445f50524943455f434f4e56455253494f4e000000006044820152606401610c7a565b612c9a612e88565b6001600160a01b038116612cc457604051631e4fbdf760e01b815260006004820152602401610c7a565b611997816136eb565b600554604051637bf7573160e11b8152600184810b600483015283900b60248201526000916001600160a01b03169063f7eeae6290604401602060405180830381865afa158015612d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906146c7565b612d4e612e88565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dbb91906141d7565b905060008111612dfe5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4e4f5f42414c414e434560901b6044820152606401610c7a565b6001546001600160a01b031663a9059cbb612e17611b4d565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015612e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d919061421d565b33612e91611b4d565b6001600160a01b031614611a495760405163118cdaa760e01b8152336004820152602401610c7a565b612ec2613936565b6119978161397f565b612ed3613936565b611a49613987565b611a49613936565b6002546001600160a01b03841660009081526020818152604080832054815130606090811b6bffffffffffffffffffffffff19908116838701528a821b8116603484015296901b9095166048860152605c850152607c80850186905281518086039091018152609c9094019052825192019190912081906002546040516001620fb3e960e11b031981526001600160a01b038881166004830152602482018890526044820187905292935091169063ffe0982e906064016020604051808303816000875af1158015612fb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fdd919061421d565b612fe657600080fd5b6001600160a01b03851660009081526020819052604090205461300a90600161398f565b6001600160a01b03861660009081526020819052604090205590509392505050565b60008051602061481c83398151915280546001190161305e57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b600061ffff8261ffff161663ffff0000620100008561ffff1661308791906146ea565b16179392505050565b600184810b6000908152600b6020908152604080832087850b8452909152812084815591820180546001600160a81b0319163360ff60a01b191617600160a01b851515021790556130e18686613064565b336000818152600c60209081526040808320805460018082018355918552929093206008830401805463ffffffff8781166004600790961686026101000a9081029102199091161790558154905162edcc2360e71b81529182019390935289820b60248201529088900b60448201529192506001600160a01b0316906376e6118090606401600060405180830381600087803b15801561318057600080fd5b505af1158015613194573d6000803e3d6000fd5b50506040805160018a810b825289900b6020820152908101879052851515606082015242608082015263ffffffff841692503391507fca96251beb7865c082fa77d85f923fbfdec44a8c053cd6b2e6546113d320e6ad9060a00160405180910390a3505050505050565b6000613209826110ea565b90503481111561323557604051634787a10360e11b815234600482015260248101829052604401610c7a565b60008260405160200161324891906143a2565b60405160208183030381529060405290506000613266826000613370565b90506000306001600160a01b031663b0f479a16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132cc91906143fb565b6008546040516396f4e9f960e01b81529192506001600160a01b038316916396f4e9f991879161331191600160a01b90046001600160401b0316908790600401614418565b60206040518083038185885af115801561332f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061335491906141d7565b505050505050565b600160008051602061481c83398151915255565b6133ab6040518060a0016040528060608152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b6040805160a081019091526009546001600160a01b031660c08201528060e0810160408051808303601f190181529181529082526020808301879052815160008082529181018352929091019190613425565b60408051808201909152600080825260208201528152602001906001900390816133fe5790505b508152602001836001600160a01b0316815260200161345d60405180604001604052806207a1208152602001600115158152506139ee565b90529392505050565b306001600160a01b037f00000000000000000000000039acd7281868d677adf24351fc018d7e1aacd7ab1614806134ed57507f00000000000000000000000039acd7281868d677adf24351fc018d7e1aacd7ab6001600160a01b03166134e16000805160206147fc833981519152546001600160a01b031690565b6001600160a01b031614155b15611a495760405163703e46dd60e11b815260040160405180910390fd5b611997612e88565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561356d575060408051601f3d908101601f1916820190925261356a918101906141d7565b60015b61359557604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610c7a565b6000805160206147fc83398151915281146135c657604051632a87526960e21b815260048101829052602401610c7a565b6110e58383613a41565b306001600160a01b037f00000000000000000000000039acd7281868d677adf24351fc018d7e1aacd7ab1614611a495760405163703e46dd60e11b815260040160405180910390fd5b600154600254604051633950935160e01b81526001600160a01b0391821660048201526024810184905260009291909116906339509351906044016020604051808303816000875af1158015613673573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613697919061421d565b6136e35760405162461bcd60e51b815260206004820152601c60248201527f6661696c656420746f20696e63726561736520616c6c6f77616e6365000000006044820152606401610c7a565b506001919050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60085460208201516001600160401b03908116600160a01b90920416146137bc5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339031b430b4b71039b2b632b1ba37b960611b6044820152606401610c7a565b600954604082015180516001600160a01b03909216916137e4916020918101820191016143fb565b6001600160a01b03161461382b5760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21039b2b73232b960911b6044820152606401610c7a565b600081606001518060200190518101906138459190614712565b905060005b81518110156110e5578181815181106138655761386561432c565b602002602001015160200151600a60008484815181106138875761388761432c565b602002602001015160000151815260200190815260200160002060006101000a81548160ff0219169083151502179055508181815181106138ca576138ca61432c565b6020026020010151600001517f0d3b9e836525256429ec72234733d4c5e98c2050ed60a3a617b60d1c9a428b8c8383815181106139095761390961432c565b602002602001015160200151604051613926911515815260200190565b60405180910390a260010161384a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16611a4957604051631afcd79f60e31b815260040160405180910390fd5b612c9a613936565b61335c613936565b60008061399c838561453c565b905083811015610c255760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610c7a565b606063181dcf1060e01b82604051602401613a0991906147c6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b613a4a82613a97565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115613a8f576110e58282613afc565b610d2d613b69565b806001600160a01b03163b600003613acd57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610c7a565b6000805160206147fc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051613b1991906147df565b600060405180830381855af49150503d8060008114613b54576040519150601f19603f3d011682016040523d82523d6000602084013e613b59565b606091505b5091509150611207858383613b88565b3415611a495760405163b398979f60e01b815260040160405180910390fd5b606082613b9d57613b9882613be4565b610c25565b8151158015613bb457506001600160a01b0384163b155b15613bdd57604051639996b31560e01b81526001600160a01b0385166004820152602401610c7a565b5080610c25565b805115613bf45780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b600060208284031215613c1f57600080fd5b81356001600160e01b031981168114610c2557600080fd5b6001600160a01b038116811461199757600080fd5b600060208284031215613c5e57600080fd5b8135610c2581613c37565b80356001600160401b0381168114613c8057600080fd5b919050565b600080600080600080600060e0888a031215613ca057600080fd5b8735613cab81613c37565b96506020880135613cbb81613c37565b95506040880135613ccb81613c37565b9450613cd960608901613c69565b93506080880135613ce981613c37565b925060a0880135613cf981613c37565b915060c0880135613d0981613c37565b8091505092959891949750929550565b8035600181900b8114613c8057600080fd5b60008060408385031215613d3e57600080fd5b613d4783613d19565b9150613d5560208401613d19565b90509250929050565b60008060408385031215613d7157600080fd5b8235613d7c81613c37565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613dc257613dc2613d8a565b60405290565b60405160a081016001600160401b0381118282101715613dc257613dc2613d8a565b604051601f8201601f191681016001600160401b0381118282101715613e1257613e12613d8a565b604052919050565b60006001600160401b03821115613e3357613e33613d8a565b5060051b60200190565b801515811461199757600080fd5b60006020808385031215613e5e57600080fd5b82356001600160401b03811115613e7457600080fd5b8301601f81018513613e8557600080fd5b8035613e98613e9382613e1a565b613dea565b81815260069190911b82018301908381019087831115613eb757600080fd5b928401925b82841015613f045760408489031215613ed55760008081fd5b613edd613da0565b8435815285850135613eee81613e3d565b8187015282526040939093019290840190613ebc565b979650505050505050565b60008083601f840112613f2157600080fd5b5081356001600160401b03811115613f3857600080fd5b6020830191508360208260051b8501011115613f5357600080fd5b9250929050565b60008060008060408587031215613f7057600080fd5b84356001600160401b0380821115613f8757600080fd5b613f9388838901613f0f565b90965094506020870135915080821115613fac57600080fd5b50613fb987828801613f0f565b95989497509550505050565b600082601f830112613fd657600080fd5b81356001600160401b03811115613fef57613fef613d8a565b614002601f8201601f1916602001613dea565b81815284602083860101111561401757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561404757600080fd5b823561405281613c37565b915060208301356001600160401b0381111561406d57600080fd5b61407985828601613fc5565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106140bb57634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156140d357600080fd5b5035919050565b6000602082840312156140ec57600080fd5b81356001600160401b0381111561410257600080fd5b820160a08185031215610c2557600080fd5b6000806040838503121561412757600080fd5b50508035926020909101359150565b60005b83811015614151578181015183820152602001614139565b50506000910152565b60008151808452614172816020860160208601614136565b601f01601f19169290920160200192915050565b602081526000610c25602083018461415a565b6000602082840312156141ab57600080fd5b8135610c2581613e3d565b6000602082840312156141c857600080fd5b813560028110610c2557600080fd5b6000602082840312156141e957600080fd5b5051919050565b6020808252601390820152724552525f53414c455f4e4f545f41435449564560681b604082015260600190565b60006020828403121561422f57600080fd5b8151610c2581613e3d565b60208082526012908201527111549497d053149150511657d3525395115160721b604082015260600190565b60208082526017908201527f4552525f4d494e5445445f4f4e5f53484942415249554d000000000000000000604082015260600190565b600080604083850312156142b057600080fd5b8251915060208301516142c281613c37565b809150509250929050565b60208082526016908201527522a9292fa420a9afaba4a72724a723afa124a22222a960511b604082015260600190565b60208082526015908201527411549497d053149150511657d4155490d21054d151605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60208082526018908201527f4552525f494e53554646494349454e545f5041594d454e540000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156108f9576108f9614379565b602080825282518282018190526000919060409081850190868401855b828110156143ee576143de848351805182526020908101511515910152565b92840192908501906001016143bf565b5091979650505050505050565b60006020828403121561440d57600080fd5b8151610c2581613c37565b600060406001600160401b03851683526020604081850152845160a0604086015261444660e086018261415a565b905081860151603f1980878403016060880152614463838361415a565b6040890151888203830160808a01528051808352908601945060009350908501905b808410156144b757845180516001600160a01b0316835286015186830152938501936001939093019290860190614485565b5060608901516001600160a01b031660a08901526080890151888203830160c08a015295506144e6818761415a565b9a9950505050505050505050565b60208082526013908201527208aa4a4be988a9c8ea890be9a92a69a82a8869606b1b604082015260600190565b60006020828403121561453357600080fd5b610c2582613d19565b808201808211156108f9576108f9614379565b600082601f83011261456057600080fd5b81356020614570613e9383613e1a565b82815260069290921b8401810191818101908684111561458f57600080fd5b8286015b848110156145d757604081890312156145ac5760008081fd5b6145b4613da0565b81356145bf81613c37565b81528185013585820152835291830191604001614593565b509695505050505050565b600060a082360312156145f457600080fd5b6145fc613dc8565b8235815261460c60208401613c69565b602082015260408301356001600160401b038082111561462b57600080fd5b61463736838701613fc5565b6040840152606085013591508082111561465057600080fd5b61465c36838701613fc5565b6060840152608085013591508082111561467557600080fd5b506146823682860161454f565b60808301525092915050565b80820281158282048414176108f9576108f9614379565b6000826146c257634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156146d957600080fd5b81518060000b8114610c2557600080fd5b63ffffffff81811683821602808216919082811461470a5761470a614379565b505092915050565b6000602080838503121561472557600080fd5b82516001600160401b0381111561473b57600080fd5b8301601f8101851361474c57600080fd5b805161475a613e9382613e1a565b81815260069190911b8201830190838101908783111561477957600080fd5b928401925b82841015613f0457604084890312156147975760008081fd5b61479f613da0565b84518152858501516147b081613e3d565b818701528252604093909301929084019061477e565b81518152602080830151151590820152604081016108f9565b600082516147f1818460208701614136565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220f06f5e3eb37504de1e660f50cfbe9c4960ca035d0f4fe28017aea514eb7b41c464736f6c63430008160033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.