Overview
ETH Balance
0.404 ETH
Eth Value
$1,456.98 (@ $3,606.38/ETH)More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 400 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Animation Ba... | 19607786 | 239 days ago | IN | 0 ETH | 0.00045213 | ||||
Update Config | 19607630 | 239 days ago | IN | 0 ETH | 0.0004911 | ||||
Public Mint | 19607620 | 239 days ago | IN | 0.07 ETH | 0.00151075 | ||||
Set Approval For... | 18844181 | 346 days ago | IN | 0 ETH | 0.00125489 | ||||
Safe Transfer Fr... | 18801171 | 352 days ago | IN | 0 ETH | 0.00385997 | ||||
Update Config | 18791944 | 353 days ago | IN | 0 ETH | 0.00255002 | ||||
Public Mint | 18791939 | 353 days ago | IN | 0.07 ETH | 0.00698873 | ||||
Safe Transfer Fr... | 17957297 | 470 days ago | IN | 0 ETH | 0.00164161 | ||||
Safe Transfer Fr... | 17957289 | 470 days ago | IN | 0 ETH | 0.00225292 | ||||
Safe Transfer Fr... | 17957285 | 470 days ago | IN | 0 ETH | 0.00206326 | ||||
Release | 17670911 | 510 days ago | IN | 0 ETH | 0.00129792 | ||||
Transfer From | 17073931 | 594 days ago | IN | 0 ETH | 0.00440345 | ||||
Safe Transfer Fr... | 16972019 | 609 days ago | IN | 0 ETH | 0.00254 | ||||
Set Approval For... | 16578941 | 664 days ago | IN | 0 ETH | 0.00185706 | ||||
Set Approval For... | 16411248 | 688 days ago | IN | 0 ETH | 0.00068447 | ||||
Claim Gift | 16367355 | 694 days ago | IN | 0 ETH | 0.00236337 | ||||
Safe Transfer Fr... | 16278200 | 706 days ago | IN | 0 ETH | 0.00173362 | ||||
Safe Transfer Fr... | 16271389 | 707 days ago | IN | 0 ETH | 0.00107857 | ||||
Set Approval For... | 16251834 | 710 days ago | IN | 0 ETH | 0.00059812 | ||||
Public Mint | 16227405 | 713 days ago | IN | 0.07 ETH | 0.00211169 | ||||
Public Mint | 16227402 | 713 days ago | IN | 0.07 ETH | 0.0022832 | ||||
Public Mint | 16227396 | 713 days ago | IN | 0.07 ETH | 0.00224685 | ||||
Set Approval For... | 16201647 | 717 days ago | IN | 0 ETH | 0.00059723 | ||||
Set Approval For... | 16138290 | 726 days ago | IN | 0 ETH | 0.00070311 | ||||
Set Approval For... | 16121377 | 728 days ago | IN | 0 ETH | 0.00060577 |
Latest 10 internal transactions
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17670911 | 510 days ago | 0.72 ETH | ||||
15164508 | 869 days ago | 0.02 ETH | ||||
14750483 | 937 days ago | 0.396 ETH | ||||
14096370 | 1039 days ago | 0.066 ETH | ||||
14027767 | 1050 days ago | 1.854 ETH | ||||
13939407 | 1063 days ago | 0.07 ETH | ||||
13858384 | 1076 days ago | 0.36155 ETH | ||||
13858333 | 1076 days ago | 0.15495 ETH | ||||
13858311 | 1076 days ago | 4.644 ETH | ||||
13839621 | 1079 days ago | 0.0045 ETH |
Loading...
Loading
Contract Name:
BlockClock
Compiler Version
v0.8.9+commit.e5eed63a
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.9; // S U N M O N T U E W E D T H U F R I S A T // J A N F E B M A R A P R M A Y J U N J U L // A U G S E P O C T N O V D E C 0 0 1 0 0 2 // 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 // 0 1 0 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 // 0 1 7 0 1 8 0 1 9 0 2 0 0 2 1 0 2 2 0 2 3 // 0 2 | --------- | 0 2 7 0 2 8 0 2 9 0 3 0 // 0 3 | B L O C K | 0 0 2 0 0 3 0 0 4 0 0 5 // 0 0 | ----------------- | 1 0 0 1 1 0 0 0 // 0 0 1 0 0 2 | C L O C K | 0 5 0 0 6 0 0 7 // 0 0 8 0 0 9 ----------- | 1 2 0 1 3 0 1 4 // 0 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 2 0 0 2 1 // | --- | 2 3 0 2 4 0 2 5 0 2 6 0 2 7 0 2 8 // | B Y --------------------- | 3 4 0 3 5 // | --- | @ S A M M Y B A U C H | 4 1 0 4 2 // 0 4 3 ----------------------- | 4 8 0 4 9 // 0 5 0 0 5 1 0 5 2 0 5 3 0 5 4 0 5 5 0 5 6 // 0 5 7 0 5 8 0 5 9 0 0 0 0 0 1 0 0 2 0 0 3 // 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 1 0 // 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 7 // 0 1 8 0 1 9 0 2 0 0 2 1 0 2 2 0 2 3 0 2 4 // 0 2 5 0 2 6 0 2 7 0 2 8 0 2 9 0 3 0 0 3 1 // 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 3 8 // 0 3 9 0 4 0 0 4 1 0 4 2 0 4 3 0 4 4 0 4 5 // 0 4 6 0 4 7 0 4 8 0 4 9 0 5 0 0 5 1 0 5 2 // 0 5 3 0 5 4 0 5 5 0 5 6 0 5 7 0 5 8 0 5 9 import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "../Libraries/Base64.sol"; import "../Libraries/ERC721EnumerableEssential.sol"; import "../Libraries/EssentialStrings.sol"; import "../Libraries/LinearDutchAuction.sol"; import "../Libraries/OpenSeaGasFreeListing.sol"; import "../Libraries/SignedAllowance.sol"; interface IBlockClockRenderer { function svgBase64Data( int8 hourOffset, uint24 hexCode, uint256 timestamp ) external view returns (string memory); function svgRaw( int8 hourOffset, uint24 hexCode, uint256 timestamp ) external view returns (bytes memory); } contract BlockClock is ERC721EnumerableEssential, Ownable, LinearDutchAuction, SignedAllowance, PaymentSplitter { using EssentialStrings for uint256; using EssentialStrings for uint24; using EssentialStrings for uint8; uint256 private nextTokenId = 1; string private _animationBaseUrl; IBlockClockRenderer public renderer; struct ClockConfig { int8 hourOffset; uint24 onHex; } mapping(uint256 => ClockConfig) public clockConfig; constructor(address[] memory _payees, uint256[] memory _shares) ERC721("BlockClock", "CLOCK") PaymentSplitter(_payees, _shares) LinearDutchAuction( LinearDutchAuction.DutchAuctionConfig({ startPoint: 1640106000, // 2021-12-21T17:00:00+00:00 startPrice: 2.47 ether, unit: AuctionIntervalUnit.Time, decreaseInterval: 120, // 2 minutes decreaseSize: 0.025 ether, numDecreases: 96 // rests at 0.07 }), 0.07 ether, Seller.SellerConfig({ totalInventory: 455, maxPerAddress: 0, // unlimited maxPerTx: 1, freeQuota: 0, reserveFreeQuota: false, lockTotalInventory: true, lockFreeQuota: true }), payable(address(this)) ) { _setAllowancesSigner(msg.sender); } function _handlePurchase( address to, uint256, bool ) internal override { _mint(to, nextTokenId); nextTokenId += 1; } function publicMint() public payable { _purchase(msg.sender, 1); } function claimGift( int8 offset, uint24 onHex, uint256 nonce, bytes memory signature ) public { require(nextTokenId <= 1024, "BC:cG:500"); _useAllowance(msg.sender, nonce, signature); _mint(msg.sender, nextTokenId); clockConfig[nextTokenId] = ClockConfig({hourOffset: offset, onHex: onHex}); nextTokenId += 1; } function updateConfig( uint256 tokenId, int8 offset, uint24 onHex ) public { require(msg.sender == ownerOf(tokenId), "BC:uC:401"); clockConfig[tokenId] = ClockConfig({hourOffset: offset, onHex: onHex}); } function svgRaw(uint256 tokenId, uint256 timestamp) public view returns (bytes memory) { ClockConfig memory clock = clockConfig[tokenId]; uint256 _timestamp = timestamp == 0 ? uint256(int256(block.timestamp) + int256(clock.hourOffset) * 1 hours) : timestamp; return renderer.svgRaw(clock.hourOffset, clock.onHex, _timestamp); } /* solhint-disable quotes */ function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "BC:tU:404"); ClockConfig memory clock = clockConfig[tokenId]; return string( abi.encodePacked( "data:application/json;base64,", Base64.encode( bytes( abi.encodePacked( '{"name":"BlockClock ', tokenId.toString(), '", "description":"BlockClocks are on-chain SVG clocks. The program is also available on IPFS for easier animated display.", "image": "', renderer.svgBase64Data(clock.hourOffset, clock.onHex, block.timestamp), '", "animation_url": "', animationUrl(tokenId), tokenProperties(tokenId), '"}}' ) ) ) ) ); } function animationUrl(uint256 tokenId) internal view returns (bytes memory) { return abi.encodePacked(_animationBaseUrl, animationQuery(tokenId)); } function setAnimationBaseUrl(string memory newBaseUrl) external onlyOwner { _animationBaseUrl = newBaseUrl; } function setRenderer(address rendererAddress) external onlyOwner { renderer = IBlockClockRenderer(rendererAddress); } function animationQuery(uint256 tokenId) internal view returns (bytes memory) { ClockConfig memory clock = clockConfig[tokenId]; return abi.encodePacked("?h=", clock.onHex.toHexString(), "&tz=", offsetBytes(clock.hourOffset)); } function tokenProperties(uint256 tokenId) internal view returns (bytes memory) { ClockConfig memory clock = clockConfig[tokenId]; return abi.encodePacked( '", "properties": { "Highlight Color": "', clock.onHex.toHtmlHexString(), '", "Timezone": "UTC', offsetBytes(clock.hourOffset) ); } function offsetBytes(int8 offset) internal view returns (bytes memory) { return offset >= 0 ? abi.encodePacked("+", uint8(offset).toString()) : abi.encodePacked("-", uint8(-offset).toString()); } function isApprovedForAll(address owner, address operator) public view override returns (bool) { return OpenSeaGasFreeListing.isApprovedForAll(owner, operator) || super.isApprovedForAll(owner, operator); } }
// 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; import "../utils/Address.sol"; import "../utils/Context.sol"; import "../utils/math/SafeMath.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + _totalReleased; uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account]; require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] = _released[account] + payment; _totalReleased = _totalReleased + payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // 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; /** * @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 {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 See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @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), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to 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), "ERC721: transfer caller is not owner nor 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), "ERC721: transfer caller is not owner nor 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), "ERC721: transfer to non ERC721Receiver 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 _owners[tokenId] != address(0); } /** * @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), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `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), "ERC721: transfer to non ERC721Receiver 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), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[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); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[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, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @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()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @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` and `to` are never both zero. * * 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 {} }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6 <0.9.0; /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability ONLY FOR token ids owned by each account as an alternative to OZ. * The ineffecient totalSupply is replaced with a simple counter. */ abstract contract ERC721EnumerableEssential is ERC721 { using Counters for Counters.Counter; // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; Counters.Counter private _tokenCounter; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _tokenCounter.current(); } /** * @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 override { super._beforeTokenTransfer(from, to, tokenId); if (from != to) { if (to == address(0)) { _tokenCounter.decrement(); } else { _addTokenToOwnerEnumeration(to, tokenId); } if (from == address(0)) { _tokenCounter.increment(); } else { _removeTokenFromOwnerEnumeration(from, tokenId); } } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library EssentialStrings { 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); } function toHtmlHexString(uint256 value) internal pure returns (string memory) { bytes memory buffer = new bytes(7); buffer[0] = "#"; for (uint256 i = 6; i > 0; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } function toPaddedNumberString(uint256 value) internal pure returns (string memory) { bytes memory buffer = new bytes(3); if (value < 10) { buffer[0] = "0"; buffer[1] = "0"; buffer[2] = _HEX_SYMBOLS[value & 0xf]; return string(buffer); } uint256 temp = value; uint256 digits = 1; while (temp != 0) { digits++; temp /= 10; } buffer[0] = "0"; while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./Seller.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; /// @notice A Seller with a linearly decreasing price. abstract contract LinearDutchAuction is Seller { /** @param unit The unit of "time" used for decreasing prices, block number or timestamp. NOTE: See the comment on AuctionIntervalUnit re use of Time as a unit. @param startPoint The block or timestamp at which the auction opens. A value of zero disables the auction. See setAuctionStartPoint(). @param startPrice The price at `startPoint`. @param decreaseInterval The number of units to wait before decreasing the price. MUST be non-zero. @param decreaseSize The amount by which price decreases after every `decreaseInterval`. @param numDecreases The maximum number of price decreases before remaining constant. The reserve price is therefore implicit and equal to startPrice-numDecrease*decreaseSize. */ struct DutchAuctionConfig { uint256 startPoint; uint256 startPrice; uint256 decreaseInterval; uint256 decreaseSize; // From https://docs.soliditylang.org/en/v0.8.10/types.html#enums "Enums // cannot have more than 256 members"; presumably they take 8 bits, so // use some of the numDecreases space instead. uint248 numDecreases; AuctionIntervalUnit unit; } /** @notice The unit of "time" along which the cost decreases. @dev If no value is provided then the zero UNSPECIFIED will trigger an error. NOTE: The Block unit is more reliable as it has an explicit progression (simply incrementing). Miners are allowed to have a time drift into the future although which predisposes to unexpected behaviour by which "future" costs are encountered. See the ConsenSys 15-second rule: https://consensys.net/blog/developers/solidity-best-practices-for-smart-contract-security/ */ enum AuctionIntervalUnit { UNSPECIFIED, Block, Time } /// @param expectedReserve See setAuctionConfig(). constructor( DutchAuctionConfig memory config, uint256 expectedReserve, Seller.SellerConfig memory sellerConfig, address payable _beneficiary ) Seller(sellerConfig, _beneficiary) { setAuctionConfig(config, expectedReserve); } /// @notice Configuration of price changes. DutchAuctionConfig public dutchAuctionConfig; /** @notice Sets the auction config. @param expectedReserve A safety check that the reserve, as calculated from the config, is as expected. */ function setAuctionConfig(DutchAuctionConfig memory config, uint256 expectedReserve) public onlyOwner { // Underflow might occur is size/num decreases is too large. unchecked { require( config.startPrice - config.decreaseSize * config.numDecreases == expectedReserve, "LinearDutchAuction: incorrect reserve" ); } require(config.unit != AuctionIntervalUnit.UNSPECIFIED, "LinearDutchAuction: unspecified unit"); require(config.decreaseInterval > 0, "LinearDutchAuction: zero decrease interval"); dutchAuctionConfig = config; } /** @notice Sets the config startPoint. A startPoint of zero disables the auction. @dev The auction can be toggle on and off with this function, without the cost of having to update the entire config. */ function setAuctionStartPoint(uint256 startPoint) public onlyOwner { dutchAuctionConfig.startPoint = startPoint; } /// @notice Override of Seller.cost() with Dutch-auction logic. function cost(uint256 n) public view override returns (uint256) { DutchAuctionConfig storage cfg = dutchAuctionConfig; uint256 current; if (cfg.unit == AuctionIntervalUnit.Block) { current = block.number; } else if (cfg.unit == AuctionIntervalUnit.Time) { current = block.timestamp; } require(cfg.startPoint != 0 && current >= cfg.startPoint, "LinearDutchAuction: Not started"); uint256 decreases = Math.min((current - cfg.startPoint) / cfg.decreaseInterval, cfg.numDecreases); return n * (cfg.startPrice - decreases * cfg.decreaseSize); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; // Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need // to pass specific addresses depending on deployment network. // https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/ /// @notice Library to achieve gas-free listings on OpenSea. library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprovedForAll(address owner, address operator) internal view returns (bool) { ProxyRegistry registry; assembly { switch chainid() case 1 { // mainnet registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1 } case 4 { // rinkeby registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317 } } return address(registry) != address(0) && address(registry.proxies(owner)) == operator; } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; /// @title SignedAllowance /// @author Simon Fremaux (@dievardump) contract SignedAllowance { using ECDSA for bytes32; // list of already used allowances mapping(bytes32 => bool) public usedAllowances; // address used to sign the allowances address private _allowancesSigner; /// @notice Helper to know allowancesSigner address /// @return the allowance signer address function allowancesSigner() public view virtual returns (address) { return _allowancesSigner; } /// @notice Helper that creates the message that signer needs to sign to allow a mint /// this is usually also used when creating the allowances, to ensure "message" /// is the same /// @param account the account to allow /// @param nonce the nonce /// @return the message to sign function createMessage(address account, uint256 nonce) public view returns (bytes32) { return keccak256(abi.encode(account, nonce, address(this))); } /// @notice Helper that creates a list of messages that signer needs to sign to allow mintings /// @param accounts the accounts to allow /// @param nonces the corresponding nonces /// @return messages the messages to sign function createMessages(address[] memory accounts, uint256[] memory nonces) external view returns (bytes32[] memory messages) { require(accounts.length == nonces.length, "!LENGTH_MISMATCH!"); messages = new bytes32[](accounts.length); for (uint256 i; i < accounts.length; i++) { messages[i] = createMessage(accounts[i], nonces[i]); } } /// @notice This function verifies that the current request is valid /// @dev It ensures that _allowancesSigner signed a message containing (account, nonce, address(this)) /// and that this message was not already used /// @param account the account the allowance is associated to /// @param nonce the nonce associated to this allowance /// @param signature the signature by the allowance signer wallet /// @return the message to mark as used function validateSignature( address account, uint256 nonce, bytes memory signature ) public view returns (bytes32) { bytes32 message = createMessage(account, nonce).toEthSignedMessageHash(); // verifies that the sha3(account, nonce, address(this)) has been signed by _allowancesSigner require(message.recover(signature) == allowancesSigner(), "!INVALID_SIGNATURE!"); require(usedAllowances[message] == false, "!ALREADY_USED!"); return message; } /// @notice internal function that verifies an allowance and marks it as used /// this function throws if signature is wrong or this nonce for this user has already been used /// @param account the account the allowance is associated to /// @param nonce the nonce /// @param signature the signature by the allowance wallet function _useAllowance( address account, uint256 nonce, bytes memory signature ) internal { bytes32 message = validateSignature(account, nonce, signature); usedAllowances[message] = true; } /// @notice Allows to change the allowance signer. This can be used to revoke any signed allowance not already used /// @param newSigner the new signer address function _setAllowancesSigner(address newSigner) internal { _allowancesSigner = newSigner; } }
// 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; /** * @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; // 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; 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; 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; /** * @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 "./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; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./Monotonic.sol"; import "./OwnerPausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** @notice An abstract contract providing the _purchase() function to: - Enforce per-wallet / per-transaction limits - Calculate required cost, forwarding to a beneficiary, and refunding extra */ abstract contract Seller is OwnerPausable, ReentrancyGuard { using Address for address payable; using Monotonic for Monotonic.Increaser; using Strings for uint256; /** @dev Note that the address limits are vulnerable to wallet farming. @param maxPerAddress Unlimited if zero. @param maxPerTex Unlimited if zero. @param freeQuota Maximum number that can be purchased free of charge by the contract owner. @param reserveFreeQuota Whether to excplitly reserve the freeQuota amount and not let it be eroded by regular purchases. @param lockFreeQuota If true, calls to setSellerConfig() will ignore changes to freeQuota. Can be locked after initial setting, but not unlocked. This allows a contract owner to commit to a maximum number of reserved items. @param lockTotalInventory Similar to lockFreeQuota but applied to totalInventory. */ struct SellerConfig { uint256 totalInventory; uint256 maxPerAddress; uint256 maxPerTx; uint248 freeQuota; bool reserveFreeQuota; bool lockFreeQuota; bool lockTotalInventory; } constructor(SellerConfig memory config, address payable _beneficiary) { setSellerConfig(config); setBeneficiary(_beneficiary); } /// @notice Configuration of purchase limits. SellerConfig public sellerConfig; /// @notice Sets the seller config. function setSellerConfig(SellerConfig memory config) public onlyOwner { require(config.totalInventory >= config.freeQuota, "Seller: excessive free quota"); require(config.totalInventory >= _totalSold.current(), "Seller: inventory < already sold"); require(config.freeQuota >= purchasedFreeOfCharge.current(), "Seller: free quota < already used"); // Overriding the in-memory fields before copying the whole struct, as // against writing individual fields, gives a greater guarantee of // correctness as the code is simpler to read. if (sellerConfig.lockTotalInventory) { config.lockTotalInventory = true; config.totalInventory = sellerConfig.totalInventory; } if (sellerConfig.lockFreeQuota) { config.lockFreeQuota = true; config.freeQuota = sellerConfig.freeQuota; } sellerConfig = config; } /// @notice Recipient of revenues. address payable public beneficiary; /// @notice Sets the recipient of revenues. function setBeneficiary(address payable _beneficiary) public onlyOwner { beneficiary = _beneficiary; } /** @dev Must return the current cost of a batch of items. This may be constant or, for example, decreasing for a Dutch auction or increasing for a bonding curve. @param n The number of items being purchased. */ function cost(uint256 n) public view virtual returns (uint256); /** @dev Called by both _purchase() and purchaseFreeOfCharge() after all limits have been put in place; must perform all contract-specific sale logic, e.g. ERC721 minting. When _handlePurchase() is called, the value returned by Seller.totalSold() will be the pre-purchase amount. @param to The recipient of the item(s). @param n The number of items allowed to be purchased, which MAY be less than to the number passed to _purchase() but SHALL be greater than zero. @param freeOfCharge Indicates that the call originated from purchaseFreeOfCharge() and not _purchase(). */ function _handlePurchase( address to, uint256 n, bool freeOfCharge ) internal virtual; /** @dev Tracks total number of items sold by this contract, including those purchased free of charge by the contract owner. */ Monotonic.Increaser private _totalSold; /// @notice Returns the total number of items sold by this contract. function totalSold() public view returns (uint256) { return _totalSold.current(); } /** @dev Tracks the number of items already bought by an address, regardless of transferring out (in the case of ERC721). @dev This isn't public as it may be skewed due to differences in msg.sender and tx.origin, which it treats in the same way such that sum(_bought)>=totalSold(). */ mapping(address => uint256) private _bought; /** @notice Returns min(n, max(extra items addr can purchase)) and reverts if 0. @param zeroMsg The message with which to revert on 0 extra. */ function _capExtra( uint256 n, address addr, string memory zeroMsg ) internal view returns (uint256) { uint256 extra = sellerConfig.maxPerAddress - _bought[addr]; if (extra == 0) { revert(string(abi.encodePacked("Seller: ", zeroMsg))); } return Math.min(n, extra); } /// @notice Emitted when a buyer is refunded. event Refund(address indexed buyer, uint256 amount); /// @notice Emitted on all purchases of non-zero amount. event Revenue(address indexed beneficiary, uint256 numPurchased, uint256 amount); /// @dev Tracks number of items purchased free of charge. Monotonic.Increaser private purchasedFreeOfCharge; /** @notice Allows the contract owner to purchase without payment, within the quota enforced by the SellerConfig. */ function purchaseFreeOfCharge(address to, uint256 n) public onlyOwner whenNotPaused { uint256 freeQuota = sellerConfig.freeQuota; n = Math.min(n, freeQuota - purchasedFreeOfCharge.current()); require(n > 0, "Seller: Free quota exceeded"); uint256 totalInventory = sellerConfig.totalInventory; n = Math.min(n, totalInventory - _totalSold.current()); require(n > 0, "Seller: Sold out"); _handlePurchase(to, n, true); _totalSold.add(n); purchasedFreeOfCharge.add(n); assert(_totalSold.current() <= totalInventory); assert(purchasedFreeOfCharge.current() <= freeQuota); } /** @notice Enforces all purchase limits (counts and costs) before calling _handlePurchase(), after which the received funds are disbursed to the beneficiary, less any required refunds. @param to The final recipient of the item(s). @param requested The number of items requested for purchase, which MAY be reduced when passed to _handlePurchase(). */ function _purchase(address to, uint256 requested) internal nonReentrant whenNotPaused { SellerConfig memory config = sellerConfig; uint256 n = config.maxPerTx == 0 ? requested : Math.min(requested, config.maxPerTx); uint256 maxAvailable = config.reserveFreeQuota ? config.totalInventory - config.freeQuota : config.totalInventory; n = Math.min(n, maxAvailable - _totalSold.current()); require(n > 0, "Seller: Sold out"); if (config.maxPerAddress > 0) { bool alsoLimitSender = _msgSender() != to; bool alsoLimitOrigin = tx.origin != _msgSender() && tx.origin != to; n = _capExtra(n, to, "Buyer limit"); if (alsoLimitSender) { n = _capExtra(n, _msgSender(), "Sender limit"); } if (alsoLimitOrigin) { n = _capExtra(n, tx.origin, "Origin limit"); } _bought[to] += n; if (alsoLimitSender) { _bought[_msgSender()] += n; } if (alsoLimitOrigin) { _bought[tx.origin] += n; } } uint256 _cost = cost(n); if (msg.value < _cost) { revert(string(abi.encodePacked("Seller: Costs ", (_cost / 1e9).toString(), " GWei"))); } /** * ##### EFFECTS */ _handlePurchase(to, n, false); _totalSold.add(n); assert(_totalSold.current() <= config.totalInventory); /** * ##### INTERACTIONS */ // Ideally we'd be using a PullPayment here, but the user experience is // poor when there's a variable cost or the number of items purchased // has been capped. We've addressed reentrancy with both a nonReentrant // modifier and the checks, effects, interactions pattern. if (msg.value > _cost) { address payable reimburse = payable(_msgSender()); uint256 refund = msg.value - _cost; // Using Address.sendValue() here would mask the revertMsg upon // reentrancy, but we want to expose it to allow for more precise // testing. This otherwise uses the exact same pattern as // Address.sendValue(). (bool success, bytes memory returnData) = reimburse.call{value: refund}(""); // Although `returnData` will have a spurious prefix, all we really // care about is that it contains the ReentrancyGuard reversion // message so we can check in the tests. require(success, string(returnData)); emit Refund(reimburse, refund); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute. return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /** @notice Provides monotonic increasing and decreasing values, similar to OpenZeppelin's Counter but (a) limited in direction, and (b) allowing for steps > 1. */ library Monotonic { /** @notice Holds a value that can only increase. @dev The internal value MUST NOT be accessed directly. Instead use current() and add(). */ struct Increaser { uint256 value; } /// @notice Returns the current value of the Increaser. function current(Increaser storage incr) internal view returns (uint256) { return incr.value; } /// @notice Adds x to the Increaser's value. function add(Increaser storage incr, uint256 x) internal { incr.value += x; } /** @notice Holds a value that can only decrease. @dev The internal value MUST NOT be accessed directly. Instead use current() and subtract(). */ struct Decreaser { uint256 value; } /// @notice Returns the current value of the Decreaser. function current(Decreaser storage decr) internal view returns (uint256) { return decr.value; } /// @notice Subtracts x from the Decreaser's value. function subtract(Decreaser storage decr, uint256 x) internal { decr.value -= x; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @notice A Pausable contract that can only be toggled by the Owner. contract OwnerPausable is Ownable, Pausable { /// @notice Pauses the contract. function pause() public onlyOwner { Pausable._pause(); } /// @notice Unpauses the contract. function unpause() public onlyOwner { Pausable._unpause(); } }
// 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 "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return recover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return recover(hash, r, vs); } else { revert("ECDSA: invalid signature length"); } } /** * @dev Overload of {ECDSA-recover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return recover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require( uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value" ); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address[]","name":"_payees","type":"address[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"numPurchased","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Revenue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"allowancesSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"beneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int8","name":"offset","type":"int8"},{"internalType":"uint24","name":"onHex","type":"uint24"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claimGift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"clockConfig","outputs":[{"internalType":"int8","name":"hourOffset","type":"int8"},{"internalType":"uint24","name":"onHex","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"createMessage","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"nonces","type":"uint256[]"}],"name":"createMessages","outputs":[{"internalType":"bytes32[]","name":"messages","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionConfig","outputs":[{"internalType":"uint256","name":"startPoint","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"decreaseInterval","type":"uint256"},{"internalType":"uint256","name":"decreaseSize","type":"uint256"},{"internalType":"uint248","name":"numDecreases","type":"uint248"},{"internalType":"enum LinearDutchAuction.AuctionIntervalUnit","name":"unit","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"name","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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"n","type":"uint256"}],"name":"purchaseFreeOfCharge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderer","outputs":[{"internalType":"contract IBlockClockRenderer","name":"","type":"address"}],"stateMutability":"view","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":"sellerConfig","outputs":[{"internalType":"uint256","name":"totalInventory","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxPerTx","type":"uint256"},{"internalType":"uint248","name":"freeQuota","type":"uint248"},{"internalType":"bool","name":"reserveFreeQuota","type":"bool"},{"internalType":"bool","name":"lockFreeQuota","type":"bool"},{"internalType":"bool","name":"lockTotalInventory","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseUrl","type":"string"}],"name":"setAnimationBaseUrl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"startPoint","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"decreaseInterval","type":"uint256"},{"internalType":"uint256","name":"decreaseSize","type":"uint256"},{"internalType":"uint248","name":"numDecreases","type":"uint248"},{"internalType":"enum LinearDutchAuction.AuctionIntervalUnit","name":"unit","type":"uint8"}],"internalType":"struct LinearDutchAuction.DutchAuctionConfig","name":"config","type":"tuple"},{"internalType":"uint256","name":"expectedReserve","type":"uint256"}],"name":"setAuctionConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startPoint","type":"uint256"}],"name":"setAuctionStartPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_beneficiary","type":"address"}],"name":"setBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rendererAddress","type":"address"}],"name":"setRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"totalInventory","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxPerTx","type":"uint256"},{"internalType":"uint248","name":"freeQuota","type":"uint248"},{"internalType":"bool","name":"reserveFreeQuota","type":"bool"},{"internalType":"bool","name":"lockFreeQuota","type":"bool"},{"internalType":"bool","name":"lockTotalInventory","type":"bool"}],"internalType":"struct Seller.SellerConfig","name":"config","type":"tuple"}],"name":"setSellerConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"svgRaw","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSold","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"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"int8","name":"offset","type":"int8"},{"internalType":"uint24","name":"onHex","type":"uint24"}],"name":"updateConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedAllowances","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"validateSignature","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405260016021553480156200001657600080fd5b506040516200591438038062005914833981016040819052620000399162000bb3565b81816040518060c001604052806361c20810815260200167224733e9d33700008152602001607881526020016658d15e17628000815260200160606001600160f81b0316815260200160028081111562000097576200009762000c91565b90526040805160e0810182526101c78152600060208083018290526001838501819052606084018390526080840183905260a0840181905260c084015283518085018552600a815269426c6f636b436c6f636b60b01b81830190815285518087019096526005865264434c4f434b60d81b92860192909252805166f8b0a10e47000095309486948694936200012e92919062000a2b565b5080516200014490600190602084019062000a2b565b505050620001616200015b620002e960201b60201c565b620002ed565b600a805460ff60a01b191690556001600b556200017e826200033f565b62000189816200057e565b506200019890508484620005eb565b5050505080518251146200020e5760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620002615760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f20706179656573000000000000604482015260640162000205565b60005b8251811015620002cd57620002b883828151811062000287576200028762000ca7565b6020026020010151838381518110620002a457620002a462000ca7565b60200260200101516200081860201b60201c565b80620002c48162000cd3565b91505062000264565b505050620002e13362000a0560201b60201c565b505062000d49565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a546001600160a01b031633146200038a5760405162461bcd60e51b81526020600482018190526024820152600080516020620058f4833981519152604482015260640162000205565b80606001516001600160f81b031681600001511015620003ed5760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f746100000000604482015260640162000205565b62000404601262000a2760201b620021381760201c565b81511015620004565760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c64604482015260640162000205565b6200046d601462000a2760201b620021381760201c565b81606001516001600160f81b03161015620004d55760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b606482015260840162000205565b601054610100900460ff1615620004f357600160c0820152600c5481525b60105460ff16156200051857600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b600a546001600160a01b03163314620005c95760405162461bcd60e51b81526020600482018190526024820152600080516020620058f4833981519152604482015260640162000205565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b03163314620006365760405162461bcd60e51b81526020600482018190526024820152600080516020620058f4833981519152604482015260640162000205565b8082608001516001600160f81b031683606001510283602001510314620006ae5760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b606482015260840162000205565b60008260a001516002811115620006c957620006c962000c91565b1415620007255760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b606482015260840162000205565b60008260400151116200078e5760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b606482015260840162000205565b815160159081556020830151601655604083015160175560608301516018556080830151601980547fff00000000000000000000000000000000000000000000000000000000000000166001600160f81b03909216918217815560a0850151859392909190600160f81b8360028111156200080d576200080d62000c91565b021790555050505050565b6001600160a01b038216620008855760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b606482015260840162000205565b60008111620008d75760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a20736861726573206172652030000000604482015260640162000205565b6001600160a01b0382166000908152601e602052604090205415620009535760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b606482015260840162000205565b602080546001810182557fc97bfaf2f8ee708c303a06d134f5ecd8389ae0432af62dc132a24118292866bb0180546001600160a01b0319166001600160a01b0385169081179091556000908152601e90915260409020819055601c54620009bc90829062000cf1565b601c55604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b601b80546001600160a01b0319166001600160a01b0392909216919091179055565b5490565b82805462000a399062000d0c565b90600052602060002090601f01602090048101928262000a5d576000855562000aa8565b82601f1062000a7857805160ff191683800117855562000aa8565b8280016001018555821562000aa8579182015b8281111562000aa857825182559160200191906001019062000a8b565b5062000ab692915062000aba565b5090565b5b8082111562000ab6576000815560010162000abb565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000b125762000b1262000ad1565b604052919050565b60006001600160401b0382111562000b365762000b3662000ad1565b5060051b60200190565b600082601f83011262000b5257600080fd5b8151602062000b6b62000b658362000b1a565b62000ae7565b82815260059290921b8401810191818101908684111562000b8b57600080fd5b8286015b8481101562000ba8578051835291830191830162000b8f565b509695505050505050565b6000806040838503121562000bc757600080fd5b82516001600160401b038082111562000bdf57600080fd5b818501915085601f83011262000bf457600080fd5b8151602062000c0762000b658362000b1a565b82815260059290921b8401810191818101908984111562000c2757600080fd5b948201945b8386101562000c5e5785516001600160a01b038116811462000c4e5760008081fd5b8252948201949082019062000c2c565b9188015191965090935050508082111562000c7857600080fd5b5062000c878582860162000b40565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141562000cea5762000cea62000cbd565b5060010190565b6000821982111562000d075762000d0762000cbd565b500190565b600181811c9082168062000d2157607f821691505b6020821081141562000d4357634e487b7160e01b600052602260045260246000fd5b50919050565b614b9b8062000d596000396000f3fe6080604052600436106102cd5760003560e01c80638456cb5911610175578063a7399243116100dc578063c87b56dd11610095578063e33b7de31161006f578063e33b7de3146109cc578063e985e9c5146109e1578063f2fde38b14610a01578063feff199914610a2157600080fd5b8063c87b56dd14610956578063ce7c2ac214610976578063e0c5b0ed146109ac57600080fd5b8063a73992431461082b578063b88d4fde1461084b578063b9303f8a1461086b578063bb69b7ef1461088b578063bf62e21d14610916578063c85b380d1461093657600080fd5b80638f4a18f71161012e5780638f4a18f7146107315780639097548d1461078b5780639106d7ba146107ab57806395d89b41146107c05780639852595c146107d5578063a22cb4651461080b57600080fd5b80638456cb59146106805780638838b5c314610695578063890621da146106b35780638ada6b0f146106d35780638b83209b146106f35780638da5cb5b1461071357600080fd5b806338af3eed116102345780636352211e116101ed578063715018a6116101c7578063715018a6146105dd57806379ecdffc146105f25780637bd07f8b146106125780637e77b7c21461066057600080fd5b80636352211e146105705780636c4a412c1461059057806370a08231146105bd57600080fd5b806338af3eed146104c75780633a98ef39146104e75780633f4ba83a146104fc57806342842e0e1461051157806356d3163d146105315780635c975abb1461055157600080fd5b8063195e870811610286578063195e87081461040f5780631c31f7101461043f57806323b872dd1461045f57806326092b831461047f5780632f274bd4146104875780632f745c59146104a757600080fd5b806301ffc9a71461031b57806306fdde0314610350578063081812fc14610372578063095ea7b3146103aa57806318160ddd146103cc57806319165587146103ef57600080fd5b36610316577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561032757600080fd5b5061033b610336366004613b99565b610a41565b60405190151581526020015b60405180910390f35b34801561035c57600080fd5b50610365610a93565b6040516103479190613c0e565b34801561037e57600080fd5b5061039261038d366004613c21565b610b25565b6040516001600160a01b039091168152602001610347565b3480156103b657600080fd5b506103ca6103c5366004613c4f565b610bbf565b005b3480156103d857600080fd5b506103e1610cd5565b604051908152602001610347565b3480156103fb57600080fd5b506103ca61040a366004613c7b565b610ce5565b34801561041b57600080fd5b5061033b61042a366004613c21565b601a6020526000908152604090205460ff1681565b34801561044b57600080fd5b506103ca61045a366004613c7b565b610eb6565b34801561046b57600080fd5b506103ca61047a366004613c98565b610f02565b6103ca610f33565b34801561049357600080fd5b506103ca6104a2366004613d73565b610f40565b3480156104b357600080fd5b506103e16104c2366004613c4f565b61112e565b3480156104d357600080fd5b50601154610392906001600160a01b031681565b3480156104f357600080fd5b50601c546103e1565b34801561050857600080fd5b506103ca6111c4565b34801561051d57600080fd5b506103ca61052c366004613c98565b6111f6565b34801561053d57600080fd5b506103ca61054c366004613c7b565b611211565b34801561055d57600080fd5b50600a54600160a01b900460ff1661033b565b34801561057c57600080fd5b5061039261058b366004613c21565b61125d565b34801561059c57600080fd5b506105b06105ab366004613e9d565b6112d4565b6040516103479190613f5e565b3480156105c957600080fd5b506103e16105d8366004613c7b565b6113de565b3480156105e957600080fd5b506103ca611465565b3480156105fe57600080fd5b506103ca61060d366004613fc7565b611499565b34801561061e57600080fd5b5060155460165460175460185460195461064e94939291906001600160f81b03811690600160f81b900460ff1686565b60405161034796959493929190614019565b34801561066c57600080fd5b506103ca61067b3660046140d3565b61153b565b34801561068c57600080fd5b506103ca61157c565b3480156106a157600080fd5b50601b546001600160a01b0316610392565b3480156106bf57600080fd5b506103e16106ce36600461413b565b6115ae565b3480156106df57600080fd5b50602354610392906001600160a01b031681565b3480156106ff57600080fd5b5061039261070e366004613c21565b6116de565b34801561071f57600080fd5b50600a546001600160a01b0316610392565b34801561073d57600080fd5b5061076d61074c366004613c21565b6024602052600090815260408120549081900b90610100900462ffffff1682565b6040805160009390930b835262ffffff909116602083015201610347565b34801561079757600080fd5b506103e16107a6366004613c21565b61170e565b3480156107b757600080fd5b506103e1611833565b3480156107cc57600080fd5b5061036561183e565b3480156107e157600080fd5b506103e16107f0366004613c7b565b6001600160a01b03166000908152601f602052604090205490565b34801561081757600080fd5b506103ca610826366004614193565b61184d565b34801561083757600080fd5b506103656108463660046141c8565b611912565b34801561085757600080fd5b506103ca6108663660046141ea565b611a09565b34801561087757600080fd5b506103ca610886366004614255565b611a41565b34801561089757600080fd5b50600c54600d54600e54600f546010546108d3949392916001600160f81b0381169160ff600160f81b9092048216918181169161010090041687565b604080519788526020880196909652948601939093526001600160f81b03909116606085015215156080840152151560a0830152151560c082015260e001610347565b34801561092257600080fd5b506103ca610931366004613c4f565b611b05565b34801561094257600080fd5b506103ca610951366004614282565b611c7a565b34801561096257600080fd5b50610365610971366004613c21565b611e62565b34801561098257600080fd5b506103e1610991366004613c7b565b6001600160a01b03166000908152601e602052604090205490565b3480156109b857600080fd5b506103ca6109c7366004613c21565b611feb565b3480156109d857600080fd5b50601d546103e1565b3480156109ed57600080fd5b5061033b6109fc366004614305565b61201a565b348015610a0d57600080fd5b506103ca610a1c366004613c7b565b61205a565b348015610a2d57600080fd5b506103e1610a3c366004613c4f565b6120f5565b60006001600160e01b031982166380ac58cd60e01b1480610a7257506001600160e01b03198216635b5e139f60e01b145b80610a8d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060008054610aa29061433e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ace9061433e565b8015610b1b5780601f10610af057610100808354040283529160200191610b1b565b820191906000526020600020905b815481529060010190602001808311610afe57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610ba35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610bca8261125d565b9050806001600160a01b0316836001600160a01b03161415610c385760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b9a565b336001600160a01b0382161480610c545750610c54813361201a565b610cc65760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b9a565b610cd0838361213c565b505050565b6000610ce060085490565b905090565b6001600160a01b0381166000908152601e6020526040902054610d595760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201526573686172657360d01b6064820152608401610b9a565b6000601d5447610d69919061438f565b6001600160a01b0383166000908152601f6020908152604080832054601c54601e909352908320549394509192610da090856143a7565b610daa91906143dc565b610db491906143f0565b905080610e175760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201526a191d59481c185e5b595b9d60aa1b6064820152608401610b9a565b6001600160a01b0383166000908152601f6020526040902054610e3b90829061438f565b6001600160a01b0384166000908152601f6020526040902055601d54610e6290829061438f565b601d55610e6f83826121aa565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b600a546001600160a01b03163314610ee05760405162461bcd60e51b8152600401610b9a90614407565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b610f0c33826122c3565b610f285760405162461bcd60e51b8152600401610b9a9061443c565b610cd083838361239a565b610f3e336001612545565b565b600a546001600160a01b03163314610f6a5760405162461bcd60e51b8152600401610b9a90614407565b80606001516001600160f81b031681600001511015610fcb5760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f7461000000006044820152606401610b9a565b6012548151101561101e5760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c646044820152606401610b9a565b60145481606001516001600160f81b031610156110875760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b6064820152608401610b9a565b601054610100900460ff16156110a457600160c0820152600c5481525b60105460ff16156110c857600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b6000611139836113de565b821061119b5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b9a565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600a546001600160a01b031633146111ee5760405162461bcd60e51b8152600401610b9a90614407565b610f3e612992565b610cd083838360405180602001604052806000815250611a09565b600a546001600160a01b0316331461123b5760405162461bcd60e51b8152600401610b9a90614407565b602380546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b031680610a8d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b9a565b6060815183511461131b5760405162461bcd60e51b8152602060048201526011602482015270214c454e4754485f4d49534d415443482160781b6044820152606401610b9a565b82516001600160401b0381111561133457611334613cd9565b60405190808252806020026020018201604052801561135d578160200160208202803683370190505b50905060005b83518110156113d7576113a88482815181106113815761138161448d565b602002602001015184838151811061139b5761139b61448d565b60200260200101516120f5565b8282815181106113ba576113ba61448d565b6020908102919091010152806113cf816144a3565b915050611363565b5092915050565b60006001600160a01b0382166114495760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b9a565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b0316331461148f5760405162461bcd60e51b8152600401610b9a90614407565b610f3e6000612a2f565b6114a28361125d565b6001600160a01b0316336001600160a01b0316146114ee5760405162461bcd60e51b815260206004820152600960248201526842433a75433a34303160b81b6044820152606401610b9a565b604080518082018252600093840b815262ffffff9283166020808301918252958552602490955292209151825493519091166101000263ffffffff1990931660ff90911617919091179055565b600a546001600160a01b031633146115655760405162461bcd60e51b8152600401610b9a90614407565b8051611578906022906020840190613aea565b5050565b600a546001600160a01b031633146115a65760405162461bcd60e51b8152600401610b9a90614407565b610f3e612a81565b6000806116116115be86866120f5565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050611625601b546001600160a01b031690565b6001600160a01b03166116388285612ae6565b6001600160a01b0316146116845760405162461bcd60e51b815260206004820152601360248201527221494e56414c49445f5349474e41545552452160681b6044820152606401610b9a565b6000818152601a602052604090205460ff16156116d45760405162461bcd60e51b815260206004820152600e60248201526d21414c52454144595f555345442160901b6044820152606401610b9a565b90505b9392505050565b6000602082815481106116f3576116f361448d565b6000918252602090912001546001600160a01b031692915050565b600060158160016004830154600160f81b900460ff16600281111561173557611735614003565b141561174257504361176d565b60026004830154600160f81b900460ff16600281111561176457611764614003565b141561176d5750425b81541580159061177e575081548110155b6117ca5760405162461bcd60e51b815260206004820152601f60248201527f4c696e656172447574636841756374696f6e3a204e6f742073746172746564006044820152606401610b9a565b600282015482546000916117ff916117e290856143f0565b6117ec91906143dc565b60048501546001600160f81b0316612b8a565b905082600301548161181191906143a7565b836001015461182091906143f0565b61182a90866143a7565b95945050505050565b6000610ce060125490565b606060018054610aa29061433e565b6001600160a01b0382163314156118a65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b9a565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600082815260246020908152604080832081518083019092525480840b8252610100900462ffffff16918101919091526060918315611951578361196c565b81516119629060000b610e106144be565b61196c9042614543565b60235483516020850151604051637adb6c6960e01b815260009290920b600483015262ffffff166024820152604481018390529192506001600160a01b031690637adb6c699060640160006040518083038186803b1580156119cd57600080fd5b505afa1580156119e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261182a91908101906145b4565b611a1333836122c3565b611a2f5760405162461bcd60e51b8152600401610b9a9061443c565b611a3b84848484612ba0565b50505050565b6104006021541115611a815760405162461bcd60e51b8152602060048201526009602482015268042433a63473a3530360bc1b6044820152606401610b9a565b611a8c338383612bd3565b611a9833602154612bff565b604080518082018252600086810b825262ffffff808716602080850191825260218054855260249091529483209351845491519092166101000263ffffffff1990911660ff909216919091171790915581546001929190611afa90849061438f565b909155505050505050565b600a546001600160a01b03163314611b2f5760405162461bcd60e51b8152600401610b9a90614407565b600a54600160a01b900460ff1615611b595760405162461bcd60e51b8152600401610b9a906145fc565b600f546001600160f81b0316611b8182611b7260145490565b611b7c90846143f0565b612b8a565b915060008211611bd35760405162461bcd60e51b815260206004820152601b60248201527f53656c6c65723a20467265652071756f746120657863656564656400000000006044820152606401610b9a565b600c54611be383611b7260125490565b925060008311611c285760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b9a565b611c3484846001612d4d565b611c3f601284612d76565b611c4a601484612d76565b80611c5460125490565b1115611c6257611c62614626565b81611c6c60145490565b1115611a3b57611a3b614626565b600a546001600160a01b03163314611ca45760405162461bcd60e51b8152600401610b9a90614407565b8082608001516001600160f81b031683606001510283602001510314611d1a5760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b6064820152608401610b9a565b60008260a001516002811115611d3257611d32614003565b1415611d8c5760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b6064820152608401610b9a565b6000826040015111611df35760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b6064820152608401610b9a565b815160159081556020830151601655604083015160175560608301516018556080830151601980546001600160f81b0319166001600160f81b03909216918217815560a0850151859392909190600160f81b836002811115611e5757611e57614003565b021790555050505050565b6000818152600260205260409020546060906001600160a01b0316611eb55760405162461bcd60e51b81526020600482015260096024820152681090ce9d154e8d0c0d60ba1b6044820152606401610b9a565b60008281526024602090815260408083208151808301909252549283900b815261010090920462ffffff1690820152611fc4611ef084612d93565b602354835160208501516040516366f027e760e01b815260009290920b600483015262ffffff1660248201524260448201526001600160a01b03909116906366f027e79060640160006040518083038186803b158015611f4f57600080fd5b505afa158015611f63573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611f8b91908101906145b4565b611f9486612e90565b611f9d87612ec4565b604051602001611fb09493929190614658565b604051602081830303815290604052612f1e565b604051602001611fd491906147a9565b604051602081830303815290604052915050919050565b600a546001600160a01b031633146120155760405162461bcd60e51b8152600401610b9a90614407565b601555565b60006120268383613083565b806116d757506001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff166116d7565b600a546001600160a01b031633146120845760405162461bcd60e51b8152600401610b9a90614407565b6001600160a01b0381166120e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b9a565b6120f281612a2f565b50565b604080516001600160a01b038416602082015290810182905230606082015260009060800160405160208183030381529060405280519060200120905092915050565b5490565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121718261125d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156121fa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b9a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612247576040519150601f19603f3d011682016040523d82523d6000602084013e61224c565b606091505b5050905080610cd05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b9a565b6000818152600260205260408120546001600160a01b031661233c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b9a565b60006123478361125d565b9050806001600160a01b0316846001600160a01b031614806123825750836001600160a01b031661237784610b25565b6001600160a01b0316145b806123925750612392818561201a565b949350505050565b826001600160a01b03166123ad8261125d565b6001600160a01b0316146124155760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b9a565b6001600160a01b0382166124775760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b9a565b612482838383613174565b61248d60008261213c565b6001600160a01b03831660009081526003602052604081208054600192906124b69084906143f0565b90915550506001600160a01b03821660009081526003602052604081208054600192906124e490849061438f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6002600b5414156125985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b9a565b6002600b55600a54600160a01b900460ff16156125c75760405162461bcd60e51b8152600401610b9a906145fc565b6040805160e081018252600c548152600d546020820152600e54918101829052600f546001600160f81b038116606083015260ff600160f81b909104811615156080830152601054808216151560a0840152610100900416151560c082015290600090156126425761263d838360400151612b8a565b612644565b825b905060008260800151612658578251612672565b60608301518351612672916001600160f81b0316906143f0565b905061268182611b7260125490565b9150600082116126c65760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b9a565b60208301511561282257336001600160a01b0386168114159060009032148015906126fa5750326001600160a01b03881614155b905061272a84886040518060400160405280600b81526020016a109d5e595c881b1a5b5a5d60aa1b8152506131da565b935081156127645761276184336040518060400160405280600c81526020016b14d95b99195c881b1a5b5a5d60a21b8152506131da565b93505b801561279c5761279984326040518060400160405280600c81526020016b13dc9a59da5b881b1a5b5a5d60a21b8152506131da565b93505b6001600160a01b038716600090815260136020526040812080548692906127c490849061438f565b909155505081156127f45733600090815260136020526040812080548692906127ee90849061438f565b90915550505b801561281f57326000908152601360205260408120805486929061281990849061438f565b90915550505b50505b600061282d8361170e565b9050803410156128835761284d612848633b9aca00836143dc565b613223565b60405160200161285d91906147ee565b60408051601f198184030181529082905262461bcd60e51b8252610b9a91600401613c0e565b61288f86846000612d4d565b61289a601284612d76565b835160125411156128ad576128ad614626565b80341115612985573360006128c283346143f0565b9050600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114612912576040519150601f19603f3d011682016040523d82523d6000602084013e612917565b606091505b509150915081819061293c5760405162461bcd60e51b8152600401610b9a9190613c0e565b50836001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8460405161297891815260200190565b60405180910390a2505050505b50506001600b5550505050565b600a54600160a01b900460ff166129e25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b9a565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a54600160a01b900460ff1615612aab5760405162461bcd60e51b8152600401610b9a906145fc565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a123390565b6000815160411415612b1a5760208201516040830151606084015160001a612b1086828585613320565b9350505050610a8d565b815160401415612b425760208201516040830151612b398583836134c0565b92505050610a8d565b60405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b9a565b6000818310612b9957816116d7565b5090919050565b612bab84848461239a565b612bb7848484846134ea565b611a3b5760405162461bcd60e51b8152600401610b9a90614833565b6000612be08484846115ae565b6000908152601a60205260409020805460ff1916600117905550505050565b6001600160a01b038216612c555760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b9a565b6000818152600260205260409020546001600160a01b031615612cba5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b9a565b612cc660008383613174565b6001600160a01b0382166000908152600360205260408120805460019290612cef90849061438f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b612d5983602154612bff565b600160216000828254612d6c919061438f565b9091555050505050565b80826000016000828254612d8a919061438f565b90915550505050565b606081612db75750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612de15780612dcb816144a3565b9150612dda9050600a836143dc565b9150612dbb565b6000816001600160401b03811115612dfb57612dfb613cd9565b6040519080825280601f01601f191660200182016040528015612e25576020820181803683370190505b5090505b841561239257612e3a6001836143f0565b9150612e47600a86614885565b612e5290603061438f565b60f81b818381518110612e6757612e6761448d565b60200101906001600160f81b031916908160001a905350612e89600a866143dc565b9450612e29565b60606022612e9d836135f4565b604051602001612eae929190614899565b6040516020818303038152906040529050919050565b60008181526024602090815260408083208151808301909252549283900b815261010090920462ffffff1690820181905260609190612f029061364e565b8151612f0d90613766565b604051602001611fd4929190614937565b805160609080612f3e575050604080516020810190915260008152919050565b60006003612f4d83600261438f565b612f5791906143dc565b612f629060046143a7565b90506000612f7182602061438f565b6001600160401b03811115612f8857612f88613cd9565b6040519080825280601f01601f191660200182016040528015612fb2576020820181803683370190505b5090506000604051806060016040528060408152602001614b26604091399050600181016020830160005b8681101561303e576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101612fdd565b506003860660018114613058576002811461306957613075565b613d3d60f01b600119830152613075565b603d60f81b6000198301525b505050918152949350505050565b600080466001811461309c57600481146130b8576130d0565b73a5409ec958c83c3f309868babaca7c86dcb077c191506130d0565b73f57b2c51ded3a29e6891aba85459d600256cf31791505b506001600160a01b03811615801590612392575060405163c455279160e01b81526001600160a01b038581166004830152808516919083169063c45527919060240160206040518083038186803b15801561312a57600080fd5b505afa15801561313e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061316291906149be565b6001600160a01b031614949350505050565b816001600160a01b0316836001600160a01b031614610cd0576001600160a01b0382166131aa576131a560086137c8565b6131b4565b6131b4828261381f565b6001600160a01b0383166131d057610cd0600880546001019055565b610cd08382613863565b6001600160a01b038216600090815260136020526040812054600d548291613201916143f0565b905080613219578260405160200161285d91906149db565b61182a8582612b8a565b6060816132475750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613271578061325b816144a3565b915061326a9050600a836143dc565b915061324b565b6000816001600160401b0381111561328b5761328b613cd9565b6040519080825280601f01601f1916602001820160405280156132b5576020820181803683370190505b5090505b8415612392576132ca6001836143f0565b91506132d7600a86614885565b6132e290603061438f565b60f81b8183815181106132f7576132f761448d565b60200101906001600160f81b031916908160001a905350613319600a866143dc565b94506132b9565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561339d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b9a565b8360ff16601b14806133b257508360ff16601c145b6134095760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b9a565b6040805160008082526020820180845288905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa15801561345d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661182a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b9a565b60006001600160ff1b03821660ff83901c601b016134e086828785613320565b9695505050505050565b60006001600160a01b0384163b156135ec57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061352e903390899088908890600401614a0b565b602060405180830381600087803b15801561354857600080fd5b505af1925050508015613578575060408051601f3d908101601f1916820190925261357591810190614a3e565b60015b6135d2573d8080156135a6576040519150601f19603f3d011682016040523d82523d6000602084013e6135ab565b606091505b5080516135ca5760405162461bcd60e51b8152600401610b9a90614833565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612392565b506001612392565b60008181526024602090815260408083208151808301909252549283900b815261010090920462ffffff169082018190526060919061363290613900565b815161363d90613766565b604051602001611fd4929190614a5b565b60408051600780825281830190925260609160009190602082018180368337019050509050602360f81b8160008151811061368b5761368b61448d565b60200101906001600160f81b031916908160001a90535060065b8015613717576f181899199a1a9b1b9c1cb0b131b232b360811b84600f16601081106136d3576136d361448d565b1a60f81b8282815181106136e9576136e961448d565b60200101906001600160f81b031916908160001a90535060049390931c9261371081614aa9565b90506136a5565b508215610a8d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b9a565b606060008260000b12156137ac5761378861378083614ac0565b60ff16612d93565b6040516020016137989190614ae0565b604051602081830303815290604052610a8d565b6137b88260ff16612d93565b604051602001612eae9190614b09565b8054806138175760405162461bcd60e51b815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f7700000000006044820152606401610b9a565b600019019055565b600061382a836113de565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60006001613870846113de565b61387a91906143f0565b6000838152600760205260409020549091508082146138cd576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6060816139275750506040805180820190915260048152630307830360e41b602082015290565b8160005b811561394a578061393b816144a3565b915050600882901c915061392b565b61239284826060600061395e8360026143a7565b61396990600261438f565b6001600160401b0381111561398057613980613cd9565b6040519080825280601f01601f1916602001820160405280156139aa576020820181803683370190505b509050600360fc1b816000815181106139c5576139c561448d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106139f4576139f461448d565b60200101906001600160f81b031916908160001a9053506000613a188460026143a7565b613a2390600161438f565b90505b6001811115613a9b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613a5757613a5761448d565b1a60f81b828281518110613a6d57613a6d61448d565b60200101906001600160f81b031916908160001a90535060049490941c93613a9481614aa9565b9050613a26565b5083156116d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b9a565b828054613af69061433e565b90600052602060002090601f016020900481019282613b185760008555613b5e565b82601f10613b3157805160ff1916838001178555613b5e565b82800160010185558215613b5e579182015b82811115613b5e578251825591602001919060010190613b43565b50613b6a929150613b6e565b5090565b5b80821115613b6a5760008155600101613b6f565b6001600160e01b0319811681146120f257600080fd5b600060208284031215613bab57600080fd5b81356116d781613b83565b60005b83811015613bd1578181015183820152602001613bb9565b83811115611a3b5750506000910152565b60008151808452613bfa816020860160208601613bb6565b601f01601f19169290920160200192915050565b6020815260006116d76020830184613be2565b600060208284031215613c3357600080fd5b5035919050565b6001600160a01b03811681146120f257600080fd5b60008060408385031215613c6257600080fd5b8235613c6d81613c3a565b946020939093013593505050565b600060208284031215613c8d57600080fd5b81356116d781613c3a565b600080600060608486031215613cad57600080fd5b8335613cb881613c3a565b92506020840135613cc881613c3a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715613d1157613d11613cd9565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613d3f57613d3f613cd9565b604052919050565b80356001600160f81b0381168114613d5e57600080fd5b919050565b80358015158114613d5e57600080fd5b600060e08284031215613d8557600080fd5b60405160e081018181106001600160401b0382111715613da757613da7613cd9565b8060405250823581526020830135602082015260408301356040820152613dd060608401613d47565b6060820152613de160808401613d63565b6080820152613df260a08401613d63565b60a0820152613e0360c08401613d63565b60c08201529392505050565b60006001600160401b03821115613e2857613e28613cd9565b5060051b60200190565b600082601f830112613e4357600080fd5b81356020613e58613e5383613e0f565b613d17565b82815260059290921b84018101918181019086841115613e7757600080fd5b8286015b84811015613e925780358352918301918301613e7b565b509695505050505050565b60008060408385031215613eb057600080fd5b82356001600160401b0380821115613ec757600080fd5b818501915085601f830112613edb57600080fd5b81356020613eeb613e5383613e0f565b82815260059290921b84018101918181019089841115613f0a57600080fd5b948201945b83861015613f31578535613f2281613c3a565b82529482019490820190613f0f565b96505086013592505080821115613f4757600080fd5b50613f5485828601613e32565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015613f9657835183529284019291840191600101613f7a565b50909695505050505050565b8035600081900b8114613d5e57600080fd5b803562ffffff81168114613d5e57600080fd5b600080600060608486031215613fdc57600080fd5b83359250613fec60208501613fa2565b9150613ffa60408501613fb4565b90509250925092565b634e487b7160e01b600052602160045260246000fd5b8681526020810186905260408101859052606081018490526001600160f81b038316608082015260c081016003831061406257634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b60006001600160401b0382111561408c5761408c613cd9565b50601f01601f191660200190565b60006140a8613e5384614073565b90508281528383830111156140bc57600080fd5b828260208301376000602084830101529392505050565b6000602082840312156140e557600080fd5b81356001600160401b038111156140fb57600080fd5b8201601f8101841361410c57600080fd5b6123928482356020840161409a565b600082601f83011261412c57600080fd5b6116d78383356020850161409a565b60008060006060848603121561415057600080fd5b833561415b81613c3a565b92506020840135915060408401356001600160401b0381111561417d57600080fd5b6141898682870161411b565b9150509250925092565b600080604083850312156141a657600080fd5b82356141b181613c3a565b91506141bf60208401613d63565b90509250929050565b600080604083850312156141db57600080fd5b50508035926020909101359150565b6000806000806080858703121561420057600080fd5b843561420b81613c3a565b9350602085013561421b81613c3a565b92506040850135915060608501356001600160401b0381111561423d57600080fd5b6142498782880161411b565b91505092959194509250565b6000806000806080858703121561426b57600080fd5b61427485613fa2565b935061421b60208601613fb4565b60008082840360e081121561429657600080fd5b60c08112156142a457600080fd5b506142ad613cef565b833581526020840135602082015260408401356040820152606084013560608201526142db60808501613d47565b608082015260a0840135600381106142f257600080fd5b60a08201529460c0939093013593505050565b6000806040838503121561431857600080fd5b823561432381613c3a565b9150602083013561433381613c3a565b809150509250929050565b600181811c9082168061435257607f821691505b6020821081141561437357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156143a2576143a2614379565b500190565b60008160001904831182151516156143c1576143c1614379565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826143eb576143eb6143c6565b500490565b60008282101561440257614402614379565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156144b7576144b7614379565b5060010190565b60006001600160ff1b03818413828413808216868404861116156144e4576144e4614379565b600160ff1b600087128281168783058912161561450357614503614379565b6000871292508782058712848416161561451f5761451f614379565b8785058712818416161561453557614535614379565b505050929093029392505050565b600080821280156001600160ff1b038490038513161561456557614565614379565b600160ff1b839003841281161561457e5761457e614379565b50500190565b6000614592613e5384614073565b90508281528383830111156145a657600080fd5b6116d7836020830184613bb6565b6000602082840312156145c657600080fd5b81516001600160401b038111156145dc57600080fd5b8201601f810184136145ed57600080fd5b61239284825160208401614584565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052600160045260246000fd5b6000815161464e818560208601613bb6565b9290920192915050565b7303d913730b6b2911d11213637b1b5a1b637b1b5960651b81528451600090614688816014850160208a01613bb6565b7f222c20226465736372697074696f6e223a22426c6f636b436c6f636b732061726014918401918201527f65206f6e2d636861696e2053564720636c6f636b732e205468652070726f677260348201527f616d20697320616c736f20617661696c61626c65206f6e204950465320666f7260548201527f2065617369657220616e696d6174656420646973706c61792e222c2022696d6160748201526533b2911d101160d11b6094820152855161474681609a840160208a01613bb6565b741116101130b734b6b0ba34b7b72fbab936111d101160591b609a9290910191820152845161477c8160af840160208901613bb6565b61479d61478e60af838501018761463c565b62227d7d60e81b815260030190565b98975050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516147e181601d850160208701613bb6565b91909101601d0192915050565b6d029b2b63632b91d1021b7b9ba39960951b81526000825161481781600e850160208701613bb6565b64204757656960d81b600e939091019283015250601301919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082614894576148946143c6565b500690565b600080845481600182811c9150808316806148b557607f831692505b60208084108214156148d557634e487b7160e01b86526022600452602486fd5b8180156148e957600181146148fa57614927565b60ff19861689528489019650614927565b60008b81526020902060005b8681101561491f5781548b820152908501908301614906565b505084890196505b50505050505061182a818561463c565b7f222c202270726f70657274696573223a207b2022486967686c6967687420436f8152663637b9111d101160c91b60208201526000835161497f816027850160208801613bb6565b72222c202254696d657a6f6e65223a202255544360681b60279184019182015283516149b281603a840160208801613bb6565b01603a01949350505050565b6000602082840312156149d057600080fd5b81516116d781613c3a565b67029b2b63632b91d160c51b8152600082516149fe816008850160208701613bb6565b9190910160080192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134e090830184613be2565b600060208284031215614a5057600080fd5b81516116d781613b83565b623f683d60e81b815260008351614a79816003850160208801613bb6565b6326747a3d60e01b6003918401918201528351614a9d816007840160208801613bb6565b01600701949350505050565b600081614ab857614ab8614379565b506000190190565b600081810b607f19811415614ad757614ad7614379565b60000392915050565b602d60f81b815260008251614afc816001850160208701613bb6565b9190910160010192915050565b602b60f81b815260008251614afc816001850160208701613bb656fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220e407b19bf4cfc01ecd9ff5bb628bc41dcae5fef62c14c955a1497c173ae1b98064736f6c634300080900334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000c102f76973f4890cab1b5d1ed26f3623381983af000000000000000000000000000001f568875f378bf6d170b790967fe429c81a00000000000000000000000035f80931b2e5074913b98da9b4832e454485431e0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000003
Deployed Bytecode
0x6080604052600436106102cd5760003560e01c80638456cb5911610175578063a7399243116100dc578063c87b56dd11610095578063e33b7de31161006f578063e33b7de3146109cc578063e985e9c5146109e1578063f2fde38b14610a01578063feff199914610a2157600080fd5b8063c87b56dd14610956578063ce7c2ac214610976578063e0c5b0ed146109ac57600080fd5b8063a73992431461082b578063b88d4fde1461084b578063b9303f8a1461086b578063bb69b7ef1461088b578063bf62e21d14610916578063c85b380d1461093657600080fd5b80638f4a18f71161012e5780638f4a18f7146107315780639097548d1461078b5780639106d7ba146107ab57806395d89b41146107c05780639852595c146107d5578063a22cb4651461080b57600080fd5b80638456cb59146106805780638838b5c314610695578063890621da146106b35780638ada6b0f146106d35780638b83209b146106f35780638da5cb5b1461071357600080fd5b806338af3eed116102345780636352211e116101ed578063715018a6116101c7578063715018a6146105dd57806379ecdffc146105f25780637bd07f8b146106125780637e77b7c21461066057600080fd5b80636352211e146105705780636c4a412c1461059057806370a08231146105bd57600080fd5b806338af3eed146104c75780633a98ef39146104e75780633f4ba83a146104fc57806342842e0e1461051157806356d3163d146105315780635c975abb1461055157600080fd5b8063195e870811610286578063195e87081461040f5780631c31f7101461043f57806323b872dd1461045f57806326092b831461047f5780632f274bd4146104875780632f745c59146104a757600080fd5b806301ffc9a71461031b57806306fdde0314610350578063081812fc14610372578063095ea7b3146103aa57806318160ddd146103cc57806319165587146103ef57600080fd5b36610316577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561032757600080fd5b5061033b610336366004613b99565b610a41565b60405190151581526020015b60405180910390f35b34801561035c57600080fd5b50610365610a93565b6040516103479190613c0e565b34801561037e57600080fd5b5061039261038d366004613c21565b610b25565b6040516001600160a01b039091168152602001610347565b3480156103b657600080fd5b506103ca6103c5366004613c4f565b610bbf565b005b3480156103d857600080fd5b506103e1610cd5565b604051908152602001610347565b3480156103fb57600080fd5b506103ca61040a366004613c7b565b610ce5565b34801561041b57600080fd5b5061033b61042a366004613c21565b601a6020526000908152604090205460ff1681565b34801561044b57600080fd5b506103ca61045a366004613c7b565b610eb6565b34801561046b57600080fd5b506103ca61047a366004613c98565b610f02565b6103ca610f33565b34801561049357600080fd5b506103ca6104a2366004613d73565b610f40565b3480156104b357600080fd5b506103e16104c2366004613c4f565b61112e565b3480156104d357600080fd5b50601154610392906001600160a01b031681565b3480156104f357600080fd5b50601c546103e1565b34801561050857600080fd5b506103ca6111c4565b34801561051d57600080fd5b506103ca61052c366004613c98565b6111f6565b34801561053d57600080fd5b506103ca61054c366004613c7b565b611211565b34801561055d57600080fd5b50600a54600160a01b900460ff1661033b565b34801561057c57600080fd5b5061039261058b366004613c21565b61125d565b34801561059c57600080fd5b506105b06105ab366004613e9d565b6112d4565b6040516103479190613f5e565b3480156105c957600080fd5b506103e16105d8366004613c7b565b6113de565b3480156105e957600080fd5b506103ca611465565b3480156105fe57600080fd5b506103ca61060d366004613fc7565b611499565b34801561061e57600080fd5b5060155460165460175460185460195461064e94939291906001600160f81b03811690600160f81b900460ff1686565b60405161034796959493929190614019565b34801561066c57600080fd5b506103ca61067b3660046140d3565b61153b565b34801561068c57600080fd5b506103ca61157c565b3480156106a157600080fd5b50601b546001600160a01b0316610392565b3480156106bf57600080fd5b506103e16106ce36600461413b565b6115ae565b3480156106df57600080fd5b50602354610392906001600160a01b031681565b3480156106ff57600080fd5b5061039261070e366004613c21565b6116de565b34801561071f57600080fd5b50600a546001600160a01b0316610392565b34801561073d57600080fd5b5061076d61074c366004613c21565b6024602052600090815260408120549081900b90610100900462ffffff1682565b6040805160009390930b835262ffffff909116602083015201610347565b34801561079757600080fd5b506103e16107a6366004613c21565b61170e565b3480156107b757600080fd5b506103e1611833565b3480156107cc57600080fd5b5061036561183e565b3480156107e157600080fd5b506103e16107f0366004613c7b565b6001600160a01b03166000908152601f602052604090205490565b34801561081757600080fd5b506103ca610826366004614193565b61184d565b34801561083757600080fd5b506103656108463660046141c8565b611912565b34801561085757600080fd5b506103ca6108663660046141ea565b611a09565b34801561087757600080fd5b506103ca610886366004614255565b611a41565b34801561089757600080fd5b50600c54600d54600e54600f546010546108d3949392916001600160f81b0381169160ff600160f81b9092048216918181169161010090041687565b604080519788526020880196909652948601939093526001600160f81b03909116606085015215156080840152151560a0830152151560c082015260e001610347565b34801561092257600080fd5b506103ca610931366004613c4f565b611b05565b34801561094257600080fd5b506103ca610951366004614282565b611c7a565b34801561096257600080fd5b50610365610971366004613c21565b611e62565b34801561098257600080fd5b506103e1610991366004613c7b565b6001600160a01b03166000908152601e602052604090205490565b3480156109b857600080fd5b506103ca6109c7366004613c21565b611feb565b3480156109d857600080fd5b50601d546103e1565b3480156109ed57600080fd5b5061033b6109fc366004614305565b61201a565b348015610a0d57600080fd5b506103ca610a1c366004613c7b565b61205a565b348015610a2d57600080fd5b506103e1610a3c366004613c4f565b6120f5565b60006001600160e01b031982166380ac58cd60e01b1480610a7257506001600160e01b03198216635b5e139f60e01b145b80610a8d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060008054610aa29061433e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ace9061433e565b8015610b1b5780601f10610af057610100808354040283529160200191610b1b565b820191906000526020600020905b815481529060010190602001808311610afe57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610ba35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610bca8261125d565b9050806001600160a01b0316836001600160a01b03161415610c385760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b9a565b336001600160a01b0382161480610c545750610c54813361201a565b610cc65760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b9a565b610cd0838361213c565b505050565b6000610ce060085490565b905090565b6001600160a01b0381166000908152601e6020526040902054610d595760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201526573686172657360d01b6064820152608401610b9a565b6000601d5447610d69919061438f565b6001600160a01b0383166000908152601f6020908152604080832054601c54601e909352908320549394509192610da090856143a7565b610daa91906143dc565b610db491906143f0565b905080610e175760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201526a191d59481c185e5b595b9d60aa1b6064820152608401610b9a565b6001600160a01b0383166000908152601f6020526040902054610e3b90829061438f565b6001600160a01b0384166000908152601f6020526040902055601d54610e6290829061438f565b601d55610e6f83826121aa565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b600a546001600160a01b03163314610ee05760405162461bcd60e51b8152600401610b9a90614407565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b610f0c33826122c3565b610f285760405162461bcd60e51b8152600401610b9a9061443c565b610cd083838361239a565b610f3e336001612545565b565b600a546001600160a01b03163314610f6a5760405162461bcd60e51b8152600401610b9a90614407565b80606001516001600160f81b031681600001511015610fcb5760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f7461000000006044820152606401610b9a565b6012548151101561101e5760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c646044820152606401610b9a565b60145481606001516001600160f81b031610156110875760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b6064820152608401610b9a565b601054610100900460ff16156110a457600160c0820152600c5481525b60105460ff16156110c857600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b6000611139836113de565b821061119b5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b9a565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600a546001600160a01b031633146111ee5760405162461bcd60e51b8152600401610b9a90614407565b610f3e612992565b610cd083838360405180602001604052806000815250611a09565b600a546001600160a01b0316331461123b5760405162461bcd60e51b8152600401610b9a90614407565b602380546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b031680610a8d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b9a565b6060815183511461131b5760405162461bcd60e51b8152602060048201526011602482015270214c454e4754485f4d49534d415443482160781b6044820152606401610b9a565b82516001600160401b0381111561133457611334613cd9565b60405190808252806020026020018201604052801561135d578160200160208202803683370190505b50905060005b83518110156113d7576113a88482815181106113815761138161448d565b602002602001015184838151811061139b5761139b61448d565b60200260200101516120f5565b8282815181106113ba576113ba61448d565b6020908102919091010152806113cf816144a3565b915050611363565b5092915050565b60006001600160a01b0382166114495760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b9a565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b0316331461148f5760405162461bcd60e51b8152600401610b9a90614407565b610f3e6000612a2f565b6114a28361125d565b6001600160a01b0316336001600160a01b0316146114ee5760405162461bcd60e51b815260206004820152600960248201526842433a75433a34303160b81b6044820152606401610b9a565b604080518082018252600093840b815262ffffff9283166020808301918252958552602490955292209151825493519091166101000263ffffffff1990931660ff90911617919091179055565b600a546001600160a01b031633146115655760405162461bcd60e51b8152600401610b9a90614407565b8051611578906022906020840190613aea565b5050565b600a546001600160a01b031633146115a65760405162461bcd60e51b8152600401610b9a90614407565b610f3e612a81565b6000806116116115be86866120f5565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050611625601b546001600160a01b031690565b6001600160a01b03166116388285612ae6565b6001600160a01b0316146116845760405162461bcd60e51b815260206004820152601360248201527221494e56414c49445f5349474e41545552452160681b6044820152606401610b9a565b6000818152601a602052604090205460ff16156116d45760405162461bcd60e51b815260206004820152600e60248201526d21414c52454144595f555345442160901b6044820152606401610b9a565b90505b9392505050565b6000602082815481106116f3576116f361448d565b6000918252602090912001546001600160a01b031692915050565b600060158160016004830154600160f81b900460ff16600281111561173557611735614003565b141561174257504361176d565b60026004830154600160f81b900460ff16600281111561176457611764614003565b141561176d5750425b81541580159061177e575081548110155b6117ca5760405162461bcd60e51b815260206004820152601f60248201527f4c696e656172447574636841756374696f6e3a204e6f742073746172746564006044820152606401610b9a565b600282015482546000916117ff916117e290856143f0565b6117ec91906143dc565b60048501546001600160f81b0316612b8a565b905082600301548161181191906143a7565b836001015461182091906143f0565b61182a90866143a7565b95945050505050565b6000610ce060125490565b606060018054610aa29061433e565b6001600160a01b0382163314156118a65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b9a565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600082815260246020908152604080832081518083019092525480840b8252610100900462ffffff16918101919091526060918315611951578361196c565b81516119629060000b610e106144be565b61196c9042614543565b60235483516020850151604051637adb6c6960e01b815260009290920b600483015262ffffff166024820152604481018390529192506001600160a01b031690637adb6c699060640160006040518083038186803b1580156119cd57600080fd5b505afa1580156119e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261182a91908101906145b4565b611a1333836122c3565b611a2f5760405162461bcd60e51b8152600401610b9a9061443c565b611a3b84848484612ba0565b50505050565b6104006021541115611a815760405162461bcd60e51b8152602060048201526009602482015268042433a63473a3530360bc1b6044820152606401610b9a565b611a8c338383612bd3565b611a9833602154612bff565b604080518082018252600086810b825262ffffff808716602080850191825260218054855260249091529483209351845491519092166101000263ffffffff1990911660ff909216919091171790915581546001929190611afa90849061438f565b909155505050505050565b600a546001600160a01b03163314611b2f5760405162461bcd60e51b8152600401610b9a90614407565b600a54600160a01b900460ff1615611b595760405162461bcd60e51b8152600401610b9a906145fc565b600f546001600160f81b0316611b8182611b7260145490565b611b7c90846143f0565b612b8a565b915060008211611bd35760405162461bcd60e51b815260206004820152601b60248201527f53656c6c65723a20467265652071756f746120657863656564656400000000006044820152606401610b9a565b600c54611be383611b7260125490565b925060008311611c285760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b9a565b611c3484846001612d4d565b611c3f601284612d76565b611c4a601484612d76565b80611c5460125490565b1115611c6257611c62614626565b81611c6c60145490565b1115611a3b57611a3b614626565b600a546001600160a01b03163314611ca45760405162461bcd60e51b8152600401610b9a90614407565b8082608001516001600160f81b031683606001510283602001510314611d1a5760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b6064820152608401610b9a565b60008260a001516002811115611d3257611d32614003565b1415611d8c5760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b6064820152608401610b9a565b6000826040015111611df35760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b6064820152608401610b9a565b815160159081556020830151601655604083015160175560608301516018556080830151601980546001600160f81b0319166001600160f81b03909216918217815560a0850151859392909190600160f81b836002811115611e5757611e57614003565b021790555050505050565b6000818152600260205260409020546060906001600160a01b0316611eb55760405162461bcd60e51b81526020600482015260096024820152681090ce9d154e8d0c0d60ba1b6044820152606401610b9a565b60008281526024602090815260408083208151808301909252549283900b815261010090920462ffffff1690820152611fc4611ef084612d93565b602354835160208501516040516366f027e760e01b815260009290920b600483015262ffffff1660248201524260448201526001600160a01b03909116906366f027e79060640160006040518083038186803b158015611f4f57600080fd5b505afa158015611f63573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611f8b91908101906145b4565b611f9486612e90565b611f9d87612ec4565b604051602001611fb09493929190614658565b604051602081830303815290604052612f1e565b604051602001611fd491906147a9565b604051602081830303815290604052915050919050565b600a546001600160a01b031633146120155760405162461bcd60e51b8152600401610b9a90614407565b601555565b60006120268383613083565b806116d757506001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff166116d7565b600a546001600160a01b031633146120845760405162461bcd60e51b8152600401610b9a90614407565b6001600160a01b0381166120e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b9a565b6120f281612a2f565b50565b604080516001600160a01b038416602082015290810182905230606082015260009060800160405160208183030381529060405280519060200120905092915050565b5490565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121718261125d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156121fa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b9a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612247576040519150601f19603f3d011682016040523d82523d6000602084013e61224c565b606091505b5050905080610cd05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b9a565b6000818152600260205260408120546001600160a01b031661233c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b9a565b60006123478361125d565b9050806001600160a01b0316846001600160a01b031614806123825750836001600160a01b031661237784610b25565b6001600160a01b0316145b806123925750612392818561201a565b949350505050565b826001600160a01b03166123ad8261125d565b6001600160a01b0316146124155760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b9a565b6001600160a01b0382166124775760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b9a565b612482838383613174565b61248d60008261213c565b6001600160a01b03831660009081526003602052604081208054600192906124b69084906143f0565b90915550506001600160a01b03821660009081526003602052604081208054600192906124e490849061438f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6002600b5414156125985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b9a565b6002600b55600a54600160a01b900460ff16156125c75760405162461bcd60e51b8152600401610b9a906145fc565b6040805160e081018252600c548152600d546020820152600e54918101829052600f546001600160f81b038116606083015260ff600160f81b909104811615156080830152601054808216151560a0840152610100900416151560c082015290600090156126425761263d838360400151612b8a565b612644565b825b905060008260800151612658578251612672565b60608301518351612672916001600160f81b0316906143f0565b905061268182611b7260125490565b9150600082116126c65760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b9a565b60208301511561282257336001600160a01b0386168114159060009032148015906126fa5750326001600160a01b03881614155b905061272a84886040518060400160405280600b81526020016a109d5e595c881b1a5b5a5d60aa1b8152506131da565b935081156127645761276184336040518060400160405280600c81526020016b14d95b99195c881b1a5b5a5d60a21b8152506131da565b93505b801561279c5761279984326040518060400160405280600c81526020016b13dc9a59da5b881b1a5b5a5d60a21b8152506131da565b93505b6001600160a01b038716600090815260136020526040812080548692906127c490849061438f565b909155505081156127f45733600090815260136020526040812080548692906127ee90849061438f565b90915550505b801561281f57326000908152601360205260408120805486929061281990849061438f565b90915550505b50505b600061282d8361170e565b9050803410156128835761284d612848633b9aca00836143dc565b613223565b60405160200161285d91906147ee565b60408051601f198184030181529082905262461bcd60e51b8252610b9a91600401613c0e565b61288f86846000612d4d565b61289a601284612d76565b835160125411156128ad576128ad614626565b80341115612985573360006128c283346143f0565b9050600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114612912576040519150601f19603f3d011682016040523d82523d6000602084013e612917565b606091505b509150915081819061293c5760405162461bcd60e51b8152600401610b9a9190613c0e565b50836001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8460405161297891815260200190565b60405180910390a2505050505b50506001600b5550505050565b600a54600160a01b900460ff166129e25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b9a565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a54600160a01b900460ff1615612aab5760405162461bcd60e51b8152600401610b9a906145fc565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a123390565b6000815160411415612b1a5760208201516040830151606084015160001a612b1086828585613320565b9350505050610a8d565b815160401415612b425760208201516040830151612b398583836134c0565b92505050610a8d565b60405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b9a565b6000818310612b9957816116d7565b5090919050565b612bab84848461239a565b612bb7848484846134ea565b611a3b5760405162461bcd60e51b8152600401610b9a90614833565b6000612be08484846115ae565b6000908152601a60205260409020805460ff1916600117905550505050565b6001600160a01b038216612c555760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b9a565b6000818152600260205260409020546001600160a01b031615612cba5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b9a565b612cc660008383613174565b6001600160a01b0382166000908152600360205260408120805460019290612cef90849061438f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b612d5983602154612bff565b600160216000828254612d6c919061438f565b9091555050505050565b80826000016000828254612d8a919061438f565b90915550505050565b606081612db75750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612de15780612dcb816144a3565b9150612dda9050600a836143dc565b9150612dbb565b6000816001600160401b03811115612dfb57612dfb613cd9565b6040519080825280601f01601f191660200182016040528015612e25576020820181803683370190505b5090505b841561239257612e3a6001836143f0565b9150612e47600a86614885565b612e5290603061438f565b60f81b818381518110612e6757612e6761448d565b60200101906001600160f81b031916908160001a905350612e89600a866143dc565b9450612e29565b60606022612e9d836135f4565b604051602001612eae929190614899565b6040516020818303038152906040529050919050565b60008181526024602090815260408083208151808301909252549283900b815261010090920462ffffff1690820181905260609190612f029061364e565b8151612f0d90613766565b604051602001611fd4929190614937565b805160609080612f3e575050604080516020810190915260008152919050565b60006003612f4d83600261438f565b612f5791906143dc565b612f629060046143a7565b90506000612f7182602061438f565b6001600160401b03811115612f8857612f88613cd9565b6040519080825280601f01601f191660200182016040528015612fb2576020820181803683370190505b5090506000604051806060016040528060408152602001614b26604091399050600181016020830160005b8681101561303e576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101612fdd565b506003860660018114613058576002811461306957613075565b613d3d60f01b600119830152613075565b603d60f81b6000198301525b505050918152949350505050565b600080466001811461309c57600481146130b8576130d0565b73a5409ec958c83c3f309868babaca7c86dcb077c191506130d0565b73f57b2c51ded3a29e6891aba85459d600256cf31791505b506001600160a01b03811615801590612392575060405163c455279160e01b81526001600160a01b038581166004830152808516919083169063c45527919060240160206040518083038186803b15801561312a57600080fd5b505afa15801561313e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061316291906149be565b6001600160a01b031614949350505050565b816001600160a01b0316836001600160a01b031614610cd0576001600160a01b0382166131aa576131a560086137c8565b6131b4565b6131b4828261381f565b6001600160a01b0383166131d057610cd0600880546001019055565b610cd08382613863565b6001600160a01b038216600090815260136020526040812054600d548291613201916143f0565b905080613219578260405160200161285d91906149db565b61182a8582612b8a565b6060816132475750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613271578061325b816144a3565b915061326a9050600a836143dc565b915061324b565b6000816001600160401b0381111561328b5761328b613cd9565b6040519080825280601f01601f1916602001820160405280156132b5576020820181803683370190505b5090505b8415612392576132ca6001836143f0565b91506132d7600a86614885565b6132e290603061438f565b60f81b8183815181106132f7576132f761448d565b60200101906001600160f81b031916908160001a905350613319600a866143dc565b94506132b9565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561339d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b9a565b8360ff16601b14806133b257508360ff16601c145b6134095760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b9a565b6040805160008082526020820180845288905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa15801561345d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661182a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b9a565b60006001600160ff1b03821660ff83901c601b016134e086828785613320565b9695505050505050565b60006001600160a01b0384163b156135ec57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061352e903390899088908890600401614a0b565b602060405180830381600087803b15801561354857600080fd5b505af1925050508015613578575060408051601f3d908101601f1916820190925261357591810190614a3e565b60015b6135d2573d8080156135a6576040519150601f19603f3d011682016040523d82523d6000602084013e6135ab565b606091505b5080516135ca5760405162461bcd60e51b8152600401610b9a90614833565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612392565b506001612392565b60008181526024602090815260408083208151808301909252549283900b815261010090920462ffffff169082018190526060919061363290613900565b815161363d90613766565b604051602001611fd4929190614a5b565b60408051600780825281830190925260609160009190602082018180368337019050509050602360f81b8160008151811061368b5761368b61448d565b60200101906001600160f81b031916908160001a90535060065b8015613717576f181899199a1a9b1b9c1cb0b131b232b360811b84600f16601081106136d3576136d361448d565b1a60f81b8282815181106136e9576136e961448d565b60200101906001600160f81b031916908160001a90535060049390931c9261371081614aa9565b90506136a5565b508215610a8d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b9a565b606060008260000b12156137ac5761378861378083614ac0565b60ff16612d93565b6040516020016137989190614ae0565b604051602081830303815290604052610a8d565b6137b88260ff16612d93565b604051602001612eae9190614b09565b8054806138175760405162461bcd60e51b815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f7700000000006044820152606401610b9a565b600019019055565b600061382a836113de565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60006001613870846113de565b61387a91906143f0565b6000838152600760205260409020549091508082146138cd576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6060816139275750506040805180820190915260048152630307830360e41b602082015290565b8160005b811561394a578061393b816144a3565b915050600882901c915061392b565b61239284826060600061395e8360026143a7565b61396990600261438f565b6001600160401b0381111561398057613980613cd9565b6040519080825280601f01601f1916602001820160405280156139aa576020820181803683370190505b509050600360fc1b816000815181106139c5576139c561448d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106139f4576139f461448d565b60200101906001600160f81b031916908160001a9053506000613a188460026143a7565b613a2390600161438f565b90505b6001811115613a9b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613a5757613a5761448d565b1a60f81b828281518110613a6d57613a6d61448d565b60200101906001600160f81b031916908160001a90535060049490941c93613a9481614aa9565b9050613a26565b5083156116d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b9a565b828054613af69061433e565b90600052602060002090601f016020900481019282613b185760008555613b5e565b82601f10613b3157805160ff1916838001178555613b5e565b82800160010185558215613b5e579182015b82811115613b5e578251825591602001919060010190613b43565b50613b6a929150613b6e565b5090565b5b80821115613b6a5760008155600101613b6f565b6001600160e01b0319811681146120f257600080fd5b600060208284031215613bab57600080fd5b81356116d781613b83565b60005b83811015613bd1578181015183820152602001613bb9565b83811115611a3b5750506000910152565b60008151808452613bfa816020860160208601613bb6565b601f01601f19169290920160200192915050565b6020815260006116d76020830184613be2565b600060208284031215613c3357600080fd5b5035919050565b6001600160a01b03811681146120f257600080fd5b60008060408385031215613c6257600080fd5b8235613c6d81613c3a565b946020939093013593505050565b600060208284031215613c8d57600080fd5b81356116d781613c3a565b600080600060608486031215613cad57600080fd5b8335613cb881613c3a565b92506020840135613cc881613c3a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715613d1157613d11613cd9565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613d3f57613d3f613cd9565b604052919050565b80356001600160f81b0381168114613d5e57600080fd5b919050565b80358015158114613d5e57600080fd5b600060e08284031215613d8557600080fd5b60405160e081018181106001600160401b0382111715613da757613da7613cd9565b8060405250823581526020830135602082015260408301356040820152613dd060608401613d47565b6060820152613de160808401613d63565b6080820152613df260a08401613d63565b60a0820152613e0360c08401613d63565b60c08201529392505050565b60006001600160401b03821115613e2857613e28613cd9565b5060051b60200190565b600082601f830112613e4357600080fd5b81356020613e58613e5383613e0f565b613d17565b82815260059290921b84018101918181019086841115613e7757600080fd5b8286015b84811015613e925780358352918301918301613e7b565b509695505050505050565b60008060408385031215613eb057600080fd5b82356001600160401b0380821115613ec757600080fd5b818501915085601f830112613edb57600080fd5b81356020613eeb613e5383613e0f565b82815260059290921b84018101918181019089841115613f0a57600080fd5b948201945b83861015613f31578535613f2281613c3a565b82529482019490820190613f0f565b96505086013592505080821115613f4757600080fd5b50613f5485828601613e32565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015613f9657835183529284019291840191600101613f7a565b50909695505050505050565b8035600081900b8114613d5e57600080fd5b803562ffffff81168114613d5e57600080fd5b600080600060608486031215613fdc57600080fd5b83359250613fec60208501613fa2565b9150613ffa60408501613fb4565b90509250925092565b634e487b7160e01b600052602160045260246000fd5b8681526020810186905260408101859052606081018490526001600160f81b038316608082015260c081016003831061406257634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b60006001600160401b0382111561408c5761408c613cd9565b50601f01601f191660200190565b60006140a8613e5384614073565b90508281528383830111156140bc57600080fd5b828260208301376000602084830101529392505050565b6000602082840312156140e557600080fd5b81356001600160401b038111156140fb57600080fd5b8201601f8101841361410c57600080fd5b6123928482356020840161409a565b600082601f83011261412c57600080fd5b6116d78383356020850161409a565b60008060006060848603121561415057600080fd5b833561415b81613c3a565b92506020840135915060408401356001600160401b0381111561417d57600080fd5b6141898682870161411b565b9150509250925092565b600080604083850312156141a657600080fd5b82356141b181613c3a565b91506141bf60208401613d63565b90509250929050565b600080604083850312156141db57600080fd5b50508035926020909101359150565b6000806000806080858703121561420057600080fd5b843561420b81613c3a565b9350602085013561421b81613c3a565b92506040850135915060608501356001600160401b0381111561423d57600080fd5b6142498782880161411b565b91505092959194509250565b6000806000806080858703121561426b57600080fd5b61427485613fa2565b935061421b60208601613fb4565b60008082840360e081121561429657600080fd5b60c08112156142a457600080fd5b506142ad613cef565b833581526020840135602082015260408401356040820152606084013560608201526142db60808501613d47565b608082015260a0840135600381106142f257600080fd5b60a08201529460c0939093013593505050565b6000806040838503121561431857600080fd5b823561432381613c3a565b9150602083013561433381613c3a565b809150509250929050565b600181811c9082168061435257607f821691505b6020821081141561437357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156143a2576143a2614379565b500190565b60008160001904831182151516156143c1576143c1614379565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826143eb576143eb6143c6565b500490565b60008282101561440257614402614379565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156144b7576144b7614379565b5060010190565b60006001600160ff1b03818413828413808216868404861116156144e4576144e4614379565b600160ff1b600087128281168783058912161561450357614503614379565b6000871292508782058712848416161561451f5761451f614379565b8785058712818416161561453557614535614379565b505050929093029392505050565b600080821280156001600160ff1b038490038513161561456557614565614379565b600160ff1b839003841281161561457e5761457e614379565b50500190565b6000614592613e5384614073565b90508281528383830111156145a657600080fd5b6116d7836020830184613bb6565b6000602082840312156145c657600080fd5b81516001600160401b038111156145dc57600080fd5b8201601f810184136145ed57600080fd5b61239284825160208401614584565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052600160045260246000fd5b6000815161464e818560208601613bb6565b9290920192915050565b7303d913730b6b2911d11213637b1b5a1b637b1b5960651b81528451600090614688816014850160208a01613bb6565b7f222c20226465736372697074696f6e223a22426c6f636b436c6f636b732061726014918401918201527f65206f6e2d636861696e2053564720636c6f636b732e205468652070726f677260348201527f616d20697320616c736f20617661696c61626c65206f6e204950465320666f7260548201527f2065617369657220616e696d6174656420646973706c61792e222c2022696d6160748201526533b2911d101160d11b6094820152855161474681609a840160208a01613bb6565b741116101130b734b6b0ba34b7b72fbab936111d101160591b609a9290910191820152845161477c8160af840160208901613bb6565b61479d61478e60af838501018761463c565b62227d7d60e81b815260030190565b98975050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516147e181601d850160208701613bb6565b91909101601d0192915050565b6d029b2b63632b91d1021b7b9ba39960951b81526000825161481781600e850160208701613bb6565b64204757656960d81b600e939091019283015250601301919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082614894576148946143c6565b500690565b600080845481600182811c9150808316806148b557607f831692505b60208084108214156148d557634e487b7160e01b86526022600452602486fd5b8180156148e957600181146148fa57614927565b60ff19861689528489019650614927565b60008b81526020902060005b8681101561491f5781548b820152908501908301614906565b505084890196505b50505050505061182a818561463c565b7f222c202270726f70657274696573223a207b2022486967686c6967687420436f8152663637b9111d101160c91b60208201526000835161497f816027850160208801613bb6565b72222c202254696d657a6f6e65223a202255544360681b60279184019182015283516149b281603a840160208801613bb6565b01603a01949350505050565b6000602082840312156149d057600080fd5b81516116d781613c3a565b67029b2b63632b91d160c51b8152600082516149fe816008850160208701613bb6565b9190910160080192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906134e090830184613be2565b600060208284031215614a5057600080fd5b81516116d781613b83565b623f683d60e81b815260008351614a79816003850160208801613bb6565b6326747a3d60e01b6003918401918201528351614a9d816007840160208801613bb6565b01600701949350505050565b600081614ab857614ab8614379565b506000190190565b600081810b607f19811415614ad757614ad7614379565b60000392915050565b602d60f81b815260008251614afc816001850160208701613bb6565b9190910160010192915050565b602b60f81b815260008251614afc816001850160208701613bb656fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220e407b19bf4cfc01ecd9ff5bb628bc41dcae5fef62c14c955a1497c173ae1b98064736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000c102f76973f4890cab1b5d1ed26f3623381983af000000000000000000000000000001f568875f378bf6d170b790967fe429c81a00000000000000000000000035f80931b2e5074913b98da9b4832e454485431e0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000003
-----Decoded View---------------
Arg [0] : _payees (address[]): 0xc102f76973f4890cAB1b5d1ed26F3623381983aF,0x000001f568875F378Bf6d170B790967FE429C81A,0x35f80931b2e5074913B98dA9b4832E454485431e
Arg [1] : _shares (uint256[]): 90,7,3
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [3] : 000000000000000000000000c102f76973f4890cab1b5d1ed26f3623381983af
Arg [4] : 000000000000000000000000000001f568875f378bf6d170b790967fe429c81a
Arg [5] : 00000000000000000000000035f80931b2e5074913b98da9b4832e454485431e
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 000000000000000000000000000000000000000000000000000000000000005a
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000003
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,606.38 | 0.404 | $1,456.98 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.