Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,882 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Combine | 20491070 | 110 days ago | IN | 0 ETH | 0.00119976 | ||||
Combine | 20271948 | 140 days ago | IN | 0 ETH | 0.0008806 | ||||
Combine | 20198410 | 150 days ago | IN | 0 ETH | 0.00051155 | ||||
Combine | 19954052 | 185 days ago | IN | 0 ETH | 0.00102891 | ||||
Combine | 19864228 | 197 days ago | IN | 0 ETH | 0.00073894 | ||||
Combine | 19854274 | 198 days ago | IN | 0 ETH | 0.00062505 | ||||
Combine | 19854201 | 198 days ago | IN | 0 ETH | 0.00065797 | ||||
Combine | 19850291 | 199 days ago | IN | 0.02 ETH | 0.00056929 | ||||
Combine | 19712844 | 218 days ago | IN | 0 ETH | 0.00152646 | ||||
Combine | 19712834 | 218 days ago | IN | 0 ETH | 0.00156614 | ||||
Combine | 19712810 | 218 days ago | IN | 0 ETH | 0.00208352 | ||||
Combine | 19691255 | 221 days ago | IN | 0 ETH | 0.00155638 | ||||
Combine | 19566121 | 239 days ago | IN | 0 ETH | 0.00300663 | ||||
Combine | 19531972 | 244 days ago | IN | 0 ETH | 0.00410544 | ||||
Combine | 19515701 | 246 days ago | IN | 0 ETH | 0.00271974 | ||||
Combine | 19487226 | 250 days ago | IN | 0 ETH | 0.00385886 | ||||
Combine | 19478655 | 251 days ago | IN | 0 ETH | 0.00666744 | ||||
Combine | 19473275 | 252 days ago | IN | 0 ETH | 0.00506314 | ||||
Combine | 19447152 | 256 days ago | IN | 0 ETH | 0.00587981 | ||||
Combine | 19351712 | 269 days ago | IN | 0 ETH | 0.00739298 | ||||
Combine | 19301284 | 276 days ago | IN | 0 ETH | 0.00371071 | ||||
Combine | 19294866 | 277 days ago | IN | 0 ETH | 0.00405263 | ||||
Combine | 19285123 | 278 days ago | IN | 0 ETH | 0.01039467 | ||||
Combine | 19262679 | 281 days ago | IN | 0 ETH | 0.00785631 | ||||
Combine | 19257166 | 282 days ago | IN | 0 ETH | 0.00424139 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
19850291 | 199 days ago | 0.02 ETH | ||||
19226716 | 286 days ago | 0.02 ETH | ||||
19190078 | 292 days ago | 0.02 ETH | ||||
19072654 | 308 days ago | 0.02 ETH | ||||
18987170 | 320 days ago | 0.02 ETH | ||||
18922722 | 329 days ago | 0.02 ETH | ||||
18872442 | 336 days ago | 0.02 ETH | ||||
18740134 | 355 days ago | 0.02 ETH | ||||
18725892 | 357 days ago | 0.02 ETH | ||||
18722140 | 357 days ago | 0.02 ETH | ||||
18707024 | 359 days ago | 0.02 ETH | ||||
18648838 | 368 days ago | 0.02 ETH | ||||
18645282 | 368 days ago | 0.02 ETH | ||||
18633956 | 370 days ago | 0.02 ETH | ||||
18535169 | 383 days ago | 0.02 ETH | ||||
18531415 | 384 days ago | 0.02 ETH | ||||
18509819 | 387 days ago | 0.02 ETH | ||||
18509187 | 387 days ago | 0.02 ETH | ||||
18508048 | 387 days ago | 0.02 ETH | ||||
18487262 | 390 days ago | 0.02 ETH | ||||
18463749 | 393 days ago | 0.02 ETH | ||||
18442139 | 396 days ago | 0.02 ETH | ||||
18442133 | 396 days ago | 0.02 ETH | ||||
18441040 | 397 days ago | 0.02 ETH | ||||
18441033 | 397 days ago | 0.02 ETH |
Loading...
Loading
Contract Name:
CombinatorSimpleReRoll
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '../interface/ICoolERC721A.sol'; import './utils/ErrorsAndEventsSimpleReRoll.sol'; // // // // .@@@%#@&&,(#. // @@@@@@@@@@@@@@@@&% // @@@@@@@@@@@@@@@/,@@( // &@@@% /@@@&@@@@@@@@@@#// // @@@@@@@@ /%@@@&@@@, @@@@@@@@@@@@@@@@@@@@@# // &@@&@@@&@@@&@@@@.. &@@@@@@&@@@@@@@&@@@@( @@@@@@& (&@@@& // @@@@@@@@@@@@@@@@@@@@@@@@ ,@@@@@@@@@@@@@@@@@@@@@@@@, (@@@@&* @@@&@/ &@@@@. // ,@@@@@@@@@@@@@@@@@@@@& &@@@@@@@@@@@@@@@@@@@@@@@@@&@@@( *@@@@@ ,&@@@@@@@@@@@@@@@@@@@& // &@@@@@@@@@@@@@@@@@% &@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@ @@@@& @@@@@@@@@@@@@@@@@@@&. // #@@@@@@@@@@@@&@@@@@@% ,&@@@@@@@@@@@@@&@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@* @@@@& %&@@@@@@@@@@@@@@@&@@@@# // @@@@@@@@@@@@@@@@@@@@@@@ ,&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@@ &@@@@ &@@@@@@@@@@@@@@@@@@@@@@@( // .&@@@@@@@@@@@@@@@@@@@@@@* &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@& .@@@@* *@&@@@@@@@@@@@@@@@@@@@@@ // &@@@@@@@@@@@@@@@@@@@@@@ &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@& @@@@( *&@@@@@@@@@@@@@@@@@@@& // &@@@&@@@&@@@&@@@&@& .&@@&@@@&@@@&@@@&@@@&@@@&@@@&@@@&@@@&@@@&@@@&@&. /&@@&# (@@&@@@&@@@&@@@&@% // *@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@ .@@@@@@@@@@@@@@@@@@@@@@@&/ // &@@@@@@@@@@@@@@@@@@@# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@& %@&@@@@@@@@@@@@@@@@@@@@ // /@@@@@@@@@@@@@@@@@@/ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@/ #@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@ // #@@@@@@@@@@@@&@@@@@@@& (@&@@@@@@@@@, .*%@@@&&&&&@@@@@@@@&@ *@@@@@@@@@&@ *@%* @@%&@@@@(. %@@@&%@@ // ,@@@(@@@@@/#@@@ ./@&&&&&&@% &@@@@@@@@@&@@ %@@@@&. ,@@@@@@ // ,*.#&&%.,. // // /// @title CombinatorSimpleReRoll /// @author Adam Goodman /// @notice This contract allows the burning of Cool Pets to upgrade them, and simplified re-rolling of traits contract CombinatorSimpleReRoll is Ownable, Pausable, ErrorsAndEventsSimpleReRoll { using ECDSA for bytes32; IERC721 public _oldCoolPets; ICoolERC721A public _newCoolPets; uint256 public _burnWindowStart; uint256 public _burnWindowEnd; uint256 public _maxSlots = 3; uint256 public _selectPetCost = 0.02 ether; uint256 public _reRollCost = 0.02 ether; uint256 public _maxSelectablePetType = 3; uint256 public _timestampWindow = 180; bytes32 public _merkleRoot; /// @dev Have to send old pets to 0x000...01 as transfer to 0x0 reverts, and old pets does not expose a burn function address public _nullAddress = address(1); /// @dev address for message signature verification address public _systemAddress; /// @dev address for withdrawing funds address public _withdrawAddress; /// @dev Hold nonces for combining to allow for tracking gem inventory off-chain mapping(address => uint256) public _currentNonce; /// @dev Hold used signatures for re-rolling mapping(bytes => bool) public _usedSignatures; // Mapping to only allow a merkle proof array to be used once. // Merkle proofs are not guaranteed to be unique to a specific Merkle root. So store them by root. mapping(bytes32 => mapping(bytes32 => bool)) public _usedMerkleProofs; constructor( address oldCoolPets, address newCoolPets, address systemAddress, address withdrawAddress, uint64 burnWindowStart, uint64 burnWindowEnd ) { _oldCoolPets = IERC721(oldCoolPets); _newCoolPets = ICoolERC721A(newCoolPets); _systemAddress = systemAddress; _withdrawAddress = withdrawAddress; setBurnWindow(burnWindowStart, burnWindowEnd); _pause(); } /// @notice Modifier to check if the burn window is open, otherwise revert modifier withinBurnWindow() { if (block.timestamp < _burnWindowStart) { revert BurnWindowNotStarted(); } if (block.timestamp > _burnWindowEnd) { revert BurnWindowEnded(); } _; } /// @notice Checks the input nonce matches the users nonce, and increments the nonce modifier validateNonce(address account, uint256 nonce) { if (nonce != _currentNonce[account]) { revert InvalidNonce(_currentNonce[account], nonce); } _currentNonce[account]++; _; } /// @notice Burns given old Cool Pets and mints upgraded Cool Pets /// @param firstPetId The first old Cool Pet to burn /// @param secondPetId The second old Cool Pet to burn /// @param gemTokenIds The gem token ids to use in each slot for the new Cool Pet - in order of slot /// @param signature The signature to validate the sender, nonce, gemIds and gemTokenIds /// @param nonce The nonce for the sender - must be greater than the last nonce used, stops signature replay, starts at 0 /// @param petSelection The pet type to mint - 0 for random function combine( uint256 firstPetId, uint256 secondPetId, uint256[] calldata gemTokenIds, bytes calldata signature, uint256 nonce, uint256 petSelection, uint256 timestamp ) external payable whenNotPaused withinBurnWindow validateNonce(msg.sender, nonce) { if (msg.sender != tx.origin) revert OnlyEOA(); if (gemTokenIds.length != _maxSlots) revert InvalidGemArrays(); if (timestamp < block.timestamp - _timestampWindow || timestamp > block.timestamp + 60) revert OutsideTimestampWindow(); if ( !_isValidSignature( keccak256( abi.encodePacked(msg.sender, nonce, gemTokenIds, petSelection, timestamp, address(this)) ), signature ) ) revert InvalidSignature(); _handlePetSelection(petSelection); _handleOldPetBurning(firstPetId, secondPetId); uint256 mintedId = _newCoolPets.nextTokenId(); _newCoolPets.mint(msg.sender, 1); emit Combined(msg.sender, firstPetId, secondPetId, mintedId, gemTokenIds, petSelection); } /// @notice re-roll a pets traits /// @param tokenId The token id of the pet to re-roll /// @param signature The signature to validate the sender, tokenId and timestamp /// @param timestamp The timestamp of the re-roll - must be within the timestamp window function reRoll( uint256 tokenId, bytes calldata signature, uint256 timestamp, bool reRollForm, bytes32[] calldata merkleProof ) external payable whenNotPaused { if (msg.sender != tx.origin) revert OnlyEOA(); if (_newCoolPets.ownerOf(tokenId) != msg.sender) revert OnlyOwnerOf(tokenId); if (timestamp < block.timestamp - _timestampWindow || timestamp > block.timestamp + 60) revert OutsideTimestampWindow(); if ( !_isValidSignature( keccak256(abi.encodePacked(msg.sender, tokenId, timestamp, reRollForm, address(this))), signature ) ) revert InvalidSignature(); if (_usedSignatures[signature]) revert SignatureAlreadyUsed(); _usedSignatures[signature] = true; _handleReRollCost(merkleProof); emit ReRolled(msg.sender, tokenId, reRollForm); } /// @notice Get the current nonce for an account function getNonce(address account) external view returns (uint256) { return _currentNonce[account]; } /// @notice Get nonces for a list of accounts function getNonceBatch(address[] memory accounts) external view returns (uint256[] memory) { uint256[] memory nonces = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; i++) { nonces[i] = _currentNonce[accounts[i]]; } return nonces; } /// @notice Pauses the contract - stopping minting via the public mint function /// @dev Only the owner can call this function /// Emit handled by {OpenZeppelin Pausable} function pause() external onlyOwner { _pause(); } /// @notice Unpauses the contract - allowing minting via the public mint function /// @dev Only the owner can call this function /// Emit handled by {OpenZeppelin Pausable} function unpause() external onlyOwner { _unpause(); } /// @notice Sets the max slots for an input gem array /// @dev Only the owner can call this function /// @param maxSlots The max slots for an input gem array function setMaxSlots(uint256 maxSlots) external onlyOwner { _maxSlots = maxSlots; emit MaxSlotsSet(maxSlots); } /// @notice Sets the system address for signature verification /// @dev Only the owner can call this function /// @param systemAddress The address of the system function setSystemAddress(address systemAddress) external onlyOwner { _systemAddress = systemAddress; emit SystemAddressSet(systemAddress); } /// @notice Sets the withdraw address for the contract /// @dev Only the owner can call this function /// @param withdrawAddress The address to withdraw to function setWithdrawAddress(address withdrawAddress) external onlyOwner { _withdrawAddress = withdrawAddress; emit WithdrawAddressSet(withdrawAddress); } /// @notice Sets the cost for selecting a specific pet type /// @dev Only the owner can call this function /// @param selectPetCost The cost for selecting a specific pet type function setSelectPetCost(uint256 selectPetCost) external onlyOwner { _selectPetCost = selectPetCost; emit SelectPetCostSet(selectPetCost); } /// @notice Sets the cost for re-rolling a pet /// @dev Only the owner can call this function /// @param reRollCost The cost for re-rolling a pet function setReRollCost(uint256 reRollCost) external onlyOwner { _reRollCost = reRollCost; emit ReRollCostSet(reRollCost); } /// @notice Sets the maximum value for a pet selection /// @dev Only the owner can call this function /// @param maxSelectablePetType The maximum value for a pet selection function setMaxSelectablePetType(uint256 maxSelectablePetType) external onlyOwner { _maxSelectablePetType = maxSelectablePetType; emit MaxSelectablePetTypeSet(maxSelectablePetType); } /// @notice Sets the address of the old Cool Pets contract /// @dev Only the owner can call this function /// @param oldCoolPets The address of the old Cool Pets contract function setOldCoolPetsAddress(address oldCoolPets) external onlyOwner { _oldCoolPets = IERC721(oldCoolPets); emit OldCoolPetsAddressSet(oldCoolPets); } /// @notice Sets the address of the new Cool Pets contract /// @dev Only the owner can call this function /// @param newCoolPets The address of the new Cool Pets contract function setNewCoolPetsAddress(address newCoolPets) external onlyOwner { _newCoolPets = ICoolERC721A(newCoolPets); emit NewCoolPetsAddressSet(newCoolPets); } /// @notice Sets the timestamp window, in seconds /// @dev Only the owner can call this function, used for signature verification /// @param timestampWindow The timestamp window, in seconds function setTimestampWindow(uint256 timestampWindow) external onlyOwner { _timestampWindow = timestampWindow; emit TimestampWindowSet(timestampWindow); } /// @notice Check if a merkle proof is valid for a user and if it has been used /// @param account The address to check /// @param merkleProof The merkle proof to check /// @return Whether the merkle proof is valid and has not been used function isValidMerkleProofAndUnused( address account, bytes32[] calldata merkleProof ) external view returns (bool) { if (_merkleRoot == bytes32(0)) { return false; } if (!isValidMerkleProof(account, merkleProof)) { return false; } bytes32 node = keccak256(abi.encodePacked(account)); return !_usedMerkleProofs[_merkleRoot][node]; } /// @notice Sets the burn window, start and end times are in seconds since unix epoch /// @dev Only the owner can call this function /// @param burnWindowStart The start time of the burn window /// @param burnWindowEnd The end time of the burn window function setBurnWindow(uint256 burnWindowStart, uint256 burnWindowEnd) public onlyOwner { if (burnWindowEnd < burnWindowStart) { revert InvalidBurnWindow(); } _burnWindowStart = burnWindowStart; _burnWindowEnd = burnWindowEnd; emit BurnWindowSet(burnWindowStart, burnWindowEnd); } /// @notice Sets the merkle root for the allowlist /// @dev Only the owner can call this function, setting the merkle root does not change /// whether the allowlist is enabled or not /// @param merkleRoot The new merkle root function setMerkleRoot(bytes32 merkleRoot) external onlyOwner { _merkleRoot = merkleRoot; emit MerkleRootSet(merkleRoot); } /// @notice Checks if a given address is on the merkle tree allowlist /// @dev Merkle trees can be generated using https://github.com/OpenZeppelin/merkle-tree /// @param account The address to check /// @param merkleProof The merkle proof to check /// @return Whether the address is on the allowlist or not function isValidMerkleProof( address account, bytes32[] calldata merkleProof ) public view virtual returns (bool) { return MerkleProof.verifyCalldata( merkleProof, _merkleRoot, keccak256(bytes.concat(keccak256(abi.encode(account)))) ); } /// @notice Handles the cost of re-rolling a pet /// @dev Reverts if the incorrect amount of funds are sent, gives a discount for re-rolling all traits function _handleReRollCost(bytes32[] calldata merkleProof) internal { if (merkleProof.length > 0 && _merkleRoot != bytes32(0)) { if (msg.value != 0) revert IncorrectFundsSent(0, msg.value); if (!isValidMerkleProof(msg.sender, merkleProof)) revert InvalidMerkleProof(); // bytes32 unique identifier for each merkle proof bytes32 node = keccak256(abi.encodePacked(msg.sender)); if (_usedMerkleProofs[_merkleRoot][node]) { revert InvalidMerkleProof(); } _usedMerkleProofs[_merkleRoot][node] = true; } else { if (msg.value != _reRollCost) revert IncorrectFundsSent(_reRollCost, msg.value); payable(_withdrawAddress).transfer(_reRollCost); } } /// @notice Handles the ownership (or approval) checks and burning of the old pets /// @param firstPetId The first old Cool Pet to burn /// @param secondPetId The second old Cool Pet to burn function _handleOldPetBurning(uint256 firstPetId, uint256 secondPetId) internal { // Check the sender is the owner or approved for each old pet // then burn the old pets _oldCoolPets.transferFrom(_getOwnerIfApproved(firstPetId), _nullAddress, firstPetId); _oldCoolPets.transferFrom(_getOwnerIfApproved(secondPetId), _nullAddress, secondPetId); } /// @notice handles validating the selected pet type and sending on the funds /// @dev If the pet selection is 0 then no pet was selected, so no funds should be sent /// @param petSelection The selected pet type function _handlePetSelection(uint256 petSelection) internal { if (petSelection > _maxSelectablePetType) { revert PetSelectionOutOfRange(petSelection, _maxSelectablePetType); } if (petSelection > 0) { if (msg.value != _selectPetCost) { revert IncorrectFundsSent(_selectPetCost, msg.value); } payable(_withdrawAddress).transfer(msg.value); } else { if (msg.value > 0) { revert IncorrectFundsSent(0, msg.value); } } } /// @notice Verify hashed data /// @param hash - Hashed data bundle /// @param signature - Signature to check hash against /// @return bool - Is verified or not function _isValidSignature(bytes32 hash, bytes calldata signature) internal view returns (bool) { bytes32 signedHash = hash.toEthSignedMessageHash(); return signedHash.recover(signature) == _systemAddress; } /// @notice Checks if a given Fracture is owned by or approved for the sender /// @dev This can be used to stop users from being able to burn Fractures someone else owns without their permission /// @param tokenId The Fracture to check /// @return The owner of the token function _getOwnerIfApproved(uint256 tokenId) internal view returns (address) { address owner = _oldCoolPets.ownerOf(tokenId); if (owner == msg.sender) { return owner; } if (_oldCoolPets.isApprovedForAll(owner, msg.sender)) { return owner; } if (_oldCoolPets.getApproved(tokenId) == msg.sender) { return owner; } revert NotOldCoolPetOwnerNorApproved(msg.sender, tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface 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 v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface ICoolERC721A { /// @notice Mint an amount of tokens to the given address /// @dev Can only be called by an account with the MINTER_ROLE /// Will revert if called when paused, see _beforeTokenTransfer /// @param to The address to mint the token to /// @param amount The amount of tokens to mint function mint(address to, uint256 amount) external; /// @notice Externally exposes the _nextTokenId function /// @dev used for referencing when burning fractures /// @return The next token id function nextTokenId() external view returns (uint256); /// @notice Returns the owner of a tokenId /// @return owner The owner address function ownerOf(uint256 tokenId) external view returns (address owner); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; contract ErrorsAndEventsSimpleReRoll { error BurnWindowNotStarted(); error BurnWindowEnded(); error NotOldCoolPetOwnerNorApproved(address account, uint256 oldPetId); error InvalidMerkleProof(); error OnlyEOA(); error OnlyOwnerOf(uint256 tokenId); error OutsideTimestampWindow(); error IncorrectFundsSent(uint256 expected, uint256 actual); error InvalidArrayLength(); error InvalidBurnWindow(); error InvalidGemArrays(); error InvalidNonce(uint256 expected, uint256 actual); error InvalidSignature(); error PetSelectionOutOfRange(uint256 petType, uint256 maxSelectablePetType); error SignatureAlreadyUsed(); event BurnWindowSet(uint256 burnWindowStart, uint256 burnWindowEnd); event Combined( address indexed account, uint256 firstPetId, uint256 secondPetId, uint256 indexed mintedId, uint256[] gemTokenIds, uint256 petSelection ); event MaxSlotsSet(uint256 maxSlots); event MaxSelectablePetTypeSet(uint256 maxSelectablePetType); event MerkleRootSet(bytes32 merkleRoot); event NewCoolPetsAddressSet(address newCoolPets); event OldCoolPetsAddressSet(address oldCoolPets); event ReRolled(address indexed account, uint256 indexed tokenId, bool reRollForm); event ReRollCostSet(uint256 rerollCost); event SelectPetCostSet(uint256 selectPetCost); event SystemAddressSet(address systemAddress); event TimestampWindowSet(uint256 timestampWindow); event WithdrawAddressSet(address withdrawAddress); event Withdrawn(address indexed to, uint256 amount); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"oldCoolPets","type":"address"},{"internalType":"address","name":"newCoolPets","type":"address"},{"internalType":"address","name":"systemAddress","type":"address"},{"internalType":"address","name":"withdrawAddress","type":"address"},{"internalType":"uint64","name":"burnWindowStart","type":"uint64"},{"internalType":"uint64","name":"burnWindowEnd","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BurnWindowEnded","type":"error"},{"inputs":[],"name":"BurnWindowNotStarted","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"IncorrectFundsSent","type":"error"},{"inputs":[],"name":"InvalidArrayLength","type":"error"},{"inputs":[],"name":"InvalidBurnWindow","type":"error"},{"inputs":[],"name":"InvalidGemArrays","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"InvalidNonce","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"oldPetId","type":"uint256"}],"name":"NotOldCoolPetOwnerNorApproved","type":"error"},{"inputs":[],"name":"OnlyEOA","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"OnlyOwnerOf","type":"error"},{"inputs":[],"name":"OutsideTimestampWindow","type":"error"},{"inputs":[{"internalType":"uint256","name":"petType","type":"uint256"},{"internalType":"uint256","name":"maxSelectablePetType","type":"uint256"}],"name":"PetSelectionOutOfRange","type":"error"},{"inputs":[],"name":"SignatureAlreadyUsed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"burnWindowStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnWindowEnd","type":"uint256"}],"name":"BurnWindowSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"firstPetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secondPetId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"mintedId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"gemTokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"petSelection","type":"uint256"}],"name":"Combined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxSelectablePetType","type":"uint256"}],"name":"MaxSelectablePetTypeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxSlots","type":"uint256"}],"name":"MaxSlotsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newCoolPets","type":"address"}],"name":"NewCoolPetsAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldCoolPets","type":"address"}],"name":"OldCoolPetsAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rerollCost","type":"uint256"}],"name":"ReRollCostSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"reRollForm","type":"bool"}],"name":"ReRolled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"selectPetCost","type":"uint256"}],"name":"SelectPetCostSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"systemAddress","type":"address"}],"name":"SystemAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestampWindow","type":"uint256"}],"name":"TimestampWindowSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"withdrawAddress","type":"address"}],"name":"WithdrawAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"_burnWindowEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_burnWindowStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_currentNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSelectablePetType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSlots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_newCoolPets","outputs":[{"internalType":"contract ICoolERC721A","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_nullAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_oldCoolPets","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_reRollCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_selectPetCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_systemAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_timestampWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"_usedMerkleProofs","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"_usedSignatures","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_withdrawAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"firstPetId","type":"uint256"},{"internalType":"uint256","name":"secondPetId","type":"uint256"},{"internalType":"uint256[]","name":"gemTokenIds","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"petSelection","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"combine","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"getNonceBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"isValidMerkleProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"isValidMerkleProofAndUnused","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"reRollForm","type":"bool"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"reRoll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"burnWindowStart","type":"uint256"},{"internalType":"uint256","name":"burnWindowEnd","type":"uint256"}],"name":"setBurnWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSelectablePetType","type":"uint256"}],"name":"setMaxSelectablePetType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSlots","type":"uint256"}],"name":"setMaxSlots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newCoolPets","type":"address"}],"name":"setNewCoolPetsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldCoolPets","type":"address"}],"name":"setOldCoolPetsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reRollCost","type":"uint256"}],"name":"setReRollCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"selectPetCost","type":"uint256"}],"name":"setSelectPetCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"systemAddress","type":"address"}],"name":"setSystemAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestampWindow","type":"uint256"}],"name":"setTimestampWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"withdrawAddress","type":"address"}],"name":"setWithdrawAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526003600581905566470de4df820000600681905560075560085560b4600955600b80546001600160a01b03191660011790553480156200004357600080fd5b506040516200264c3803806200264c833981016040819052620000669162000309565b6200007133620000f6565b6000805460ff60a01b19169055600180546001600160a01b038089166001600160a01b03199283161790925560028054888416908316179055600c8054878416908316179055600d805492861692909116919091179055620000e06001600160401b0380841690831662000146565b620000ea620001b9565b5050505050506200038a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001506200021c565b818110156200017257604051630af251a960e21b815260040160405180910390fd5b6003829055600481905560408051838152602081018390527ff789c5c0eeb996ec1d8492b13118626f794210c5e9861cc10dddde30eb1d6706910160405180910390a15050565b620001c36200027e565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620001ff3390565b6040516001600160a01b03909116815260200160405180910390a1565b6000546001600160a01b031633146200027c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b565b62000292600054600160a01b900460ff1690565b156200027c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640162000273565b80516001600160a01b0381168114620002ec57600080fd5b919050565b80516001600160401b0381168114620002ec57600080fd5b60008060008060008060c087890312156200032357600080fd5b6200032e87620002d4565b95506200033e60208801620002d4565b94506200034e60408801620002d4565b93506200035e60608801620002d4565b92506200036e60808801620002f1565b91506200037e60a08801620002f1565b90509295509295509295565b6122b2806200039a6000396000f3fe6080604052600436106102305760003560e01c80637cb647591161012e578063c4167140116100ab578063def50f6c1161006f578063def50f6c1461066f578063e5554d581461068f578063f2fde38b146106af578063f983c486146106cf578063fd07bf181461070a57600080fd5b8063c4167140146105cc578063caeec601146105ec578063ceada61214610619578063cf4c5b1514610639578063da52f6171461064f57600080fd5b80638da5cb5b116100f25780638da5cb5b1461054c5780638e4520b11461056a5780639b6dd02c14610580578063a2717c2c14610596578063b8668adb146105b657600080fd5b80637cb64759146104d85780637f91283c146104f85780638456cb591461050e57806384843a7714610523578063881988f71461053657600080fd5b80633f4ba83a116101bc57806367127fe21161018057806367127fe214610428578063715018a61461044857806377b897bd1461045d578063789ca8781461049857806379c94062146104b857600080fd5b80633f4ba83a1461039e5780633fd28f04146103b3578063475c5001146103d35780635c975abb146103f35780635e0149041461041257600080fd5b80632d0335ab116102035780632d0335ab146102d75780632fc37ab21461031b5780633ab1a494146103315780633badc244146103515780633dcdb0691461037157600080fd5b80630621019714610235578063170e18441461025757806325ddfabe1461029457806327a6e622146102c4575b600080fd5b34801561024157600080fd5b50610255610250366004611ca0565b61072a565b005b34801561026357600080fd5b50600154610277906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102a057600080fd5b506102b46102af366004611d02565b610787565b604051901515815260200161028b565b6102556102d2366004611da7565b61080b565b3480156102e357600080fd5b5061030d6102f2366004611ca0565b6001600160a01b03166000908152600e602052604090205490565b60405190815260200161028b565b34801561032757600080fd5b5061030d600a5481565b34801561033d57600080fd5b5061025561034c366004611ca0565b610a4e565b34801561035d57600080fd5b50600254610277906001600160a01b031681565b34801561037d57600080fd5b5061030d61038c366004611ca0565b600e6020526000908152604090205481565b3480156103aa57600080fd5b50610255610aa4565b3480156103bf57600080fd5b506102556103ce366004611e3f565b610ab6565b3480156103df57600080fd5b506102556103ee366004611e61565b610b26565b3480156103ff57600080fd5b50600054600160a01b900460ff166102b4565b34801561041e57600080fd5b5061030d60065481565b34801561043457600080fd5b50610255610443366004611ca0565b610b63565b34801561045457600080fd5b50610255610bb9565b34801561046957600080fd5b506102b4610478366004611e3f565b601060209081526000928352604080842090915290825290205460ff1681565b3480156104a457600080fd5b506102556104b3366004611e61565b610bcb565b3480156104c457600080fd5b506102556104d3366004611e61565b610c08565b3480156104e457600080fd5b506102556104f3366004611e61565b610c45565b34801561050457600080fd5b5061030d60085481565b34801561051a57600080fd5b50610255610c82565b610255610531366004611e7a565b610c92565b34801561054257600080fd5b5061030d60055481565b34801561055857600080fd5b506000546001600160a01b0316610277565b34801561057657600080fd5b5061030d60045481565b34801561058c57600080fd5b5061030d60035481565b3480156105a257600080fd5b506102556105b1366004611ca0565b610f7a565b3480156105c257600080fd5b5061030d60095481565b3480156105d857600080fd5b506102556105e7366004611e61565b610fd0565b3480156105f857600080fd5b5061060c610607366004611f5c565b61100d565b60405161028b919061200e565b34801561062557600080fd5b50600b54610277906001600160a01b031681565b34801561064557600080fd5b5061030d60075481565b34801561065b57600080fd5b5061025561066a366004611e61565b6110d8565b34801561067b57600080fd5b506102b461068a366004611d02565b611115565b34801561069b57600080fd5b50600c54610277906001600160a01b031681565b3480156106bb57600080fd5b506102556106ca366004611ca0565b611178565b3480156106db57600080fd5b506102b46106ea366004612052565b8051602081830181018051600f8252928201919093012091525460ff1681565b34801561071657600080fd5b50600d54610277906001600160a01b031681565b6107326111f1565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527fd585f32d2260b0cd69a1e4fc82ffedfebdacbc10727ee026264133ba6d20f8e7906020015b60405180910390a150565b600a5460009061079957506000610804565b6107a4848484611115565b6107b057506000610804565b6040516001600160601b0319606086901b16602082015260009060340160408051601f198184030181529181528151602092830120600a54600090815260108452828120918152925290205460ff16159150505b9392505050565b61081361124b565b33321461083357604051639f8129d160e01b815260040160405180910390fd5b6002546040516331a9108f60e11b81526004810189905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a091906120e7565b6001600160a01b0316146108cf576040516366af197160e11b8152600481018890526024015b60405180910390fd5b6009546108dc904261211a565b8410806108f257506108ef42603c61212d565b84115b156109105760405163cfeb22ab60e01b815260040160405180910390fd5b6040516001600160601b031933606090811b82166020840152603483018a90526054830187905285151560f81b607484015230901b16607582015261096f90608901604051602081830303815290604052805190602001208787611298565b61098c57604051638baa579f60e01b815260040160405180910390fd5b600f868660405161099e929190612140565b9081526040519081900360200190205460ff16156109cf5760405163900bb2c960e01b815260040160405180910390fd5b6001600f87876040516109e3929190612140565b908152604051908190036020019020805491151560ff19909216919091179055610a0d8282611357565b6040518315158152879033907e63d362ed47d8c874b80b4039b5086fb39b08c89c96a6323fa89a2d4dc336bd9060200160405180910390a350505050505050565b610a566111f1565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f2c652ea37be08d0f2633767e71b34b890fe3ed9888f23ec2de43d95944095abd9060200161077c565b610aac6111f1565b610ab46114c6565b565b610abe6111f1565b81811015610adf57604051630af251a960e21b815260040160405180910390fd5b6003829055600481905560408051838152602081018390527ff789c5c0eeb996ec1d8492b13118626f794210c5e9861cc10dddde30eb1d6706910160405180910390a15050565b610b2e6111f1565b60078190556040518181527fa9be777b5a7646862f135255c678379a291e3d1b96c32a0781534d8f53ea07c99060200161077c565b610b6b6111f1565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fa596d513234755c800924ec28cdc7d41411c7f12387d74eb732032ed5d8e8aff9060200161077c565b610bc16111f1565b610ab4600061151b565b610bd36111f1565b60098190556040518181527fd97fa85b76be92993b04dff8e024f4346a8d84f1773bad042d17012634e826fe9060200161077c565b610c106111f1565b60058190556040518181527ffb327d39a5b52cc89173c59995e0fd6a9069c1af4c056d0be06dfd7b395488d19060200161077c565b610c4d6111f1565b600a8190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b9060200161077c565b610c8a6111f1565b610ab461156b565b610c9a61124b565b600354421015610cbd576040516374c49cc160e11b815260040160405180910390fd5b600454421115610ce05760405163abed54db60e01b815260040160405180910390fd5b336000818152600e602052604090205484908114610d36576001600160a01b0382166000908152600e6020526040908190205490516306427aeb60e01b81526004810191909152602481018290526044016108c6565b6001600160a01b0382166000908152600e60205260408120805491610d5a83612150565b9091555050333214610d7f57604051639f8129d160e01b815260040160405180910390fd5b6005548814610da157604051637651dfc760e11b815260040160405180910390fd5b600954610dae904261211a565b831080610dc45750610dc142603c61212d565b83115b15610de25760405163cfeb22ab60e01b815260040160405180910390fd5b610e1f33868b8b888830604051602001610e029796959493929190612169565b604051602081830303815290604052805190602001208888611298565b610e3c57604051638baa579f60e01b815260040160405180910390fd5b610e45846115ae565b610e4f8b8b611679565b60025460408051631d5e528f60e21b815290516000926001600160a01b0316916375794a3c9160048083019260209291908290030181865afa158015610e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebd91906121cc565b6002546040516340c10f1960e01b8152336004820152600160248201529192506001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610f0a57600080fd5b505af1158015610f1e573d6000803e3d6000fd5b5050505080336001600160a01b03167fb89b11ccd45abc77729280da7104ce67db5d7f1157bedcf5a10005783b6ae26a8e8e8e8e8b604051610f649594939291906121e5565b60405180910390a3505050505050505050505050565b610f826111f1565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fa60ef328a5fc3227b3bc479e5f6b241335d583a90e30254af895123e18810b279060200161077c565b610fd86111f1565b60088190556040518181527ffcefbbc9970e92db79c2246114fef8f0b3fc966c1d3eb1b055c022e9aa3616169060200161077c565b60606000825167ffffffffffffffff81111561102b5761102b611f15565b604051908082528060200260200182016040528015611054578160200160208202803683370190505b50905060005b83518110156110d157600e600085838151811061107957611079612233565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106110b4576110b4612233565b6020908102919091010152806110c981612150565b91505061105a565b5092915050565b6110e06111f1565b60068190556040518181527f51844519b331997fdd4996e995cbdfe17b25335f5dd01aecd1634db0802659ea9060200161077c565b600a54604080516001600160a01b03861660208201526000926111709286928692910160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120611787565b949350505050565b6111806111f1565b6001600160a01b0381166111e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108c6565b6111ee8161151b565b50565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c6565b600054600160a01b900460ff1615610ab45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108c6565b6000806112f2856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b600c54604080516020601f88018190048102820181019092528681529293506001600160a01b0390911691611344918790879081908401838280828437600092019190915250869392505061179f9050565b6001600160a01b03161495945050505050565b80158015906113675750600a5415155b1561145657341561139457604051634e77191f60e11b8152600060048201523460248201526044016108c6565b61139f338383611115565b6113bc5760405163582f497d60e11b815260040160405180910390fd5b6040516001600160601b03193360601b16602082015260009060340160408051601f198184030181529181528151602092830120600a5460009081526010845282812082825290935291205490915060ff161561142c5760405163582f497d60e11b815260040160405180910390fd5b600a54600090815260106020908152604080832093835292905220805460ff191660011790555050565b600754341461148557600754604051634e77191f60e11b815260048101919091523460248201526044016108c6565b600d546007546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156114c1573d6000803e3d6000fd5b505050565b6114ce6117c5565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61157361124b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114fe3390565b6008548111156115df57600854604051631a8dffdd60e11b81526108c6918391600401918252602082015260400190565b801561165157600654341461161457600654604051634e77191f60e11b815260048101919091523460248201526044016108c6565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f1935050505015801561164d573d6000803e3d6000fd5b5050565b34156111ee57604051634e77191f60e11b8152600060048201523460248201526044016108c6565b6001546001600160a01b03166323b872dd61169384611815565b600b5460405160e084901b6001600160e01b03191681526001600160a01b0392831660048201529116602482015260448101859052606401600060405180830381600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b50506001546001600160a01b031691506323b872dd905061171983611815565b600b5460405160e084901b6001600160e01b03191681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561176b57600080fd5b505af115801561177f573d6000803e3d6000fd5b505050505050565b6000826117958686856119c0565b1495945050505050565b60008060006117ae8585611a0c565b915091506117bb81611a51565b5090505b92915050565b600054600160a01b900460ff16610ab45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108c6565b6001546040516331a9108f60e11b81526004810183905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188791906120e7565b9050336001600160a01b0382160361189f5792915050565b60015460405163e985e9c560e01b81526001600160a01b0383811660048301523360248301529091169063e985e9c590604401602060405180830381865afa1580156118ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119139190612249565b1561191e5792915050565b60015460405163020604bf60e21b81526004810185905233916001600160a01b03169063081812fc90602401602060405180830381865afa158015611967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198b91906120e7565b6001600160a01b03160361199f5792915050565b60405162d0a56160e11b8152336004820152602481018490526044016108c6565b600081815b84811015611a03576119ef828787848181106119e3576119e3612233565b90506020020135611b9b565b9150806119fb81612150565b9150506119c5565b50949350505050565b6000808251604103611a425760208301516040840151606085015160001a611a3687828585611bc7565b94509450505050611a4a565b506000905060025b9250929050565b6000816004811115611a6557611a65612266565b03611a6d5750565b6001816004811115611a8157611a81612266565b03611ace5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108c6565b6002816004811115611ae257611ae2612266565b03611b2f5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108c6565b6003816004811115611b4357611b43612266565b036111ee5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108c6565b6000818310611bb7576000828152602084905260409020610804565b5060009182526020526040902090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611bfe5750600090506003611c82565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611c52573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c7b57600060019250925050611c82565b9150600090505b94509492505050565b6001600160a01b03811681146111ee57600080fd5b600060208284031215611cb257600080fd5b813561080481611c8b565b60008083601f840112611ccf57600080fd5b50813567ffffffffffffffff811115611ce757600080fd5b6020830191508360208260051b8501011115611a4a57600080fd5b600080600060408486031215611d1757600080fd5b8335611d2281611c8b565b9250602084013567ffffffffffffffff811115611d3e57600080fd5b611d4a86828701611cbd565b9497909650939450505050565b60008083601f840112611d6957600080fd5b50813567ffffffffffffffff811115611d8157600080fd5b602083019150836020828501011115611a4a57600080fd5b80151581146111ee57600080fd5b600080600080600080600060a0888a031215611dc257600080fd5b87359650602088013567ffffffffffffffff80821115611de157600080fd5b611ded8b838c01611d57565b909850965060408a0135955060608a01359150611e0982611d99565b90935060808901359080821115611e1f57600080fd5b50611e2c8a828b01611cbd565b989b979a50959850939692959293505050565b60008060408385031215611e5257600080fd5b50508035926020909101359150565b600060208284031215611e7357600080fd5b5035919050565b600080600080600080600080600060e08a8c031215611e9857600080fd5b8935985060208a0135975060408a013567ffffffffffffffff80821115611ebe57600080fd5b611eca8d838e01611cbd565b909950975060608c0135915080821115611ee357600080fd5b50611ef08c828d01611d57565b9a9d999c50979a9699979860808801359760a0810135975060c0013595509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f5457611f54611f15565b604052919050565b60006020808385031215611f6f57600080fd5b823567ffffffffffffffff80821115611f8757600080fd5b818501915085601f830112611f9b57600080fd5b813581811115611fad57611fad611f15565b8060051b9150611fbe848301611f2b565b8181529183018401918481019088841115611fd857600080fd5b938501935b838510156120025784359250611ff283611c8b565b8282529385019390850190611fdd565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156120465783518352928401929184019160010161202a565b50909695505050505050565b6000602080838503121561206557600080fd5b823567ffffffffffffffff8082111561207d57600080fd5b818501915085601f83011261209157600080fd5b8135818111156120a3576120a3611f15565b6120b5601f8201601f19168501611f2b565b915080825286848285010111156120cb57600080fd5b8084840185840137600090820190930192909252509392505050565b6000602082840312156120f957600080fd5b815161080481611c8b565b634e487b7160e01b600052601160045260246000fd5b818103818111156117bf576117bf612104565b808201808211156117bf576117bf612104565b8183823760009101908152919050565b60006001820161216257612162612104565b5060010190565b6001600160601b0319606089901b81168252601482018890526000906001600160fb1b0387111561219957600080fd5b8660051b80896034860137909201603481019590955250605484019290925260601b166074820152608801949350505050565b6000602082840312156121de57600080fd5b5051919050565b85815260208101859052608060408201819052810183905260006001600160fb1b0384111561221357600080fd5b8360051b808660a08501376060830193909352500160a001949350505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561225b57600080fd5b815161080481611d99565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c6e02e1beb48e3ab00ca0556c7416d92590af235c8c8fb6c830f35688bb3ea4464736f6c6343000811003300000000000000000000000086c10d10eca1fca9daf87a279abccabe0063f247000000000000000000000000da11e1d06e4e0d0ac26805bdb063ecdbac426aa0000000000000000000000000e9e5b0b86f8dde410e9288dbd409871bdb32e122000000000000000000000000d98d29beb788ff04e7a648775fcb083282ae9c4b00000000000000000000000000000000000000000000000000000000650adec00000000000000000000000000000000000000000000000000000000077dc8a30
Deployed Bytecode
0x6080604052600436106102305760003560e01c80637cb647591161012e578063c4167140116100ab578063def50f6c1161006f578063def50f6c1461066f578063e5554d581461068f578063f2fde38b146106af578063f983c486146106cf578063fd07bf181461070a57600080fd5b8063c4167140146105cc578063caeec601146105ec578063ceada61214610619578063cf4c5b1514610639578063da52f6171461064f57600080fd5b80638da5cb5b116100f25780638da5cb5b1461054c5780638e4520b11461056a5780639b6dd02c14610580578063a2717c2c14610596578063b8668adb146105b657600080fd5b80637cb64759146104d85780637f91283c146104f85780638456cb591461050e57806384843a7714610523578063881988f71461053657600080fd5b80633f4ba83a116101bc57806367127fe21161018057806367127fe214610428578063715018a61461044857806377b897bd1461045d578063789ca8781461049857806379c94062146104b857600080fd5b80633f4ba83a1461039e5780633fd28f04146103b3578063475c5001146103d35780635c975abb146103f35780635e0149041461041257600080fd5b80632d0335ab116102035780632d0335ab146102d75780632fc37ab21461031b5780633ab1a494146103315780633badc244146103515780633dcdb0691461037157600080fd5b80630621019714610235578063170e18441461025757806325ddfabe1461029457806327a6e622146102c4575b600080fd5b34801561024157600080fd5b50610255610250366004611ca0565b61072a565b005b34801561026357600080fd5b50600154610277906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102a057600080fd5b506102b46102af366004611d02565b610787565b604051901515815260200161028b565b6102556102d2366004611da7565b61080b565b3480156102e357600080fd5b5061030d6102f2366004611ca0565b6001600160a01b03166000908152600e602052604090205490565b60405190815260200161028b565b34801561032757600080fd5b5061030d600a5481565b34801561033d57600080fd5b5061025561034c366004611ca0565b610a4e565b34801561035d57600080fd5b50600254610277906001600160a01b031681565b34801561037d57600080fd5b5061030d61038c366004611ca0565b600e6020526000908152604090205481565b3480156103aa57600080fd5b50610255610aa4565b3480156103bf57600080fd5b506102556103ce366004611e3f565b610ab6565b3480156103df57600080fd5b506102556103ee366004611e61565b610b26565b3480156103ff57600080fd5b50600054600160a01b900460ff166102b4565b34801561041e57600080fd5b5061030d60065481565b34801561043457600080fd5b50610255610443366004611ca0565b610b63565b34801561045457600080fd5b50610255610bb9565b34801561046957600080fd5b506102b4610478366004611e3f565b601060209081526000928352604080842090915290825290205460ff1681565b3480156104a457600080fd5b506102556104b3366004611e61565b610bcb565b3480156104c457600080fd5b506102556104d3366004611e61565b610c08565b3480156104e457600080fd5b506102556104f3366004611e61565b610c45565b34801561050457600080fd5b5061030d60085481565b34801561051a57600080fd5b50610255610c82565b610255610531366004611e7a565b610c92565b34801561054257600080fd5b5061030d60055481565b34801561055857600080fd5b506000546001600160a01b0316610277565b34801561057657600080fd5b5061030d60045481565b34801561058c57600080fd5b5061030d60035481565b3480156105a257600080fd5b506102556105b1366004611ca0565b610f7a565b3480156105c257600080fd5b5061030d60095481565b3480156105d857600080fd5b506102556105e7366004611e61565b610fd0565b3480156105f857600080fd5b5061060c610607366004611f5c565b61100d565b60405161028b919061200e565b34801561062557600080fd5b50600b54610277906001600160a01b031681565b34801561064557600080fd5b5061030d60075481565b34801561065b57600080fd5b5061025561066a366004611e61565b6110d8565b34801561067b57600080fd5b506102b461068a366004611d02565b611115565b34801561069b57600080fd5b50600c54610277906001600160a01b031681565b3480156106bb57600080fd5b506102556106ca366004611ca0565b611178565b3480156106db57600080fd5b506102b46106ea366004612052565b8051602081830181018051600f8252928201919093012091525460ff1681565b34801561071657600080fd5b50600d54610277906001600160a01b031681565b6107326111f1565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527fd585f32d2260b0cd69a1e4fc82ffedfebdacbc10727ee026264133ba6d20f8e7906020015b60405180910390a150565b600a5460009061079957506000610804565b6107a4848484611115565b6107b057506000610804565b6040516001600160601b0319606086901b16602082015260009060340160408051601f198184030181529181528151602092830120600a54600090815260108452828120918152925290205460ff16159150505b9392505050565b61081361124b565b33321461083357604051639f8129d160e01b815260040160405180910390fd5b6002546040516331a9108f60e11b81526004810189905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a091906120e7565b6001600160a01b0316146108cf576040516366af197160e11b8152600481018890526024015b60405180910390fd5b6009546108dc904261211a565b8410806108f257506108ef42603c61212d565b84115b156109105760405163cfeb22ab60e01b815260040160405180910390fd5b6040516001600160601b031933606090811b82166020840152603483018a90526054830187905285151560f81b607484015230901b16607582015261096f90608901604051602081830303815290604052805190602001208787611298565b61098c57604051638baa579f60e01b815260040160405180910390fd5b600f868660405161099e929190612140565b9081526040519081900360200190205460ff16156109cf5760405163900bb2c960e01b815260040160405180910390fd5b6001600f87876040516109e3929190612140565b908152604051908190036020019020805491151560ff19909216919091179055610a0d8282611357565b6040518315158152879033907e63d362ed47d8c874b80b4039b5086fb39b08c89c96a6323fa89a2d4dc336bd9060200160405180910390a350505050505050565b610a566111f1565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f2c652ea37be08d0f2633767e71b34b890fe3ed9888f23ec2de43d95944095abd9060200161077c565b610aac6111f1565b610ab46114c6565b565b610abe6111f1565b81811015610adf57604051630af251a960e21b815260040160405180910390fd5b6003829055600481905560408051838152602081018390527ff789c5c0eeb996ec1d8492b13118626f794210c5e9861cc10dddde30eb1d6706910160405180910390a15050565b610b2e6111f1565b60078190556040518181527fa9be777b5a7646862f135255c678379a291e3d1b96c32a0781534d8f53ea07c99060200161077c565b610b6b6111f1565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fa596d513234755c800924ec28cdc7d41411c7f12387d74eb732032ed5d8e8aff9060200161077c565b610bc16111f1565b610ab4600061151b565b610bd36111f1565b60098190556040518181527fd97fa85b76be92993b04dff8e024f4346a8d84f1773bad042d17012634e826fe9060200161077c565b610c106111f1565b60058190556040518181527ffb327d39a5b52cc89173c59995e0fd6a9069c1af4c056d0be06dfd7b395488d19060200161077c565b610c4d6111f1565b600a8190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b9060200161077c565b610c8a6111f1565b610ab461156b565b610c9a61124b565b600354421015610cbd576040516374c49cc160e11b815260040160405180910390fd5b600454421115610ce05760405163abed54db60e01b815260040160405180910390fd5b336000818152600e602052604090205484908114610d36576001600160a01b0382166000908152600e6020526040908190205490516306427aeb60e01b81526004810191909152602481018290526044016108c6565b6001600160a01b0382166000908152600e60205260408120805491610d5a83612150565b9091555050333214610d7f57604051639f8129d160e01b815260040160405180910390fd5b6005548814610da157604051637651dfc760e11b815260040160405180910390fd5b600954610dae904261211a565b831080610dc45750610dc142603c61212d565b83115b15610de25760405163cfeb22ab60e01b815260040160405180910390fd5b610e1f33868b8b888830604051602001610e029796959493929190612169565b604051602081830303815290604052805190602001208888611298565b610e3c57604051638baa579f60e01b815260040160405180910390fd5b610e45846115ae565b610e4f8b8b611679565b60025460408051631d5e528f60e21b815290516000926001600160a01b0316916375794a3c9160048083019260209291908290030181865afa158015610e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebd91906121cc565b6002546040516340c10f1960e01b8152336004820152600160248201529192506001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610f0a57600080fd5b505af1158015610f1e573d6000803e3d6000fd5b5050505080336001600160a01b03167fb89b11ccd45abc77729280da7104ce67db5d7f1157bedcf5a10005783b6ae26a8e8e8e8e8b604051610f649594939291906121e5565b60405180910390a3505050505050505050505050565b610f826111f1565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fa60ef328a5fc3227b3bc479e5f6b241335d583a90e30254af895123e18810b279060200161077c565b610fd86111f1565b60088190556040518181527ffcefbbc9970e92db79c2246114fef8f0b3fc966c1d3eb1b055c022e9aa3616169060200161077c565b60606000825167ffffffffffffffff81111561102b5761102b611f15565b604051908082528060200260200182016040528015611054578160200160208202803683370190505b50905060005b83518110156110d157600e600085838151811061107957611079612233565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106110b4576110b4612233565b6020908102919091010152806110c981612150565b91505061105a565b5092915050565b6110e06111f1565b60068190556040518181527f51844519b331997fdd4996e995cbdfe17b25335f5dd01aecd1634db0802659ea9060200161077c565b600a54604080516001600160a01b03861660208201526000926111709286928692910160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120611787565b949350505050565b6111806111f1565b6001600160a01b0381166111e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108c6565b6111ee8161151b565b50565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c6565b600054600160a01b900460ff1615610ab45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108c6565b6000806112f2856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b600c54604080516020601f88018190048102820181019092528681529293506001600160a01b0390911691611344918790879081908401838280828437600092019190915250869392505061179f9050565b6001600160a01b03161495945050505050565b80158015906113675750600a5415155b1561145657341561139457604051634e77191f60e11b8152600060048201523460248201526044016108c6565b61139f338383611115565b6113bc5760405163582f497d60e11b815260040160405180910390fd5b6040516001600160601b03193360601b16602082015260009060340160408051601f198184030181529181528151602092830120600a5460009081526010845282812082825290935291205490915060ff161561142c5760405163582f497d60e11b815260040160405180910390fd5b600a54600090815260106020908152604080832093835292905220805460ff191660011790555050565b600754341461148557600754604051634e77191f60e11b815260048101919091523460248201526044016108c6565b600d546007546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156114c1573d6000803e3d6000fd5b505050565b6114ce6117c5565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61157361124b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114fe3390565b6008548111156115df57600854604051631a8dffdd60e11b81526108c6918391600401918252602082015260400190565b801561165157600654341461161457600654604051634e77191f60e11b815260048101919091523460248201526044016108c6565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f1935050505015801561164d573d6000803e3d6000fd5b5050565b34156111ee57604051634e77191f60e11b8152600060048201523460248201526044016108c6565b6001546001600160a01b03166323b872dd61169384611815565b600b5460405160e084901b6001600160e01b03191681526001600160a01b0392831660048201529116602482015260448101859052606401600060405180830381600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b50506001546001600160a01b031691506323b872dd905061171983611815565b600b5460405160e084901b6001600160e01b03191681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561176b57600080fd5b505af115801561177f573d6000803e3d6000fd5b505050505050565b6000826117958686856119c0565b1495945050505050565b60008060006117ae8585611a0c565b915091506117bb81611a51565b5090505b92915050565b600054600160a01b900460ff16610ab45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108c6565b6001546040516331a9108f60e11b81526004810183905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188791906120e7565b9050336001600160a01b0382160361189f5792915050565b60015460405163e985e9c560e01b81526001600160a01b0383811660048301523360248301529091169063e985e9c590604401602060405180830381865afa1580156118ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119139190612249565b1561191e5792915050565b60015460405163020604bf60e21b81526004810185905233916001600160a01b03169063081812fc90602401602060405180830381865afa158015611967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198b91906120e7565b6001600160a01b03160361199f5792915050565b60405162d0a56160e11b8152336004820152602481018490526044016108c6565b600081815b84811015611a03576119ef828787848181106119e3576119e3612233565b90506020020135611b9b565b9150806119fb81612150565b9150506119c5565b50949350505050565b6000808251604103611a425760208301516040840151606085015160001a611a3687828585611bc7565b94509450505050611a4a565b506000905060025b9250929050565b6000816004811115611a6557611a65612266565b03611a6d5750565b6001816004811115611a8157611a81612266565b03611ace5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108c6565b6002816004811115611ae257611ae2612266565b03611b2f5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108c6565b6003816004811115611b4357611b43612266565b036111ee5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108c6565b6000818310611bb7576000828152602084905260409020610804565b5060009182526020526040902090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611bfe5750600090506003611c82565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611c52573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c7b57600060019250925050611c82565b9150600090505b94509492505050565b6001600160a01b03811681146111ee57600080fd5b600060208284031215611cb257600080fd5b813561080481611c8b565b60008083601f840112611ccf57600080fd5b50813567ffffffffffffffff811115611ce757600080fd5b6020830191508360208260051b8501011115611a4a57600080fd5b600080600060408486031215611d1757600080fd5b8335611d2281611c8b565b9250602084013567ffffffffffffffff811115611d3e57600080fd5b611d4a86828701611cbd565b9497909650939450505050565b60008083601f840112611d6957600080fd5b50813567ffffffffffffffff811115611d8157600080fd5b602083019150836020828501011115611a4a57600080fd5b80151581146111ee57600080fd5b600080600080600080600060a0888a031215611dc257600080fd5b87359650602088013567ffffffffffffffff80821115611de157600080fd5b611ded8b838c01611d57565b909850965060408a0135955060608a01359150611e0982611d99565b90935060808901359080821115611e1f57600080fd5b50611e2c8a828b01611cbd565b989b979a50959850939692959293505050565b60008060408385031215611e5257600080fd5b50508035926020909101359150565b600060208284031215611e7357600080fd5b5035919050565b600080600080600080600080600060e08a8c031215611e9857600080fd5b8935985060208a0135975060408a013567ffffffffffffffff80821115611ebe57600080fd5b611eca8d838e01611cbd565b909950975060608c0135915080821115611ee357600080fd5b50611ef08c828d01611d57565b9a9d999c50979a9699979860808801359760a0810135975060c0013595509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f5457611f54611f15565b604052919050565b60006020808385031215611f6f57600080fd5b823567ffffffffffffffff80821115611f8757600080fd5b818501915085601f830112611f9b57600080fd5b813581811115611fad57611fad611f15565b8060051b9150611fbe848301611f2b565b8181529183018401918481019088841115611fd857600080fd5b938501935b838510156120025784359250611ff283611c8b565b8282529385019390850190611fdd565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156120465783518352928401929184019160010161202a565b50909695505050505050565b6000602080838503121561206557600080fd5b823567ffffffffffffffff8082111561207d57600080fd5b818501915085601f83011261209157600080fd5b8135818111156120a3576120a3611f15565b6120b5601f8201601f19168501611f2b565b915080825286848285010111156120cb57600080fd5b8084840185840137600090820190930192909252509392505050565b6000602082840312156120f957600080fd5b815161080481611c8b565b634e487b7160e01b600052601160045260246000fd5b818103818111156117bf576117bf612104565b808201808211156117bf576117bf612104565b8183823760009101908152919050565b60006001820161216257612162612104565b5060010190565b6001600160601b0319606089901b81168252601482018890526000906001600160fb1b0387111561219957600080fd5b8660051b80896034860137909201603481019590955250605484019290925260601b166074820152608801949350505050565b6000602082840312156121de57600080fd5b5051919050565b85815260208101859052608060408201819052810183905260006001600160fb1b0384111561221357600080fd5b8360051b808660a08501376060830193909352500160a001949350505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561225b57600080fd5b815161080481611d99565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c6e02e1beb48e3ab00ca0556c7416d92590af235c8c8fb6c830f35688bb3ea4464736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000086c10d10eca1fca9daf87a279abccabe0063f247000000000000000000000000da11e1d06e4e0d0ac26805bdb063ecdbac426aa0000000000000000000000000e9e5b0b86f8dde410e9288dbd409871bdb32e122000000000000000000000000d98d29beb788ff04e7a648775fcb083282ae9c4b00000000000000000000000000000000000000000000000000000000650adec00000000000000000000000000000000000000000000000000000000077dc8a30
-----Decoded View---------------
Arg [0] : oldCoolPets (address): 0x86C10D10ECa1Fca9DAF87a279ABCcabe0063F247
Arg [1] : newCoolPets (address): 0xDa11E1d06e4e0d0AC26805bdB063ECDBac426AA0
Arg [2] : systemAddress (address): 0xE9e5B0B86f8Dde410e9288Dbd409871BDB32e122
Arg [3] : withdrawAddress (address): 0xD98D29Beb788fF04e7a648775FcB083282aE9C4B
Arg [4] : burnWindowStart (uint64): 1695211200
Arg [5] : burnWindowEnd (uint64): 2010942000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000086c10d10eca1fca9daf87a279abccabe0063f247
Arg [1] : 000000000000000000000000da11e1d06e4e0d0ac26805bdb063ecdbac426aa0
Arg [2] : 000000000000000000000000e9e5b0b86f8dde410e9288dbd409871bdb32e122
Arg [3] : 000000000000000000000000d98d29beb788ff04e7a648775fcb083282ae9c4b
Arg [4] : 00000000000000000000000000000000000000000000000000000000650adec0
Arg [5] : 0000000000000000000000000000000000000000000000000000000077dc8a30
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
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.