Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 2,435 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 16484962 | 1125 days ago | IN | 0 ETH | 0.00121803 | ||||
| Refund | 16346304 | 1144 days ago | IN | 0 ETH | 0.00065524 | ||||
| Refund | 16276873 | 1154 days ago | IN | 0 ETH | 0.00100152 | ||||
| Refund | 16276406 | 1154 days ago | IN | 0 ETH | 0.0006988 | ||||
| Refund | 16247404 | 1158 days ago | IN | 0 ETH | 0.00060672 | ||||
| Refund | 16239492 | 1159 days ago | IN | 0 ETH | 0.00054502 | ||||
| Refund | 16234847 | 1160 days ago | IN | 0 ETH | 0.00071371 | ||||
| Refund | 16229564 | 1160 days ago | IN | 0 ETH | 0.00049383 | ||||
| Refund | 16229527 | 1160 days ago | IN | 0 ETH | 0.00047587 | ||||
| Refund | 16228725 | 1160 days ago | IN | 0 ETH | 0.00104668 | ||||
| Refund | 16227684 | 1161 days ago | IN | 0 ETH | 0.00146164 | ||||
| Refund | 16227500 | 1161 days ago | IN | 0 ETH | 0.00096516 | ||||
| Refund | 16225792 | 1161 days ago | IN | 0 ETH | 0.00075737 | ||||
| Refund | 16225422 | 1161 days ago | IN | 0 ETH | 0.00058049 | ||||
| Refund | 16225390 | 1161 days ago | IN | 0 ETH | 0.00059768 | ||||
| Refund | 16224495 | 1161 days ago | IN | 0 ETH | 0.00062834 | ||||
| Set Auction Time... | 16221490 | 1161 days ago | IN | 0 ETH | 0.00068038 | ||||
| Raise | 16221474 | 1161 days ago | IN | 10 ETH | 0.00075367 | ||||
| Set Auction Time... | 16221418 | 1161 days ago | IN | 0 ETH | 0.0006383 | ||||
| Transfer | 16221341 | 1161 days ago | IN | 6 ETH | 0.00037111 | ||||
| Transfer | 16221326 | 1161 days ago | IN | 6 ETH | 0.00038308 | ||||
| Transfer | 16221319 | 1161 days ago | IN | 10 ETH | 0.00039957 | ||||
| Withdraw | 16221312 | 1161 days ago | IN | 0 ETH | 0.00108362 | ||||
| Refund | 16220563 | 1162 days ago | IN | 0 ETH | 0.0008286 | ||||
| Refund | 16220506 | 1162 days ago | IN | 0 ETH | 0.00070895 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
|||
|---|---|---|---|---|---|---|---|
| Transfer | 16484962 | 1125 days ago | 7.5291 ETH | ||||
| Transfer | 16368850 | 1141 days ago | 0.0817 ETH | ||||
| Transfer | 16346304 | 1144 days ago | 0.05 ETH | ||||
| Transfer | 16337290 | 1145 days ago | 0.038 ETH | ||||
| Transfer | 16276873 | 1154 days ago | 0.053 ETH | ||||
| Transfer | 16276406 | 1154 days ago | 0.051 ETH | ||||
| Transfer | 16273415 | 1154 days ago | 0.093 ETH | ||||
| Transfer | 16254290 | 1157 days ago | 0.064 ETH | ||||
| Transfer | 16253147 | 1157 days ago | 0.098 ETH | ||||
| Transfer | 16248921 | 1158 days ago | 0.076 ETH | ||||
| Transfer | 16247404 | 1158 days ago | 0.05 ETH | ||||
| Transfer | 16244480 | 1158 days ago | 0.1292 ETH | ||||
| Transfer | 16239492 | 1159 days ago | 0.05 ETH | ||||
| Transfer | 16234847 | 1160 days ago | 0.05 ETH | ||||
| Transfer | 16230286 | 1160 days ago | 0.102 ETH | ||||
| Transfer | 16230169 | 1160 days ago | 0.028 ETH | ||||
| Transfer | 16229564 | 1160 days ago | 0.141 ETH | ||||
| Transfer | 16229527 | 1160 days ago | 0.102 ETH | ||||
| Transfer | 16228725 | 1160 days ago | 0.12 ETH | ||||
| Transfer | 16227684 | 1161 days ago | 0.115 ETH | ||||
| Transfer | 16227500 | 1161 days ago | 0.149 ETH | ||||
| Transfer | 16225939 | 1161 days ago | 0.13 ETH | ||||
| Transfer | 16225792 | 1161 days ago | 0.05 ETH | ||||
| Transfer | 16225422 | 1161 days ago | 0.06 ETH | ||||
| Transfer | 16225412 | 1161 days ago | 0.094 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OldeusAuction
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import {ERC4973O} from './ERC4973O.sol';
import {BitMaps} from '@openzeppelin/contracts/utils/structs/BitMaps.sol';
import {ECDSA} from '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import {SignatureChecker} from '@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {Strings} from '@openzeppelin/contracts/utils/Strings.sol';
import {Pausable} from '@openzeppelin/contracts/security/Pausable.sol';
import {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol';
bytes32 constant AUCTION_HASH = keccak256('Auction(address active,address passive,uint256 bid)');
struct Stats {
uint216 bidAmount;
uint16 bidCount;
uint16 tokenIndex;
bool refundClaimed;
}
contract OldeusAuction is ERC4973O, Ownable, Pausable, ReentrancyGuard {
using BitMaps for BitMaps.BitMap;
using ECDSA for bytes32;
using Strings for uint16;
mapping(uint256 => Stats) private _stats;
uint64 public entryPrice;
uint64 public minBid;
uint64 public tokenIndex;
uint64 public openTime;
uint96 public finalPrice;
uint96 public closeTime;
address public issuer;
address public oldeusOrigins;
string private _baseURI;
event Take(address indexed to, uint256 indexed tokenId);
event Raise(uint256 indexed tokenId, uint256 indexed totalBid);
modifier onlyOldeusOrigins() {
require(oldeusOrigins != address(0), "onlyOldeusOrigins: address can't be zero address");
require(msg.sender == oldeusOrigins, 'onlyOldeusOrigins: unauthorized');
_;
}
constructor(
string memory name_,
string memory symbol_,
string memory version_,
address issuer_,
uint64 entryPrice_,
uint64 minBid_,
uint64 openTime_,
uint96 closeTime_
) ERC4973O(name_, symbol_, version_) {
issuer = issuer_;
entryPrice = entryPrice_;
minBid = minBid_;
openTime = openTime_;
closeTime = closeTime_;
}
modifier whenLive() {
require(block.timestamp >= openTime, "whenLive: auction hasn't opened");
require(block.timestamp <= closeTime, 'whenLive: auction has closed');
_;
}
function take(address from, bytes calldata signature) external payable whenLive whenNotPaused returns (uint256) {
require(from == issuer, 'take: from must be Oldeus');
require(msg.value >= entryPrice, 'take: insufficient funds');
uint256 tokenId = _take(from, signature);
Stats storage stats_ = _stats[tokenId];
stats_.bidCount = 1;
stats_.bidAmount = uint216(msg.value);
stats_.tokenIndex = uint16(++tokenIndex);
emit Take(msg.sender, tokenId);
return tokenId;
}
function raise(bytes calldata signature) external payable whenLive whenNotPaused {
require(msg.value >= minBid, 'raise: insufficient funds');
uint256 tokenId = _safeCheckAgreement(msg.sender, issuer, msg.value, signature);
require(msg.value >= minBid, 'raise: insufficient funds');
require(_exists(tokenId), "raise: token doesn't exist");
Stats storage stats_ = _stats[tokenId];
++stats_.bidCount;
stats_.bidAmount += uint216(msg.value);
emit Raise(tokenId, stats_.bidAmount);
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(bytes(_baseURI).length > 0, "tokenURI: baseURI isn't set");
require(_exists(tokenId), "tokenURI: token doesn't exist");
return string.concat(_baseURI, _stats[tokenId].tokenIndex.toString());
}
function stats(uint256 tokenId) external view returns (Stats memory) {
require(_exists(tokenId), "stats: token doesn't exist");
return _stats[tokenId];
}
function stats(address holder) external view returns (Stats memory) {
uint256 tokenId = uint256(_getHash(holder, issuer));
require(_exists(tokenId), "stats: token doesn't exist");
return _stats[tokenId];
}
function refund(bytes calldata signature) external nonReentrant {
require(block.timestamp > closeTime, 'refund: auction not closed');
require(finalPrice > 0, 'refund: final price not set');
uint256 tokenId = _safeCheckAgreement(msg.sender, issuer, signature);
Stats storage stats_ = _stats[tokenId];
require(!stats_.refundClaimed, 'refund: claimed');
require(stats_.bidAmount < finalPrice, 'refund: bidder has won');
address payable recipient = payable(msg.sender);
recipient.transfer(stats_.bidAmount);
stats_.refundClaimed = true;
}
function refund(address payable to, uint256 refundAmount) external onlyOldeusOrigins nonReentrant {
require(finalPrice > 0, 'refund: final price not set');
uint256 tokenId = uint256(_getHash(to, issuer));
Stats storage stats_ = _stats[tokenId];
require(!stats_.refundClaimed, 'refund: claimed');
require(refundAmount < stats_.bidAmount, 'refund: insufficient bid');
to.transfer(refundAmount);
stats_.refundClaimed = true;
}
function exists(address holder) external view returns (bool) {
uint256 tokenId = uint256(_getHash(holder, issuer));
return _exists(tokenId);
}
function tokenId(address holder) external view returns (uint256) {
uint256 tokenId = uint256(_getHash(holder, issuer));
return tokenId;
}
function withdraw(address payable to) external onlyOwner {
require(to != address(0), "withdraw: address can't be zero address");
address contractAddress = address(this);
to.transfer(contractAddress.balance);
}
function migrate(address from, address to) external onlyOwner {
uint256 tokenIdFrom = uint256(_getHash(from, issuer));
require(_exists(tokenIdFrom), 'migrate: no token exists');
uint256 tokenIdTo = uint256(_getHash(to, issuer));
require(!_usedHashes.get(tokenIdTo), 'migrate: token exists');
_stats[tokenIdTo] = _stats[tokenIdFrom];
delete _stats[tokenIdFrom];
_mint(issuer, to, tokenIdTo);
_burn(tokenIdFrom);
}
function setAuctionTimes(uint256 openTime_, uint256 closeTime_) external onlyOwner {
openTime = uint64(openTime_);
closeTime = uint64(closeTime_);
}
function setBaseURI(string calldata baseURI) external onlyOwner {
_baseURI = baseURI;
}
function setEntryPrice(uint256 entryPrice_) external onlyOwner {
entryPrice = uint64(entryPrice_);
}
function setMinBid(uint256 minBid_) external onlyOwner {
minBid = uint64(minBid_);
}
function setIssuer(address issuer_) external onlyOwner {
require(issuer_ != address(0), "setIssuer: address can't zero address");
issuer = issuer_;
}
function setFinalPrice(uint256 finalPrice_) external onlyOwner {
require(finalPrice_ != 0, "setFinalPrice: final price can't be zero");
finalPrice = uint64(finalPrice_);
}
function setOldeusOrigins(address oldeusOrigins_) external onlyOwner {
require(oldeusOrigins_ != address(0), "setOldeusOrigins: address can't zero address");
oldeusOrigins = oldeusOrigins_;
}
function togglePaused() external onlyOwner {
if (paused()) {
_unpause();
} else {
_pause();
}
}
function _take(address from, bytes calldata signature) internal override returns (uint256) {
require(msg.sender != from, "_take: can't take from self");
uint256 tokenId = _safeCheckAgreement(msg.sender, from, msg.value, signature);
require(!_usedHashes.get(tokenId), '_take: id already used');
_mint(from, msg.sender, tokenId);
_usedHashes.set(tokenId);
return tokenId;
}
function _safeCheckAgreement(address active, address passive, uint256 bid, bytes calldata signature) internal view returns (uint256) {
bytes32 transactionHash = _getHash(active, passive, bid);
require(SignatureChecker.isValidSignatureNow(passive, transactionHash, signature), '_safeCheckAgreement: invalid signature');
bytes32 hash = _getHash(active, passive);
uint256 tokenId = uint256(hash);
return tokenId;
}
function _getHash(address active, address passive, uint256 bid) internal view returns (bytes32) {
bytes32 structHash = keccak256(abi.encode(AUCTION_HASH, active, passive, bid));
return _hashTypedDataV4(structHash);
}
}// 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 v4.4.1 (interfaces/IERC1271.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*
* _Available since v4.1._
*/
interface IERC1271 {
/**
* @dev Should return whether the signature provided is valid for the provided data
* @param hash Hash of the data to be signed
* @param signature Signature byte array associated with _data
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}// SPDX-License-Identifier: MIT
// 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) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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/EIP712.sol)
pragma solidity ^0.8.0;
import "./ECDSA.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*/
abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
uint256 private immutable _CACHED_CHAIN_ID;
address private immutable _CACHED_THIS;
bytes32 private immutable _HASHED_NAME;
bytes32 private immutable _HASHED_VERSION;
bytes32 private immutable _TYPE_HASH;
/* solhint-enable var-name-mixedcase */
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
constructor(string memory name, string memory version) {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
_CACHED_CHAIN_ID = block.chainid;
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
_CACHED_THIS = address(this);
_TYPE_HASH = typeHash;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
}
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/SignatureChecker.sol)
pragma solidity ^0.8.0;
import "./ECDSA.sol";
import "../Address.sol";
import "../../interfaces/IERC1271.sol";
/**
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
* signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
* Argent and Gnosis Safe.
*
* _Available since v4.1._
*/
library SignatureChecker {
/**
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidSignatureNow(
address signer,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
if (error == ECDSA.RecoverError.NoError && recovered == signer) {
return true;
}
(bool success, bytes memory result) = signer.staticcall(
abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
);
return (success &&
result.length == 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
}
}// 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
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/BitMaps.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
* Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
*/
library BitMaps {
struct BitMap {
mapping(uint256 => uint256) _data;
}
/**
* @dev Returns whether the bit at `index` is set.
*/
function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
return bitmap._data[bucket] & mask != 0;
}
/**
* @dev Sets the bit at `index` to the boolean `value`.
*/
function setTo(
BitMap storage bitmap,
uint256 index,
bool value
) internal {
if (value) {
set(bitmap, index);
} else {
unset(bitmap, index);
}
}
/**
* @dev Sets the bit at `index`.
*/
function set(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
bitmap._data[bucket] |= mask;
}
/**
* @dev Unsets the bit at `index`.
*/
function unset(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
bitmap._data[bucket] &= ~mask;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./interfaces/ERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.8;
import {SignatureChecker} from '@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol';
import {EIP712} from '@openzeppelin/contracts/utils/cryptography/EIP712.sol';
import {BitMaps} from '@openzeppelin/contracts/utils/structs/BitMaps.sol';
import {ERC165} from './ERC165.sol';
import {IERC721Metadata} from './interfaces/ERC721Metadata.sol';
import {IERC4973} from './interfaces/ERC4973.sol';
bytes32 constant AGREEMENT_HASH = keccak256('Agreement(address active,address passive)');
/// @notice Modified version of the reference implementation of EIP-4973 tokens.
/// @author Felix Nordén
/// Heavy inspiration taken from the reference implementation (https://github.com/rugpullindex/ERC4973/blob/master/src/ERC4973.sol)
abstract contract ERC4973O is EIP712, ERC165, IERC721Metadata, IERC4973 {
using BitMaps for BitMaps.BitMap;
BitMaps.BitMap internal _usedHashes;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
constructor(string memory name_, string memory symbol_, string memory version) EIP712(name_, version) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC4973).interfaceId || super.supportsInterface(interfaceId);
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function unequip(uint256 tokenId) public virtual override {
require(msg.sender == ownerOf(tokenId), 'unequip: sender must be owner');
_usedHashes.unset(tokenId);
_burn(tokenId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), 'balanceOf: address zero is not a valid owner');
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ownerOf: token doesn't exist");
return owner;
}
function _give(address to, bytes calldata signature) internal virtual returns (uint256) {
require(msg.sender != to, "_give: can't give from self");
uint256 tokenId = _safeCheckAgreement(msg.sender, to, signature);
require(!_usedHashes.get(tokenId), '_give: id already used');
_mint(msg.sender, to, tokenId);
_usedHashes.set(tokenId);
return tokenId;
}
function _take(address from, bytes calldata signature) internal virtual returns (uint256) {
require(msg.sender != from, "_take: can't take from self");
uint256 tokenId = _safeCheckAgreement(msg.sender, from, signature);
require(!_usedHashes.get(tokenId), '_take: id already used');
_mint(from, msg.sender, tokenId);
_usedHashes.set(tokenId);
return tokenId;
}
function _safeCheckAgreement(address active, address passive, bytes calldata signature) internal virtual returns (uint256) {
bytes32 hash = _getHash(active, passive);
require(SignatureChecker.isValidSignatureNow(passive, hash, signature), '_safeCheckAgreement: invalid signature');
uint256 tokenId = uint256(hash);
return tokenId;
}
function _getHash(address active, address passive) internal view returns (bytes32) {
bytes32 structHash = keccak256(abi.encode(AGREEMENT_HASH, active, passive));
return _hashTypedDataV4(structHash);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _mint(address from, address to, uint256 tokenId) internal virtual returns (uint256) {
require(!_exists(tokenId), '_mint: tokenId exists');
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
return tokenId;
}
function _burn(uint256 tokenId) internal virtual {
address owner = ownerOf(tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
}// 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: CC0-1.0
pragma solidity ^0.8.6;
/** @title Account-bound tokens
* @dev See https://eips.ethereum.org/EIPS/eip-4973
* Note: the ERC-165 identifier for this interface is 0x5164cf47
*/
interface IERC4973 {
/// @dev This emits when ownership of any ABT changes by any mechanism.
/// This event emits when ABTs are given or equipped and unequipped
/// (`to` == 0).
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
/// @notice Count all ABTs assigned to an owner
/// @dev ABTs assigned to the zero address are considered invalid, and this
/// function throws for queries about the zero address.
/// @param owner An address for whom to query the balance
/// @return The number of ABTs owned by `address owner`, possibly zero
function balanceOf(address owner) external view returns (uint256);
/// @notice Find the address bound to an ERC4973 account-bound token
/// @dev ABTs assigned to zero address are considered invalid, and queries
/// about them do throw.
/// @param tokenId The identifier for an ABT.
/// @return The address of the owner bound to the ABT.
function ownerOf(uint256 tokenId) external view returns (address);
/// @notice Removes the `uint256 tokenId` from an account. At any time, an
/// ABT receiver must be able to disassociate themselves from an ABT
/// publicly through calling this function. After successfully executing this
/// function, given the parameters for calling `function give` or
/// `function take` a token must be re-equipable.
/// @dev Must emit a `event Transfer` with the `address to` field pointing to
/// the zero address.
/// @param tokenId The identifier for an ABT.
function unequip(uint256 tokenId) external;
/// @notice Creates and transfers the ownership of an ABT from the
/// transaction's `msg.sender` to `address to`.
/// @dev Throws unless `bytes signature` represents an EIP-2089 Compact
/// Signature of the EIP-712 structured data hash
/// `Agreement(address active,address passive,string tokenURI)` expressing
/// `address to`'s explicit agreement to be publicly associated with
/// `msg.sender` and `string tokenURI`. A unique `uint256 tokenId` must be
/// generated by type-casting the `bytes32` EIP-712 structured data hash to a
/// `uint256`. If `bytes signature` is empty or `address to` is a contract,
/// an EIP-1271-compatible call to `function isValidSignatureNow(...)` must
/// be made to `address to`. A successful execution must result in the
/// `event Transfer(msg.sender, to, tokenId)`. Once an ABT exists as an
/// `uint256 tokenId` in the contract, `function give(...)` must throw.
/// @param to The receiver of the ABT.
/// @param uri A distinct Uniform Resource Identifier (URI) for a given ABT.
/// @param signature A EIP-2089-compatible Compact Signature of the EIP-712
/// structured data hash
/// `Agreement(address active,address passive,string tokenURI)` signed by
/// `address to`.
/// @return A unique `uint256 tokenId` generated by type-casting the `bytes32`
/// EIP-712 structured data hash to a `uint256`.
// TODO: Remove with notes
// function give(
// address to,
// string calldata uri,
// bytes calldata signature
// ) external returns (uint256);
/// @notice Creates and transfers the ownership of an ABT from an
/// `address from` to the transaction's `msg.sender`.
/// @dev Throws unless `bytes signature` represents an EIP-2089 Compact
/// Signature of the EIP-712 structured data hash
/// `Agreement(address active,address passive,string tokenURI)` expressing
/// `address from`'s explicit agreement to be publicly associated with
/// `msg.sender` and `string tokenURI`. A unique `uint256 tokenId` must be
/// generated by type-casting the `bytes32` EIP-712 structured data hash to a
/// `uint256`. If `bytes signature` is empty or `address from` is a contract,
/// an EIP-1271-compatible call to `function isValidSignatureNow(...)` must
/// be made to `address from`. A successful execution must result in the
/// emission of an `event Transfer(from, msg.sender, tokenId)`. Once an ABT
/// exists as an `uint256 tokenId` in the contract, `function take(...)` must
/// throw.
/// @param from The origin of the ABT.
/// @param uri A distinct Uniform Resource Identifier (URI) for a given ABT.
/// @param signature A EIP-2089-compatible Compact Signature of the EIP-712
/// structured data hash
/// `Agreement(address active,address passive,string tokenURI)` signed by
/// `address from`.
/// @return A unique `uint256 tokenId` generated by type-casting the `bytes32`
/// EIP-712 structured data hash to a `uint256`.
// TODO: Remove with notes
// function take(
// address from,
// string calldata uri,
// bytes calldata signature
// ) external returns (uint256);
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.6;
interface IERC721Metadata {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"version_","type":"string"},{"internalType":"address","name":"issuer_","type":"address"},{"internalType":"uint64","name":"entryPrice_","type":"uint64"},{"internalType":"uint64","name":"minBid_","type":"uint64"},{"internalType":"uint64","name":"openTime_","type":"uint64"},{"internalType":"uint96","name":"closeTime_","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"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":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"totalBid","type":"uint256"}],"name":"Raise","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Take","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeTime","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryPrice","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalPrice","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issuer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minBid","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldeusOrigins","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"raise","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"refundAmount","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"openTime_","type":"uint256"},{"internalType":"uint256","name":"closeTime_","type":"uint256"}],"name":"setAuctionTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"entryPrice_","type":"uint256"}],"name":"setEntryPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"finalPrice_","type":"uint256"}],"name":"setFinalPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"issuer_","type":"address"}],"name":"setIssuer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minBid_","type":"uint256"}],"name":"setMinBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldeusOrigins_","type":"address"}],"name":"setOldeusOrigins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"stats","outputs":[{"components":[{"internalType":"uint216","name":"bidAmount","type":"uint216"},{"internalType":"uint16","name":"bidCount","type":"uint16"},{"internalType":"uint16","name":"tokenIndex","type":"uint16"},{"internalType":"bool","name":"refundClaimed","type":"bool"}],"internalType":"struct Stats","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stats","outputs":[{"components":[{"internalType":"uint216","name":"bidAmount","type":"uint216"},{"internalType":"uint16","name":"bidCount","type":"uint16"},{"internalType":"uint16","name":"tokenIndex","type":"uint16"},{"internalType":"bool","name":"refundClaimed","type":"bool"}],"internalType":"struct Stats","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"take","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"togglePaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"tokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIndex","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unequip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101406040523480156200001257600080fd5b506040516200367d3803806200367d833981016040819052620000359162000325565b87516020808a019190912087518883012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c094850190915281519190950120905291909152610120528787876001620000d58482620004a3565b506002620000e48382620004a3565b5050505062000102620000fc620001bd60201b60201c565b620001c1565b6005805460ff60a01b191690556001600655600a80546001600160a01b0319166001600160a01b039690961695909517909455600880546001600160401b039485166001600160801b0319909116176801000000000000000093851693909302929092176001600160c01b0316600160c01b919093160291909117905560098054600160601b600160c01b0319166c010000000000000000000000006001600160601b0390931692909202919091179055506200056f915050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200023b57600080fd5b81516001600160401b038082111562000258576200025862000213565b604051601f8301601f19908116603f0116810190828211818310171562000283576200028362000213565b81604052838152602092508683858801011115620002a057600080fd5b600091505b83821015620002c45785820183015181830184015290820190620002a5565b600093810190920192909252949350505050565b80516001600160a01b0381168114620002f057600080fd5b919050565b80516001600160401b0381168114620002f057600080fd5b80516001600160601b0381168114620002f057600080fd5b600080600080600080600080610100898b0312156200034357600080fd5b88516001600160401b03808211156200035b57600080fd5b620003698c838d0162000229565b995060208b01519150808211156200038057600080fd5b6200038e8c838d0162000229565b985060408b0151915080821115620003a557600080fd5b50620003b48b828c0162000229565b965050620003c560608a01620002d8565b9450620003d560808a01620002f5565b9350620003e560a08a01620002f5565b9250620003f560c08a01620002f5565b91506200040560e08a016200030d565b90509295985092959890939650565b600181811c908216806200042957607f821691505b6020821081036200044a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200049e57600081815260208120601f850160051c81016020861015620004795750805b601f850160051c820191505b818110156200049a5782815560010162000485565b5050505b505050565b81516001600160401b03811115620004bf57620004bf62000213565b620004d781620004d0845462000414565b8462000450565b602080601f8311600181146200050f5760008415620004f65750858301515b600019600386901b1c1916600185901b1785556200049a565b600085815260208120601f198616915b8281101562000540578886015182559484019460019091019084016200051f565b50858210156200055f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161010051610120516130be620005bf60003960006129bf01526000612a0e015260006129e9015260006129420152600061296c0152600061299601526130be6000f3fe60806040526004361061026a5760003560e01c8063715018a611610153578063ad217ae5116100cb578063d179e3d01161007f578063f2fde38b11610064578063f2fde38b14610768578063f6a3d24e14610788578063f745adfc146107a857600080fd5b8063d179e3d014610713578063d55f92731461073357600080fd5b8063bb55f25c116100b0578063bb55f25c146106c0578063bb786693146106e0578063c87b56dd146106f357600080fd5b8063ad217ae514610678578063b42568881461069857600080fd5b806395d89b4111610122578063a6b513ee11610107578063a6b513ee14610620578063a6e77af114610645578063ac603e301461066557600080fd5b806395d89b41146105eb5780639f1b2fc11461060057600080fd5b8063715018a6146105315780637ca31724146105465780638bcdcbf3146105665780638da5cb5b146105cd57600080fd5b80635362f5a6116101e65780635eb7d946116101b55780636352211e1161019a5780636352211e146104c3578063638d0129146104e357806370a082311461050357600080fd5b80635eb7d9461461045a578063627749e61461047a57600080fd5b80635362f5a6146103db57806355cc4e57146103fb57806355f804b31461041b5780635c975abb1461043b57600080fd5b80631d1438481161023d5780633e109a19116102225780633e109a1914610355578063410085df1461039b57806351cff8d9146103bb57600080fd5b80631d1438481461030857806336566f061461034057600080fd5b806301ffc9a71461026f57806306fdde03146102a45780631068361f146102c657806312874688146102e8575b600080fd5b34801561027b57600080fd5b5061028f61028a366004612b65565b6107c9565b60405190151581526020015b60405180910390f35b3480156102b057600080fd5b506102b9610866565b60405161029b9190612bdf565b3480156102d257600080fd5b506102e66102e1366004612c07565b6108f8565b005b3480156102f457600080fd5b506102e6610303366004612c40565b610b22565b34801561031457600080fd5b50600a54610328906001600160a01b031681565b6040516001600160a01b03909116815260200161029b565b34801561034c57600080fd5b506102e6610b71565b34801561036157600080fd5b506008546103829068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161029b565b3480156103a757600080fd5b506102e66103b6366004612c59565b610b9d565b3480156103c757600080fd5b506102e66103d6366004612c85565b610e11565b3480156103e757600080fd5b50600b54610328906001600160a01b031681565b34801561040757600080fd5b506102e6610416366004612c85565b610ed2565b34801561042757600080fd5b506102e6610436366004612ce4565b610f78565b34801561044757600080fd5b50600554600160a01b900460ff1661028f565b34801561046657600080fd5b506102e6610475366004612ce4565b610f8d565b34801561048657600080fd5b506009546104a690600160601b90046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff909116815260200161029b565b3480156104cf57600080fd5b506103286104de366004612c40565b6111a6565b3480156104ef57600080fd5b506102e66104fe366004612c85565b61120b565b34801561050f57600080fd5b5061052361051e366004612c85565b6112b1565b60405190815260200161029b565b34801561053d57600080fd5b506102e661134b565b34801561055257600080fd5b50610523610561366004612c85565b61135d565b34801561057257600080fd5b50610586610581366004612c85565b611380565b6040805182516001600160d81b0316815260208084015161ffff9081169183019190915283830151169181019190915260609182015115159181019190915260800161029b565b3480156105d957600080fd5b506005546001600160a01b0316610328565b3480156105f757600080fd5b506102b9611489565b34801561060c57600080fd5b506102e661061b366004612d26565b611498565b34801561062c57600080fd5b506009546104a6906bffffffffffffffffffffffff1681565b34801561065157600080fd5b506102e6610660366004612c40565b611508565b6102e6610673366004612ce4565b611534565b34801561068457600080fd5b50610586610693366004612c40565b611814565b3480156106a457600080fd5b5060085461038290600160c01b900467ffffffffffffffff1681565b3480156106cc57600080fd5b506102e66106db366004612c40565b6118fe565b6105236106ee366004612d48565b6119a3565b3480156106ff57600080fd5b506102b961070e366004612c40565b611c2c565b34801561071f57600080fd5b506102e661072e366004612c40565b611d3d565b34801561073f57600080fd5b5060085461038290700100000000000000000000000000000000900467ffffffffffffffff1681565b34801561077457600080fd5b506102e6610783366004612c85565b611dd2565b34801561079457600080fd5b5061028f6107a3366004612c85565b611e5f565b3480156107b457600080fd5b506008546103829067ffffffffffffffff1681565b60006001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000148061082c57506001600160e01b031982167fc28b40ff00000000000000000000000000000000000000000000000000000000145b8061086057507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606001805461087590612d9d565b80601f01602080910402602001604051908101604052809291908181526020018280546108a190612d9d565b80156108ee5780601f106108c3576101008083540402835291602001916108ee565b820191906000526020600020905b8154815290600101906020018083116108d157829003601f168201915b5050505050905090565b610900611e9d565b600a5460009061091a9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03166109865760405162461bcd60e51b815260206004820152601860248201527f6d6967726174653a206e6f20746f6b656e20657869737473000000000000000060448201526064015b60405180910390fd5b600a546000906109a09084906001600160a01b0316611ef7565b600881901c600090815260208190526040902054909150600160ff83161b1615610a0c5760405162461bcd60e51b815260206004820152601560248201527f6d6967726174653a20746f6b656e206578697374730000000000000000000000604482015260640161097d565b600082815260076020526040808220838352908220815481546001600160d81b039091167fffffffffff00000000000000000000000000000000000000000000000000000082168117835583547fffffff000000000000000000000000000000000000000000000000000000000090921617600160d81b9182900461ffff90811690920217808355835461ffff60e81b198216600160e81b9182900490931602918217835583547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091166001600160f81b0390921691909117600160f81b9182900460ff16151590910217905583825255600a54610b12906001600160a01b03168483611f72565b50610b1c82612063565b50505050565b610b2a611e9d565b6008805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909216919091179055565b610b79611e9d565b600554600160a01b900460ff1615610b9557610b936120f6565b565b610b9361214b565b600b546001600160a01b0316610c1b5760405162461bcd60e51b815260206004820152603060248201527f6f6e6c794f6c646575734f726967696e733a20616464726573732063616e277460448201527f206265207a65726f206164647265737300000000000000000000000000000000606482015260840161097d565b600b546001600160a01b03163314610c755760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c794f6c646575734f726967696e733a20756e617574686f72697a656400604482015260640161097d565b610c7d61218e565b6009546bffffffffffffffffffffffff16610cda5760405162461bcd60e51b815260206004820152601b60248201527f726566756e643a2066696e616c207072696365206e6f74207365740000000000604482015260640161097d565b600a54600090610cf49084906001600160a01b0316611ef7565b6000818152600760205260409020805491925090600160f81b900460ff1615610d5f5760405162461bcd60e51b815260206004820152600f60248201527f726566756e643a20636c61696d65640000000000000000000000000000000000604482015260640161097d565b80546001600160d81b03168310610db85760405162461bcd60e51b815260206004820152601860248201527f726566756e643a20696e73756666696369656e74206269640000000000000000604482015260640161097d565b6040516001600160a01b0385169084156108fc029085906000818181858888f19350505050158015610dee573d6000803e3d6000fd5b5080546001600160f81b0316600160f81b17905550610e0d6001600655565b5050565b610e19611e9d565b6001600160a01b038116610e955760405162461bcd60e51b815260206004820152602760248201527f77697468647261773a20616464726573732063616e2774206265207a65726f2060448201527f6164647265737300000000000000000000000000000000000000000000000000606482015260840161097d565b60405130906001600160a01b03831690823180156108fc02916000818181858888f19350505050158015610ecd573d6000803e3d6000fd5b505050565b610eda611e9d565b6001600160a01b038116610f565760405162461bcd60e51b815260206004820152602560248201527f7365744973737565723a20616464726573732063616e2774207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161097d565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610f80611e9d565b600c610ecd828483612e3b565b610f9561218e565b600954600160601b90046bffffffffffffffffffffffff164211610ffb5760405162461bcd60e51b815260206004820152601a60248201527f726566756e643a2061756374696f6e206e6f7420636c6f736564000000000000604482015260640161097d565b6009546bffffffffffffffffffffffff166110585760405162461bcd60e51b815260206004820152601b60248201527f726566756e643a2066696e616c207072696365206e6f74207365740000000000604482015260640161097d565b600a546000906110749033906001600160a01b031685856121e7565b6000818152600760205260409020805491925090600160f81b900460ff16156110df5760405162461bcd60e51b815260206004820152600f60248201527f726566756e643a20636c61696d65640000000000000000000000000000000000604482015260640161097d565b60095481546bffffffffffffffffffffffff9091166001600160d81b039091161061114c5760405162461bcd60e51b815260206004820152601660248201527f726566756e643a206269646465722068617320776f6e00000000000000000000604482015260640161097d565b8054604051339182916001600160d81b0390911680156108fc02916000818181858888f19350505050158015611186573d6000803e3d6000fd5b505080546001600160f81b0316600160f81b17905550610e0d6001600655565b6000818152600360205260408120546001600160a01b0316806108605760405162461bcd60e51b815260206004820152601c60248201527f6f776e65724f663a20746f6b656e20646f65736e277420657869737400000000604482015260640161097d565b611213611e9d565b6001600160a01b03811661128f5760405162461bcd60e51b815260206004820152602c60248201527f7365744f6c646575734f726967696e733a20616464726573732063616e27742060448201527f7a65726f20616464726573730000000000000000000000000000000000000000606482015260840161097d565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821661132f5760405162461bcd60e51b815260206004820152602c60248201527f62616c616e63654f663a2061646472657373207a65726f206973206e6f74206160448201527f2076616c6964206f776e65720000000000000000000000000000000000000000606482015260840161097d565b506001600160a01b031660009081526004602052604090205490565b611353611e9d565b610b93600061229b565b600a5460009081906113799084906001600160a01b0316611ef7565b9392505050565b604080516080810182526000808252602082018190529181018290526060810191909152600a546000906113be9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03166114255760405162461bcd60e51b815260206004820152601a60248201527f73746174733a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b600090815260076020908152604091829020825160808101845290546001600160d81b038116825261ffff600160d81b8204811693830193909352600160e81b81049092169281019290925260ff600160f81b909104161515606082015292915050565b60606002805461087590612d9d565b6114a0611e9d565b6008805477ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b67ffffffffffffffff94851602179055600980547fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff1691909216600160601b02179055565b611510611e9d565b6008805467ffffffffffffffff191667ffffffffffffffff92909216919091179055565b600854600160c01b900467ffffffffffffffff164210156115975760405162461bcd60e51b815260206004820152601f60248201527f7768656e4c6976653a2061756374696f6e206861736e2774206f70656e656400604482015260640161097d565b600954600160601b90046bffffffffffffffffffffffff164211156115fe5760405162461bcd60e51b815260206004820152601c60248201527f7768656e4c6976653a2061756374696f6e2068617320636c6f73656400000000604482015260640161097d565b6116066122ed565b60085468010000000000000000900467ffffffffffffffff1634101561166e5760405162461bcd60e51b815260206004820152601960248201527f72616973653a20696e73756666696369656e742066756e647300000000000000604482015260640161097d565b600a5460009061168b9033906001600160a01b0316348686612347565b60085490915068010000000000000000900467ffffffffffffffff163410156116f65760405162461bcd60e51b815260206004820152601960248201527f72616973653a20696e73756666696369656e742066756e647300000000000000604482015260640161097d565b6000818152600360205260409020546001600160a01b031661175a5760405162461bcd60e51b815260206004820152601a60248201527f72616973653a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b600081815260076020526040902080548190601b9061178390600160d81b900461ffff16612f12565b825461ffff9182166101009390930a92830291909202199091161790558054349082906000906117bd9084906001600160d81b0316612f33565b82546101009290920a6001600160d81b0381810219909316918316021790915582546040519116915083907ff1b7598a82d48d884c693d3ac1b536a3bbffef8f48a0abb715928bfcdcd9f85a90600090a350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600360205260409020546001600160a01b031661189c5760405162461bcd60e51b815260206004820152601a60248201527f73746174733a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b50600090815260076020908152604091829020825160808101845290546001600160d81b038116825261ffff600160d81b8204811693830193909352600160e81b81049092169281019290925260ff600160f81b909104161515606082015290565b611906611e9d565b8060000361197c5760405162461bcd60e51b815260206004820152602860248201527f73657446696e616c50726963653a2066696e616c2070726963652063616e277460448201527f206265207a65726f000000000000000000000000000000000000000000000000606482015260840161097d565b600980546bffffffffffffffffffffffff191667ffffffffffffffff909216919091179055565b600854600090600160c01b900467ffffffffffffffff16421015611a095760405162461bcd60e51b815260206004820152601f60248201527f7768656e4c6976653a2061756374696f6e206861736e2774206f70656e656400604482015260640161097d565b600954600160601b90046bffffffffffffffffffffffff16421115611a705760405162461bcd60e51b815260206004820152601c60248201527f7768656e4c6976653a2061756374696f6e2068617320636c6f73656400000000604482015260640161097d565b611a786122ed565b600a546001600160a01b03858116911614611ad55760405162461bcd60e51b815260206004820152601960248201527f74616b653a2066726f6d206d757374206265204f6c6465757300000000000000604482015260640161097d565b60085467ffffffffffffffff16341015611b315760405162461bcd60e51b815260206004820152601860248201527f74616b653a20696e73756666696369656e742066756e64730000000000000000604482015260640161097d565b6000611b3e85858561240b565b60008181526007602052604090208054600160d81b7fffffff0000000000000000000000000000000000000000000000000000000000909116346001600160d81b031617178155600880549293509091601090611bb890700100000000000000000000000000000000900467ffffffffffffffff16612f5a565b825467ffffffffffffffff8083166101009490940a9384029302191691909117909155815461ffff909116600160e81b0261ffff60e81b19909116178155604051829033907fd69eabfc802f58b2a23d16767d1fcab6551f30a60ab43a24f147d3823d7d036890600090a350949350505050565b60606000600c8054611c3d90612d9d565b905011611c8c5760405162461bcd60e51b815260206004820152601b60248201527f746f6b656e5552493a20626173655552492069736e2774207365740000000000604482015260640161097d565b6000828152600360205260409020546001600160a01b0316611cf05760405162461bcd60e51b815260206004820152601d60248201527f746f6b656e5552493a20746f6b656e20646f65736e2774206578697374000000604482015260640161097d565b600082815260076020526040902054600c90611d1690600160e81b900461ffff16612513565b604051602001611d27929190612f77565b6040516020818303038152906040529050919050565b611d46816111a6565b6001600160a01b0316336001600160a01b031614611da65760405162461bcd60e51b815260206004820152601d60248201527f756e65717569703a2073656e646572206d757374206265206f776e6572000000604482015260640161097d565b600881901c60009081526020819052604090208054600160ff84161b19169055611dcf81612063565b50565b611dda611e9d565b6001600160a01b038116611e565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161097d565b611dcf8161229b565b600a546000908190611e7b9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03161515611379565b6005546001600160a01b03163314610b935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161097d565b6000807f93c86b6f16d05688c27172668c232ca3b501d3313ded3f32c0f132d7a22e0b1b8484604051602001611f49939291909283526001600160a01b03918216602084015216604082015260600190565b604051602081830303815290604052805190602001209050611f6a816125b3565b949350505050565b6000818152600360205260408120546001600160a01b031615611fd75760405162461bcd60e51b815260206004820152601560248201527f5f6d696e743a20746f6b656e4964206578697374730000000000000000000000604482015260640161097d565b6001600160a01b0383166000908152600460205260408120805460019290612000908490612ffe565b909155505060008281526003602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45092915050565b600061206e826111a6565b6001600160a01b0381166000908152600460205260408120805492935060019290919061209c908490613011565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6120fe61261c565b6005805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6121536122ed565b6005805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861212e3390565b6002600654036121e05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161097d565b6002600655565b6000806121f48686611ef7565b9050612237858286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267592505050565b6122925760405162461bcd60e51b815260206004820152602660248201527f5f73616665436865636b41677265656d656e743a20696e76616c6964207369676044820152656e617475726560d01b606482015260840161097d565b95945050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600554600160a01b900460ff1615610b935760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161097d565b6000806123558787876127e4565b9050612398868286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267592505050565b6123f35760405162461bcd60e51b815260206004820152602660248201527f5f73616665436865636b41677265656d656e743a20696e76616c6964207369676044820152656e617475726560d01b606482015260840161097d565b60006123ff8888611ef7565b98975050505050505050565b60006001600160a01b03841633036124655760405162461bcd60e51b815260206004820152601b60248201527f5f74616b653a2063616e27742074616b652066726f6d2073656c660000000000604482015260640161097d565b60006124743386348787612347565b600881901c600090815260208190526040902054909150600160ff83161b16156124e05760405162461bcd60e51b815260206004820152601660248201527f5f74616b653a20696420616c7265616479207573656400000000000000000000604482015260640161097d565b6124eb853383611f72565b50600881901c60009081526020819052604090208054600160ff84161b179055949350505050565b6060600061252083612853565b600101905060008167ffffffffffffffff81111561254057612540612dd7565b6040519080825280601f01601f19166020018201604052801561256a576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461257457509392505050565b60006108606125c0612935565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600554600160a01b900460ff16610b935760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161097d565b60008060006126848585612a5c565b9092509050600081600481111561269d5761269d613024565b1480156126bb5750856001600160a01b0316826001600160a01b0316145b156126cb57600192505050611379565b600080876001600160a01b0316631626ba7e60e01b88886040516024016126f392919061303a565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516127469190613053565b600060405180830381855afa9150503d8060008114612781576040519150601f19603f3d011682016040523d82523d6000602084013e612786565b606091505b5091509150818015612799575080516020145b80156123ff575080517f1626ba7e00000000000000000000000000000000000000000000000000000000906127d7908301602090810190840161306f565b1498975050505050505050565b604080517fd507be88b71f14a65988cdef4dafe31a47a7d25685cea1eeebd81f3425cb41af6020808301919091526001600160a01b03868116838501528516606083015260808083018590528351808403909101815260a09092019092528051910120600090612292816125b3565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061289c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106128c8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106128e657662386f26fc10000830492506010015b6305f5e10083106128fe576305f5e100830492506008015b612710831061291257612710830492506004015b60648310612924576064830492506002015b600a83106108605760010192915050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561298e57507f000000000000000000000000000000000000000000000000000000000000000046145b156129b857507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612a925760208301516040840151606085015160001a612a8687828585612aa1565b94509450505050612a9a565b506000905060025b9250929050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612ad85750600090506003612b5c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612b2c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612b5557600060019250925050612b5c565b9150600090505b94509492505050565b600060208284031215612b7757600080fd5b81356001600160e01b03198116811461137957600080fd5b60005b83811015612baa578181015183820152602001612b92565b50506000910152565b60008151808452612bcb816020860160208601612b8f565b601f01601f19169290920160200192915050565b6020815260006113796020830184612bb3565b6001600160a01b0381168114611dcf57600080fd5b60008060408385031215612c1a57600080fd5b8235612c2581612bf2565b91506020830135612c3581612bf2565b809150509250929050565b600060208284031215612c5257600080fd5b5035919050565b60008060408385031215612c6c57600080fd5b8235612c7781612bf2565b946020939093013593505050565b600060208284031215612c9757600080fd5b813561137981612bf2565b60008083601f840112612cb457600080fd5b50813567ffffffffffffffff811115612ccc57600080fd5b602083019150836020828501011115612a9a57600080fd5b60008060208385031215612cf757600080fd5b823567ffffffffffffffff811115612d0e57600080fd5b612d1a85828601612ca2565b90969095509350505050565b60008060408385031215612d3957600080fd5b50508035926020909101359150565b600080600060408486031215612d5d57600080fd5b8335612d6881612bf2565b9250602084013567ffffffffffffffff811115612d8457600080fd5b612d9086828701612ca2565b9497909650939450505050565b600181811c90821680612db157607f821691505b602082108103612dd157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ecd57600081815260208120601f850160051c81016020861015612e145750805b601f850160051c820191505b81811015612e3357828155600101612e20565b505050505050565b67ffffffffffffffff831115612e5357612e53612dd7565b612e6783612e618354612d9d565b83612ded565b6000601f841160018114612e9b5760008515612e835750838201355b600019600387901b1c1916600186901b178355612ef5565b600083815260209020601f19861690835b82811015612ecc5786850135825560209485019460019092019101612eac565b5086821015612ee95760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052601160045260246000fd5b600061ffff808316818103612f2957612f29612efc565b6001019392505050565b6001600160d81b03818116838216019080821115612f5357612f53612efc565b5092915050565b600067ffffffffffffffff808316818103612f2957612f29612efc565b6000808454612f8581612d9d565b60018281168015612f9d5760018114612fb257612fe1565b60ff1984168752821515830287019450612fe1565b8860005260208060002060005b85811015612fd85781548a820152908401908201612fbf565b50505082870194505b505050508351612ff5818360208801612b8f565b01949350505050565b8082018082111561086057610860612efc565b8181038181111561086057610860612efc565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611f6a6040830184612bb3565b60008251613065818460208701612b8f565b9190910192915050565b60006020828403121561308157600080fd5b505191905056fea2646970667358221220e8f859a43acb629a4e3d0895d8d337c68eb12e118741a1d831a5c0a4aa240ab564736f6c634300081100330000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000871c32d6f988ac375679b5e2d8c205bf281ca210000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000639b286000000000000000000000000000000000000000000000000000000000639dcb60000000000000000000000000000000000000000000000000000000000000000f4f6c646575733a204d797468696373000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074d5954484943530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061026a5760003560e01c8063715018a611610153578063ad217ae5116100cb578063d179e3d01161007f578063f2fde38b11610064578063f2fde38b14610768578063f6a3d24e14610788578063f745adfc146107a857600080fd5b8063d179e3d014610713578063d55f92731461073357600080fd5b8063bb55f25c116100b0578063bb55f25c146106c0578063bb786693146106e0578063c87b56dd146106f357600080fd5b8063ad217ae514610678578063b42568881461069857600080fd5b806395d89b4111610122578063a6b513ee11610107578063a6b513ee14610620578063a6e77af114610645578063ac603e301461066557600080fd5b806395d89b41146105eb5780639f1b2fc11461060057600080fd5b8063715018a6146105315780637ca31724146105465780638bcdcbf3146105665780638da5cb5b146105cd57600080fd5b80635362f5a6116101e65780635eb7d946116101b55780636352211e1161019a5780636352211e146104c3578063638d0129146104e357806370a082311461050357600080fd5b80635eb7d9461461045a578063627749e61461047a57600080fd5b80635362f5a6146103db57806355cc4e57146103fb57806355f804b31461041b5780635c975abb1461043b57600080fd5b80631d1438481161023d5780633e109a19116102225780633e109a1914610355578063410085df1461039b57806351cff8d9146103bb57600080fd5b80631d1438481461030857806336566f061461034057600080fd5b806301ffc9a71461026f57806306fdde03146102a45780631068361f146102c657806312874688146102e8575b600080fd5b34801561027b57600080fd5b5061028f61028a366004612b65565b6107c9565b60405190151581526020015b60405180910390f35b3480156102b057600080fd5b506102b9610866565b60405161029b9190612bdf565b3480156102d257600080fd5b506102e66102e1366004612c07565b6108f8565b005b3480156102f457600080fd5b506102e6610303366004612c40565b610b22565b34801561031457600080fd5b50600a54610328906001600160a01b031681565b6040516001600160a01b03909116815260200161029b565b34801561034c57600080fd5b506102e6610b71565b34801561036157600080fd5b506008546103829068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161029b565b3480156103a757600080fd5b506102e66103b6366004612c59565b610b9d565b3480156103c757600080fd5b506102e66103d6366004612c85565b610e11565b3480156103e757600080fd5b50600b54610328906001600160a01b031681565b34801561040757600080fd5b506102e6610416366004612c85565b610ed2565b34801561042757600080fd5b506102e6610436366004612ce4565b610f78565b34801561044757600080fd5b50600554600160a01b900460ff1661028f565b34801561046657600080fd5b506102e6610475366004612ce4565b610f8d565b34801561048657600080fd5b506009546104a690600160601b90046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff909116815260200161029b565b3480156104cf57600080fd5b506103286104de366004612c40565b6111a6565b3480156104ef57600080fd5b506102e66104fe366004612c85565b61120b565b34801561050f57600080fd5b5061052361051e366004612c85565b6112b1565b60405190815260200161029b565b34801561053d57600080fd5b506102e661134b565b34801561055257600080fd5b50610523610561366004612c85565b61135d565b34801561057257600080fd5b50610586610581366004612c85565b611380565b6040805182516001600160d81b0316815260208084015161ffff9081169183019190915283830151169181019190915260609182015115159181019190915260800161029b565b3480156105d957600080fd5b506005546001600160a01b0316610328565b3480156105f757600080fd5b506102b9611489565b34801561060c57600080fd5b506102e661061b366004612d26565b611498565b34801561062c57600080fd5b506009546104a6906bffffffffffffffffffffffff1681565b34801561065157600080fd5b506102e6610660366004612c40565b611508565b6102e6610673366004612ce4565b611534565b34801561068457600080fd5b50610586610693366004612c40565b611814565b3480156106a457600080fd5b5060085461038290600160c01b900467ffffffffffffffff1681565b3480156106cc57600080fd5b506102e66106db366004612c40565b6118fe565b6105236106ee366004612d48565b6119a3565b3480156106ff57600080fd5b506102b961070e366004612c40565b611c2c565b34801561071f57600080fd5b506102e661072e366004612c40565b611d3d565b34801561073f57600080fd5b5060085461038290700100000000000000000000000000000000900467ffffffffffffffff1681565b34801561077457600080fd5b506102e6610783366004612c85565b611dd2565b34801561079457600080fd5b5061028f6107a3366004612c85565b611e5f565b3480156107b457600080fd5b506008546103829067ffffffffffffffff1681565b60006001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000148061082c57506001600160e01b031982167fc28b40ff00000000000000000000000000000000000000000000000000000000145b8061086057507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606001805461087590612d9d565b80601f01602080910402602001604051908101604052809291908181526020018280546108a190612d9d565b80156108ee5780601f106108c3576101008083540402835291602001916108ee565b820191906000526020600020905b8154815290600101906020018083116108d157829003601f168201915b5050505050905090565b610900611e9d565b600a5460009061091a9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03166109865760405162461bcd60e51b815260206004820152601860248201527f6d6967726174653a206e6f20746f6b656e20657869737473000000000000000060448201526064015b60405180910390fd5b600a546000906109a09084906001600160a01b0316611ef7565b600881901c600090815260208190526040902054909150600160ff83161b1615610a0c5760405162461bcd60e51b815260206004820152601560248201527f6d6967726174653a20746f6b656e206578697374730000000000000000000000604482015260640161097d565b600082815260076020526040808220838352908220815481546001600160d81b039091167fffffffffff00000000000000000000000000000000000000000000000000000082168117835583547fffffff000000000000000000000000000000000000000000000000000000000090921617600160d81b9182900461ffff90811690920217808355835461ffff60e81b198216600160e81b9182900490931602918217835583547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091166001600160f81b0390921691909117600160f81b9182900460ff16151590910217905583825255600a54610b12906001600160a01b03168483611f72565b50610b1c82612063565b50505050565b610b2a611e9d565b6008805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909216919091179055565b610b79611e9d565b600554600160a01b900460ff1615610b9557610b936120f6565b565b610b9361214b565b600b546001600160a01b0316610c1b5760405162461bcd60e51b815260206004820152603060248201527f6f6e6c794f6c646575734f726967696e733a20616464726573732063616e277460448201527f206265207a65726f206164647265737300000000000000000000000000000000606482015260840161097d565b600b546001600160a01b03163314610c755760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c794f6c646575734f726967696e733a20756e617574686f72697a656400604482015260640161097d565b610c7d61218e565b6009546bffffffffffffffffffffffff16610cda5760405162461bcd60e51b815260206004820152601b60248201527f726566756e643a2066696e616c207072696365206e6f74207365740000000000604482015260640161097d565b600a54600090610cf49084906001600160a01b0316611ef7565b6000818152600760205260409020805491925090600160f81b900460ff1615610d5f5760405162461bcd60e51b815260206004820152600f60248201527f726566756e643a20636c61696d65640000000000000000000000000000000000604482015260640161097d565b80546001600160d81b03168310610db85760405162461bcd60e51b815260206004820152601860248201527f726566756e643a20696e73756666696369656e74206269640000000000000000604482015260640161097d565b6040516001600160a01b0385169084156108fc029085906000818181858888f19350505050158015610dee573d6000803e3d6000fd5b5080546001600160f81b0316600160f81b17905550610e0d6001600655565b5050565b610e19611e9d565b6001600160a01b038116610e955760405162461bcd60e51b815260206004820152602760248201527f77697468647261773a20616464726573732063616e2774206265207a65726f2060448201527f6164647265737300000000000000000000000000000000000000000000000000606482015260840161097d565b60405130906001600160a01b03831690823180156108fc02916000818181858888f19350505050158015610ecd573d6000803e3d6000fd5b505050565b610eda611e9d565b6001600160a01b038116610f565760405162461bcd60e51b815260206004820152602560248201527f7365744973737565723a20616464726573732063616e2774207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161097d565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610f80611e9d565b600c610ecd828483612e3b565b610f9561218e565b600954600160601b90046bffffffffffffffffffffffff164211610ffb5760405162461bcd60e51b815260206004820152601a60248201527f726566756e643a2061756374696f6e206e6f7420636c6f736564000000000000604482015260640161097d565b6009546bffffffffffffffffffffffff166110585760405162461bcd60e51b815260206004820152601b60248201527f726566756e643a2066696e616c207072696365206e6f74207365740000000000604482015260640161097d565b600a546000906110749033906001600160a01b031685856121e7565b6000818152600760205260409020805491925090600160f81b900460ff16156110df5760405162461bcd60e51b815260206004820152600f60248201527f726566756e643a20636c61696d65640000000000000000000000000000000000604482015260640161097d565b60095481546bffffffffffffffffffffffff9091166001600160d81b039091161061114c5760405162461bcd60e51b815260206004820152601660248201527f726566756e643a206269646465722068617320776f6e00000000000000000000604482015260640161097d565b8054604051339182916001600160d81b0390911680156108fc02916000818181858888f19350505050158015611186573d6000803e3d6000fd5b505080546001600160f81b0316600160f81b17905550610e0d6001600655565b6000818152600360205260408120546001600160a01b0316806108605760405162461bcd60e51b815260206004820152601c60248201527f6f776e65724f663a20746f6b656e20646f65736e277420657869737400000000604482015260640161097d565b611213611e9d565b6001600160a01b03811661128f5760405162461bcd60e51b815260206004820152602c60248201527f7365744f6c646575734f726967696e733a20616464726573732063616e27742060448201527f7a65726f20616464726573730000000000000000000000000000000000000000606482015260840161097d565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821661132f5760405162461bcd60e51b815260206004820152602c60248201527f62616c616e63654f663a2061646472657373207a65726f206973206e6f74206160448201527f2076616c6964206f776e65720000000000000000000000000000000000000000606482015260840161097d565b506001600160a01b031660009081526004602052604090205490565b611353611e9d565b610b93600061229b565b600a5460009081906113799084906001600160a01b0316611ef7565b9392505050565b604080516080810182526000808252602082018190529181018290526060810191909152600a546000906113be9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03166114255760405162461bcd60e51b815260206004820152601a60248201527f73746174733a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b600090815260076020908152604091829020825160808101845290546001600160d81b038116825261ffff600160d81b8204811693830193909352600160e81b81049092169281019290925260ff600160f81b909104161515606082015292915050565b60606002805461087590612d9d565b6114a0611e9d565b6008805477ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b67ffffffffffffffff94851602179055600980547fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff1691909216600160601b02179055565b611510611e9d565b6008805467ffffffffffffffff191667ffffffffffffffff92909216919091179055565b600854600160c01b900467ffffffffffffffff164210156115975760405162461bcd60e51b815260206004820152601f60248201527f7768656e4c6976653a2061756374696f6e206861736e2774206f70656e656400604482015260640161097d565b600954600160601b90046bffffffffffffffffffffffff164211156115fe5760405162461bcd60e51b815260206004820152601c60248201527f7768656e4c6976653a2061756374696f6e2068617320636c6f73656400000000604482015260640161097d565b6116066122ed565b60085468010000000000000000900467ffffffffffffffff1634101561166e5760405162461bcd60e51b815260206004820152601960248201527f72616973653a20696e73756666696369656e742066756e647300000000000000604482015260640161097d565b600a5460009061168b9033906001600160a01b0316348686612347565b60085490915068010000000000000000900467ffffffffffffffff163410156116f65760405162461bcd60e51b815260206004820152601960248201527f72616973653a20696e73756666696369656e742066756e647300000000000000604482015260640161097d565b6000818152600360205260409020546001600160a01b031661175a5760405162461bcd60e51b815260206004820152601a60248201527f72616973653a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b600081815260076020526040902080548190601b9061178390600160d81b900461ffff16612f12565b825461ffff9182166101009390930a92830291909202199091161790558054349082906000906117bd9084906001600160d81b0316612f33565b82546101009290920a6001600160d81b0381810219909316918316021790915582546040519116915083907ff1b7598a82d48d884c693d3ac1b536a3bbffef8f48a0abb715928bfcdcd9f85a90600090a350505050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600360205260409020546001600160a01b031661189c5760405162461bcd60e51b815260206004820152601a60248201527f73746174733a20746f6b656e20646f65736e2774206578697374000000000000604482015260640161097d565b50600090815260076020908152604091829020825160808101845290546001600160d81b038116825261ffff600160d81b8204811693830193909352600160e81b81049092169281019290925260ff600160f81b909104161515606082015290565b611906611e9d565b8060000361197c5760405162461bcd60e51b815260206004820152602860248201527f73657446696e616c50726963653a2066696e616c2070726963652063616e277460448201527f206265207a65726f000000000000000000000000000000000000000000000000606482015260840161097d565b600980546bffffffffffffffffffffffff191667ffffffffffffffff909216919091179055565b600854600090600160c01b900467ffffffffffffffff16421015611a095760405162461bcd60e51b815260206004820152601f60248201527f7768656e4c6976653a2061756374696f6e206861736e2774206f70656e656400604482015260640161097d565b600954600160601b90046bffffffffffffffffffffffff16421115611a705760405162461bcd60e51b815260206004820152601c60248201527f7768656e4c6976653a2061756374696f6e2068617320636c6f73656400000000604482015260640161097d565b611a786122ed565b600a546001600160a01b03858116911614611ad55760405162461bcd60e51b815260206004820152601960248201527f74616b653a2066726f6d206d757374206265204f6c6465757300000000000000604482015260640161097d565b60085467ffffffffffffffff16341015611b315760405162461bcd60e51b815260206004820152601860248201527f74616b653a20696e73756666696369656e742066756e64730000000000000000604482015260640161097d565b6000611b3e85858561240b565b60008181526007602052604090208054600160d81b7fffffff0000000000000000000000000000000000000000000000000000000000909116346001600160d81b031617178155600880549293509091601090611bb890700100000000000000000000000000000000900467ffffffffffffffff16612f5a565b825467ffffffffffffffff8083166101009490940a9384029302191691909117909155815461ffff909116600160e81b0261ffff60e81b19909116178155604051829033907fd69eabfc802f58b2a23d16767d1fcab6551f30a60ab43a24f147d3823d7d036890600090a350949350505050565b60606000600c8054611c3d90612d9d565b905011611c8c5760405162461bcd60e51b815260206004820152601b60248201527f746f6b656e5552493a20626173655552492069736e2774207365740000000000604482015260640161097d565b6000828152600360205260409020546001600160a01b0316611cf05760405162461bcd60e51b815260206004820152601d60248201527f746f6b656e5552493a20746f6b656e20646f65736e2774206578697374000000604482015260640161097d565b600082815260076020526040902054600c90611d1690600160e81b900461ffff16612513565b604051602001611d27929190612f77565b6040516020818303038152906040529050919050565b611d46816111a6565b6001600160a01b0316336001600160a01b031614611da65760405162461bcd60e51b815260206004820152601d60248201527f756e65717569703a2073656e646572206d757374206265206f776e6572000000604482015260640161097d565b600881901c60009081526020819052604090208054600160ff84161b19169055611dcf81612063565b50565b611dda611e9d565b6001600160a01b038116611e565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161097d565b611dcf8161229b565b600a546000908190611e7b9084906001600160a01b0316611ef7565b6000818152600360205260409020549091506001600160a01b03161515611379565b6005546001600160a01b03163314610b935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161097d565b6000807f93c86b6f16d05688c27172668c232ca3b501d3313ded3f32c0f132d7a22e0b1b8484604051602001611f49939291909283526001600160a01b03918216602084015216604082015260600190565b604051602081830303815290604052805190602001209050611f6a816125b3565b949350505050565b6000818152600360205260408120546001600160a01b031615611fd75760405162461bcd60e51b815260206004820152601560248201527f5f6d696e743a20746f6b656e4964206578697374730000000000000000000000604482015260640161097d565b6001600160a01b0383166000908152600460205260408120805460019290612000908490612ffe565b909155505060008281526003602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45092915050565b600061206e826111a6565b6001600160a01b0381166000908152600460205260408120805492935060019290919061209c908490613011565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6120fe61261c565b6005805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6121536122ed565b6005805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861212e3390565b6002600654036121e05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161097d565b6002600655565b6000806121f48686611ef7565b9050612237858286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267592505050565b6122925760405162461bcd60e51b815260206004820152602660248201527f5f73616665436865636b41677265656d656e743a20696e76616c6964207369676044820152656e617475726560d01b606482015260840161097d565b95945050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600554600160a01b900460ff1615610b935760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161097d565b6000806123558787876127e4565b9050612398868286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267592505050565b6123f35760405162461bcd60e51b815260206004820152602660248201527f5f73616665436865636b41677265656d656e743a20696e76616c6964207369676044820152656e617475726560d01b606482015260840161097d565b60006123ff8888611ef7565b98975050505050505050565b60006001600160a01b03841633036124655760405162461bcd60e51b815260206004820152601b60248201527f5f74616b653a2063616e27742074616b652066726f6d2073656c660000000000604482015260640161097d565b60006124743386348787612347565b600881901c600090815260208190526040902054909150600160ff83161b16156124e05760405162461bcd60e51b815260206004820152601660248201527f5f74616b653a20696420616c7265616479207573656400000000000000000000604482015260640161097d565b6124eb853383611f72565b50600881901c60009081526020819052604090208054600160ff84161b179055949350505050565b6060600061252083612853565b600101905060008167ffffffffffffffff81111561254057612540612dd7565b6040519080825280601f01601f19166020018201604052801561256a576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461257457509392505050565b60006108606125c0612935565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600554600160a01b900460ff16610b935760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161097d565b60008060006126848585612a5c565b9092509050600081600481111561269d5761269d613024565b1480156126bb5750856001600160a01b0316826001600160a01b0316145b156126cb57600192505050611379565b600080876001600160a01b0316631626ba7e60e01b88886040516024016126f392919061303a565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516127469190613053565b600060405180830381855afa9150503d8060008114612781576040519150601f19603f3d011682016040523d82523d6000602084013e612786565b606091505b5091509150818015612799575080516020145b80156123ff575080517f1626ba7e00000000000000000000000000000000000000000000000000000000906127d7908301602090810190840161306f565b1498975050505050505050565b604080517fd507be88b71f14a65988cdef4dafe31a47a7d25685cea1eeebd81f3425cb41af6020808301919091526001600160a01b03868116838501528516606083015260808083018590528351808403909101815260a09092019092528051910120600090612292816125b3565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061289c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106128c8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106128e657662386f26fc10000830492506010015b6305f5e10083106128fe576305f5e100830492506008015b612710831061291257612710830492506004015b60648310612924576064830492506002015b600a83106108605760010192915050565b6000306001600160a01b037f0000000000000000000000009bbfbc602c2b6b2de55b9b3b9740830f3da93a671614801561298e57507f000000000000000000000000000000000000000000000000000000000000000146145b156129b857507fd9b494d015b45cc907c1c9b01ad9b475d7b08cc72f85733d5ccaf7b08a5fa29890565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527faf3af82b2ae6d55594bb856a065b1e96a36856b37953102cea83f52b00dcc374828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612a925760208301516040840151606085015160001a612a8687828585612aa1565b94509450505050612a9a565b506000905060025b9250929050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612ad85750600090506003612b5c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612b2c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612b5557600060019250925050612b5c565b9150600090505b94509492505050565b600060208284031215612b7757600080fd5b81356001600160e01b03198116811461137957600080fd5b60005b83811015612baa578181015183820152602001612b92565b50506000910152565b60008151808452612bcb816020860160208601612b8f565b601f01601f19169290920160200192915050565b6020815260006113796020830184612bb3565b6001600160a01b0381168114611dcf57600080fd5b60008060408385031215612c1a57600080fd5b8235612c2581612bf2565b91506020830135612c3581612bf2565b809150509250929050565b600060208284031215612c5257600080fd5b5035919050565b60008060408385031215612c6c57600080fd5b8235612c7781612bf2565b946020939093013593505050565b600060208284031215612c9757600080fd5b813561137981612bf2565b60008083601f840112612cb457600080fd5b50813567ffffffffffffffff811115612ccc57600080fd5b602083019150836020828501011115612a9a57600080fd5b60008060208385031215612cf757600080fd5b823567ffffffffffffffff811115612d0e57600080fd5b612d1a85828601612ca2565b90969095509350505050565b60008060408385031215612d3957600080fd5b50508035926020909101359150565b600080600060408486031215612d5d57600080fd5b8335612d6881612bf2565b9250602084013567ffffffffffffffff811115612d8457600080fd5b612d9086828701612ca2565b9497909650939450505050565b600181811c90821680612db157607f821691505b602082108103612dd157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ecd57600081815260208120601f850160051c81016020861015612e145750805b601f850160051c820191505b81811015612e3357828155600101612e20565b505050505050565b67ffffffffffffffff831115612e5357612e53612dd7565b612e6783612e618354612d9d565b83612ded565b6000601f841160018114612e9b5760008515612e835750838201355b600019600387901b1c1916600186901b178355612ef5565b600083815260209020601f19861690835b82811015612ecc5786850135825560209485019460019092019101612eac565b5086821015612ee95760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052601160045260246000fd5b600061ffff808316818103612f2957612f29612efc565b6001019392505050565b6001600160d81b03818116838216019080821115612f5357612f53612efc565b5092915050565b600067ffffffffffffffff808316818103612f2957612f29612efc565b6000808454612f8581612d9d565b60018281168015612f9d5760018114612fb257612fe1565b60ff1984168752821515830287019450612fe1565b8860005260208060002060005b85811015612fd85781548a820152908401908201612fbf565b50505082870194505b505050508351612ff5818360208801612b8f565b01949350505050565b8082018082111561086057610860612efc565b8181038181111561086057610860612efc565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611f6a6040830184612bb3565b60008251613065818460208701612b8f565b9190910192915050565b60006020828403121561308157600080fd5b505191905056fea2646970667358221220e8f859a43acb629a4e3d0895d8d337c68eb12e118741a1d831a5c0a4aa240ab564736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000871c32d6f988ac375679b5e2d8c205bf281ca210000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000639b286000000000000000000000000000000000000000000000000000000000639dcb60000000000000000000000000000000000000000000000000000000000000000f4f6c646575733a204d797468696373000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074d5954484943530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): Oldeus: Mythics
Arg [1] : symbol_ (string): MYTHICS
Arg [2] : version_ (string): 1
Arg [3] : issuer_ (address): 0x0871c32d6f988aC375679b5e2d8C205bf281Ca21
Arg [4] : entryPrice_ (uint64): 5000000000000000
Arg [5] : minBid_ (uint64): 100000000000000
Arg [6] : openTime_ (uint64): 1671112800
Arg [7] : closeTime_ (uint96): 1671285600
-----Encoded View---------------
14 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [3] : 0000000000000000000000000871c32d6f988ac375679b5e2d8c205bf281ca21
Arg [4] : 0000000000000000000000000000000000000000000000000011c37937e08000
Arg [5] : 00000000000000000000000000000000000000000000000000005af3107a4000
Arg [6] : 00000000000000000000000000000000000000000000000000000000639b2860
Arg [7] : 00000000000000000000000000000000000000000000000000000000639dcb60
Arg [8] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [9] : 4f6c646575733a204d7974686963730000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [11] : 4d59544849435300000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [13] : 3100000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.