Source Code
Overview
ETH Balance
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MicroNFTV2
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "../MicroUtilityV2.sol";
import "./ERC721.sol";
error SaleInactive();
error PurchaseWrongPrice(uint256 correctPrice);
error SoldOut();
error PurchaseTooManyForAddress();
error Canceled();
error IsNotBridge();
error SaleCanNotUpdate();
error InvalidSaleDetail();
error SaleIsNotEnded();
error Unauthorized();
error InvalidToken(uint256 tokenId);
contract MicroNFTV2 is ERC721, Ownable, ReentrancyGuard, MicroUtilityV2 {
using Strings for uint256;
using SafeMath for uint256;
uint256 public constant VERSION = 2;
string public notRevealedUri;
bool private initialized;
uint224 private _currentTokenId;
uint256 private constant STATIC_GAS_LIMIT = 210_000;
struct SaleConfiguration {
uint64 editionSize;
uint16 profitSharing;
address payable fundsRecipient;
uint256 publicSalePrice;
uint32 maxSalePurchasePerAddress;
uint64 publicSaleStart;
uint64 publicSaleEnd;
bool cancelable;
}
mapping(address => uint256) public totalMintsByAddress;
SaleConfiguration public saleConfig;
event BridgeIn(address indexed _to, uint256 _dstChainId, uint256 _tokenId);
event BridgeOut(
address indexed _from,
uint256 _dstChainId,
uint256 _tokenId
);
event Purchase(
address indexed to,
uint256 indexed quantity,
uint256 indexed price,
uint256 firstMintedTokenId
);
event OpenMintFinalized(
address indexed sender,
uint256 editionSize,
uint256 timeEnd
);
event CancelSaleEdition(address indexed sender, uint256 lastTimeUpdated);
event PublicSaleCollection(address indexed sender, uint256 lastTimeUpdated);
event FundsWithdrawn(
address indexed sender,
address indexed fundsRecipient,
uint256 fund
);
event SharingWithdrawn(
address indexed sender,
address indexed fundsRecipient,
uint256 fund
);
constructor() ERC721("", "") {}
modifier onlyBridge() {
if (!microManager.microBridge(_msgSender())) {
revert IsNotBridge();
}
_;
}
modifier onlyCancelable() {
if (saleConfig.cancelable) {
revert Canceled();
}
_;
}
modifier canMintTokens(uint256 quantity) {
if (
saleConfig.editionSize != 0 &&
quantity + _currentTokenId > saleConfig.editionSize
) {
revert SoldOut();
}
_;
}
modifier onlyPublicSaleActive() {
if (!_publicSaleActive()) {
revert SaleInactive();
}
_;
}
function init(bytes memory initPayload) external onlyOwner returns (bool) {
if (initialized) {
revert Unauthorized();
}
(
string memory _baseURI,
string memory _notRevealedURI,
string memory _name,
string memory _symbol,
address _owner,
address _manager
) = abi.decode(
initPayload,
(string, string, string, string, address, address)
);
_setManager(_manager);
notRevealedUri = _notRevealedURI;
_setBaseURI(_baseURI);
transferOwnership(_owner);
initialized = true;
_setNameAndSymbol(_name, _symbol);
return true;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
if (!_exists(tokenId)) {
revert InvalidToken(tokenId);
}
if (bytes(notRevealedUri).length > 0) {
return notRevealedUri;
}
string memory currentBaseURI = baseURI();
return
bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(
currentBaseURI,
tokenId.toString(),
".json"
)
)
: "";
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
_setBaseURI(_newBaseURI);
}
function setNotRevealedURI(string memory _notRevealedURI)
external
onlyOwner
{
notRevealedUri = _notRevealedURI;
}
/**
* Owner, Admin FUNCTIONS
* non state changing
*/
function adminMint(address recipient, uint256 quantity)
external
onlyOwner
canMintTokens(quantity)
returns (uint256)
{
_mintNFTs(recipient, quantity);
return _currentTokenId;
}
function setSaleDetail(bytes memory initPayload)
external
onlyCancelable
onlyOwner
{
if (
saleConfig.publicSaleStart != 0 &&
block.timestamp > saleConfig.publicSaleStart
) {
revert SaleCanNotUpdate();
}
SaleConfiguration memory config = abi.decode(
initPayload,
(SaleConfiguration)
);
if (
config.publicSaleStart <= block.timestamp ||
config.publicSaleEnd <= config.publicSaleStart ||
config.profitSharing > 50 ||
config.fundsRecipient == address(0)
) {
revert InvalidSaleDetail();
}
saleConfig = SaleConfiguration({
editionSize: config.editionSize,
profitSharing: config.profitSharing,
fundsRecipient: config.fundsRecipient,
publicSalePrice: config.publicSalePrice,
maxSalePurchasePerAddress: config.maxSalePurchasePerAddress,
publicSaleStart: config.publicSaleStart,
publicSaleEnd: config.publicSaleEnd,
cancelable: false
});
emit PublicSaleCollection(_msgSender(), block.timestamp);
}
function finalizeOpenEdition() external onlyCancelable onlyOwner {
saleConfig.editionSize = uint64(_currentTokenId);
saleConfig.publicSaleEnd = uint64(block.timestamp);
emit OpenMintFinalized(
_msgSender(),
saleConfig.editionSize,
block.timestamp
);
}
function cancelSaleEdition() external onlyCancelable onlyOwner {
if (block.timestamp > saleConfig.publicSaleEnd) {
revert SaleIsNotEnded();
}
saleConfig.cancelable = true;
emit CancelSaleEdition(_msgSender(), block.timestamp);
}
/**
* EXTERNAL FUNCTIONS
* state changing
*/
function purchase(uint256 quantity)
external
payable
onlyCancelable
canMintTokens(quantity)
onlyPublicSaleActive
nonReentrant
returns (uint256)
{
address sender = _msgSender();
uint256 salePrice = saleConfig.profitSharing > 0
? saleConfig.publicSalePrice.sub(
saleConfig.publicSalePrice.mul(saleConfig.profitSharing).div(
100
)
)
: saleConfig.publicSalePrice;
uint256 totalFee = salePrice.mul(quantity).add(
getMicroFeeWei(quantity)
);
if (msg.value < totalFee) {
revert PurchaseWrongPrice(totalFee);
}
if (
saleConfig.maxSalePurchasePerAddress != 0 &&
totalMintsByAddress[sender].add(quantity) >
saleConfig.maxSalePurchasePerAddress
) {
revert PurchaseTooManyForAddress();
}
uint256 remainder = msg.value.sub(totalFee);
_mintNFTs(sender, quantity);
totalMintsByAddress[sender] += quantity;
_payoutMicroFee(quantity);
_payoutFundingRaise(salePrice, quantity);
_payoutRemainder(remainder, sender);
uint256 firstMintedTokenId = uint256(_currentTokenId - quantity).add(1);
emit Purchase({
to: sender,
quantity: quantity,
price: salePrice,
firstMintedTokenId: firstMintedTokenId
});
return firstMintedTokenId;
}
function bridgeOut(
address _from,
uint64 _dstChainId,
uint256 _tokenId
) external onlyBridge {
if (
!_isApprovedOrOwner(_msgSender(), _tokenId) ||
ERC721.ownerOf(_tokenId) != _msgSender()
) {
revert Unauthorized();
}
_burn(_tokenId);
emit BridgeOut(_from, _dstChainId, _tokenId);
}
function bridgeIn(
address _toAddress,
uint64 _dstChainId,
uint256 _tokenId
) external onlyBridge {
if (_exists(_tokenId)) {
revert InvalidToken(_tokenId);
}
_safeMint(_toAddress, _tokenId);
emit BridgeIn(_toAddress, _dstChainId, _tokenId);
}
/**
* INTERNAL FUNCTIONS
* state changing
*/
function _mintNFTs(address recipient, uint256 quantity) internal {
uint256 chainPrepend = sourceGetChainPrepend(0);
uint256 tokenId = 0;
for (uint256 i; i < quantity; ) {
_currentTokenId += 1;
while (_exists(chainPrepend + uint256(_currentTokenId))) {
_currentTokenId += 1;
}
tokenId = sourceGetChainPrepend(_currentTokenId);
_safeMint(recipient, tokenId);
unchecked{
++i;
}
}
}
function sourceGetChainPrepend(uint224 id) internal view returns (uint256) {
return
uint256(
bytes32(abi.encodePacked(uint32(block.chainid), uint224(id)))
);
}
function _publicSaleActive() internal view returns (bool) {
return
saleConfig.publicSaleStart <= block.timestamp &&
saleConfig.publicSaleEnd > block.timestamp;
}
function _payoutFundingRaise(uint256 salePrice, uint256 quantity)
internal
returns (bool)
{
if (saleConfig.fundsRecipient == address(0) || salePrice == 0) {
return false;
}
uint256 totalPurchase = salePrice.mul(quantity);
_payoutRemainder(totalPurchase, saleConfig.fundsRecipient);
emit FundsWithdrawn(
_msgSender(),
saleConfig.fundsRecipient,
totalPurchase
);
return true;
}
function _payoutRemainder(uint256 value, address recipient) internal {
if (value > 0) {
(bool success, ) = payable(recipient).call{
value: value,
gas: gasleft() > STATIC_GAS_LIMIT ? STATIC_GAS_LIMIT : gasleft()
}("");
if (!success) {
revert PaymentFailed();
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, 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 be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns 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);
/**
* @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;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./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);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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 substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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 addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./EnumerableSet.sol";
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
* supported.
*/
library EnumerableMap {
using EnumerableSet for EnumerableSet.Bytes32Set;
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct Map {
// Storage of keys
EnumerableSet.Bytes32Set _keys;
mapping(bytes32 => bytes32) _values;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function _set(
Map storage map,
bytes32 key,
bytes32 value
) private returns (bool) {
map._values[key] = value;
return map._keys.add(key);
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function _remove(Map storage map, bytes32 key) private returns (bool) {
delete map._values[key];
return map._keys.remove(key);
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._keys.contains(key);
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function _length(Map storage map) private view returns (uint256) {
return map._keys.length();
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
bytes32 key = map._keys.at(index);
return (key, map._values[key]);
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
bytes32 value = map._values[key];
if (value == bytes32(0)) {
return (_contains(map, key), bytes32(0));
} else {
return (true, value);
}
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
bytes32 value = map._values[key];
require(value != 0 || _contains(map, key), "EnumerableMap: nonexistent key");
return value;
}
/**
* @dev Same as {_get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {_tryGet}.
*/
function _get(
Map storage map,
bytes32 key,
string memory errorMessage
) private view returns (bytes32) {
bytes32 value = map._values[key];
require(value != 0 || _contains(map, key), errorMessage);
return value;
}
// UintToAddressMap
struct UintToAddressMap {
Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(
UintToAddressMap storage map,
uint256 key,
address value
) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the set. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint160(uint256(value))));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*
* _Available since v3.4._
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
return (success, address(uint160(uint256(value))));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(
UintToAddressMap storage map,
uint256 key,
string memory errorMessage
) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.5.0;
interface IMicroManager {
function microBridge(address _address) external view returns (bool);
function treasuryAddress() external view returns (address);
function microProtocolFee() external view returns (uint256);
function oracleAddress() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface IPriceOracle {
function convertUsdToWei(uint256 usdAmount) external view returns (uint256 weiAmount);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import {IPriceOracle} from "./interfaces/IPriceOracle.sol";
import {IMicroManager} from "./interfaces/IMicroManager.sol";
error PaymentFailed();
contract MicroUtilityV2 is Ownable {
IMicroManager public microManager;
uint256 private constant STATIC_GAS_LIMIT = 210_000;
event FeePayout(
uint256 MicroMintFeeWei,
address MicroFeeRecipient,
bool success
);
constructor() {}
/**
* PUBLIC FUNCTIONS
* state changing
*/
function getMicroFeeUsd(
uint256 quantity
) public view returns (uint256 fee) {
fee = microManager.microProtocolFee() * quantity;
}
function getMicroFeeWei(uint256 quantity) public view returns (uint256) {
return _usdToWei(microManager.microProtocolFee() * quantity);
}
function _payoutMicroFee(uint256 quantity) internal {
uint256 microProtocolFee = getMicroFeeWei(quantity);
address payable treasury = payable(microManager.treasuryAddress());
(bool success, ) = treasury.call{
value: microProtocolFee,
gas: gasleft() > STATIC_GAS_LIMIT ? STATIC_GAS_LIMIT : gasleft()
}("");
if (!success) {
revert PaymentFailed();
}
emit FeePayout(microProtocolFee, treasury, success);
}
function _usdToWei(
uint256 amount
) internal view returns (uint256 weiAmount) {
if (amount == 0) {
return 0;
}
weiAmount = IPriceOracle(microManager.oracleAddress()).convertUsdToWei(
amount
);
}
function _setManager(address _manager) internal {
microManager = IMicroManager(_manager);
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using SafeMath for uint256;
using Address for address;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToAddressMap;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from holder address to their (enumerable) set of owned tokens
mapping (address => EnumerableSet.UintSet) private _holderTokens;
// Enumerable mapping from token ids to their owners
EnumerableMap.UintToAddressMap private _tokenOwners;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Base URI
string private _baseURI;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_){
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "zero address");
return _holderTokens[owner].length();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return _tokenOwners.get(tokenId, "nonexistent");
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "nonexistent");
string memory base = baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return '';
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(base, tokenId.toString()));
}
/**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a prefix in {tokenURI} to each token's URI, or
* to the token ID if no specific URI is set for that token ID.
*/
function baseURI() public view virtual returns (string memory) {
return _baseURI;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
return _holderTokens[owner].at(index);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
// _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
return _tokenOwners.length();
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
(uint256 tokenId, ) = _tokenOwners.at(index);
return tokenId;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "approval");
require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
"approval"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "nonexistent");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _tokenOwners.contains(tokenId);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "nonexistent");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
d*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "implementer");
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "zero");
require(!_exists(tokenId), "minted");
_beforeTokenTransfer(address(0), to, tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId); // internal owner
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_holderTokens[owner].remove(tokenId);
_tokenOwners.remove(tokenId);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "not own"); // internal owner
require(to != address(0), "zero");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_holderTokens[from].remove(tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function _setBaseURI(string memory baseURI_) internal virtual {
_baseURI = baseURI_;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function _setNameAndSymbol(string memory name_, string memory symbol_) internal virtual {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
), "implementer");
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Canceled","type":"error"},{"inputs":[],"name":"InvalidSaleDetail","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"IsNotBridge","type":"error"},{"inputs":[],"name":"PaymentFailed","type":"error"},{"inputs":[],"name":"PurchaseTooManyForAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"correctPrice","type":"uint256"}],"name":"PurchaseWrongPrice","type":"error"},{"inputs":[],"name":"SaleCanNotUpdate","type":"error"},{"inputs":[],"name":"SaleInactive","type":"error"},{"inputs":[],"name":"SaleIsNotEnded","type":"error"},{"inputs":[],"name":"SoldOut","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"BridgeIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"BridgeOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"lastTimeUpdated","type":"uint256"}],"name":"CancelSaleEdition","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"MicroMintFeeWei","type":"uint256"},{"indexed":false,"internalType":"address","name":"MicroFeeRecipient","type":"address"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"}],"name":"FeePayout","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"fundsRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"fund","type":"uint256"}],"name":"FundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"editionSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timeEnd","type":"uint256"}],"name":"OpenMintFinalized","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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"lastTimeUpdated","type":"uint256"}],"name":"PublicSaleCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"firstMintedTokenId","type":"uint256"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"fundsRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"fund","type":"uint256"}],"name":"SharingWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"adminMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_toAddress","type":"address"},{"internalType":"uint64","name":"_dstChainId","type":"uint64"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"bridgeIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint64","name":"_dstChainId","type":"uint64"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"bridgeOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelSaleEdition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeOpenEdition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"getMicroFeeUsd","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"getMicroFeeWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"initPayload","type":"bytes"}],"name":"init","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"microManager","outputs":[{"internalType":"contract IMicroManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"notRevealedUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"purchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleConfig","outputs":[{"internalType":"uint64","name":"editionSize","type":"uint64"},{"internalType":"uint16","name":"profitSharing","type":"uint16"},{"internalType":"address payable","name":"fundsRecipient","type":"address"},{"internalType":"uint256","name":"publicSalePrice","type":"uint256"},{"internalType":"uint32","name":"maxSalePurchasePerAddress","type":"uint32"},{"internalType":"uint64","name":"publicSaleStart","type":"uint64"},{"internalType":"uint64","name":"publicSaleEnd","type":"uint64"},{"internalType":"bool","name":"cancelable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_notRevealedURI","type":"string"}],"name":"setNotRevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"initPayload","type":"bytes"}],"name":"setSaleDetail","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalMintsByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604080516020808201808452600080845284519283019094529281528151919290916200004291600691620000d6565b50805162000058906007906020840190620000d6565b505050620000756200006f6200008060201b60201c565b62000084565b6001600a55620001b8565b3390565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620000e4906200017c565b90600052602060002090601f01602090048101928262000108576000855562000153565b82601f106200012357805160ff191683800117855562000153565b8280016001018555821562000153579182015b828111156200015357825182559160200191906001019062000136565b506200016192915062000165565b5090565b5b8082111562000161576000815560010162000166565b600181811c908216806200019157607f821691505b602082108103620001b257634e487b7160e01b600052602260045260246000fd5b50919050565b61355c80620001c86000396000f3fe60806040526004361061021a5760003560e01c806366edd34d11610123578063a22cb465116100ab578063efef39a11161006f578063efef39a114610703578063f2c4ce1e14610716578063f2fde38b14610736578063f5a0384c14610756578063ffa1ad741461076b57600080fd5b8063a22cb4651461063a578063b88d4fde1461065a578063c87b56dd1461067a578063e58306f91461069a578063e985e9c5146106ba57600080fd5b80638da5cb5b116100f25780638da5cb5b146104e757806390aa0b0f146105055780639123f01e146105d857806394847d621461060557806395d89b411461062557600080fd5b806366edd34d1461047d5780636c0360eb1461049d57806370a08231146104b2578063715018a6146104d257600080fd5b80632cde1215116101a65780634ddf47d4116101755780634ddf47d4146103dd5780634f6ccce7146103fd57806355f804b31461041d578063616985ed1461043d5780636352211e1461045d57600080fd5b80632cde1215146103685780632f745c591461038857806341e96eb1146103a857806342842e0e146103bd57600080fd5b8063095ea7b3116101ed578063095ea7b3146102c35780630e21ea06146102e55780630e46c9a61461030557806318160ddd1461032557806323b872dd1461034857600080fd5b806301ffc9a71461021f57806306fdde0314610254578063081812fc14610276578063081c8c44146102ae575b600080fd5b34801561022b57600080fd5b5061023f61023a366004612cb3565b610780565b60405190151581526020015b60405180910390f35b34801561026057600080fd5b506102696107d2565b60405161024b9190612d28565b34801561028257600080fd5b50610296610291366004612d3b565b610864565b6040516001600160a01b03909116815260200161024b565b3480156102ba57600080fd5b506102696108ca565b3480156102cf57600080fd5b506102e36102de366004612d69565b610958565b005b3480156102f157600080fd5b50600b54610296906001600160a01b031681565b34801561031157600080fd5b506102e3610320366004612daa565b610a13565b34801561033157600080fd5b5061033a610b4b565b60405190815260200161024b565b34801561035457600080fd5b506102e3610363366004612deb565b610b5c565b34801561037457600080fd5b506102e3610383366004612daa565b610ba7565b34801561039457600080fd5b5061033a6103a3366004612d69565b610cbc565b3480156103b457600080fd5b506102e3610ce5565b3480156103c957600080fd5b506102e36103d8366004612deb565b610de1565b3480156103e957600080fd5b5061023f6103f8366004612ee6565b610dfc565b34801561040957600080fd5b5061033a610418366004612d3b565b610ee0565b34801561042957600080fd5b506102e3610438366004612f1a565b610ef6565b34801561044957600080fd5b5061033a610458366004612d3b565b610f2c565b34801561046957600080fd5b50610296610478366004612d3b565b610fb8565b34801561048957600080fd5b5061033a610498366004612d3b565b610ff3565b3480156104a957600080fd5b50610269611077565b3480156104be57600080fd5b5061033a6104cd366004612f62565b611086565b3480156104de57600080fd5b506102e36110ee565b3480156104f357600080fd5b506009546001600160a01b0316610296565b34801561051157600080fd5b50600f54601054601154610574926001600160401b0380821693600160401b830461ffff1693600160501b9093046001600160a01b031692909163ffffffff8216916401000000008104821691600160601b82041690600160a01b900460ff1688565b604080516001600160401b03998a16815261ffff90981660208901526001600160a01b0390961695870195909552606086019390935263ffffffff9091166080850152841660a08401529290921660c082015290151560e08201526101000161024b565b3480156105e457600080fd5b5061033a6105f3366004612f62565b600e6020526000908152604090205481565b34801561061157600080fd5b506102e3610620366004612ee6565b611124565b34801561063157600080fd5b506102696113c6565b34801561064657600080fd5b506102e3610655366004612f8d565b6113d5565b34801561066657600080fd5b506102e3610675366004612fc6565b611482565b34801561068657600080fd5b50610269610695366004612d3b565b6114d5565b3480156106a657600080fd5b5061033a6106b5366004612d69565b611604565b3480156106c657600080fd5b5061023f6106d5366004613031565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61033a610711366004612d3b565b6116b5565b34801561072257600080fd5b506102e3610731366004612f1a565b61199f565b34801561074257600080fd5b506102e3610751366004612f62565b6119e0565b34801561076257600080fd5b506102e3611a78565b34801561077757600080fd5b5061033a600281565b60006001600160e01b031982166380ac58cd60e01b14806107b157506001600160e01b03198216635b5e139f60e01b145b806107cc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600680546107e19061305f565b80601f016020809104026020016040519081016040528092919081815260200182805461080d9061305f565b801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b5050505050905090565b600061086f82611b54565b6108ae5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdb995e1a5cdd195b9d60aa1b60448201526064015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600c80546108d79061305f565b80601f01602080910402602001604051908101604052809291908181526020018280546109039061305f565b80156109505780601f1061092557610100808354040283529160200191610950565b820191906000526020600020905b81548152906001019060200180831161093357829003601f168201915b505050505081565b600061096382610fb8565b9050806001600160a01b0316836001600160a01b0316036109b15760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd985b60c21b60448201526064016108a5565b336001600160a01b03821614806109cd57506109cd81336106d5565b610a045760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd985b60c21b60448201526064016108a5565b610a0e8383611b61565b505050565b600b546001600160a01b0316631222cea6336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8d91906130a4565b610aaa576040516311ebaa2760e11b815260040160405180910390fd5b610ab5335b82611bcf565b1580610ad2575033610ac682610fb8565b6001600160a01b031614155b15610aef576040516282b42960e81b815260040160405180910390fd5b610af881611c92565b604080516001600160401b0384168152602081018390526001600160a01b038516917f40b70b451dc629fad6a565da866d93b8c178df2cb218fc32f6af8041165309c191015b60405180910390a2505050565b6000610b576001611d15565b905090565b610b6533610aaf565b610b9c5760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd995960c21b60448201526064016108a5565b610a0e838383611d20565b600b546001600160a01b0316631222cea6336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2191906130a4565b610c3e576040516311ebaa2760e11b815260040160405180910390fd5b610c4781611b54565b15610c685760405163124bad6360e31b8152600481018290526024016108a5565b610c728382611e56565b604080516001600160401b0384168152602081018390526001600160a01b038516917f780140c12a9c67a3a283c7f237e9577318a108e1dfdeb57542a4655c89be38b79101610b3e565b6001600160a01b0382166000908152602081905260408120610cde9083611e70565b9392505050565b601154600160a01b900460ff1615610d1057604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b03163314610d3a5760405162461bcd60e51b81526004016108a5906130c1565b600d54600f80546001600160401b03610100909304831667ffffffffffffffff199091161790556011805442909216600160601b0267ffffffffffffffff60601b19909216919091179055610d8c3390565b600f54604080516001600160401b0390921682524260208301526001600160a01b0392909216917fc0786675f6128bc0b8e886ad509fa0cc374ec4c3efe21e941920ea683bd1741d91015b60405180910390a2565b610a0e83838360405180602001604052806000815250611482565b6009546000906001600160a01b03163314610e295760405162461bcd60e51b81526004016108a5906130c1565b600d5460ff1615610e4c576040516282b42960e81b815260040160405180910390fd5b60008060008060008087806020019051810190610e699190613146565b600b80546001600160a01b0319166001600160a01b038316179055949a509298509096509450925090508451610ea690600c906020880190612c04565b50610eb086611e7c565b610eb9826119e0565b600d805460ff19166001179055610ed08484611e8f565b600196505050505050505b919050565b600080610eee600184611eb6565b509392505050565b6009546001600160a01b03163314610f205760405162461bcd60e51b81526004016108a5906130c1565b610f2981611e7c565b50565b60006107cc82600b60009054906101000a90046001600160a01b03166001600160a01b0316630c1119bb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa99190613212565b610fb39190613241565b611ed2565b60006107cc826040518060400160405280600b81526020016a1b9bdb995e1a5cdd195b9d60aa1b8152506001611fc99092919063ffffffff16565b600081600b60009054906101000a90046001600160a01b03166001600160a01b0316630c1119bb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106d9190613212565b6107cc9190613241565b6060600880546107e19061305f565b60006001600160a01b0382166110cd5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016108a5565b6001600160a01b03821660009081526020819052604090206107cc90611fd6565b6009546001600160a01b031633146111185760405162461bcd60e51b81526004016108a5906130c1565b6111226000611fe0565b565b601154600160a01b900460ff161561114f57604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b031633146111795760405162461bcd60e51b81526004016108a5906130c1565b60115464010000000090046001600160401b0316158015906111ad575060115464010000000090046001600160401b031642115b156111cb57604051630571129f60e51b815260040160405180910390fd5b6000818060200190518101906111e19190613291565b9050428160a001516001600160401b031611158061121957508060a001516001600160401b03168160c001516001600160401b031611155b8061122c57506032816020015161ffff16115b80611242575060408101516001600160a01b0316155b15611260576040516371dff4bd60e11b815260040160405180910390fd5b604080516101008101825282516001600160401b0390811680835260208086015161ffff16908401819052858501516001600160a01b031694840185905260608087015190850181905260808088015163ffffffff1690860181905260a080890151861690870181905260c0808a0151909616958701869052600060e090970196909652600f805469ffffffffffffffffffff1916909417600160401b909302929092177fffff0000000000000000000000000000000000000000ffffffffffffffffffff16600160501b90960295909517909155601093909355601180546bffffffffffffffffffffffff19169093176401000000009092029190911768ffffffffffffffffff60601b1916600160601b90910260ff60a01b1916179055336001600160a01b03167f7f5a7a2bf5c04c7c8759c017a2991abaf03db78e2595e806fe7b6add4dffe4b6426040516113ba91815260200190565b60405180910390a25050565b6060600780546107e19061305f565b336001600160a01b038316036114165760405162461bcd60e51b815260206004820152600660248201526531b0b63632b960d11b60448201526064016108a5565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61148c3383611bcf565b6114c35760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd995960c21b60448201526064016108a5565b6114cf84848484612032565b50505050565b60606114e082611b54565b6115005760405163124bad6360e31b8152600481018390526024016108a5565b6000600c805461150f9061305f565b905011156115a957600c80546115249061305f565b80601f01602080910402602001604051908101604052809291908181526020018280546115509061305f565b801561159d5780601f106115725761010080835404028352916020019161159d565b820191906000526020600020905b81548152906001019060200180831161158057829003601f168201915b50505050509050919050565b60006115b3611077565b905060008151116115d35760405180602001604052806000815250610cde565b806115dd84612083565b6040516020016115ee929190613353565b6040516020818303038152906040529392505050565b6009546000906001600160a01b031633146116315760405162461bcd60e51b81526004016108a5906130c1565b600f5482906001600160401b0316158015906116745750600f54600d546001600160401b03909116906116729061010090046001600160e01b031683613392565b115b15611692576040516352df9fe560e01b815260040160405180910390fd5b61169c8484612183565b5050600d5461010090046001600160e01b031692915050565b601154600090600160a01b900460ff16156116e357604051631afb0ae560e01b815260040160405180910390fd5b600f5482906001600160401b0316158015906117265750600f54600d546001600160401b03909116906117249061010090046001600160e01b031683613392565b115b15611744576040516352df9fe560e01b815260040160405180910390fd5b61174c612293565b61176957604051630fe219dd60e21b815260040160405180910390fd5b6002600a54036117bb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a5565b6002600a55600f543390600090600160401b900461ffff166117df57601054611814565b600f546010546118149161180b916064916118059190600160401b900461ffff166122cf565b906122db565b601054906122e7565b9050600061183461182487610f2c565b61182e84896122cf565b906122f3565b90508034101561185a5760405163c5a8df2f60e01b8152600481018290526024016108a5565b60115463ffffffff16158015906118a057506011546001600160a01b0384166000908152600e602052604090205463ffffffff9182169161189e919089906122f316565b115b156118be57604051631722816d60e01b815260040160405180910390fd5b60006118ca34836122e7565b90506118d68488612183565b6001600160a01b0384166000908152600e6020526040812080548992906118fe908490613392565b9091555061190d9050876122ff565b611917838861245f565b506119228185612519565b600d546000906119489060019061182e908b9061010090046001600160e01b03166133aa565b90508388866001600160a01b03167f5bc97d73357ac0d035d4b9268a69240988a5776b8a4fcced3dbc223960123f408460405161198791815260200190565b60405180910390a46001600a55979650505050505050565b6009546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a5906130c1565b80516119dc90600c906020840190612c04565b5050565b6009546001600160a01b03163314611a0a5760405162461bcd60e51b81526004016108a5906130c1565b6001600160a01b038116611a6f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a5565b610f2981611fe0565b601154600160a01b900460ff1615611aa357604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b03163314611acd5760405162461bcd60e51b81526004016108a5906130c1565b601154600160601b90046001600160401b0316421115611b0057604051631060d8c160e11b815260040160405180910390fd5b6011805460ff60a01b1916600160a01b179055611b1a3390565b6001600160a01b03167f3cf0fddeb2fbf69861d5f13d66be17516300342ce630d94fb7ea3388c0c27dce42604051610dd791815260200190565b60006107cc6001836125a8565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b9682610fb8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611bda82611b54565b611c145760405162461bcd60e51b815260206004820152600b60248201526a1b9bdb995e1a5cdd195b9d60aa1b60448201526064016108a5565b6000611c1f83610fb8565b9050806001600160a01b0316846001600160a01b03161480611c5a5750836001600160a01b0316611c4f84610864565b6001600160a01b0316145b80611c8a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b6000611c9d82610fb8565b9050611caa600083611b61565b6001600160a01b0381166000908152602081905260409020611ccc90836125b4565b50611cd86001836125c0565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006107cc826125cc565b826001600160a01b0316611d3382610fb8565b6001600160a01b031614611d735760405162461bcd60e51b81526020600482015260076024820152663737ba1037bbb760c91b60448201526064016108a5565b6001600160a01b038216611db25760405162461bcd60e51b81526004016108a5906020808252600490820152637a65726f60e01b604082015260600190565b611dbd600082611b61565b6001600160a01b0383166000908152602081905260409020611ddf90826125b4565b506001600160a01b0382166000908152602081905260409020611e0290826125d7565b50611e0f600182846125e3565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6119dc8282604051806020016040528060008152506125f9565b6000610cde838361264a565b80516119dc906008906020840190612c04565b8151611ea2906006906020850190612c04565b508051610a0e906007906020840190612c04565b6000808080611ec58686612674565b9097909650945050505050565b600081600003611ee457506000919050565b600b60009054906101000a90046001600160a01b03166001600160a01b031663a89ae4ba6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b91906133c1565b6001600160a01b031663f5d78161836040518263ffffffff1660e01b8152600401611f8891815260200190565b602060405180830381865afa158015611fa5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc9190613212565b6000611c8a84848461269f565b60006107cc825490565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61203d848484611d20565b612049848484846126eb565b6114cf5760405162461bcd60e51b815260206004820152600b60248201526a34b6b83632b6b2b73a32b960a91b60448201526064016108a5565b6060816000036120aa5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156120d457806120be816133de565b91506120cd9050600a8361340d565b91506120ae565b6000816001600160401b038111156120ee576120ee612e1b565b6040519080825280601f01601f191660200182016040528015612118576020820181803683370190505b5090505b8415611c8a5761212d6001836133aa565b915061213a600a86613421565b612145906030613392565b60f81b81838151811061215a5761215a613435565b60200101906001600160f81b031916908160001a90535061217c600a8661340d565b945061211c565b600061218f60006127c4565b90506000805b8381101561228c576001600d60018282829054906101000a90046001600160e01b03166121c2919061344b565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055505b600d5461220b906122069061010090046001600160e01b031685613392565b611b54565b1561225e576001600d60018282829054906101000a90046001600160e01b0316612235919061344b565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055506121e7565b600d546122789061010090046001600160e01b03166127c4565b91506122848583611e56565b600101612195565b5050505050565b601154600090426401000000009091046001600160401b031611801590610b5757505060115442600160601b9091046001600160401b03161190565b6000610cde8284613241565b6000610cde828461340d565b6000610cde82846133aa565b6000610cde8284613392565b600061230a82610f2c565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b031663c5f956af6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612361573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238591906133c1565b90506000816001600160a01b031683620334505a116123a4575a6123a9565b620334505b6040519091906000818181858888f193505050503d80600081146123e9576040519150601f19603f3d011682016040523d82523d6000602084013e6123ee565b606091505b5050905080612410576040516307a4ced160e51b815260040160405180910390fd5b604080518481526001600160a01b03841660208201528215158183015290517f7d91e6735310f2a10253c2b777a07cdd5bce000456de934af23dfc9e4aea7f879181900360600190a150505050565b600f54600090600160501b90046001600160a01b0316158061247f575082155b1561248c575060006107cc565b600061249884846122cf565b600f549091506124b9908290600160501b90046001600160a01b0316612519565b600f54600160501b90046001600160a01b0316336001600160a01b03167fa92ff919b850e4909ab2261d907ef955f11bc1716733a6cbece38d163a69af8a8360405161250791815260200190565b60405180910390a35060019392505050565b81156119dc576000816001600160a01b031683620334505a1161253c575a612541565b620334505b6040519091906000818181858888f193505050503d8060008114612581576040519150601f19603f3d011682016040523d82523d6000602084013e612586565b606091505b5050905080610a0e576040516307a4ced160e51b815260040160405180910390fd5b6000610cde838361280a565b6000610cde8383612816565b6000610cde8383612909565b60006107cc82611fd6565b6000610cde8383612926565b6000611c8a84846001600160a01b038516612975565b6126038383612992565b61261060008484846126eb565b610a0e5760405162461bcd60e51b815260206004820152600b60248201526a34b6b83632b6b2b73a32b960a91b60448201526064016108a5565b600082600001828154811061266157612661613435565b9060005260206000200154905092915050565b600080806126828585611e70565b600081815260029690960160205260409095205494959350505050565b6000828152600284016020526040812054801515806126c357506126c3858561280a565b83906126e25760405162461bcd60e51b81526004016108a59190612d28565b50949350505050565b60006001600160a01b0384163b61270457506001611c8a565b600061278d630a85bd0160e11b338887876040516024016127289493929190613476565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b0319909516949094179093528051808201909152600b81526a34b6b83632b6b2b73a32b960a91b928101929092526001600160a01b03881691612a7c565b90506000818060200190518101906127a591906134b3565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b604080514660e01b6001600160e01b03191660208083019190915283901b63ffffffff19166024820152600091016040516020818303038152906040526107cc906134d0565b6000610cde8383612a8b565b600081815260018301602052604081205480156128ff57600061283a6001836133aa565b855490915060009061284e906001906133aa565b90508181146128b357600086600001828154811061286e5761286e613435565b906000526020600020015490508087600001848154811061289157612891613435565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128c4576128c46134f4565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107cc565b60009150506107cc565b60008181526002830160205260408120819055610cde83836125b4565b600081815260018301602052604081205461296d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107cc565b5060006107cc565b60008281526002840160205260408120829055611c8a84846125d7565b6001600160a01b0382166129d15760405162461bcd60e51b81526004016108a5906020808252600490820152637a65726f60e01b604082015260600190565b6129da81611b54565b15612a105760405162461bcd60e51b81526020600482015260066024820152651b5a5b9d195960d21b60448201526064016108a5565b6001600160a01b0382166000908152602081905260409020612a3290826125d7565b50612a3f600182846125e3565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060611c8a8484600085612aa3565b60008181526001830160205260408120541515610cde565b606082471015612b045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108a5565b843b612b525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108a5565b600080866001600160a01b03168587604051612b6e919061350a565b60006040518083038185875af1925050503d8060008114612bab576040519150601f19603f3d011682016040523d82523d6000602084013e612bb0565b606091505b5091509150612bc0828286612bcb565b979650505050505050565b60608315612bda575081610cde565b825115612bea5782518084602001fd5b8160405162461bcd60e51b81526004016108a59190612d28565b828054612c109061305f565b90600052602060002090601f016020900481019282612c325760008555612c78565b82601f10612c4b57805160ff1916838001178555612c78565b82800160010185558215612c78579182015b82811115612c78578251825591602001919060010190612c5d565b50612c84929150612c88565b5090565b5b80821115612c845760008155600101612c89565b6001600160e01b031981168114610f2957600080fd5b600060208284031215612cc557600080fd5b8135610cde81612c9d565b60005b83811015612ceb578181015183820152602001612cd3565b838111156114cf5750506000910152565b60008151808452612d14816020860160208601612cd0565b601f01601f19169290920160200192915050565b602081526000610cde6020830184612cfc565b600060208284031215612d4d57600080fd5b5035919050565b6001600160a01b0381168114610f2957600080fd5b60008060408385031215612d7c57600080fd5b8235612d8781612d54565b946020939093013593505050565b6001600160401b0381168114610f2957600080fd5b600080600060608486031215612dbf57600080fd5b8335612dca81612d54565b92506020840135612dda81612d95565b929592945050506040919091013590565b600080600060608486031215612e0057600080fd5b8335612e0b81612d54565b92506020840135612dda81612d54565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e5957612e59612e1b565b604052919050565b60006001600160401b03821115612e7a57612e7a612e1b565b50601f01601f191660200190565b6000612e9b612e9684612e61565b612e31565b9050828152838383011115612eaf57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612ed757600080fd5b610cde83833560208501612e88565b600060208284031215612ef857600080fd5b81356001600160401b03811115612f0e57600080fd5b611c8a84828501612ec6565b600060208284031215612f2c57600080fd5b81356001600160401b03811115612f4257600080fd5b8201601f81018413612f5357600080fd5b611c8a84823560208401612e88565b600060208284031215612f7457600080fd5b8135610cde81612d54565b8015158114610f2957600080fd5b60008060408385031215612fa057600080fd5b8235612fab81612d54565b91506020830135612fbb81612f7f565b809150509250929050565b60008060008060808587031215612fdc57600080fd5b8435612fe781612d54565b93506020850135612ff781612d54565b92506040850135915060608501356001600160401b0381111561301957600080fd5b61302587828801612ec6565b91505092959194509250565b6000806040838503121561304457600080fd5b823561304f81612d54565b91506020830135612fbb81612d54565b600181811c9082168061307357607f821691505b60208210810361309357634e487b7160e01b600052602260045260246000fd5b50919050565b8051610edb81612f7f565b6000602082840312156130b657600080fd5b8151610cde81612f7f565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082601f83011261310757600080fd5b8151613115612e9682612e61565b81815284602083860101111561312a57600080fd5b611c8a826020830160208701612cd0565b8051610edb81612d54565b60008060008060008060c0878903121561315f57600080fd5b86516001600160401b038082111561317657600080fd5b6131828a838b016130f6565b9750602089015191508082111561319857600080fd5b6131a48a838b016130f6565b965060408901519150808211156131ba57600080fd5b6131c68a838b016130f6565b955060608901519150808211156131dc57600080fd5b506131e989828a016130f6565b9350506131f86080880161313b565b915061320660a0880161313b565b90509295509295509295565b60006020828403121561322457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561325b5761325b61322b565b500290565b8051610edb81612d95565b805161ffff81168114610edb57600080fd5b805163ffffffff81168114610edb57600080fd5b60006101008083850312156132a557600080fd5b604051908101906001600160401b03821181831017156132c7576132c7612e1b565b81604052835191506132d882612d95565b8181526132e76020850161326b565b60208201526132f86040850161313b565b6040820152606084015160608201526133136080850161327d565b608082015261332460a08501613260565b60a082015261333560c08501613260565b60c082015261334660e08501613099565b60e0820152949350505050565b60008351613365818460208801612cd0565b835190830190613379818360208801612cd0565b64173539b7b760d91b9101908152600501949350505050565b600082198211156133a5576133a561322b565b500190565b6000828210156133bc576133bc61322b565b500390565b6000602082840312156133d357600080fd5b8151610cde81612d54565b6000600182016133f0576133f061322b565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261341c5761341c6133f7565b500490565b600082613430576134306133f7565b500690565b634e487b7160e01b600052603260045260246000fd5b60006001600160e01b0382811684821680830382111561346d5761346d61322b565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134a990830184612cfc565b9695505050505050565b6000602082840312156134c557600080fd5b8151610cde81612c9d565b805160208083015191908110156130935760001960209190910360031b1b16919050565b634e487b7160e01b600052603160045260246000fd5b6000825161351c818460208701612cd0565b919091019291505056fea2646970667358221220dfacd2850259427bc6170826cb50923f4b7189b7dd2ee7a289658655e60ba8e064736f6c634300080d0033
Deployed Bytecode
0x60806040526004361061021a5760003560e01c806366edd34d11610123578063a22cb465116100ab578063efef39a11161006f578063efef39a114610703578063f2c4ce1e14610716578063f2fde38b14610736578063f5a0384c14610756578063ffa1ad741461076b57600080fd5b8063a22cb4651461063a578063b88d4fde1461065a578063c87b56dd1461067a578063e58306f91461069a578063e985e9c5146106ba57600080fd5b80638da5cb5b116100f25780638da5cb5b146104e757806390aa0b0f146105055780639123f01e146105d857806394847d621461060557806395d89b411461062557600080fd5b806366edd34d1461047d5780636c0360eb1461049d57806370a08231146104b2578063715018a6146104d257600080fd5b80632cde1215116101a65780634ddf47d4116101755780634ddf47d4146103dd5780634f6ccce7146103fd57806355f804b31461041d578063616985ed1461043d5780636352211e1461045d57600080fd5b80632cde1215146103685780632f745c591461038857806341e96eb1146103a857806342842e0e146103bd57600080fd5b8063095ea7b3116101ed578063095ea7b3146102c35780630e21ea06146102e55780630e46c9a61461030557806318160ddd1461032557806323b872dd1461034857600080fd5b806301ffc9a71461021f57806306fdde0314610254578063081812fc14610276578063081c8c44146102ae575b600080fd5b34801561022b57600080fd5b5061023f61023a366004612cb3565b610780565b60405190151581526020015b60405180910390f35b34801561026057600080fd5b506102696107d2565b60405161024b9190612d28565b34801561028257600080fd5b50610296610291366004612d3b565b610864565b6040516001600160a01b03909116815260200161024b565b3480156102ba57600080fd5b506102696108ca565b3480156102cf57600080fd5b506102e36102de366004612d69565b610958565b005b3480156102f157600080fd5b50600b54610296906001600160a01b031681565b34801561031157600080fd5b506102e3610320366004612daa565b610a13565b34801561033157600080fd5b5061033a610b4b565b60405190815260200161024b565b34801561035457600080fd5b506102e3610363366004612deb565b610b5c565b34801561037457600080fd5b506102e3610383366004612daa565b610ba7565b34801561039457600080fd5b5061033a6103a3366004612d69565b610cbc565b3480156103b457600080fd5b506102e3610ce5565b3480156103c957600080fd5b506102e36103d8366004612deb565b610de1565b3480156103e957600080fd5b5061023f6103f8366004612ee6565b610dfc565b34801561040957600080fd5b5061033a610418366004612d3b565b610ee0565b34801561042957600080fd5b506102e3610438366004612f1a565b610ef6565b34801561044957600080fd5b5061033a610458366004612d3b565b610f2c565b34801561046957600080fd5b50610296610478366004612d3b565b610fb8565b34801561048957600080fd5b5061033a610498366004612d3b565b610ff3565b3480156104a957600080fd5b50610269611077565b3480156104be57600080fd5b5061033a6104cd366004612f62565b611086565b3480156104de57600080fd5b506102e36110ee565b3480156104f357600080fd5b506009546001600160a01b0316610296565b34801561051157600080fd5b50600f54601054601154610574926001600160401b0380821693600160401b830461ffff1693600160501b9093046001600160a01b031692909163ffffffff8216916401000000008104821691600160601b82041690600160a01b900460ff1688565b604080516001600160401b03998a16815261ffff90981660208901526001600160a01b0390961695870195909552606086019390935263ffffffff9091166080850152841660a08401529290921660c082015290151560e08201526101000161024b565b3480156105e457600080fd5b5061033a6105f3366004612f62565b600e6020526000908152604090205481565b34801561061157600080fd5b506102e3610620366004612ee6565b611124565b34801561063157600080fd5b506102696113c6565b34801561064657600080fd5b506102e3610655366004612f8d565b6113d5565b34801561066657600080fd5b506102e3610675366004612fc6565b611482565b34801561068657600080fd5b50610269610695366004612d3b565b6114d5565b3480156106a657600080fd5b5061033a6106b5366004612d69565b611604565b3480156106c657600080fd5b5061023f6106d5366004613031565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61033a610711366004612d3b565b6116b5565b34801561072257600080fd5b506102e3610731366004612f1a565b61199f565b34801561074257600080fd5b506102e3610751366004612f62565b6119e0565b34801561076257600080fd5b506102e3611a78565b34801561077757600080fd5b5061033a600281565b60006001600160e01b031982166380ac58cd60e01b14806107b157506001600160e01b03198216635b5e139f60e01b145b806107cc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600680546107e19061305f565b80601f016020809104026020016040519081016040528092919081815260200182805461080d9061305f565b801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b5050505050905090565b600061086f82611b54565b6108ae5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdb995e1a5cdd195b9d60aa1b60448201526064015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600c80546108d79061305f565b80601f01602080910402602001604051908101604052809291908181526020018280546109039061305f565b80156109505780601f1061092557610100808354040283529160200191610950565b820191906000526020600020905b81548152906001019060200180831161093357829003601f168201915b505050505081565b600061096382610fb8565b9050806001600160a01b0316836001600160a01b0316036109b15760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd985b60c21b60448201526064016108a5565b336001600160a01b03821614806109cd57506109cd81336106d5565b610a045760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd985b60c21b60448201526064016108a5565b610a0e8383611b61565b505050565b600b546001600160a01b0316631222cea6336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8d91906130a4565b610aaa576040516311ebaa2760e11b815260040160405180910390fd5b610ab5335b82611bcf565b1580610ad2575033610ac682610fb8565b6001600160a01b031614155b15610aef576040516282b42960e81b815260040160405180910390fd5b610af881611c92565b604080516001600160401b0384168152602081018390526001600160a01b038516917f40b70b451dc629fad6a565da866d93b8c178df2cb218fc32f6af8041165309c191015b60405180910390a2505050565b6000610b576001611d15565b905090565b610b6533610aaf565b610b9c5760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd995960c21b60448201526064016108a5565b610a0e838383611d20565b600b546001600160a01b0316631222cea6336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2191906130a4565b610c3e576040516311ebaa2760e11b815260040160405180910390fd5b610c4781611b54565b15610c685760405163124bad6360e31b8152600481018290526024016108a5565b610c728382611e56565b604080516001600160401b0384168152602081018390526001600160a01b038516917f780140c12a9c67a3a283c7f237e9577318a108e1dfdeb57542a4655c89be38b79101610b3e565b6001600160a01b0382166000908152602081905260408120610cde9083611e70565b9392505050565b601154600160a01b900460ff1615610d1057604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b03163314610d3a5760405162461bcd60e51b81526004016108a5906130c1565b600d54600f80546001600160401b03610100909304831667ffffffffffffffff199091161790556011805442909216600160601b0267ffffffffffffffff60601b19909216919091179055610d8c3390565b600f54604080516001600160401b0390921682524260208301526001600160a01b0392909216917fc0786675f6128bc0b8e886ad509fa0cc374ec4c3efe21e941920ea683bd1741d91015b60405180910390a2565b610a0e83838360405180602001604052806000815250611482565b6009546000906001600160a01b03163314610e295760405162461bcd60e51b81526004016108a5906130c1565b600d5460ff1615610e4c576040516282b42960e81b815260040160405180910390fd5b60008060008060008087806020019051810190610e699190613146565b600b80546001600160a01b0319166001600160a01b038316179055949a509298509096509450925090508451610ea690600c906020880190612c04565b50610eb086611e7c565b610eb9826119e0565b600d805460ff19166001179055610ed08484611e8f565b600196505050505050505b919050565b600080610eee600184611eb6565b509392505050565b6009546001600160a01b03163314610f205760405162461bcd60e51b81526004016108a5906130c1565b610f2981611e7c565b50565b60006107cc82600b60009054906101000a90046001600160a01b03166001600160a01b0316630c1119bb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa99190613212565b610fb39190613241565b611ed2565b60006107cc826040518060400160405280600b81526020016a1b9bdb995e1a5cdd195b9d60aa1b8152506001611fc99092919063ffffffff16565b600081600b60009054906101000a90046001600160a01b03166001600160a01b0316630c1119bb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106d9190613212565b6107cc9190613241565b6060600880546107e19061305f565b60006001600160a01b0382166110cd5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016108a5565b6001600160a01b03821660009081526020819052604090206107cc90611fd6565b6009546001600160a01b031633146111185760405162461bcd60e51b81526004016108a5906130c1565b6111226000611fe0565b565b601154600160a01b900460ff161561114f57604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b031633146111795760405162461bcd60e51b81526004016108a5906130c1565b60115464010000000090046001600160401b0316158015906111ad575060115464010000000090046001600160401b031642115b156111cb57604051630571129f60e51b815260040160405180910390fd5b6000818060200190518101906111e19190613291565b9050428160a001516001600160401b031611158061121957508060a001516001600160401b03168160c001516001600160401b031611155b8061122c57506032816020015161ffff16115b80611242575060408101516001600160a01b0316155b15611260576040516371dff4bd60e11b815260040160405180910390fd5b604080516101008101825282516001600160401b0390811680835260208086015161ffff16908401819052858501516001600160a01b031694840185905260608087015190850181905260808088015163ffffffff1690860181905260a080890151861690870181905260c0808a0151909616958701869052600060e090970196909652600f805469ffffffffffffffffffff1916909417600160401b909302929092177fffff0000000000000000000000000000000000000000ffffffffffffffffffff16600160501b90960295909517909155601093909355601180546bffffffffffffffffffffffff19169093176401000000009092029190911768ffffffffffffffffff60601b1916600160601b90910260ff60a01b1916179055336001600160a01b03167f7f5a7a2bf5c04c7c8759c017a2991abaf03db78e2595e806fe7b6add4dffe4b6426040516113ba91815260200190565b60405180910390a25050565b6060600780546107e19061305f565b336001600160a01b038316036114165760405162461bcd60e51b815260206004820152600660248201526531b0b63632b960d11b60448201526064016108a5565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61148c3383611bcf565b6114c35760405162461bcd60e51b8152602060048201526008602482015267185c1c1c9bdd995960c21b60448201526064016108a5565b6114cf84848484612032565b50505050565b60606114e082611b54565b6115005760405163124bad6360e31b8152600481018390526024016108a5565b6000600c805461150f9061305f565b905011156115a957600c80546115249061305f565b80601f01602080910402602001604051908101604052809291908181526020018280546115509061305f565b801561159d5780601f106115725761010080835404028352916020019161159d565b820191906000526020600020905b81548152906001019060200180831161158057829003601f168201915b50505050509050919050565b60006115b3611077565b905060008151116115d35760405180602001604052806000815250610cde565b806115dd84612083565b6040516020016115ee929190613353565b6040516020818303038152906040529392505050565b6009546000906001600160a01b031633146116315760405162461bcd60e51b81526004016108a5906130c1565b600f5482906001600160401b0316158015906116745750600f54600d546001600160401b03909116906116729061010090046001600160e01b031683613392565b115b15611692576040516352df9fe560e01b815260040160405180910390fd5b61169c8484612183565b5050600d5461010090046001600160e01b031692915050565b601154600090600160a01b900460ff16156116e357604051631afb0ae560e01b815260040160405180910390fd5b600f5482906001600160401b0316158015906117265750600f54600d546001600160401b03909116906117249061010090046001600160e01b031683613392565b115b15611744576040516352df9fe560e01b815260040160405180910390fd5b61174c612293565b61176957604051630fe219dd60e21b815260040160405180910390fd5b6002600a54036117bb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a5565b6002600a55600f543390600090600160401b900461ffff166117df57601054611814565b600f546010546118149161180b916064916118059190600160401b900461ffff166122cf565b906122db565b601054906122e7565b9050600061183461182487610f2c565b61182e84896122cf565b906122f3565b90508034101561185a5760405163c5a8df2f60e01b8152600481018290526024016108a5565b60115463ffffffff16158015906118a057506011546001600160a01b0384166000908152600e602052604090205463ffffffff9182169161189e919089906122f316565b115b156118be57604051631722816d60e01b815260040160405180910390fd5b60006118ca34836122e7565b90506118d68488612183565b6001600160a01b0384166000908152600e6020526040812080548992906118fe908490613392565b9091555061190d9050876122ff565b611917838861245f565b506119228185612519565b600d546000906119489060019061182e908b9061010090046001600160e01b03166133aa565b90508388866001600160a01b03167f5bc97d73357ac0d035d4b9268a69240988a5776b8a4fcced3dbc223960123f408460405161198791815260200190565b60405180910390a46001600a55979650505050505050565b6009546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a5906130c1565b80516119dc90600c906020840190612c04565b5050565b6009546001600160a01b03163314611a0a5760405162461bcd60e51b81526004016108a5906130c1565b6001600160a01b038116611a6f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a5565b610f2981611fe0565b601154600160a01b900460ff1615611aa357604051631afb0ae560e01b815260040160405180910390fd5b6009546001600160a01b03163314611acd5760405162461bcd60e51b81526004016108a5906130c1565b601154600160601b90046001600160401b0316421115611b0057604051631060d8c160e11b815260040160405180910390fd5b6011805460ff60a01b1916600160a01b179055611b1a3390565b6001600160a01b03167f3cf0fddeb2fbf69861d5f13d66be17516300342ce630d94fb7ea3388c0c27dce42604051610dd791815260200190565b60006107cc6001836125a8565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b9682610fb8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611bda82611b54565b611c145760405162461bcd60e51b815260206004820152600b60248201526a1b9bdb995e1a5cdd195b9d60aa1b60448201526064016108a5565b6000611c1f83610fb8565b9050806001600160a01b0316846001600160a01b03161480611c5a5750836001600160a01b0316611c4f84610864565b6001600160a01b0316145b80611c8a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b6000611c9d82610fb8565b9050611caa600083611b61565b6001600160a01b0381166000908152602081905260409020611ccc90836125b4565b50611cd86001836125c0565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006107cc826125cc565b826001600160a01b0316611d3382610fb8565b6001600160a01b031614611d735760405162461bcd60e51b81526020600482015260076024820152663737ba1037bbb760c91b60448201526064016108a5565b6001600160a01b038216611db25760405162461bcd60e51b81526004016108a5906020808252600490820152637a65726f60e01b604082015260600190565b611dbd600082611b61565b6001600160a01b0383166000908152602081905260409020611ddf90826125b4565b506001600160a01b0382166000908152602081905260409020611e0290826125d7565b50611e0f600182846125e3565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6119dc8282604051806020016040528060008152506125f9565b6000610cde838361264a565b80516119dc906008906020840190612c04565b8151611ea2906006906020850190612c04565b508051610a0e906007906020840190612c04565b6000808080611ec58686612674565b9097909650945050505050565b600081600003611ee457506000919050565b600b60009054906101000a90046001600160a01b03166001600160a01b031663a89ae4ba6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b91906133c1565b6001600160a01b031663f5d78161836040518263ffffffff1660e01b8152600401611f8891815260200190565b602060405180830381865afa158015611fa5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc9190613212565b6000611c8a84848461269f565b60006107cc825490565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61203d848484611d20565b612049848484846126eb565b6114cf5760405162461bcd60e51b815260206004820152600b60248201526a34b6b83632b6b2b73a32b960a91b60448201526064016108a5565b6060816000036120aa5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156120d457806120be816133de565b91506120cd9050600a8361340d565b91506120ae565b6000816001600160401b038111156120ee576120ee612e1b565b6040519080825280601f01601f191660200182016040528015612118576020820181803683370190505b5090505b8415611c8a5761212d6001836133aa565b915061213a600a86613421565b612145906030613392565b60f81b81838151811061215a5761215a613435565b60200101906001600160f81b031916908160001a90535061217c600a8661340d565b945061211c565b600061218f60006127c4565b90506000805b8381101561228c576001600d60018282829054906101000a90046001600160e01b03166121c2919061344b565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055505b600d5461220b906122069061010090046001600160e01b031685613392565b611b54565b1561225e576001600d60018282829054906101000a90046001600160e01b0316612235919061344b565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055506121e7565b600d546122789061010090046001600160e01b03166127c4565b91506122848583611e56565b600101612195565b5050505050565b601154600090426401000000009091046001600160401b031611801590610b5757505060115442600160601b9091046001600160401b03161190565b6000610cde8284613241565b6000610cde828461340d565b6000610cde82846133aa565b6000610cde8284613392565b600061230a82610f2c565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b031663c5f956af6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612361573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238591906133c1565b90506000816001600160a01b031683620334505a116123a4575a6123a9565b620334505b6040519091906000818181858888f193505050503d80600081146123e9576040519150601f19603f3d011682016040523d82523d6000602084013e6123ee565b606091505b5050905080612410576040516307a4ced160e51b815260040160405180910390fd5b604080518481526001600160a01b03841660208201528215158183015290517f7d91e6735310f2a10253c2b777a07cdd5bce000456de934af23dfc9e4aea7f879181900360600190a150505050565b600f54600090600160501b90046001600160a01b0316158061247f575082155b1561248c575060006107cc565b600061249884846122cf565b600f549091506124b9908290600160501b90046001600160a01b0316612519565b600f54600160501b90046001600160a01b0316336001600160a01b03167fa92ff919b850e4909ab2261d907ef955f11bc1716733a6cbece38d163a69af8a8360405161250791815260200190565b60405180910390a35060019392505050565b81156119dc576000816001600160a01b031683620334505a1161253c575a612541565b620334505b6040519091906000818181858888f193505050503d8060008114612581576040519150601f19603f3d011682016040523d82523d6000602084013e612586565b606091505b5050905080610a0e576040516307a4ced160e51b815260040160405180910390fd5b6000610cde838361280a565b6000610cde8383612816565b6000610cde8383612909565b60006107cc82611fd6565b6000610cde8383612926565b6000611c8a84846001600160a01b038516612975565b6126038383612992565b61261060008484846126eb565b610a0e5760405162461bcd60e51b815260206004820152600b60248201526a34b6b83632b6b2b73a32b960a91b60448201526064016108a5565b600082600001828154811061266157612661613435565b9060005260206000200154905092915050565b600080806126828585611e70565b600081815260029690960160205260409095205494959350505050565b6000828152600284016020526040812054801515806126c357506126c3858561280a565b83906126e25760405162461bcd60e51b81526004016108a59190612d28565b50949350505050565b60006001600160a01b0384163b61270457506001611c8a565b600061278d630a85bd0160e11b338887876040516024016127289493929190613476565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b0319909516949094179093528051808201909152600b81526a34b6b83632b6b2b73a32b960a91b928101929092526001600160a01b03881691612a7c565b90506000818060200190518101906127a591906134b3565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b604080514660e01b6001600160e01b03191660208083019190915283901b63ffffffff19166024820152600091016040516020818303038152906040526107cc906134d0565b6000610cde8383612a8b565b600081815260018301602052604081205480156128ff57600061283a6001836133aa565b855490915060009061284e906001906133aa565b90508181146128b357600086600001828154811061286e5761286e613435565b906000526020600020015490508087600001848154811061289157612891613435565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128c4576128c46134f4565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107cc565b60009150506107cc565b60008181526002830160205260408120819055610cde83836125b4565b600081815260018301602052604081205461296d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107cc565b5060006107cc565b60008281526002840160205260408120829055611c8a84846125d7565b6001600160a01b0382166129d15760405162461bcd60e51b81526004016108a5906020808252600490820152637a65726f60e01b604082015260600190565b6129da81611b54565b15612a105760405162461bcd60e51b81526020600482015260066024820152651b5a5b9d195960d21b60448201526064016108a5565b6001600160a01b0382166000908152602081905260409020612a3290826125d7565b50612a3f600182846125e3565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060611c8a8484600085612aa3565b60008181526001830160205260408120541515610cde565b606082471015612b045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108a5565b843b612b525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108a5565b600080866001600160a01b03168587604051612b6e919061350a565b60006040518083038185875af1925050503d8060008114612bab576040519150601f19603f3d011682016040523d82523d6000602084013e612bb0565b606091505b5091509150612bc0828286612bcb565b979650505050505050565b60608315612bda575081610cde565b825115612bea5782518084602001fd5b8160405162461bcd60e51b81526004016108a59190612d28565b828054612c109061305f565b90600052602060002090601f016020900481019282612c325760008555612c78565b82601f10612c4b57805160ff1916838001178555612c78565b82800160010185558215612c78579182015b82811115612c78578251825591602001919060010190612c5d565b50612c84929150612c88565b5090565b5b80821115612c845760008155600101612c89565b6001600160e01b031981168114610f2957600080fd5b600060208284031215612cc557600080fd5b8135610cde81612c9d565b60005b83811015612ceb578181015183820152602001612cd3565b838111156114cf5750506000910152565b60008151808452612d14816020860160208601612cd0565b601f01601f19169290920160200192915050565b602081526000610cde6020830184612cfc565b600060208284031215612d4d57600080fd5b5035919050565b6001600160a01b0381168114610f2957600080fd5b60008060408385031215612d7c57600080fd5b8235612d8781612d54565b946020939093013593505050565b6001600160401b0381168114610f2957600080fd5b600080600060608486031215612dbf57600080fd5b8335612dca81612d54565b92506020840135612dda81612d95565b929592945050506040919091013590565b600080600060608486031215612e0057600080fd5b8335612e0b81612d54565b92506020840135612dda81612d54565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e5957612e59612e1b565b604052919050565b60006001600160401b03821115612e7a57612e7a612e1b565b50601f01601f191660200190565b6000612e9b612e9684612e61565b612e31565b9050828152838383011115612eaf57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612ed757600080fd5b610cde83833560208501612e88565b600060208284031215612ef857600080fd5b81356001600160401b03811115612f0e57600080fd5b611c8a84828501612ec6565b600060208284031215612f2c57600080fd5b81356001600160401b03811115612f4257600080fd5b8201601f81018413612f5357600080fd5b611c8a84823560208401612e88565b600060208284031215612f7457600080fd5b8135610cde81612d54565b8015158114610f2957600080fd5b60008060408385031215612fa057600080fd5b8235612fab81612d54565b91506020830135612fbb81612f7f565b809150509250929050565b60008060008060808587031215612fdc57600080fd5b8435612fe781612d54565b93506020850135612ff781612d54565b92506040850135915060608501356001600160401b0381111561301957600080fd5b61302587828801612ec6565b91505092959194509250565b6000806040838503121561304457600080fd5b823561304f81612d54565b91506020830135612fbb81612d54565b600181811c9082168061307357607f821691505b60208210810361309357634e487b7160e01b600052602260045260246000fd5b50919050565b8051610edb81612f7f565b6000602082840312156130b657600080fd5b8151610cde81612f7f565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082601f83011261310757600080fd5b8151613115612e9682612e61565b81815284602083860101111561312a57600080fd5b611c8a826020830160208701612cd0565b8051610edb81612d54565b60008060008060008060c0878903121561315f57600080fd5b86516001600160401b038082111561317657600080fd5b6131828a838b016130f6565b9750602089015191508082111561319857600080fd5b6131a48a838b016130f6565b965060408901519150808211156131ba57600080fd5b6131c68a838b016130f6565b955060608901519150808211156131dc57600080fd5b506131e989828a016130f6565b9350506131f86080880161313b565b915061320660a0880161313b565b90509295509295509295565b60006020828403121561322457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561325b5761325b61322b565b500290565b8051610edb81612d95565b805161ffff81168114610edb57600080fd5b805163ffffffff81168114610edb57600080fd5b60006101008083850312156132a557600080fd5b604051908101906001600160401b03821181831017156132c7576132c7612e1b565b81604052835191506132d882612d95565b8181526132e76020850161326b565b60208201526132f86040850161313b565b6040820152606084015160608201526133136080850161327d565b608082015261332460a08501613260565b60a082015261333560c08501613260565b60c082015261334660e08501613099565b60e0820152949350505050565b60008351613365818460208801612cd0565b835190830190613379818360208801612cd0565b64173539b7b760d91b9101908152600501949350505050565b600082198211156133a5576133a561322b565b500190565b6000828210156133bc576133bc61322b565b500390565b6000602082840312156133d357600080fd5b8151610cde81612d54565b6000600182016133f0576133f061322b565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261341c5761341c6133f7565b500490565b600082613430576134306133f7565b500690565b634e487b7160e01b600052603260045260246000fd5b60006001600160e01b0382811684821680830382111561346d5761346d61322b565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134a990830184612cfc565b9695505050505050565b6000602082840312156134c557600080fd5b8151610cde81612c9d565b805160208083015191908110156130935760001960209190910360031b1b16919050565b634e487b7160e01b600052603160045260246000fd5b6000825161351c818460208701612cd0565b919091019291505056fea2646970667358221220dfacd2850259427bc6170826cb50923f4b7189b7dd2ee7a289658655e60ba8e064736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.