Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 306 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Cancel | 19340092 | 726 days ago | IN | 0 ETH | 0.00296771 | ||||
| Fulfill Order | 19301869 | 731 days ago | IN | 0.003 ETH | 0.00286384 | ||||
| Fulfill Order | 19301377 | 731 days ago | IN | 0.05555 ETH | 0.00293564 | ||||
| Fulfill Order | 19290040 | 733 days ago | IN | 0.005777 ETH | 0.006185 | ||||
| Cancel | 19280336 | 734 days ago | IN | 0 ETH | 0.00207469 | ||||
| Cancel | 19276734 | 735 days ago | IN | 0 ETH | 0.00375195 | ||||
| Cancel | 19273959 | 735 days ago | IN | 0 ETH | 0.00218297 | ||||
| Cancel | 19273957 | 735 days ago | IN | 0 ETH | 0.00215799 | ||||
| Cancel | 19273957 | 735 days ago | IN | 0 ETH | 0.00215841 | ||||
| Cancel | 19273956 | 735 days ago | IN | 0 ETH | 0.00223624 | ||||
| Cancel | 19273956 | 735 days ago | IN | 0 ETH | 0.00223624 | ||||
| Cancel | 19273955 | 735 days ago | IN | 0 ETH | 0.00219304 | ||||
| Cancel | 19273952 | 735 days ago | IN | 0 ETH | 0.00194725 | ||||
| Cancel | 19273944 | 735 days ago | IN | 0 ETH | 0.00206698 | ||||
| Cancel | 19273925 | 735 days ago | IN | 0 ETH | 0.00216929 | ||||
| Cancel | 19273919 | 735 days ago | IN | 0 ETH | 0.00224986 | ||||
| Cancel | 19273917 | 735 days ago | IN | 0 ETH | 0.00242901 | ||||
| Cancel | 19273916 | 735 days ago | IN | 0 ETH | 0.00250897 | ||||
| Cancel | 19273914 | 735 days ago | IN | 0 ETH | 0.00165128 | ||||
| Cancel | 19273914 | 735 days ago | IN | 0 ETH | 0.00244526 | ||||
| Fulfill Order | 19270453 | 736 days ago | IN | 0.005 ETH | 0.007343 | ||||
| Fulfill Order | 19270326 | 736 days ago | IN | 0.009333 ETH | 0.00456577 | ||||
| Fulfill Order | 19270323 | 736 days ago | IN | 0.006666 ETH | 0.00492343 | ||||
| Fulfill Order | 19270319 | 736 days ago | IN | 0.006666 ETH | 0.00434425 | ||||
| Fulfill Order | 19270315 | 736 days ago | IN | 0.005777 ETH | 0.00448727 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 19301869 | 731 days ago | 0.00294 ETH | ||||
| Transfer | 19301869 | 731 days ago | 0.00006 ETH | ||||
| Transfer | 19301377 | 731 days ago | 0.054439 ETH | ||||
| Transfer | 19301377 | 731 days ago | 0.001111 ETH | ||||
| Transfer | 19290040 | 733 days ago | 0.00566146 ETH | ||||
| Transfer | 19290040 | 733 days ago | 0.00011554 ETH | ||||
| Transfer | 19270453 | 736 days ago | 0.0049 ETH | ||||
| Transfer | 19270453 | 736 days ago | 0.0001 ETH | ||||
| Transfer | 19270326 | 736 days ago | 0.00914634 ETH | ||||
| Transfer | 19270326 | 736 days ago | 0.00018666 ETH | ||||
| Transfer | 19270323 | 736 days ago | 0.00653268 ETH | ||||
| Transfer | 19270323 | 736 days ago | 0.00013332 ETH | ||||
| Transfer | 19270319 | 736 days ago | 0.00653268 ETH | ||||
| Transfer | 19270319 | 736 days ago | 0.00013332 ETH | ||||
| Transfer | 19270315 | 736 days ago | 0.00566146 ETH | ||||
| Transfer | 19270315 | 736 days ago | 0.00011554 ETH | ||||
| Transfer | 19270280 | 736 days ago | 0.0049 ETH | ||||
| Transfer | 19270280 | 736 days ago | 0.0001 ETH | ||||
| Transfer | 19270277 | 736 days ago | 0.00653268 ETH | ||||
| Transfer | 19270277 | 736 days ago | 0.00013332 ETH | ||||
| Transfer | 19270276 | 736 days ago | 0.0049 ETH | ||||
| Transfer | 19270276 | 736 days ago | 0.0001 ETH | ||||
| Transfer | 19270273 | 736 days ago | 0.0049 ETH | ||||
| Transfer | 19270273 | 736 days ago | 0.0001 ETH | ||||
| Transfer | 19270251 | 736 days ago | 0.0049 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
InscriptionMarket_v1
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 20000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "contracts/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "contracts/lib/Struct.sol";
import "contracts/lib/Enum.sol";
contract InscriptionMarket_v1 is
Ownable,
EIP712,
OrderParameterBase,
ReentrancyGuard
{
using SafeERC20 for IERC20;
struct OrderStatus {
bool isValidated;
bool isCancelled;
}
address public feeReceiver;
// 100 / 10000
uint256 public feeRate;
// offerer => counter
mapping(address => uint256) public counters;
// order hash => status
mapping(bytes32 => OrderStatus) public orderStatus;
event OrderCancelled(address indexed canceller, uint256 indexed salt);
event Sold(
bytes32 indexed orderHash,
uint256 indexed salt,
uint256 indexed time,
address from,
address to
);
event SetFeeReceiver(address feeReceiver);
event SetFeeRate(uint256 feeRate);
error OrderTypeError(ItemType offerType, ItemType considerationType);
error InvalidCanceller();
constructor(address owner) Ownable(owner) EIP712("insevm.trade", "v1.0.0") {}
function _verify(
bytes32 orderHash,
bytes calldata signature
) internal view returns (address) {
bytes32 digest = _hashTypedDataV4(orderHash);
address signer = ECDSA.recover(digest, signature);
return (signer);
}
function fulfillOrder(
OrderParameters calldata order
) external payable nonReentrant {
address from;
address to;
// calculate order hash
bytes32 orderHash = _deriveOrderHash(order, counters[order.offerer]);
require(
block.timestamp >= order.startTime &&
block.timestamp <= order.endTime,
"Time error"
);
OrderStatus storage _orderStatus = orderStatus[orderHash];
require(
!_orderStatus.isCancelled && !_orderStatus.isValidated,
"Status error"
);
// verify signature
require(
_verify(orderHash, order.signature) == order.offerer,
"Sign error"
);
require(
order.consideration.length == 1 && order.offer.length == 1,
"Param length error"
);
// transfer fee
uint256 _serviceFee;
ConsiderationItem memory consideration = order.consideration[0];
OfferItem memory offerItem = order.offer[0];
if (offerItem.itemType == ItemType.NATIVE) {
// ETH can't approve, offer's type cann't be NATIVE
revert OrderTypeError(offerItem.itemType, consideration.itemType);
}
// Consideration
if (
consideration.itemType == ItemType.NATIVE ||
consideration.itemType == ItemType.ERC20
) {
// check offer type, NATIVE/ERC20 <-> ERC721/ERC1155
if (
offerItem.itemType != ItemType.ERC721 &&
offerItem.itemType != ItemType.ERC1155
) {
revert OrderTypeError(
offerItem.itemType,
consideration.itemType
);
}
_serviceFee = consideration.startAmount * feeRate / 10000;
if (consideration.itemType == ItemType.NATIVE) {
require(
msg.value >= consideration.startAmount,
"TX value error"
);
payable(feeReceiver).transfer(_serviceFee);
unchecked {
payable(consideration.recipient).transfer(
consideration.startAmount - _serviceFee
);
}
} else if (consideration.itemType == ItemType.ERC20) {
IERC20(consideration.token).safeTransferFrom(
msg.sender,
feeReceiver,
_serviceFee
);
IERC20(consideration.token).safeTransferFrom(
msg.sender,
consideration.recipient,
consideration.startAmount - _serviceFee
);
}
} else if (
consideration.itemType == ItemType.ERC721 ||
consideration.itemType == ItemType.ERC1155
) {
if(offerItem.itemType != ItemType.ERC20){
// other offer type is not support
revert OrderTypeError(offerItem.itemType, consideration.itemType);
}
if (consideration.itemType == ItemType.ERC721) {
IERC721(consideration.token).safeTransferFrom(
msg.sender,
consideration.recipient,
consideration.identifierOrCriteria
);
} else if (consideration.itemType == ItemType.ERC1155) {
IERC1155(consideration.token).safeTransferFrom(
msg.sender,
consideration.recipient,
consideration.identifierOrCriteria,
consideration.startAmount,
"0x0"
);
}
from = msg.sender;
to = consideration.recipient;
} else {
// other consideration type is not support
revert OrderTypeError(offerItem.itemType, consideration.itemType);
}
// Offer
if (offerItem.itemType == ItemType.ERC20) {
// check consideration type
if (
consideration.itemType != ItemType.ERC721 &&
consideration.itemType != ItemType.ERC1155
) {
revert OrderTypeError(
offerItem.itemType,
consideration.itemType
);
}
_serviceFee = offerItem.startAmount * feeRate / 10000;
IERC20(offerItem.token).safeTransferFrom(
order.offerer,
feeReceiver,
_serviceFee
);
IERC20(offerItem.token).safeTransferFrom(
order.offerer,
msg.sender,
offerItem.startAmount - _serviceFee
);
} else if (
offerItem.itemType == ItemType.ERC721 ||
offerItem.itemType == ItemType.ERC1155
) {
if (offerItem.itemType == ItemType.ERC721) {
IERC721(offerItem.token).safeTransferFrom(
order.offerer,
msg.sender,
offerItem.identifierOrCriteria
);
} else if (offerItem.itemType == ItemType.ERC1155) {
IERC1155(offerItem.token).safeTransferFrom(
order.offerer,
msg.sender,
offerItem.identifierOrCriteria,
offerItem.startAmount,
"0x0"
);
}
from = order.offerer;
to = msg.sender;
} else {
// other offer type is not support
revert OrderTypeError(offerItem.itemType, consideration.itemType);
}
_orderStatus.isValidated = true;
emit Sold(orderHash, order.salt, block.timestamp, from, to);
}
function cancel(OrderComponents[] calldata orders) external nonReentrant {
OrderStatus storage _orderStatus;
address offerer;
for (uint256 i; i < orders.length; ) {
// Retrieve the order.
OrderComponents calldata order = orders[i];
offerer = order.offerer;
// Ensure caller is either offerer or zone of the order.
if (msg.sender != offerer) {
revert InvalidCanceller();
}
// Derive order hash using the order parameters and the counter.
bytes32 orderHash = _deriveOrderHash(
OrderParameters(
offerer,
order.offer,
order.consideration,
order.startTime,
order.endTime,
order.salt,
order.signature
),
order.counter
);
// Retrieve the order status using the derived order hash.
_orderStatus = orderStatus[orderHash];
// Update the order status as not valid and cancelled.
_orderStatus.isValidated = false;
_orderStatus.isCancelled = true;
// Emit an event signifying that the order has been cancelled.
emit OrderCancelled(offerer, order.salt);
// Increment counter inside body of loop for gas efficiency.
++i;
}
}
function setFee(
uint256 fee
) public onlyOwner {
require(
feeReceiver != address(0), "fee receiver is empty"
);
require(
fee < 10000, "exceed max fee"
);
feeRate = fee;
emit SetFeeRate(fee);
}
function setFeeReceiver(
address receiver
) public onlyOwner {
feeReceiver = receiver;
emit SetFeeReceiver(feeReceiver);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.20;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the value of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @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
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
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, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
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]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
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.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// 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, s);
}
// 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, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.20;
import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
* encoding is very generic and therefore its 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 order to
* produce the hash of their typed data 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].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* @custom:oz-upgrades-unsafe-allow state-variable-immutable
*/
abstract contract EIP712 is IERC5267 {
using ShortStrings for *;
bytes32 private constant TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
// 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 _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;
bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;
ShortString private immutable _name;
ShortString private immutable _version;
string private _nameFallback;
string private _versionFallback;
/**
* @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) {
_name = name.toShortStringWithFallback(_nameFallback);
_version = version.toShortStringWithFallback(_versionFallback);
_hashedName = keccak256(bytes(name));
_hashedVersion = keccak256(bytes(version));
_cachedChainId = block.chainid;
_cachedDomainSeparator = _buildDomainSeparator();
_cachedThis = address(this);
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
return _cachedDomainSeparator;
} else {
return _buildDomainSeparator();
}
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, 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 MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {IERC-5267}.
*/
function eip712Domain()
public
view
virtual
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: By default this function reads _name which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Name() internal view returns (string memory) {
return _name.toStringWithFallback(_nameFallback);
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: By default this function reads _version which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Version() internal view returns (string memory) {
return _version.toStringWithFallback(_versionFallback);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.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);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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 towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (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 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 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.
uint256 twos = denominator & (0 - denominator);
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 (unsignedRoundsUp(rounding) && 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
* towards zero.
*
* 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @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;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
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
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// 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;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @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), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @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) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
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);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external returns(bool);
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external returns(bool);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
enum ItemType {
// 0: ETH on mainnet, MATIC on polygon, etc.
NATIVE,
// 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)
ERC20,
// 2: ERC721 items
ERC721,
// 3: ERC1155 items
ERC1155
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "contracts/lib/Enum.sol";
struct OfferItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
}
struct ConsiderationItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
address payable recipient;
}
struct OrderParameters {
address offerer;
OfferItem[] offer;
ConsiderationItem[] consideration;
uint256 startTime;
uint256 endTime;
uint256 salt;
bytes signature;
}
struct OrderComponents {
address offerer;
OfferItem[] offer;
ConsiderationItem[] consideration;
uint256 startTime;
uint256 endTime;
uint256 salt;
bytes signature;
uint256 counter;
}
contract OrderParameterBase {
bytes internal constant _OFFER_ITEM = abi.encodePacked(
"OfferItem(",
"uint8 itemType,",
"address token,",
"uint256 identifierOrCriteria,",
"uint256 startAmount,",
"uint256 endAmount",
")"
);
bytes32 internal constant _OFFER_ITEM_TYPEHASH =
keccak256(
_OFFER_ITEM
);
bytes internal constant _CONSIDERATION_ITEM = abi.encodePacked(
"ConsiderationItem(",
"uint8 itemType,",
"address token,",
"uint256 identifierOrCriteria,",
"uint256 startAmount,",
"uint256 endAmount,",
"address recipient",
")"
);
bytes32 internal constant _CONSIDERATION_ITEM_TYPEHASH =
keccak256(
_CONSIDERATION_ITEM
);
bytes32 internal constant _ORDER_TYPEHASH =
keccak256(
abi.encodePacked(
"OrderComponents(",
"address offerer,",
"OfferItem[] offer,",
"ConsiderationItem[] consideration,",
"uint256 startTime,",
"uint256 endTime,",
"uint256 salt,",
"uint256 counter",
")",
_CONSIDERATION_ITEM,
_OFFER_ITEM
)
);
bytes32 internal constant _ORDER_TYPEHASH_NOT_ARRAY =
keccak256(
abi.encodePacked(
"OrderComponents(",
"address offerer,",
"OfferItem offer,",
"ConsiderationItem consideration,",
"uint256 startTime,",
"uint256 endTime,",
"uint256 salt,",
"uint256 counter",
")",
_CONSIDERATION_ITEM,
_OFFER_ITEM
)
);
function _deriveOrderHash(
OrderParameters memory orderParameters,
uint256 counter
) internal pure returns (bytes32 orderHash) {
// Designate new memory regions for offer and consideration item hashes.
bytes32[] memory offerHashes = new bytes32[](
orderParameters.offer.length
);
bytes32[] memory considerationHashes = new bytes32[](
orderParameters.consideration.length
);
// Iterate over each offer on the order.
for (uint256 i = 0; i < orderParameters.offer.length; ++i) {
// Hash the offer and place the result into memory.
offerHashes[i] = _hashOfferItem(orderParameters.offer[i]);
}
// Iterate over each consideration on the order.
for (uint256 i = 0; i < orderParameters.consideration.length; ++i) {
// Hash the consideration and place the result into memory.
considerationHashes[i] = _hashConsiderationItem(
orderParameters.consideration[i]
);
}
// Derive and return the order hash as specified by EIP-712.
return
keccak256(
abi.encode(
_ORDER_TYPEHASH,
orderParameters.offerer,
keccak256(abi.encodePacked(offerHashes)),
keccak256(abi.encodePacked(considerationHashes)),
orderParameters.startTime,
orderParameters.endTime,
orderParameters.salt,
counter
)
);
}
function _deriveOrderHash_NotArray(
OrderParameters memory orderParameters,
uint256 counter
) internal pure returns (bytes32 orderHash) {
bytes32 offerHash = _hashOfferItem(orderParameters.offer[0]);
bytes32 considerationHash = _hashConsiderationItem(
orderParameters.consideration[0]
);
// Derive and return the order hash as specified by EIP-712.
return
keccak256(
abi.encode(
_ORDER_TYPEHASH_NOT_ARRAY,
orderParameters.offerer,
offerHash,
considerationHash,
orderParameters.startTime,
orderParameters.endTime,
orderParameters.salt,
counter
)
);
}
function _hashOfferItem(
OfferItem memory offerItem
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
_OFFER_ITEM_TYPEHASH,
offerItem.itemType,
offerItem.token,
offerItem.identifierOrCriteria,
offerItem.startAmount,
offerItem.endAmount
)
);
}
function _hashConsiderationItem(ConsiderationItem memory considerationItem)
internal
pure
returns (bytes32)
{
return
keccak256(
abi.encode(
_CONSIDERATION_ITEM_TYPEHASH,
considerationItem.itemType,
considerationItem.token,
considerationItem.identifierOrCriteria,
considerationItem.startAmount,
considerationItem.endAmount,
considerationItem.recipient
)
);
}
}{
"optimizer": {
"enabled": true,
"runs": 20000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidCanceller","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"enum ItemType","name":"offerType","type":"uint8"},{"internalType":"enum ItemType","name":"considerationType","type":"uint8"}],"name":"OrderTypeError","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"canceller","type":"address"},{"indexed":true,"internalType":"uint256","name":"salt","type":"uint256"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feeRate","type":"uint256"}],"name":"SetFeeRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeReceiver","type":"address"}],"name":"SetFeeReceiver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"salt","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Sold","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"counter","type":"uint256"}],"internalType":"struct OrderComponents[]","name":"orders","type":"tuple[]"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"counters","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct OrderParameters","name":"order","type":"tuple"}],"name":"fulfillOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orderStatus","outputs":[{"internalType":"bool","name":"isValidated","type":"bool"},{"internalType":"bool","name":"isCancelled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101606040523480156200001257600080fd5b506040516200376338038062003763833981016040819052620000359162000240565b604080518082018252600c81526b696e7365766d2e747261646560a01b60208083019190915282518084019093526006835265076312e302e360d41b9083015290826001600160a01b038116620000a757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000b28162000174565b50620000c0826001620001c4565b61012052620000d1816002620001c4565b61014052815160208084019190912060e052815190820120610100524660a0526200015f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05250600160035562000458565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602083511015620001e457620001dc83620001fd565b9050620001f7565b81620001f1848262000317565b5060ff90505b92915050565b600080829050601f815111156200022b578260405163305a27a960e01b81526004016200009e9190620003e3565b8051620002388262000433565b179392505050565b6000602082840312156200025357600080fd5b81516001600160a01b03811681146200026b57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200029d57607f821691505b602082108103620002be57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200031257600081815260208120601f850160051c81016020861015620002ed5750805b601f850160051c820191505b818110156200030e57828155600101620002f9565b5050505b505050565b81516001600160401b0381111562000333576200033362000272565b6200034b8162000344845462000288565b84620002c4565b602080601f8311600181146200038357600084156200036a5750858301515b600019600386901b1c1916600185901b1785556200030e565b600085815260208120601f198616915b82811015620003b45788860151825594840194600190910190840162000393565b5085821015620003d35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b818110156200041257858101830151858201604001528201620003f4565b506000604082860101526040601f19601f8301168501019250505092915050565b80516020808301519190811015620002be5760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516132b0620004b36000396000611ae301526000611ab10152600061209f0152600061207701526000611fd201526000611ffc0152600061202601526132b06000f3fe6080604052600436106100c75760003560e01c8063978bbdb911610074578063be65ab8c1161004e578063be65ab8c14610250578063efdcd9741461027d578063f2fde38b1461029d57600080fd5b8063978bbdb9146101df578063b0e7fbae14610203578063b3f006741461022357600080fd5b8063715018a6116100a5578063715018a61461015657806384b0196e1461016b5780638da5cb5b1461019357600080fd5b80632dff692d146100cc578063679f431c1461012157806369fe0e2d14610136575b600080fd5b3480156100d857600080fd5b506101056100e7366004612553565b60076020526000908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b61013461012f36600461256c565b6102bd565b005b34801561014257600080fd5b50610134610151366004612553565b610e7c565b34801561016257600080fd5b50610134610faa565b34801561017757600080fd5b50610180610fbe565b6040516101189796959493929190612615565b34801561019f57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b3480156101eb57600080fd5b506101f560055481565b604051908152602001610118565b34801561020f57600080fd5b5061013461021e3660046126d4565b611020565b34801561022f57600080fd5b506004546101ba9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561025c57600080fd5b506101f561026b36600461277b565b60066020526000908152604090205481565b34801561028957600080fd5b5061013461029836600461277b565b6112c4565b3480156102a957600080fd5b506101346102b836600461277b565b61133f565b6102c56113a0565b600080806103266102d585612aec565b600660006102e6602089018961277b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113e3565b905083606001354210158015610340575083608001354211155b6103ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f54696d65206572726f720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008181526007602052604090208054610100900460ff161580156103d25750805460ff16155b610438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f537461747573206572726f72000000000000000000000000000000000000000060448201526064016103a2565b610445602086018661277b565b73ffffffffffffffffffffffffffffffffffffffff166104718361046c60c0890189612bad565b6118eb565b73ffffffffffffffffffffffffffffffffffffffff16146104ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5369676e206572726f720000000000000000000000000000000000000000000060448201526064016103a2565b6104fb6040860186612c19565b9050600114801561051a57506105146020860186612c80565b90506001145b610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f506172616d206c656e677468206572726f72000000000000000000000000000060448201526064016103a2565b6000806105906040880188612c19565b60008181106105a1576105a1612ce7565b905060c002018036038101906105b79190612d16565b905060006105c86020890189612c80565b60008181106105d9576105d9612ce7565b905060a002018036038101906105ef9190612d32565b905060008151600381111561060657610606612d4e565b0361064357805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b60008251600381111561065857610658612d4e565b1480610676575060018251600381111561067457610674612d4e565b145b156108be5760028151600381111561069057610690612d4e565b141580156106b157506003815160038111156106ae576106ae612d4e565b14155b156106ee57805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b61271060055483606001516107039190612e02565b61070d9190612e19565b925060008251600381111561072457610724612d4e565b03610835578160600151341015610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f54582076616c7565206572726f7200000000000000000000000000000000000060448201526064016103a2565b60045460405173ffffffffffffffffffffffffffffffffffffffff9091169084156108fc029085906000818181858888f193505050501580156107de573d6000803e3d6000fd5b508160a0015173ffffffffffffffffffffffffffffffffffffffff166108fc848460600151039081150290604051600060405180830381858888f1935050505015801561082f573d6000803e3d6000fd5b50610ae8565b60018251600381111561084a5761084a612d4e565b036108b957600454602083015161087d9173ffffffffffffffffffffffffffffffffffffffff9182169133911686611947565b6108b9338360a001518585606001516108969190612e54565b602086015173ffffffffffffffffffffffffffffffffffffffff16929190611947565b610ae8565b6002825160038111156108d3576108d3612d4e565b14806108f157506003825160038111156108ef576108ef612d4e565b145b15610ab05760018151600381111561090b5761090b612d4e565b1461094857805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b60028251600381111561095d5761095d612d4e565b03610a0557602082015160a083015160408085015190517f42842e0e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff928316602482015260448101919091529116906342842e0e90606401600060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b50505050610aa1565b600382516003811115610a1a57610a1a612d4e565b03610aa157816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a338460a00151856040015186606001516040518563ffffffff1660e01b8152600401610a6e9493929190612e67565b600060405180830381600087803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b505050505b3396508160a001519550610ae8565b805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b600181516003811115610afd57610afd612d4e565b03610c1857600282516003811115610b1757610b17612d4e565b14158015610b385750600382516003811115610b3557610b35612d4e565b14155b15610b7557805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b6127106005548260600151610b8a9190612e02565b610b949190612e19565b9250610bcf610ba660208a018a61277b565b600454602084015173ffffffffffffffffffffffffffffffffffffffff90811692911686611947565b610c13610bdf60208a018a61277b565b33858460600151610bf09190612e54565b602085015173ffffffffffffffffffffffffffffffffffffffff16929190611947565b610de5565b600281516003811115610c2d57610c2d612d4e565b1480610c4b5750600381516003811115610c4957610c49612d4e565b145b15610ab057600281516003811115610c6557610c65612d4e565b03610d2c5760208082015173ffffffffffffffffffffffffffffffffffffffff16906342842e0e90610c99908b018b61277b565b60408085015190517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301523360248301526044820152606401600060405180830381600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b50505050610dd2565b600381516003811115610d4157610d41612d4e565b03610dd25760208082015173ffffffffffffffffffffffffffffffffffffffff169063f242432a90610d75908b018b61277b565b33846040015185606001516040518563ffffffff1660e01b8152600401610d9f9493929190612e67565b600060405180830381600087803b158015610db957600080fd5b505af1158015610dcd573d6000803e3d6000fd5b505050505b610ddf602089018961277b565b96503395505b83547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011784556040805173ffffffffffffffffffffffffffffffffffffffff898116825288166020820152429160a08b01359188917fd83bf72c88d7355a2de3c89ca42e86a646abb6fc1bc91613e4e816021bf091c0910160405180910390a450505050505050610e796001600355565b50565b610e846119e2565b60045473ffffffffffffffffffffffffffffffffffffffff16610f03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f66656520726563656976657220697320656d707479000000000000000000000060448201526064016103a2565b6127108110610f6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f657863656564206d61782066656500000000000000000000000000000000000060448201526064016103a2565b60058190556040518181527f6717373928cccf59cc9912055cfa8db86e7085b95c94c15862b121114aa333be906020015b60405180910390a150565b610fb26119e2565b610fbc6000611a35565b565b600060608060008060006060610fd2611aaa565b610fda611adc565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b6110286113a0565b60008060005b838110156112b3573685858381811061104957611049612ce7565b905060200281019061105b9190612ee0565b905061106a602082018261277b565b92503373ffffffffffffffffffffffffffffffffffffffff8416146110bb576040517f80ec737400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061121f6040518060e001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018480602001906110f79190612c80565b808060200260200160405190810160405280939291908181526020016000905b828210156111435761113460a08302860136819003810190612d32565b81526020019060010190611117565b505050918352505060200161115b6040860186612c19565b808060200260200160405190810160405280939291908181526020016000905b828210156111a75761119860c08302860136819003810190612d16565b8152602001906001019061117b565b5050505050815260200184606001358152602001846080013581526020018460a001358152602001848060c001906111df9190612bad565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505091525060e08401356113e3565b60008181526007602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016610100178155905190975091925060a08401359173ffffffffffffffffffffffffffffffffffffffff8716917fdd003742fb214507783ce004fe55f5ac14f89c6de4a7cd7487e47eb091c6226591a36112aa83612f1e565b9250505061102e565b5050506112c06001600355565b5050565b6112cc6119e2565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fffb40bfdfd246e95f543d08d9713c339f1d90fa9265e39b4f562f9011d7c919f90602001610f9f565b6113476119e2565b73ffffffffffffffffffffffffffffffffffffffff8116611397576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016103a2565b610e7981611a35565b6002600354036113dc576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600355565b60008083602001515167ffffffffffffffff81111561140457611404612798565b60405190808252806020026020018201604052801561142d578160200160208202803683370190505b509050600084604001515167ffffffffffffffff81111561145057611450612798565b604051908082528060200260200182016040528015611479578160200160208202803683370190505b50905060005b8560200151518110156114df576114b2866020015182815181106114a5576114a5612ce7565b6020026020010151611b09565b8382815181106114c4576114c4612ce7565b60209081029190910101526114d881612f1e565b905061147f565b5060005b856040015151811015611543576115168660400151828151811061150957611509612ce7565b6020026020010151611c7d565b82828151811061152857611528612ce7565b602090810291909101015261153c81612f1e565b90506114e3565b506040517f436f6e73696465726174696f6e4974656d28000000000000000000000000000060208201527f75696e7438206974656d547970652c000000000000000000000000000000000060328201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060418201527f75696e74323536206964656e7469666965724f7243726974657269612c000000604f8201527f75696e74323536207374617274416d6f756e742c000000000000000000000000606c8201527f75696e7432353620656e64416d6f756e742c000000000000000000000000000060808201527f6164647265737320726563697069656e7400000000000000000000000000000060928201527f290000000000000000000000000000000000000000000000000000000000000060a382015260a401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f4f666665724974656d280000000000000000000000000000000000000000000060208301527f75696e7438206974656d547970652c0000000000000000000000000000000000602a8301527f6164647265737320746f6b656e2c00000000000000000000000000000000000060398301527f75696e74323536206964656e7469666965724f7243726974657269612c00000060478301527f75696e74323536207374617274416d6f756e742c00000000000000000000000060648301527f75696e7432353620656e64416d6f756e7400000000000000000000000000000060788301527f2900000000000000000000000000000000000000000000000000000000000000608983015290608a01604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526117f39291602001612f72565b6040516020818303038152906040528051906020012085600001518360405160200161181f9190613118565b60405160208183030381529060405280519060200120836040516020016118469190613118565b60405160208183030381529060405280519060200120886060015189608001518a60a001518a6040516020016118ca98979695949392919097885273ffffffffffffffffffffffffffffffffffffffff96909616602088015260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b60405160208183030381529060405280519060200120925050505b92915050565b6000806118f785611e00565b9050600061193b8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611e4892505050565b925050505b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526119dc908590611e72565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610fbc576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016103a2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060611ad77f00000000000000000000000000000000000000000000000000000000000000006001611f0d565b905090565b6060611ad77f00000000000000000000000000000000000000000000000000000000000000006002611f0d565b6040517f4f666665724974656d280000000000000000000000000000000000000000000060208201527f75696e7438206974656d547970652c0000000000000000000000000000000000602a8201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060398201527f75696e74323536206964656e7469666965724f7243726974657269612c00000060478201527f75696e74323536207374617274416d6f756e742c00000000000000000000000060648201527f75696e7432353620656e64416d6f756e7400000000000000000000000000000060788201527f29000000000000000000000000000000000000000000000000000000000000006089820152600090608a016040516020818303038152906040528051906020012082600001518360200151846040015185606001518660800151604051602001611c609695949392919061314e565b604051602081830303815290604052805190602001209050919050565b6040517f436f6e73696465726174696f6e4974656d28000000000000000000000000000060208201527f75696e7438206974656d547970652c000000000000000000000000000000000060328201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060418201527f75696e74323536206964656e7469666965724f7243726974657269612c000000604f8201527f75696e74323536207374617274416d6f756e742c000000000000000000000000606c8201527f75696e7432353620656e64416d6f756e742c000000000000000000000000000060808201527f6164647265737320726563697069656e7400000000000000000000000000000060928201527f290000000000000000000000000000000000000000000000000000000000000060a382015260009060a40160405160208183030381529060405280519060200120826000015183602001518460400151856060015186608001518760a00151604051602001611c60979695949392919061319b565b60006118e5611e0d611fb8565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b600080600080611e5886866120f0565b925092509250611e68828261213d565b5090949350505050565b6000611e9473ffffffffffffffffffffffffffffffffffffffff841683612241565b90508051600014158015611eb9575080806020019051810190611eb791906131f3565b155b15611f08576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016103a2565b505050565b606060ff8314611f2757611f208361224f565b90506118e5565b818054611f3390613215565b80601f0160208091040260200160405190810160405280929190818152602001828054611f5f90613215565b8015611fac5780601f10611f8157610100808354040283529160200191611fac565b820191906000526020600020905b815481529060010190602001808311611f8f57829003601f168201915b505050505090506118e5565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561201e57507f000000000000000000000000000000000000000000000000000000000000000046145b1561204857507f000000000000000000000000000000000000000000000000000000000000000090565b611ad7604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6000806000835160410361212a5760208401516040850151606086015160001a61211c8882858561228e565b955095509550505050612136565b50508151600091506002905b9250925092565b600082600381111561215157612151612d4e565b0361215a575050565b600182600381111561216e5761216e612d4e565b036121a5576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156121b9576121b9612d4e565b036121f3576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024016103a2565b600382600381111561220757612207612d4e565b036112c0576040517fd78bce0c000000000000000000000000000000000000000000000000000000008152600481018290526024016103a2565b606061194083836000612388565b6060600061225c83612441565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156122c9575060009150600390508261237e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561231d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166123745750600092506001915082905061237e565b9250600091508190505b9450945094915050565b6060814710156123c6576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016103a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516123ef9190613268565b60006040518083038185875af1925050503d806000811461242c576040519150601f19603f3d011682016040523d82523d6000602084013e612431565b606091505b509150915061193b868383612482565b600060ff8216601f8111156118e5576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826124975761249282612511565b611940565b81511580156124bb575073ffffffffffffffffffffffffffffffffffffffff84163b155b1561250a576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016103a2565b5080611940565b8051156125215780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561256557600080fd5b5035919050565b60006020828403121561257e57600080fd5b813567ffffffffffffffff81111561259557600080fd5b820160e0818503121561194057600080fd5b60005b838110156125c25781810151838201526020016125aa565b50506000910152565b600081518084526125e38160208601602086016125a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e08184015261265160e084018a6125cb565b8381036040850152612663818a6125cb565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156126c2578351835292840192918401916001016126a6565b50909c9b505050505050505050505050565b600080602083850312156126e757600080fd5b823567ffffffffffffffff808211156126ff57600080fd5b818501915085601f83011261271357600080fd5b81358181111561272257600080fd5b8660208260051b850101111561273757600080fd5b60209290920196919550909350505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610e7957600080fd5b803561277681612749565b919050565b60006020828403121561278d57600080fd5b813561194081612749565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156127ea576127ea612798565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561283757612837612798565b604052919050565b600067ffffffffffffffff82111561285957612859612798565b5060051b60200190565b80356004811061277657600080fd5b600060a0828403121561288457600080fd5b60405160a0810181811067ffffffffffffffff821117156128a7576128a7612798565b6040529050806128b683612863565b815260208301356128c681612749565b806020830152506040830135604082015260608301356060820152608083013560808201525092915050565b600082601f83011261290357600080fd5b813560206129186129138361283f565b6127f0565b82815260a0928302850182019282820191908785111561293757600080fd5b8387015b8581101561295a5761294d8982612872565b845292840192810161293b565b5090979650505050505050565b600060c0828403121561297957600080fd5b60405160c0810181811067ffffffffffffffff8211171561299c5761299c612798565b6040529050806129ab83612863565b815260208301356129bb81612749565b8060208301525060408301356040820152606083013560608201526080830135608082015260a08301356129ee81612749565b60a0919091015292915050565b600082601f830112612a0c57600080fd5b81356020612a1c6129138361283f565b82815260c09283028501820192828201919087851115612a3b57600080fd5b8387015b8581101561295a57612a518982612967565b8452928401928101612a3f565b600082601f830112612a6f57600080fd5b813567ffffffffffffffff811115612a8957612a89612798565b612aba60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016127f0565b818152846020838601011115612acf57600080fd5b816020850160208301376000918101602001919091529392505050565b600060e08236031215612afe57600080fd5b612b066127c7565b612b0f8361276b565b8152602083013567ffffffffffffffff80821115612b2c57600080fd5b612b38368387016128f2565b60208401526040850135915080821115612b5157600080fd5b612b5d368387016129fb565b6040840152606085013560608401526080850135608084015260a085013560a084015260c0850135915080821115612b9457600080fd5b50612ba136828601612a5e565b60c08301525092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612be257600080fd5b83018035915067ffffffffffffffff821115612bfd57600080fd5b602001915036819003821315612c1257600080fd5b9250929050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c4e57600080fd5b83018035915067ffffffffffffffff821115612c6957600080fd5b602001915060c081023603821315612c1257600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612cb557600080fd5b83018035915067ffffffffffffffff821115612cd057600080fd5b602001915060a081023603821315612c1257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060c08284031215612d2857600080fd5b6119408383612967565b600060a08284031215612d4457600080fd5b6119408383612872565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110612db4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60408101612dc68285612d7d565b6119406020830184612d7d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176118e5576118e5612dd3565b600082612e4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156118e5576118e5612dd3565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015282606083015260a06080830152612ed660a08301600381527f3078300000000000000000000000000000000000000000000000000000000000602082015260400190565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01833603018112612f1457600080fd5b9190910192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612f4f57612f4f612dd3565b5060010190565b60008151612f688185602086016125a7565b9290920192915050565b7f4f72646572436f6d706f6e656e7473280000000000000000000000000000000081527f61646472657373206f6666657265722c0000000000000000000000000000000060108201527f4f666665724974656d5b5d206f666665722c000000000000000000000000000060208201527f436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f60328201527f6e2c00000000000000000000000000000000000000000000000000000000000060528201527f75696e7432353620737461727454696d652c000000000000000000000000000060548201527f75696e7432353620656e6454696d652c0000000000000000000000000000000060668201527f75696e743235362073616c742c0000000000000000000000000000000000000060768201527f75696e7432353620636f756e746572000000000000000000000000000000000060838201527f29000000000000000000000000000000000000000000000000000000000000006092820152600083516131008160938501602088016125a7565b61310f60938285010185612f56565b95945050505050565b815160009082906020808601845b8381101561314257815185529382019390820190600101613126565b50929695505050505050565b86815260c081016131626020830188612d7d565b73ffffffffffffffffffffffffffffffffffffffff861660408301528460608301528360808301528260a0830152979650505050505050565b87815260e081016131af6020830189612d7d565b73ffffffffffffffffffffffffffffffffffffffff80881660408401528660608401528560808401528460a084015280841660c08401525098975050505050505050565b60006020828403121561320557600080fd5b8151801515811461194057600080fd5b600181811c9082168061322957607f821691505b602082108103613262577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008251612f148184602087016125a756fea2646970667358221220c3778295f293e903aba7408303d4abacea69b71c6f633475edf4e5ad5da3593a64736f6c6343000814003300000000000000000000000038480093ad3c093e973fff9f8f794204e557c16f
Deployed Bytecode
0x6080604052600436106100c75760003560e01c8063978bbdb911610074578063be65ab8c1161004e578063be65ab8c14610250578063efdcd9741461027d578063f2fde38b1461029d57600080fd5b8063978bbdb9146101df578063b0e7fbae14610203578063b3f006741461022357600080fd5b8063715018a6116100a5578063715018a61461015657806384b0196e1461016b5780638da5cb5b1461019357600080fd5b80632dff692d146100cc578063679f431c1461012157806369fe0e2d14610136575b600080fd5b3480156100d857600080fd5b506101056100e7366004612553565b60076020526000908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b61013461012f36600461256c565b6102bd565b005b34801561014257600080fd5b50610134610151366004612553565b610e7c565b34801561016257600080fd5b50610134610faa565b34801561017757600080fd5b50610180610fbe565b6040516101189796959493929190612615565b34801561019f57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b3480156101eb57600080fd5b506101f560055481565b604051908152602001610118565b34801561020f57600080fd5b5061013461021e3660046126d4565b611020565b34801561022f57600080fd5b506004546101ba9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561025c57600080fd5b506101f561026b36600461277b565b60066020526000908152604090205481565b34801561028957600080fd5b5061013461029836600461277b565b6112c4565b3480156102a957600080fd5b506101346102b836600461277b565b61133f565b6102c56113a0565b600080806103266102d585612aec565b600660006102e6602089018961277b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113e3565b905083606001354210158015610340575083608001354211155b6103ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f54696d65206572726f720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008181526007602052604090208054610100900460ff161580156103d25750805460ff16155b610438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f537461747573206572726f72000000000000000000000000000000000000000060448201526064016103a2565b610445602086018661277b565b73ffffffffffffffffffffffffffffffffffffffff166104718361046c60c0890189612bad565b6118eb565b73ffffffffffffffffffffffffffffffffffffffff16146104ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5369676e206572726f720000000000000000000000000000000000000000000060448201526064016103a2565b6104fb6040860186612c19565b9050600114801561051a57506105146020860186612c80565b90506001145b610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f506172616d206c656e677468206572726f72000000000000000000000000000060448201526064016103a2565b6000806105906040880188612c19565b60008181106105a1576105a1612ce7565b905060c002018036038101906105b79190612d16565b905060006105c86020890189612c80565b60008181106105d9576105d9612ce7565b905060a002018036038101906105ef9190612d32565b905060008151600381111561060657610606612d4e565b0361064357805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b60008251600381111561065857610658612d4e565b1480610676575060018251600381111561067457610674612d4e565b145b156108be5760028151600381111561069057610690612d4e565b141580156106b157506003815160038111156106ae576106ae612d4e565b14155b156106ee57805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b61271060055483606001516107039190612e02565b61070d9190612e19565b925060008251600381111561072457610724612d4e565b03610835578160600151341015610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f54582076616c7565206572726f7200000000000000000000000000000000000060448201526064016103a2565b60045460405173ffffffffffffffffffffffffffffffffffffffff9091169084156108fc029085906000818181858888f193505050501580156107de573d6000803e3d6000fd5b508160a0015173ffffffffffffffffffffffffffffffffffffffff166108fc848460600151039081150290604051600060405180830381858888f1935050505015801561082f573d6000803e3d6000fd5b50610ae8565b60018251600381111561084a5761084a612d4e565b036108b957600454602083015161087d9173ffffffffffffffffffffffffffffffffffffffff9182169133911686611947565b6108b9338360a001518585606001516108969190612e54565b602086015173ffffffffffffffffffffffffffffffffffffffff16929190611947565b610ae8565b6002825160038111156108d3576108d3612d4e565b14806108f157506003825160038111156108ef576108ef612d4e565b145b15610ab05760018151600381111561090b5761090b612d4e565b1461094857805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b60028251600381111561095d5761095d612d4e565b03610a0557602082015160a083015160408085015190517f42842e0e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff928316602482015260448101919091529116906342842e0e90606401600060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b50505050610aa1565b600382516003811115610a1a57610a1a612d4e565b03610aa157816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a338460a00151856040015186606001516040518563ffffffff1660e01b8152600401610a6e9493929190612e67565b600060405180830381600087803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b505050505b3396508160a001519550610ae8565b805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b600181516003811115610afd57610afd612d4e565b03610c1857600282516003811115610b1757610b17612d4e565b14158015610b385750600382516003811115610b3557610b35612d4e565b14155b15610b7557805182516040517fc0eba3a10000000000000000000000000000000000000000000000000000000081526103a2929190600401612db8565b6127106005548260600151610b8a9190612e02565b610b949190612e19565b9250610bcf610ba660208a018a61277b565b600454602084015173ffffffffffffffffffffffffffffffffffffffff90811692911686611947565b610c13610bdf60208a018a61277b565b33858460600151610bf09190612e54565b602085015173ffffffffffffffffffffffffffffffffffffffff16929190611947565b610de5565b600281516003811115610c2d57610c2d612d4e565b1480610c4b5750600381516003811115610c4957610c49612d4e565b145b15610ab057600281516003811115610c6557610c65612d4e565b03610d2c5760208082015173ffffffffffffffffffffffffffffffffffffffff16906342842e0e90610c99908b018b61277b565b60408085015190517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301523360248301526044820152606401600060405180830381600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b50505050610dd2565b600381516003811115610d4157610d41612d4e565b03610dd25760208082015173ffffffffffffffffffffffffffffffffffffffff169063f242432a90610d75908b018b61277b565b33846040015185606001516040518563ffffffff1660e01b8152600401610d9f9493929190612e67565b600060405180830381600087803b158015610db957600080fd5b505af1158015610dcd573d6000803e3d6000fd5b505050505b610ddf602089018961277b565b96503395505b83547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011784556040805173ffffffffffffffffffffffffffffffffffffffff898116825288166020820152429160a08b01359188917fd83bf72c88d7355a2de3c89ca42e86a646abb6fc1bc91613e4e816021bf091c0910160405180910390a450505050505050610e796001600355565b50565b610e846119e2565b60045473ffffffffffffffffffffffffffffffffffffffff16610f03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f66656520726563656976657220697320656d707479000000000000000000000060448201526064016103a2565b6127108110610f6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f657863656564206d61782066656500000000000000000000000000000000000060448201526064016103a2565b60058190556040518181527f6717373928cccf59cc9912055cfa8db86e7085b95c94c15862b121114aa333be906020015b60405180910390a150565b610fb26119e2565b610fbc6000611a35565b565b600060608060008060006060610fd2611aaa565b610fda611adc565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b6110286113a0565b60008060005b838110156112b3573685858381811061104957611049612ce7565b905060200281019061105b9190612ee0565b905061106a602082018261277b565b92503373ffffffffffffffffffffffffffffffffffffffff8416146110bb576040517f80ec737400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061121f6040518060e001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018480602001906110f79190612c80565b808060200260200160405190810160405280939291908181526020016000905b828210156111435761113460a08302860136819003810190612d32565b81526020019060010190611117565b505050918352505060200161115b6040860186612c19565b808060200260200160405190810160405280939291908181526020016000905b828210156111a75761119860c08302860136819003810190612d16565b8152602001906001019061117b565b5050505050815260200184606001358152602001846080013581526020018460a001358152602001848060c001906111df9190612bad565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505091525060e08401356113e3565b60008181526007602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016610100178155905190975091925060a08401359173ffffffffffffffffffffffffffffffffffffffff8716917fdd003742fb214507783ce004fe55f5ac14f89c6de4a7cd7487e47eb091c6226591a36112aa83612f1e565b9250505061102e565b5050506112c06001600355565b5050565b6112cc6119e2565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fffb40bfdfd246e95f543d08d9713c339f1d90fa9265e39b4f562f9011d7c919f90602001610f9f565b6113476119e2565b73ffffffffffffffffffffffffffffffffffffffff8116611397576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016103a2565b610e7981611a35565b6002600354036113dc576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600355565b60008083602001515167ffffffffffffffff81111561140457611404612798565b60405190808252806020026020018201604052801561142d578160200160208202803683370190505b509050600084604001515167ffffffffffffffff81111561145057611450612798565b604051908082528060200260200182016040528015611479578160200160208202803683370190505b50905060005b8560200151518110156114df576114b2866020015182815181106114a5576114a5612ce7565b6020026020010151611b09565b8382815181106114c4576114c4612ce7565b60209081029190910101526114d881612f1e565b905061147f565b5060005b856040015151811015611543576115168660400151828151811061150957611509612ce7565b6020026020010151611c7d565b82828151811061152857611528612ce7565b602090810291909101015261153c81612f1e565b90506114e3565b506040517f436f6e73696465726174696f6e4974656d28000000000000000000000000000060208201527f75696e7438206974656d547970652c000000000000000000000000000000000060328201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060418201527f75696e74323536206964656e7469666965724f7243726974657269612c000000604f8201527f75696e74323536207374617274416d6f756e742c000000000000000000000000606c8201527f75696e7432353620656e64416d6f756e742c000000000000000000000000000060808201527f6164647265737320726563697069656e7400000000000000000000000000000060928201527f290000000000000000000000000000000000000000000000000000000000000060a382015260a401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f4f666665724974656d280000000000000000000000000000000000000000000060208301527f75696e7438206974656d547970652c0000000000000000000000000000000000602a8301527f6164647265737320746f6b656e2c00000000000000000000000000000000000060398301527f75696e74323536206964656e7469666965724f7243726974657269612c00000060478301527f75696e74323536207374617274416d6f756e742c00000000000000000000000060648301527f75696e7432353620656e64416d6f756e7400000000000000000000000000000060788301527f2900000000000000000000000000000000000000000000000000000000000000608983015290608a01604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526117f39291602001612f72565b6040516020818303038152906040528051906020012085600001518360405160200161181f9190613118565b60405160208183030381529060405280519060200120836040516020016118469190613118565b60405160208183030381529060405280519060200120886060015189608001518a60a001518a6040516020016118ca98979695949392919097885273ffffffffffffffffffffffffffffffffffffffff96909616602088015260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b60405160208183030381529060405280519060200120925050505b92915050565b6000806118f785611e00565b9050600061193b8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611e4892505050565b925050505b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526119dc908590611e72565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610fbc576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016103a2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060611ad77f696e7365766d2e7472616465000000000000000000000000000000000000000c6001611f0d565b905090565b6060611ad77f76312e302e3000000000000000000000000000000000000000000000000000066002611f0d565b6040517f4f666665724974656d280000000000000000000000000000000000000000000060208201527f75696e7438206974656d547970652c0000000000000000000000000000000000602a8201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060398201527f75696e74323536206964656e7469666965724f7243726974657269612c00000060478201527f75696e74323536207374617274416d6f756e742c00000000000000000000000060648201527f75696e7432353620656e64416d6f756e7400000000000000000000000000000060788201527f29000000000000000000000000000000000000000000000000000000000000006089820152600090608a016040516020818303038152906040528051906020012082600001518360200151846040015185606001518660800151604051602001611c609695949392919061314e565b604051602081830303815290604052805190602001209050919050565b6040517f436f6e73696465726174696f6e4974656d28000000000000000000000000000060208201527f75696e7438206974656d547970652c000000000000000000000000000000000060328201527f6164647265737320746f6b656e2c00000000000000000000000000000000000060418201527f75696e74323536206964656e7469666965724f7243726974657269612c000000604f8201527f75696e74323536207374617274416d6f756e742c000000000000000000000000606c8201527f75696e7432353620656e64416d6f756e742c000000000000000000000000000060808201527f6164647265737320726563697069656e7400000000000000000000000000000060928201527f290000000000000000000000000000000000000000000000000000000000000060a382015260009060a40160405160208183030381529060405280519060200120826000015183602001518460400151856060015186608001518760a00151604051602001611c60979695949392919061319b565b60006118e5611e0d611fb8565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b600080600080611e5886866120f0565b925092509250611e68828261213d565b5090949350505050565b6000611e9473ffffffffffffffffffffffffffffffffffffffff841683612241565b90508051600014158015611eb9575080806020019051810190611eb791906131f3565b155b15611f08576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016103a2565b505050565b606060ff8314611f2757611f208361224f565b90506118e5565b818054611f3390613215565b80601f0160208091040260200160405190810160405280929190818152602001828054611f5f90613215565b8015611fac5780601f10611f8157610100808354040283529160200191611fac565b820191906000526020600020905b815481529060010190602001808311611f8f57829003601f168201915b505050505090506118e5565b60003073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005e1d63da97e2f87fe79bb5b8a790ad66655bbd8d1614801561201e57507f000000000000000000000000000000000000000000000000000000000000000146145b1561204857507f3b61155915f83bf5516bd52761275b7069904fd2d955a6898b5eae37d9501e2f90565b611ad7604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f7a29009561f7538928664c266769243e1703994d0cccb6e6056d7724aa526da7918101919091527f15124d26d1272f8d4d5266a24ca397811f414b8cd05a53b26b745f63af5ae2fc60608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6000806000835160410361212a5760208401516040850151606086015160001a61211c8882858561228e565b955095509550505050612136565b50508151600091506002905b9250925092565b600082600381111561215157612151612d4e565b0361215a575050565b600182600381111561216e5761216e612d4e565b036121a5576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156121b9576121b9612d4e565b036121f3576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024016103a2565b600382600381111561220757612207612d4e565b036112c0576040517fd78bce0c000000000000000000000000000000000000000000000000000000008152600481018290526024016103a2565b606061194083836000612388565b6060600061225c83612441565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156122c9575060009150600390508261237e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561231d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166123745750600092506001915082905061237e565b9250600091508190505b9450945094915050565b6060814710156123c6576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016103a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516123ef9190613268565b60006040518083038185875af1925050503d806000811461242c576040519150601f19603f3d011682016040523d82523d6000602084013e612431565b606091505b509150915061193b868383612482565b600060ff8216601f8111156118e5576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826124975761249282612511565b611940565b81511580156124bb575073ffffffffffffffffffffffffffffffffffffffff84163b155b1561250a576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016103a2565b5080611940565b8051156125215780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561256557600080fd5b5035919050565b60006020828403121561257e57600080fd5b813567ffffffffffffffff81111561259557600080fd5b820160e0818503121561194057600080fd5b60005b838110156125c25781810151838201526020016125aa565b50506000910152565b600081518084526125e38160208601602086016125a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e08184015261265160e084018a6125cb565b8381036040850152612663818a6125cb565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156126c2578351835292840192918401916001016126a6565b50909c9b505050505050505050505050565b600080602083850312156126e757600080fd5b823567ffffffffffffffff808211156126ff57600080fd5b818501915085601f83011261271357600080fd5b81358181111561272257600080fd5b8660208260051b850101111561273757600080fd5b60209290920196919550909350505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610e7957600080fd5b803561277681612749565b919050565b60006020828403121561278d57600080fd5b813561194081612749565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156127ea576127ea612798565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561283757612837612798565b604052919050565b600067ffffffffffffffff82111561285957612859612798565b5060051b60200190565b80356004811061277657600080fd5b600060a0828403121561288457600080fd5b60405160a0810181811067ffffffffffffffff821117156128a7576128a7612798565b6040529050806128b683612863565b815260208301356128c681612749565b806020830152506040830135604082015260608301356060820152608083013560808201525092915050565b600082601f83011261290357600080fd5b813560206129186129138361283f565b6127f0565b82815260a0928302850182019282820191908785111561293757600080fd5b8387015b8581101561295a5761294d8982612872565b845292840192810161293b565b5090979650505050505050565b600060c0828403121561297957600080fd5b60405160c0810181811067ffffffffffffffff8211171561299c5761299c612798565b6040529050806129ab83612863565b815260208301356129bb81612749565b8060208301525060408301356040820152606083013560608201526080830135608082015260a08301356129ee81612749565b60a0919091015292915050565b600082601f830112612a0c57600080fd5b81356020612a1c6129138361283f565b82815260c09283028501820192828201919087851115612a3b57600080fd5b8387015b8581101561295a57612a518982612967565b8452928401928101612a3f565b600082601f830112612a6f57600080fd5b813567ffffffffffffffff811115612a8957612a89612798565b612aba60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016127f0565b818152846020838601011115612acf57600080fd5b816020850160208301376000918101602001919091529392505050565b600060e08236031215612afe57600080fd5b612b066127c7565b612b0f8361276b565b8152602083013567ffffffffffffffff80821115612b2c57600080fd5b612b38368387016128f2565b60208401526040850135915080821115612b5157600080fd5b612b5d368387016129fb565b6040840152606085013560608401526080850135608084015260a085013560a084015260c0850135915080821115612b9457600080fd5b50612ba136828601612a5e565b60c08301525092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612be257600080fd5b83018035915067ffffffffffffffff821115612bfd57600080fd5b602001915036819003821315612c1257600080fd5b9250929050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c4e57600080fd5b83018035915067ffffffffffffffff821115612c6957600080fd5b602001915060c081023603821315612c1257600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612cb557600080fd5b83018035915067ffffffffffffffff821115612cd057600080fd5b602001915060a081023603821315612c1257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060c08284031215612d2857600080fd5b6119408383612967565b600060a08284031215612d4457600080fd5b6119408383612872565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110612db4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60408101612dc68285612d7d565b6119406020830184612d7d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176118e5576118e5612dd3565b600082612e4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156118e5576118e5612dd3565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015282606083015260a06080830152612ed660a08301600381527f3078300000000000000000000000000000000000000000000000000000000000602082015260400190565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01833603018112612f1457600080fd5b9190910192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612f4f57612f4f612dd3565b5060010190565b60008151612f688185602086016125a7565b9290920192915050565b7f4f72646572436f6d706f6e656e7473280000000000000000000000000000000081527f61646472657373206f6666657265722c0000000000000000000000000000000060108201527f4f666665724974656d5b5d206f666665722c000000000000000000000000000060208201527f436f6e73696465726174696f6e4974656d5b5d20636f6e73696465726174696f60328201527f6e2c00000000000000000000000000000000000000000000000000000000000060528201527f75696e7432353620737461727454696d652c000000000000000000000000000060548201527f75696e7432353620656e6454696d652c0000000000000000000000000000000060668201527f75696e743235362073616c742c0000000000000000000000000000000000000060768201527f75696e7432353620636f756e746572000000000000000000000000000000000060838201527f29000000000000000000000000000000000000000000000000000000000000006092820152600083516131008160938501602088016125a7565b61310f60938285010185612f56565b95945050505050565b815160009082906020808601845b8381101561314257815185529382019390820190600101613126565b50929695505050505050565b86815260c081016131626020830188612d7d565b73ffffffffffffffffffffffffffffffffffffffff861660408301528460608301528360808301528260a0830152979650505050505050565b87815260e081016131af6020830189612d7d565b73ffffffffffffffffffffffffffffffffffffffff80881660408401528660608401528560808401528460a084015280841660c08401525098975050505050505050565b60006020828403121561320557600080fd5b8151801515811461194057600080fd5b600181811c9082168061322957607f821691505b602082108103613262577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008251612f148184602087016125a756fea2646970667358221220c3778295f293e903aba7408303d4abacea69b71c6f633475edf4e5ad5da3593a64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000038480093ad3c093e973fff9f8f794204e557c16f
-----Decoded View---------------
Arg [0] : owner (address): 0x38480093ad3c093e973FFf9F8F794204E557c16F
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000038480093ad3c093e973fff9f8f794204e557c16f
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.