Source Code
Overview
ETH Balance
0.2666 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 15 from a total of 15 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Contribute Eth | 4736958 | 544 days ago | IN | 0.002 ETH | 0.00618055 | ||||
Contribute Eth | 4727291 | 546 days ago | IN | 0.1 ETH | 0.00009834 | ||||
Contribute Eth | 4727290 | 546 days ago | IN | 0.01 ETH | 0.0004603 | ||||
Contribute Eth | 4727289 | 546 days ago | IN | 0.1 ETH | 0.000565 | ||||
Contribute Eth | 4727285 | 546 days ago | IN | 0 ETH | 0.00003327 | ||||
Contribute Eth | 4727177 | 546 days ago | IN | 0.01 ETH | 0.00060609 | ||||
Contribute Eth | 4725796 | 546 days ago | IN | 0.0012 ETH | 0.00009817 | ||||
Contribute Eth | 4725659 | 546 days ago | IN | 0.0011 ETH | 0.00045934 | ||||
Contribute Eth | 4725623 | 546 days ago | IN | 0.0011 ETH | 0.00009801 | ||||
Contribute Eth | 4719402 | 547 days ago | IN | 0.01 ETH | 0.00146394 | ||||
Contribute Eth | 4713095 | 548 days ago | IN | 0.0012 ETH | 0.0000977 | ||||
Contribute Eth | 4712332 | 548 days ago | IN | 0.01 ETH | 0.02071286 | ||||
Contribute Eth | 4712207 | 548 days ago | IN | 0.01 ETH | 0.00066656 | ||||
Contribute Eth | 4712202 | 548 days ago | IN | 0.01 ETH | 0.00080787 | ||||
Create Gofundme | 4712164 | 548 days ago | IN | 0 ETH | 0.00403327 |
Latest 5 internal transactions
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
0x60806040 | 4727273 | 546 days ago | Contract Creation | 0 ETH | |||
0x60806040 | 4727171 | 546 days ago | Contract Creation | 0 ETH | |||
0x60806040 | 4719400 | 547 days ago | Contract Creation | 0 ETH | |||
0x60806040 | 4712325 | 548 days ago | Contract Creation | 0 ETH | |||
0x60806040 | 4712164 | 548 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
GoEthMe
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import {RewardsNft} from "./RewardsNft.sol"; import "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol"; struct GoFund { uint id_; string title; string description; uint256 fundingGoal; address owner; uint startTime; uint256 durationTime; bool isActive; uint256 fundingBalance; string tokenUri; RewardsNft nftAddress; address[] contributors; uint yayvotes; uint nayvotes; } /// @title GoEthMe - A decentralized fundraising platform for creative projects. contract GoEthMe { uint public id; struct Contributors { address contributor; uint balance; uint time; } mapping(uint => GoFund) funder; mapping(address => mapping(uint => Contributors)) contributors_; mapping(uint => mapping(address => uint)) public contribute; mapping(uint => mapping(address => bool)) public hasContributed; GoFund[] public activeCampaigns; error InsufficientInput(); error NotActive(); error NotActiveCause(); error ExceededFundingGoal(); error NotInDuration(); error NotOwner(); error TimeNotReached(); event CreateGofundme( uint id, string _title, uint256 _fundingGoal, uint256 _durationTime ); event ContributeEth( uint indexed _ID, uint _fundingBalance, address contributor, uint amount ); event GetContributedFunds(uint indexed _ID, bool isActive); /// @notice Create a GoFund campaign. /// @param _title The title of the campaign. /// @param uri The URI for the associated NFT. /// @param _fundingGoal The funding goal in ether. /// @param _durationTime The duration of the campaign in seconds. /// @return _id The unique ID of the created campaign. function createGofundme( address creator, string memory _title, string memory _description, string memory uri, uint256 _fundingGoal, uint256 _durationTime ) external returns (uint _id) { id++; _id = id; GoFund storage fund = funder[_id]; fund.id_ = _id; fund.title = _title; fund.description = _description; fund.fundingGoal = _fundingGoal; fund.owner = creator; fund.startTime = block.timestamp; fund.durationTime = _durationTime + block.timestamp; fund.nftAddress = new RewardsNft(_title, "RFT"); fund.tokenUri = uri; fund.isActive = true; // push to the active campaigns activeCampaigns.push( GoFund( fund.id_, fund.title, fund.description, fund.fundingGoal, fund.owner, fund.startTime, fund.durationTime, fund.isActive, 0, fund.tokenUri, fund.nftAddress, fund.contributors, fund.yayvotes, fund.nayvotes ) ); emit CreateGofundme(_id, _title, _fundingGoal, _durationTime); } /// @notice Contribute Ether to a GoFund campaign. /// @param _ID The ID of the campaign to contribute to. function contributeEth(uint _ID) external payable { if (msg.value <= 0.001 ether) revert InsufficientInput(); GoFund storage fund = funder[_ID]; if (fund.isActive != true) revert NotActive(); if (fund.fundingBalance + msg.value > fund.fundingGoal) revert ExceededFundingGoal(); if (block.timestamp > fund.durationTime) revert NotInDuration(); contributors_[msg.sender][_ID].time = block.timestamp; uint ID_ = _ID - 1; activeCampaigns[ID_].fundingBalance += msg.value; contribute[_ID][msg.sender] += msg.value; fund.fundingBalance += msg.value; if (!hasContributed[_ID][msg.sender]) { fund.contributors.push(msg.sender); hasContributed[_ID][msg.sender] = true; } if (fund.nftAddress.balanceOf(msg.sender) == 0) { fund.nftAddress._safeMint(msg.sender, fund.tokenUri); } emit ContributeEth( _ID, fund.fundingBalance, msg.sender, contribute[_ID][msg.sender] ); } /// @notice Get contributed funds from a GoFund campaign. /// @param _ID The ID of the campaign to retrieve funds from. function getContributedFunds(uint _ID) external { GoFund storage fund = funder[_ID]; if (fund.isActive != true) revert NotActiveCause(); if (msg.sender != fund.owner) revert NotOwner(); if (fund.durationTime > block.timestamp) revert TimeNotReached(); uint _bal = fund.fundingBalance; fund.fundingBalance = 0; fund.isActive = false; payable(fund.owner).transfer(_bal); emit GetContributedFunds(_ID, false); } /// @notice Retrieve a list of contributors and their contribution balances for a campaign. /// @param _ID The ID of the campaign to retrieve contributors from. /// @return _contributors An array of contributors and their balances. function getContributors( uint _ID ) external view returns (Contributors[] memory _contributors) { GoFund storage fund = funder[_ID]; uint total = fund.contributors.length; _contributors = new Contributors[](total); for (uint i = 0; i < total; i++) { address contributor = fund.contributors[i]; uint amount = contribute[_ID][contributor]; uint time = contributors_[contributor][_ID].time; _contributors[i] = Contributors(contributor, amount, time); } } function getfunder(uint _ID) external view returns (GoFund memory goFund) { goFund = funder[_ID]; } function getAllCampaignsCount() external view returns (uint) { return id; } function getCampaigns() external view returns (GoFund[] memory) { return activeCampaigns; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract RewardsNft is ERC721, ERC721URIStorage { uint256 tokenIdCounter; constructor( string memory _name, string memory _symbol ) ERC721(_name, _symbol) {} function _safeMint(address contributor, string memory _tokenUri) external { _safeMint(contributor, tokenIdCounter); _setTokenURI(tokenIdCounter, _tokenUri); tokenIdCounter++; } // functions that needs to be overriden because i used the ERC721URIStorage extension function tokenURI( uint256 tokenId ) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721, ERC721URIStorage) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {Strings} from "../../../utils/Strings.sol"; import {IERC4906} from "../../../interfaces/IERC4906.sol"; import {IERC165} from "../../../interfaces/IERC165.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is IERC4906, ERC721 { using Strings for uint256; // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only // defines events and does not include any external function. bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906); // Optional mapping for token URIs mapping(uint256 tokenId => string) private _tokenURIs; /** * @dev See {IERC165-supportsInterface} */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) { return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireOwned(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via string.concat). if (bytes(_tokenURI).length > 0) { return string.concat(base, _tokenURI); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Emits {MetadataUpdate}. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { _tokenURIs[tokenId] = _tokenURI; emit MetadataUpdate(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.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}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => 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 returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(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 overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * 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 { _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); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - 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) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. 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 */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4906.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; import {IERC721} from "./IERC721.sol"; /// @title EIP-721 Metadata Update Extension interface IERC4906 is IERC165, IERC721 { /// @dev This event emits when the metadata of a token is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFT. event MetadataUpdate(uint256 _tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @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 `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../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 // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "../token/ERC721/IERC721.sol";
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract ABI
API[{"inputs":[],"name":"ExceededFundingGoal","type":"error"},{"inputs":[],"name":"InsufficientInput","type":"error"},{"inputs":[],"name":"NotActive","type":"error"},{"inputs":[],"name":"NotActiveCause","type":"error"},{"inputs":[],"name":"NotInDuration","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"TimeNotReached","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_ID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fundingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"contributor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ContributeEth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"_title","type":"string"},{"indexed":false,"internalType":"uint256","name":"_fundingGoal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_durationTime","type":"uint256"}],"name":"CreateGofundme","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_ID","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"GetContributedFunds","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeCampaigns","outputs":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"fundingGoal","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"durationTime","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint256","name":"fundingBalance","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"},{"internalType":"contract RewardsNft","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"yayvotes","type":"uint256"},{"internalType":"uint256","name":"nayvotes","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"contribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ID","type":"uint256"}],"name":"contributeEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"_title","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"_fundingGoal","type":"uint256"},{"internalType":"uint256","name":"_durationTime","type":"uint256"}],"name":"createGofundme","outputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllCampaignsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCampaigns","outputs":[{"components":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"fundingGoal","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"durationTime","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint256","name":"fundingBalance","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"},{"internalType":"contract RewardsNft","name":"nftAddress","type":"address"},{"internalType":"address[]","name":"contributors","type":"address[]"},{"internalType":"uint256","name":"yayvotes","type":"uint256"},{"internalType":"uint256","name":"nayvotes","type":"uint256"}],"internalType":"struct GoFund[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ID","type":"uint256"}],"name":"getContributedFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ID","type":"uint256"}],"name":"getContributors","outputs":[{"components":[{"internalType":"address","name":"contributor","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"internalType":"struct GoEthMe.Contributors[]","name":"_contributors","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ID","type":"uint256"}],"name":"getfunder","outputs":[{"components":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"fundingGoal","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"durationTime","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint256","name":"fundingBalance","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"},{"internalType":"contract RewardsNft","name":"nftAddress","type":"address"},{"internalType":"address[]","name":"contributors","type":"address[]"},{"internalType":"uint256","name":"yayvotes","type":"uint256"},{"internalType":"uint256","name":"nayvotes","type":"uint256"}],"internalType":"struct GoFund","name":"goFund","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"hasContributed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50613520806100206000396000f3fe608060405260043610620000a95760003560e01c806360b0b0f0116200006c57806360b0b0f0146200018c57806394470d5114620001c8578063a6b036331462000208578063af640d0f146200022f578063b5b96ae01462000247578063bfc281c2146200029757600080fd5b80631a93c87614620000ae578063352d722f14620000e65780633726102d14620000ff5780633c1ab00f14620001335780635f7720171462000167575b600080fd5b348015620000bb57600080fd5b50620000d3620000cd366004620017a1565b620002ae565b6040519081526020015b60405180910390f35b620000fd620000f736600462001858565b620007ed565b005b3480156200010c57600080fd5b50620001246200011e36600462001858565b62000b24565b604051620000dd919062001a14565b3480156200014057600080fd5b50620001586200015236600462001858565b62000e78565b604051620000dd919062001a30565b3480156200017457600080fd5b50620000fd6200018636600462001858565b62000fd8565b3480156200019957600080fd5b50620000d3620001ab36600462001a94565b600360209081526000928352604080842090915290825290205481565b348015620001d557600080fd5b50620001ed620001e736600462001858565b620010f5565b604051620000dd9d9c9b9a9998979695949392919062001ac3565b3480156200021557600080fd5b50620002206200133a565b604051620000dd919062001b75565b3480156200023c57600080fd5b50620000d360005481565b3480156200025457600080fd5b50620002866200026636600462001a94565b600460209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001620000dd565b348015620002a457600080fd5b50600054620000d3565b600080548180620002bf8362001bf1565b909155505060008054808252600160208190526040909220818155909250908101620002ec888262001c9c565b5060028101620002fd878262001c9c565b50600381018490556004810180546001600160a01b0319166001600160a01b038a16179055426005820181905562000336908462001d69565b600682015560405187906200034b906200164a565b62000357919062001d85565b604051809103906000f08015801562000374573d6000803e3d6000fd5b50600a820180546001600160a01b0319166001600160a01b039290921691909117905560098101620003a7868262001c9c565b5060078101805460ff19166001908117909155604080516101c08101909152825481529082018054600592916020830191620003e39062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620004119062001c0d565b8015620004625780601f10620004365761010080835404028352916020019162000462565b820191906000526020600020905b8154815290600101906020018083116200044457829003601f168201915b505050505081526020018360020180546200047d9062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620004ab9062001c0d565b8015620004fc5780601f10620004d057610100808354040283529160200191620004fc565b820191906000526020600020905b815481529060010190602001808311620004de57829003601f168201915b50505091835250506003840154602082015260048401546001600160a01b031660408201526005840154606082015260068401546080820152600784015460ff16151560a0820152600060c082015260098401805460e090920191620005629062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620005909062001c0d565b8015620005e15780601f10620005b557610100808354040283529160200191620005e1565b820191906000526020600020905b815481529060010190602001808311620005c357829003601f168201915b5050509183525050600a8401546001600160a01b0316602080830191909152600b8501805460408051828502810185018252828152940193928301828280156200065557602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000636575b5050509183525050600c840154602080830191909152600d8501546040909201919091528254600181810185556000948552938290208351600e90920201908155908201519192909190820190620006ae908262001c9c565b5060408201516002820190620006c5908262001c9c565b506060820151600382015560808201516004820180546001600160a01b0319166001600160a01b0390921691909117905560a0820151600582015560c0820151600682015560e082015160078201805460ff19169115159190911790556101008201516008820155610120820151600982019062000744908262001c9c565b50610140820151600a820180546001600160a01b0319166001600160a01b0390921691909117905561016082015180516200078a91600b84019160209091019062001658565b5061018082015181600c01556101a082015181600d015550507fa5cf465c2209ac6f051686a1f5b7953bea51baf09ce1435777fc442aef402adb82888686604051620007da949392919062001dbf565b60405180910390a1509695505050505050565b66038d7ea4c680003411620008155760405163f8b3bb6160e01b815260040160405180910390fd5b60008181526001602081905260409091206007810154909160ff9091161515146200085357604051634065aaf160e11b815260040160405180910390fd5b80600301543482600801546200086a919062001d69565b11156200088a576040516302285fb560e51b815260040160405180910390fd5b8060060154421115620008b057604051631fd1a5cd60e31b815260040160405180910390fd5b336000908152600260208181526040808420868552909152822042910155620008db60018462001ded565b90503460058281548110620008f457620008f462001e03565b90600052602060002090600e0201600801600082825462000916919062001d69565b90915550506000838152600360209081526040808320338452909152812080543492906200094690849062001d69565b925050819055503482600801600082825462000963919062001d69565b9091555050600083815260046020908152604080832033845290915290205460ff16620009d657600b82018054600181810183556000928352602080842090920180546001600160a01b0319163390811790915586845260048352604080852091855292529120805460ff191690911790555b600a8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801562000a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a47919062001e19565b60000362000abd57600a8201546040516342780cc960e11b81526001600160a01b03909116906384f019929062000a88903390600987019060040162001e33565b600060405180830381600087803b15801562000aa357600080fd5b505af115801562000ab8573d6000803e3d6000fd5b505050505b600882015460008481526003602090815260408083203380855290835292819020548151948552918401929092529082015283907f641e0d946349dea2c0a7b1d1cced725c0bea588db875ec196860b61dea3e46f2906060015b60405180910390a2505050565b62000bab604051806101c001604052806000815260200160608152602001606081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600015158152602001600081526020016060815260200160006001600160a01b031681526020016060815260200160008152602001600081525090565b60008281526001602081815260409283902083516101c081019094528054845291820180549184019162000bdf9062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000c0d9062001c0d565b801562000c5e5780601f1062000c325761010080835404028352916020019162000c5e565b820191906000526020600020905b81548152906001019060200180831162000c4057829003601f168201915b5050505050815260200160028201805462000c799062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000ca79062001c0d565b801562000cf85780601f1062000ccc5761010080835404028352916020019162000cf8565b820191906000526020600020905b81548152906001019060200180831162000cda57829003601f168201915b50505091835250506003820154602082015260048201546001600160a01b031660408201526005820154606082015260068201546080820152600782015460ff16151560a0820152600882015460c082015260098201805460e09092019162000d619062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000d8f9062001c0d565b801562000de05780601f1062000db45761010080835404028352916020019162000de0565b820191906000526020600020905b81548152906001019060200180831162000dc257829003601f168201915b5050509183525050600a8201546001600160a01b0316602080830191909152600b83018054604080518285028101850182528281529401939283018282801562000e5457602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000e35575b50505050508152602001600c8201548152602001600d820154815250509050919050565b6000818152600160205260409020600b810154606091908067ffffffffffffffff81111562000eab5762000eab620016f6565b60405190808252806020026020018201604052801562000f0c57816020015b62000ef8604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b81526020019060019003908162000eca5790505b50925060005b8181101562000fd057600083600b01828154811062000f355762000f3562001e03565b60009182526020808320909101548883526003825260408084206001600160a01b039092168085529183528084205460028085528286208c87528552948290209094015481516060810183528381529384018590529083018190528851919450919088908690811062000fac5762000fac62001e03565b6020026020010181905250505050808062000fc79062001bf1565b91505062000f12565b505050919050565b60008181526001602081905260409091206007810154909160ff909116151514620010165760405163ecb0722160e01b815260040160405180910390fd5b60048101546001600160a01b0316331462001044576040516330cd747160e01b815260040160405180910390fd5b42816006015411156200106a576040516371dcf04960e01b815260040160405180910390fd5b60088101805460009182905560078301805460ff19169055600483015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015620010c0573d6000803e3d6000fd5b506040516000815283907f5c25ab154783865d4e794ef9cd084f7d821f35631b7a027c4f30be3c8f076df99060200162000b17565b600581815481106200110657600080fd5b60009182526020909120600e909102018054600182018054919350906200112d9062001c0d565b80601f01602080910402602001604051908101604052809291908181526020018280546200115b9062001c0d565b8015620011ac5780601f106200118057610100808354040283529160200191620011ac565b820191906000526020600020905b8154815290600101906020018083116200118e57829003601f168201915b505050505090806002018054620011c39062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620011f19062001c0d565b8015620012425780601f10620012165761010080835404028352916020019162001242565b820191906000526020600020905b8154815290600101906020018083116200122457829003601f168201915b50505050600383015460048401546005850154600686015460078701546008880154600989018054989996986001600160a01b0390961697509395929460ff90921693909291620012939062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620012c19062001c0d565b8015620013125780601f10620012e65761010080835404028352916020019162001312565b820191906000526020600020905b815481529060010190602001808311620012f457829003601f168201915b50505050600a830154600c840154600d9094015492936001600160a01b03909116929091508d565b60606005805480602002602001604051908101604052809291908181526020016000905b828210156200164157838290600052602060002090600e0201604051806101c0016040529081600082015481526020016001820180546200139f9062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620013cd9062001c0d565b80156200141e5780601f10620013f2576101008083540402835291602001916200141e565b820191906000526020600020905b8154815290600101906020018083116200140057829003601f168201915b50505050508152602001600282018054620014399062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620014679062001c0d565b8015620014b85780601f106200148c57610100808354040283529160200191620014b8565b820191906000526020600020905b8154815290600101906020018083116200149a57829003601f168201915b50505091835250506003820154602082015260048201546001600160a01b031660408201526005820154606082015260068201546080820152600782015460ff16151560a0820152600882015460c082015260098201805460e090920191620015219062001c0d565b80601f01602080910402602001604051908101604052809291908181526020018280546200154f9062001c0d565b8015620015a05780601f106200157457610100808354040283529160200191620015a0565b820191906000526020600020905b8154815290600101906020018083116200158257829003601f168201915b5050509183525050600a8201546001600160a01b0316602080830191909152600b8301805460408051828502810185018252828152940193928301828280156200161457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620015f5575b50505050508152602001600c8201548152602001600d82015481525050815260200190600101906200135e565b50505050905090565b6116148062001ed783390190565b828054828255906000526020600020908101928215620016b0579160200282015b82811115620016b057825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062001679565b50620016be929150620016c2565b5090565b5b80821115620016be5760008155600101620016c3565b80356001600160a01b0381168114620016f157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200171e57600080fd5b813567ffffffffffffffff808211156200173c576200173c620016f6565b604051601f8301601f19908116603f01168101908282118183101715620017675762001767620016f6565b816040528381528660208588010111156200178157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060008060c08789031215620017bb57600080fd5b620017c687620016d9565b9550602087013567ffffffffffffffff80821115620017e457600080fd5b620017f28a838b016200170c565b965060408901359150808211156200180957600080fd5b620018178a838b016200170c565b955060608901359150808211156200182e57600080fd5b506200183d89828a016200170c565b9350506080870135915060a087013590509295509295509295565b6000602082840312156200186b57600080fd5b5035919050565b6000815180845260005b818110156200189a576020818501810151868301820152016200187c565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501945080840160005b83811015620018f55781516001600160a01b031687529582019590820190600101620018ce565b509495945050505050565b60006101c0825184526020830151816020860152620019228286018262001872565b915050604083015184820360408601526200193e828262001872565b9150506060830151606085015260808301516200196660808601826001600160a01b03169052565b5060a083015160a085015260c083015160c085015260e08301516200198f60e086018215159052565b5061010083810151908501526101208084015185830382870152620019b5838262001872565b9250505061014080840151620019d5828701826001600160a01b03169052565b50506101608084015185830382870152620019f18382620018ba565b61018086810151908801526101a095860151959096019490945250929392505050565b60208152600062001a29602083018462001900565b9392505050565b602080825282518282018190526000919060409081850190868401855b8281101562001a8757815180516001600160a01b031685528681015187860152850151858501526060909301929085019060010162001a4d565b5091979650505050505050565b6000806040838503121562001aa857600080fd5b8235915062001aba60208401620016d9565b90509250929050565b8d81526101a06020820152600062001ae06101a083018f62001872565b828103604084015262001af4818f62001872565b606084018e90526001600160a01b038d16608085015260a084018c905260c084018b905289151560e085015290508761010084015282810361012084015262001b3e818862001872565b91505062001b586101408301866001600160a01b03169052565b61016082019390935261018001529b9a5050505050505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101562001bce57603f1988860301845262001bbb85835162001900565b9450928501929085019060010162001b9c565b5092979650505050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001c065762001c0662001bdb565b5060010190565b600181811c9082168062001c2257607f821691505b60208210810362001c4357634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562001c9757600081815260208120601f850160051c8101602086101562001c725750805b601f850160051c820191505b8181101562001c935782815560010162001c7e565b5050505b505050565b815167ffffffffffffffff81111562001cb95762001cb9620016f6565b62001cd18162001cca845462001c0d565b8462001c49565b602080601f83116001811462001d09576000841562001cf05750858301515b600019600386901b1c1916600185901b17855562001c93565b600085815260208120601f198616915b8281101562001d3a5788860151825594840194600190910190840162001d19565b508582101562001d595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111562001d7f5762001d7f62001bdb565b92915050565b60408152600062001d9a604083018462001872565b8281036020840152600381526214919560ea1b60208201526040810191505092915050565b84815260806020820152600062001dda608083018662001872565b6040830194909452506060015292915050565b8181038181111562001d7f5762001d7f62001bdb565b634e487b7160e01b600052603260045260246000fd5b60006020828403121562001e2c57600080fd5b5051919050565b60018060a01b0383168152600060206040818401526000845462001e578162001c0d565b806040870152606060018084166000811462001e7c576001811462001e975762001ec7565b60ff1985168984015283151560051b89018301955062001ec7565b896000528660002060005b8581101562001ebf5781548b820186015290830190880162001ea2565b8a0184019650505b5093999850505050505050505056fe60806040523480156200001157600080fd5b506040516200161438038062001614833981016040819052620000349162000123565b818160006200004483826200021c565b5060016200005382826200021c565b5050505050620002e8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008657600080fd5b81516001600160401b0380821115620000a357620000a36200005e565b604051601f8301601f19908116603f01168101908282118183101715620000ce57620000ce6200005e565b81604052838152602092508683858801011115620000eb57600080fd5b600091505b838210156200010f5785820183015181830184015290820190620000f0565b600093810190920192909252949350505050565b600080604083850312156200013757600080fd5b82516001600160401b03808211156200014f57600080fd5b6200015d8683870162000074565b935060208501519150808211156200017457600080fd5b50620001838582860162000074565b9150509250929050565b600181811c90821680620001a257607f821691505b602082108103620001c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021757600081815260208120601f850160051c81016020861015620001f25750805b601f850160051c820191505b818110156200021357828155600101620001fe565b5050505b505050565b81516001600160401b038111156200023857620002386200005e565b62000250816200024984546200018d565b84620001c9565b602080601f8311600181146200028857600084156200026f5750858301515b600019600386901b1c1916600185901b17855562000213565b600085815260208120601f198616915b82811015620002b95788860151825594840194600190910190840162000298565b5085821015620002d85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61131c80620002f86000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a22cb46511610066578063a22cb465146101e1578063b88d4fde146101f4578063c87b56dd14610207578063e985e9c51461021a57600080fd5b806370a08231146101a557806384f01992146101c657806395d89b41146101d957600080fd5b8063095ea7b3116100c8578063095ea7b31461015757806323b872dd1461016c57806342842e0e1461017f5780636352211e1461019257600080fd5b806301ffc9a7146100ef57806306fdde0314610117578063081812fc1461012c575b600080fd5b6101026100fd366004610ddf565b61022d565b60405190151581526020015b60405180910390f35b61011f61023e565b60405161010e9190610e4c565b61013f61013a366004610e5f565b6102d0565b6040516001600160a01b03909116815260200161010e565b61016a610165366004610e94565b6102f9565b005b61016a61017a366004610ebe565b610308565b61016a61018d366004610ebe565b610398565b61013f6101a0366004610e5f565b6103b8565b6101b86101b3366004610efa565b6103c3565b60405190815260200161010e565b61016a6101d4366004610fa1565b61040b565b61011f61043c565b61016a6101ef366004611003565b61044b565b61016a61020236600461103f565b610456565b61011f610215366004610e5f565b61046d565b6101026102283660046110bb565b610478565b6000610238826104a6565b92915050565b60606000805461024d906110ee565b80601f0160208091040260200160405190810160405280929190818152602001828054610279906110ee565b80156102c65780601f1061029b576101008083540402835291602001916102c6565b820191906000526020600020905b8154815290600101906020018083116102a957829003601f168201915b5050505050905090565b60006102db826104cb565b506000828152600460205260409020546001600160a01b0316610238565b610304828233610504565b5050565b6001600160a01b03821661033757604051633250574960e11b8152600060048201526024015b60405180910390fd5b6000610344838333610511565b9050836001600160a01b0316816001600160a01b031614610392576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161032e565b50505050565b6103b383838360405180602001604052806000815250610456565b505050565b6000610238826104cb565b60006001600160a01b0382166103ef576040516322718ad960e21b81526000600482015260240161032e565b506001600160a01b031660009081526003602052604090205490565b6104178260075461060a565b61042360075482610624565b6007805490600061043383611128565b91905055505050565b60606001805461024d906110ee565b610304338383610674565b610461848484610308565b61039284848484610713565b60606102388261083c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b03198216632483248360e11b148061023857506102388261094d565b6000818152600260205260408120546001600160a01b03168061023857604051637e27328960e01b81526004810184905260240161032e565b6103b3838383600161099d565b6000828152600260205260408120546001600160a01b039081169083161561053e5761053e818486610aa3565b6001600160a01b0381161561057c5761055b60008560008061099d565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b038516156105ab576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b610304828260405180602001604052806000815250610b07565b600082815260066020526040902061063c828261119d565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b0382166106a657604051630b61174360e31b81526001600160a01b038316600482015260240161032e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561039257604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061075590339088908790879060040161125d565b6020604051808303816000875af1925050508015610790575060408051601f3d908101601f1916820190925261078d9181019061129a565b60015b6107f9573d8080156107be576040519150601f19603f3d011682016040523d82523d6000602084013e6107c3565b606091505b5080516000036107f157604051633250574960e11b81526001600160a01b038516600482015260240161032e565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461083557604051633250574960e11b81526001600160a01b038516600482015260240161032e565b5050505050565b6060610847826104cb565b5060008281526006602052604081208054610861906110ee565b80601f016020809104026020016040519081016040528092919081815260200182805461088d906110ee565b80156108da5780601f106108af576101008083540402835291602001916108da565b820191906000526020600020905b8154815290600101906020018083116108bd57829003601f168201915b5050505050905060006108f860408051602081019091526000815290565b9050805160000361090a575092915050565b81511561093c5780826040516020016109249291906112b7565b60405160208183030381529060405292505050919050565b61094584610b1e565b949350505050565b60006001600160e01b031982166380ac58cd60e01b148061097e57506001600160e01b03198216635b5e139f60e01b145b8061023857506301ffc9a760e01b6001600160e01b0319831614610238565b80806109b157506001600160a01b03821615155b15610a735760006109c1846104cb565b90506001600160a01b038316158015906109ed5750826001600160a01b0316816001600160a01b031614155b8015610a0057506109fe8184610478565b155b15610a295760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161032e565b8115610a715783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b610aae838383610b93565b6103b3576001600160a01b038316610adc57604051637e27328960e01b81526004810182905260240161032e565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161032e565b610b118383610bf6565b6103b36000848484610713565b6060610b29826104cb565b506000610b4160408051602081019091526000815290565b90506000815111610b615760405180602001604052806000815250610b8c565b80610b6b84610c5b565b604051602001610b7c9291906112b7565b6040516020818303038152906040525b9392505050565b60006001600160a01b038316158015906109455750826001600160a01b0316846001600160a01b03161480610bcd5750610bcd8484610478565b806109455750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160a01b038216610c2057604051633250574960e11b81526000600482015260240161032e565b6000610c2e83836000610511565b90506001600160a01b038116156103b3576040516339e3563760e11b81526000600482015260240161032e565b60606000610c6883610cee565b600101905060008167ffffffffffffffff811115610c8857610c88610f15565b6040519080825280601f01601f191660200182016040528015610cb2576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610cbc57509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610d2d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610d59576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d7757662386f26fc10000830492506010015b6305f5e1008310610d8f576305f5e100830492506008015b6127108310610da357612710830492506004015b60648310610db5576064830492506002015b600a83106102385760010192915050565b6001600160e01b031981168114610ddc57600080fd5b50565b600060208284031215610df157600080fd5b8135610b8c81610dc6565b60005b83811015610e17578181015183820152602001610dff565b50506000910152565b60008151808452610e38816020860160208601610dfc565b601f01601f19169290920160200192915050565b602081526000610b8c6020830184610e20565b600060208284031215610e7157600080fd5b5035919050565b80356001600160a01b0381168114610e8f57600080fd5b919050565b60008060408385031215610ea757600080fd5b610eb083610e78565b946020939093013593505050565b600080600060608486031215610ed357600080fd5b610edc84610e78565b9250610eea60208501610e78565b9150604084013590509250925092565b600060208284031215610f0c57600080fd5b610b8c82610e78565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610f4657610f46610f15565b604051601f8501601f19908116603f01168101908282118183101715610f6e57610f6e610f15565b81604052809350858152868686011115610f8757600080fd5b858560208301376000602087830101525050509392505050565b60008060408385031215610fb457600080fd5b610fbd83610e78565b9150602083013567ffffffffffffffff811115610fd957600080fd5b8301601f81018513610fea57600080fd5b610ff985823560208401610f2b565b9150509250929050565b6000806040838503121561101657600080fd5b61101f83610e78565b91506020830135801515811461103457600080fd5b809150509250929050565b6000806000806080858703121561105557600080fd5b61105e85610e78565b935061106c60208601610e78565b925060408501359150606085013567ffffffffffffffff81111561108f57600080fd5b8501601f810187136110a057600080fd5b6110af87823560208401610f2b565b91505092959194509250565b600080604083850312156110ce57600080fd5b6110d783610e78565b91506110e560208401610e78565b90509250929050565b600181811c9082168061110257607f821691505b60208210810361112257634e487b7160e01b600052602260045260246000fd5b50919050565b60006001820161114857634e487b7160e01b600052601160045260246000fd5b5060010190565b601f8211156103b357600081815260208120601f850160051c810160208610156111765750805b601f850160051c820191505b8181101561119557828155600101611182565b505050505050565b815167ffffffffffffffff8111156111b7576111b7610f15565b6111cb816111c584546110ee565b8461114f565b602080601f83116001811461120057600084156111e85750858301515b600019600386901b1c1916600185901b178555611195565b600085815260208120601f198616915b8281101561122f57888601518255948401946001909101908401611210565b508582101561124d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061129090830184610e20565b9695505050505050565b6000602082840312156112ac57600080fd5b8151610b8c81610dc6565b600083516112c9818460208801610dfc565b8351908301906112dd818360208801610dfc565b0194935050505056fea26469706673582212202ae538558007d53c3297f562c40afcec2396cb9d0ebb607b32602a8230c2107d64736f6c63430008150033a2646970667358221220d4f2d86d772a8e4ceb708dcf2ec2d06d3bbcc5f31bbebf2ba4a22ee3c8ada33264736f6c63430008150033
Deployed Bytecode
0x608060405260043610620000a95760003560e01c806360b0b0f0116200006c57806360b0b0f0146200018c57806394470d5114620001c8578063a6b036331462000208578063af640d0f146200022f578063b5b96ae01462000247578063bfc281c2146200029757600080fd5b80631a93c87614620000ae578063352d722f14620000e65780633726102d14620000ff5780633c1ab00f14620001335780635f7720171462000167575b600080fd5b348015620000bb57600080fd5b50620000d3620000cd366004620017a1565b620002ae565b6040519081526020015b60405180910390f35b620000fd620000f736600462001858565b620007ed565b005b3480156200010c57600080fd5b50620001246200011e36600462001858565b62000b24565b604051620000dd919062001a14565b3480156200014057600080fd5b50620001586200015236600462001858565b62000e78565b604051620000dd919062001a30565b3480156200017457600080fd5b50620000fd6200018636600462001858565b62000fd8565b3480156200019957600080fd5b50620000d3620001ab36600462001a94565b600360209081526000928352604080842090915290825290205481565b348015620001d557600080fd5b50620001ed620001e736600462001858565b620010f5565b604051620000dd9d9c9b9a9998979695949392919062001ac3565b3480156200021557600080fd5b50620002206200133a565b604051620000dd919062001b75565b3480156200023c57600080fd5b50620000d360005481565b3480156200025457600080fd5b50620002866200026636600462001a94565b600460209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001620000dd565b348015620002a457600080fd5b50600054620000d3565b600080548180620002bf8362001bf1565b909155505060008054808252600160208190526040909220818155909250908101620002ec888262001c9c565b5060028101620002fd878262001c9c565b50600381018490556004810180546001600160a01b0319166001600160a01b038a16179055426005820181905562000336908462001d69565b600682015560405187906200034b906200164a565b62000357919062001d85565b604051809103906000f08015801562000374573d6000803e3d6000fd5b50600a820180546001600160a01b0319166001600160a01b039290921691909117905560098101620003a7868262001c9c565b5060078101805460ff19166001908117909155604080516101c08101909152825481529082018054600592916020830191620003e39062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620004119062001c0d565b8015620004625780601f10620004365761010080835404028352916020019162000462565b820191906000526020600020905b8154815290600101906020018083116200044457829003601f168201915b505050505081526020018360020180546200047d9062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620004ab9062001c0d565b8015620004fc5780601f10620004d057610100808354040283529160200191620004fc565b820191906000526020600020905b815481529060010190602001808311620004de57829003601f168201915b50505091835250506003840154602082015260048401546001600160a01b031660408201526005840154606082015260068401546080820152600784015460ff16151560a0820152600060c082015260098401805460e090920191620005629062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620005909062001c0d565b8015620005e15780601f10620005b557610100808354040283529160200191620005e1565b820191906000526020600020905b815481529060010190602001808311620005c357829003601f168201915b5050509183525050600a8401546001600160a01b0316602080830191909152600b8501805460408051828502810185018252828152940193928301828280156200065557602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000636575b5050509183525050600c840154602080830191909152600d8501546040909201919091528254600181810185556000948552938290208351600e90920201908155908201519192909190820190620006ae908262001c9c565b5060408201516002820190620006c5908262001c9c565b506060820151600382015560808201516004820180546001600160a01b0319166001600160a01b0390921691909117905560a0820151600582015560c0820151600682015560e082015160078201805460ff19169115159190911790556101008201516008820155610120820151600982019062000744908262001c9c565b50610140820151600a820180546001600160a01b0319166001600160a01b0390921691909117905561016082015180516200078a91600b84019160209091019062001658565b5061018082015181600c01556101a082015181600d015550507fa5cf465c2209ac6f051686a1f5b7953bea51baf09ce1435777fc442aef402adb82888686604051620007da949392919062001dbf565b60405180910390a1509695505050505050565b66038d7ea4c680003411620008155760405163f8b3bb6160e01b815260040160405180910390fd5b60008181526001602081905260409091206007810154909160ff9091161515146200085357604051634065aaf160e11b815260040160405180910390fd5b80600301543482600801546200086a919062001d69565b11156200088a576040516302285fb560e51b815260040160405180910390fd5b8060060154421115620008b057604051631fd1a5cd60e31b815260040160405180910390fd5b336000908152600260208181526040808420868552909152822042910155620008db60018462001ded565b90503460058281548110620008f457620008f462001e03565b90600052602060002090600e0201600801600082825462000916919062001d69565b90915550506000838152600360209081526040808320338452909152812080543492906200094690849062001d69565b925050819055503482600801600082825462000963919062001d69565b9091555050600083815260046020908152604080832033845290915290205460ff16620009d657600b82018054600181810183556000928352602080842090920180546001600160a01b0319163390811790915586845260048352604080852091855292529120805460ff191690911790555b600a8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801562000a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a47919062001e19565b60000362000abd57600a8201546040516342780cc960e11b81526001600160a01b03909116906384f019929062000a88903390600987019060040162001e33565b600060405180830381600087803b15801562000aa357600080fd5b505af115801562000ab8573d6000803e3d6000fd5b505050505b600882015460008481526003602090815260408083203380855290835292819020548151948552918401929092529082015283907f641e0d946349dea2c0a7b1d1cced725c0bea588db875ec196860b61dea3e46f2906060015b60405180910390a2505050565b62000bab604051806101c001604052806000815260200160608152602001606081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600015158152602001600081526020016060815260200160006001600160a01b031681526020016060815260200160008152602001600081525090565b60008281526001602081815260409283902083516101c081019094528054845291820180549184019162000bdf9062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000c0d9062001c0d565b801562000c5e5780601f1062000c325761010080835404028352916020019162000c5e565b820191906000526020600020905b81548152906001019060200180831162000c4057829003601f168201915b5050505050815260200160028201805462000c799062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000ca79062001c0d565b801562000cf85780601f1062000ccc5761010080835404028352916020019162000cf8565b820191906000526020600020905b81548152906001019060200180831162000cda57829003601f168201915b50505091835250506003820154602082015260048201546001600160a01b031660408201526005820154606082015260068201546080820152600782015460ff16151560a0820152600882015460c082015260098201805460e09092019162000d619062001c0d565b80601f016020809104026020016040519081016040528092919081815260200182805462000d8f9062001c0d565b801562000de05780601f1062000db45761010080835404028352916020019162000de0565b820191906000526020600020905b81548152906001019060200180831162000dc257829003601f168201915b5050509183525050600a8201546001600160a01b0316602080830191909152600b83018054604080518285028101850182528281529401939283018282801562000e5457602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000e35575b50505050508152602001600c8201548152602001600d820154815250509050919050565b6000818152600160205260409020600b810154606091908067ffffffffffffffff81111562000eab5762000eab620016f6565b60405190808252806020026020018201604052801562000f0c57816020015b62000ef8604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b81526020019060019003908162000eca5790505b50925060005b8181101562000fd057600083600b01828154811062000f355762000f3562001e03565b60009182526020808320909101548883526003825260408084206001600160a01b039092168085529183528084205460028085528286208c87528552948290209094015481516060810183528381529384018590529083018190528851919450919088908690811062000fac5762000fac62001e03565b6020026020010181905250505050808062000fc79062001bf1565b91505062000f12565b505050919050565b60008181526001602081905260409091206007810154909160ff909116151514620010165760405163ecb0722160e01b815260040160405180910390fd5b60048101546001600160a01b0316331462001044576040516330cd747160e01b815260040160405180910390fd5b42816006015411156200106a576040516371dcf04960e01b815260040160405180910390fd5b60088101805460009182905560078301805460ff19169055600483015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015620010c0573d6000803e3d6000fd5b506040516000815283907f5c25ab154783865d4e794ef9cd084f7d821f35631b7a027c4f30be3c8f076df99060200162000b17565b600581815481106200110657600080fd5b60009182526020909120600e909102018054600182018054919350906200112d9062001c0d565b80601f01602080910402602001604051908101604052809291908181526020018280546200115b9062001c0d565b8015620011ac5780601f106200118057610100808354040283529160200191620011ac565b820191906000526020600020905b8154815290600101906020018083116200118e57829003601f168201915b505050505090806002018054620011c39062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620011f19062001c0d565b8015620012425780601f10620012165761010080835404028352916020019162001242565b820191906000526020600020905b8154815290600101906020018083116200122457829003601f168201915b50505050600383015460048401546005850154600686015460078701546008880154600989018054989996986001600160a01b0390961697509395929460ff90921693909291620012939062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620012c19062001c0d565b8015620013125780601f10620012e65761010080835404028352916020019162001312565b820191906000526020600020905b815481529060010190602001808311620012f457829003601f168201915b50505050600a830154600c840154600d9094015492936001600160a01b03909116929091508d565b60606005805480602002602001604051908101604052809291908181526020016000905b828210156200164157838290600052602060002090600e0201604051806101c0016040529081600082015481526020016001820180546200139f9062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620013cd9062001c0d565b80156200141e5780601f10620013f2576101008083540402835291602001916200141e565b820191906000526020600020905b8154815290600101906020018083116200140057829003601f168201915b50505050508152602001600282018054620014399062001c0d565b80601f0160208091040260200160405190810160405280929190818152602001828054620014679062001c0d565b8015620014b85780601f106200148c57610100808354040283529160200191620014b8565b820191906000526020600020905b8154815290600101906020018083116200149a57829003601f168201915b50505091835250506003820154602082015260048201546001600160a01b031660408201526005820154606082015260068201546080820152600782015460ff16151560a0820152600882015460c082015260098201805460e090920191620015219062001c0d565b80601f01602080910402602001604051908101604052809291908181526020018280546200154f9062001c0d565b8015620015a05780601f106200157457610100808354040283529160200191620015a0565b820191906000526020600020905b8154815290600101906020018083116200158257829003601f168201915b5050509183525050600a8201546001600160a01b0316602080830191909152600b8301805460408051828502810185018252828152940193928301828280156200161457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620015f5575b50505050508152602001600c8201548152602001600d82015481525050815260200190600101906200135e565b50505050905090565b6116148062001ed783390190565b828054828255906000526020600020908101928215620016b0579160200282015b82811115620016b057825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062001679565b50620016be929150620016c2565b5090565b5b80821115620016be5760008155600101620016c3565b80356001600160a01b0381168114620016f157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200171e57600080fd5b813567ffffffffffffffff808211156200173c576200173c620016f6565b604051601f8301601f19908116603f01168101908282118183101715620017675762001767620016f6565b816040528381528660208588010111156200178157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060008060c08789031215620017bb57600080fd5b620017c687620016d9565b9550602087013567ffffffffffffffff80821115620017e457600080fd5b620017f28a838b016200170c565b965060408901359150808211156200180957600080fd5b620018178a838b016200170c565b955060608901359150808211156200182e57600080fd5b506200183d89828a016200170c565b9350506080870135915060a087013590509295509295509295565b6000602082840312156200186b57600080fd5b5035919050565b6000815180845260005b818110156200189a576020818501810151868301820152016200187c565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501945080840160005b83811015620018f55781516001600160a01b031687529582019590820190600101620018ce565b509495945050505050565b60006101c0825184526020830151816020860152620019228286018262001872565b915050604083015184820360408601526200193e828262001872565b9150506060830151606085015260808301516200196660808601826001600160a01b03169052565b5060a083015160a085015260c083015160c085015260e08301516200198f60e086018215159052565b5061010083810151908501526101208084015185830382870152620019b5838262001872565b9250505061014080840151620019d5828701826001600160a01b03169052565b50506101608084015185830382870152620019f18382620018ba565b61018086810151908801526101a095860151959096019490945250929392505050565b60208152600062001a29602083018462001900565b9392505050565b602080825282518282018190526000919060409081850190868401855b8281101562001a8757815180516001600160a01b031685528681015187860152850151858501526060909301929085019060010162001a4d565b5091979650505050505050565b6000806040838503121562001aa857600080fd5b8235915062001aba60208401620016d9565b90509250929050565b8d81526101a06020820152600062001ae06101a083018f62001872565b828103604084015262001af4818f62001872565b606084018e90526001600160a01b038d16608085015260a084018c905260c084018b905289151560e085015290508761010084015282810361012084015262001b3e818862001872565b91505062001b586101408301866001600160a01b03169052565b61016082019390935261018001529b9a5050505050505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101562001bce57603f1988860301845262001bbb85835162001900565b9450928501929085019060010162001b9c565b5092979650505050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001c065762001c0662001bdb565b5060010190565b600181811c9082168062001c2257607f821691505b60208210810362001c4357634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562001c9757600081815260208120601f850160051c8101602086101562001c725750805b601f850160051c820191505b8181101562001c935782815560010162001c7e565b5050505b505050565b815167ffffffffffffffff81111562001cb95762001cb9620016f6565b62001cd18162001cca845462001c0d565b8462001c49565b602080601f83116001811462001d09576000841562001cf05750858301515b600019600386901b1c1916600185901b17855562001c93565b600085815260208120601f198616915b8281101562001d3a5788860151825594840194600190910190840162001d19565b508582101562001d595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111562001d7f5762001d7f62001bdb565b92915050565b60408152600062001d9a604083018462001872565b8281036020840152600381526214919560ea1b60208201526040810191505092915050565b84815260806020820152600062001dda608083018662001872565b6040830194909452506060015292915050565b8181038181111562001d7f5762001d7f62001bdb565b634e487b7160e01b600052603260045260246000fd5b60006020828403121562001e2c57600080fd5b5051919050565b60018060a01b0383168152600060206040818401526000845462001e578162001c0d565b806040870152606060018084166000811462001e7c576001811462001e975762001ec7565b60ff1985168984015283151560051b89018301955062001ec7565b896000528660002060005b8581101562001ebf5781548b820186015290830190880162001ea2565b8a0184019650505b5093999850505050505050505056fe60806040523480156200001157600080fd5b506040516200161438038062001614833981016040819052620000349162000123565b818160006200004483826200021c565b5060016200005382826200021c565b5050505050620002e8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200008657600080fd5b81516001600160401b0380821115620000a357620000a36200005e565b604051601f8301601f19908116603f01168101908282118183101715620000ce57620000ce6200005e565b81604052838152602092508683858801011115620000eb57600080fd5b600091505b838210156200010f5785820183015181830184015290820190620000f0565b600093810190920192909252949350505050565b600080604083850312156200013757600080fd5b82516001600160401b03808211156200014f57600080fd5b6200015d8683870162000074565b935060208501519150808211156200017457600080fd5b50620001838582860162000074565b9150509250929050565b600181811c90821680620001a257607f821691505b602082108103620001c357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021757600081815260208120601f850160051c81016020861015620001f25750805b601f850160051c820191505b818110156200021357828155600101620001fe565b5050505b505050565b81516001600160401b038111156200023857620002386200005e565b62000250816200024984546200018d565b84620001c9565b602080601f8311600181146200028857600084156200026f5750858301515b600019600386901b1c1916600185901b17855562000213565b600085815260208120601f198616915b82811015620002b95788860151825594840194600190910190840162000298565b5085821015620002d85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61131c80620002f86000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a22cb46511610066578063a22cb465146101e1578063b88d4fde146101f4578063c87b56dd14610207578063e985e9c51461021a57600080fd5b806370a08231146101a557806384f01992146101c657806395d89b41146101d957600080fd5b8063095ea7b3116100c8578063095ea7b31461015757806323b872dd1461016c57806342842e0e1461017f5780636352211e1461019257600080fd5b806301ffc9a7146100ef57806306fdde0314610117578063081812fc1461012c575b600080fd5b6101026100fd366004610ddf565b61022d565b60405190151581526020015b60405180910390f35b61011f61023e565b60405161010e9190610e4c565b61013f61013a366004610e5f565b6102d0565b6040516001600160a01b03909116815260200161010e565b61016a610165366004610e94565b6102f9565b005b61016a61017a366004610ebe565b610308565b61016a61018d366004610ebe565b610398565b61013f6101a0366004610e5f565b6103b8565b6101b86101b3366004610efa565b6103c3565b60405190815260200161010e565b61016a6101d4366004610fa1565b61040b565b61011f61043c565b61016a6101ef366004611003565b61044b565b61016a61020236600461103f565b610456565b61011f610215366004610e5f565b61046d565b6101026102283660046110bb565b610478565b6000610238826104a6565b92915050565b60606000805461024d906110ee565b80601f0160208091040260200160405190810160405280929190818152602001828054610279906110ee565b80156102c65780601f1061029b576101008083540402835291602001916102c6565b820191906000526020600020905b8154815290600101906020018083116102a957829003601f168201915b5050505050905090565b60006102db826104cb565b506000828152600460205260409020546001600160a01b0316610238565b610304828233610504565b5050565b6001600160a01b03821661033757604051633250574960e11b8152600060048201526024015b60405180910390fd5b6000610344838333610511565b9050836001600160a01b0316816001600160a01b031614610392576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161032e565b50505050565b6103b383838360405180602001604052806000815250610456565b505050565b6000610238826104cb565b60006001600160a01b0382166103ef576040516322718ad960e21b81526000600482015260240161032e565b506001600160a01b031660009081526003602052604090205490565b6104178260075461060a565b61042360075482610624565b6007805490600061043383611128565b91905055505050565b60606001805461024d906110ee565b610304338383610674565b610461848484610308565b61039284848484610713565b60606102388261083c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b03198216632483248360e11b148061023857506102388261094d565b6000818152600260205260408120546001600160a01b03168061023857604051637e27328960e01b81526004810184905260240161032e565b6103b3838383600161099d565b6000828152600260205260408120546001600160a01b039081169083161561053e5761053e818486610aa3565b6001600160a01b0381161561057c5761055b60008560008061099d565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b038516156105ab576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b610304828260405180602001604052806000815250610b07565b600082815260066020526040902061063c828261119d565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b0382166106a657604051630b61174360e31b81526001600160a01b038316600482015260240161032e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561039257604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061075590339088908790879060040161125d565b6020604051808303816000875af1925050508015610790575060408051601f3d908101601f1916820190925261078d9181019061129a565b60015b6107f9573d8080156107be576040519150601f19603f3d011682016040523d82523d6000602084013e6107c3565b606091505b5080516000036107f157604051633250574960e11b81526001600160a01b038516600482015260240161032e565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461083557604051633250574960e11b81526001600160a01b038516600482015260240161032e565b5050505050565b6060610847826104cb565b5060008281526006602052604081208054610861906110ee565b80601f016020809104026020016040519081016040528092919081815260200182805461088d906110ee565b80156108da5780601f106108af576101008083540402835291602001916108da565b820191906000526020600020905b8154815290600101906020018083116108bd57829003601f168201915b5050505050905060006108f860408051602081019091526000815290565b9050805160000361090a575092915050565b81511561093c5780826040516020016109249291906112b7565b60405160208183030381529060405292505050919050565b61094584610b1e565b949350505050565b60006001600160e01b031982166380ac58cd60e01b148061097e57506001600160e01b03198216635b5e139f60e01b145b8061023857506301ffc9a760e01b6001600160e01b0319831614610238565b80806109b157506001600160a01b03821615155b15610a735760006109c1846104cb565b90506001600160a01b038316158015906109ed5750826001600160a01b0316816001600160a01b031614155b8015610a0057506109fe8184610478565b155b15610a295760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161032e565b8115610a715783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b610aae838383610b93565b6103b3576001600160a01b038316610adc57604051637e27328960e01b81526004810182905260240161032e565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161032e565b610b118383610bf6565b6103b36000848484610713565b6060610b29826104cb565b506000610b4160408051602081019091526000815290565b90506000815111610b615760405180602001604052806000815250610b8c565b80610b6b84610c5b565b604051602001610b7c9291906112b7565b6040516020818303038152906040525b9392505050565b60006001600160a01b038316158015906109455750826001600160a01b0316846001600160a01b03161480610bcd5750610bcd8484610478565b806109455750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160a01b038216610c2057604051633250574960e11b81526000600482015260240161032e565b6000610c2e83836000610511565b90506001600160a01b038116156103b3576040516339e3563760e11b81526000600482015260240161032e565b60606000610c6883610cee565b600101905060008167ffffffffffffffff811115610c8857610c88610f15565b6040519080825280601f01601f191660200182016040528015610cb2576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610cbc57509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610d2d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610d59576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610d7757662386f26fc10000830492506010015b6305f5e1008310610d8f576305f5e100830492506008015b6127108310610da357612710830492506004015b60648310610db5576064830492506002015b600a83106102385760010192915050565b6001600160e01b031981168114610ddc57600080fd5b50565b600060208284031215610df157600080fd5b8135610b8c81610dc6565b60005b83811015610e17578181015183820152602001610dff565b50506000910152565b60008151808452610e38816020860160208601610dfc565b601f01601f19169290920160200192915050565b602081526000610b8c6020830184610e20565b600060208284031215610e7157600080fd5b5035919050565b80356001600160a01b0381168114610e8f57600080fd5b919050565b60008060408385031215610ea757600080fd5b610eb083610e78565b946020939093013593505050565b600080600060608486031215610ed357600080fd5b610edc84610e78565b9250610eea60208501610e78565b9150604084013590509250925092565b600060208284031215610f0c57600080fd5b610b8c82610e78565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610f4657610f46610f15565b604051601f8501601f19908116603f01168101908282118183101715610f6e57610f6e610f15565b81604052809350858152868686011115610f8757600080fd5b858560208301376000602087830101525050509392505050565b60008060408385031215610fb457600080fd5b610fbd83610e78565b9150602083013567ffffffffffffffff811115610fd957600080fd5b8301601f81018513610fea57600080fd5b610ff985823560208401610f2b565b9150509250929050565b6000806040838503121561101657600080fd5b61101f83610e78565b91506020830135801515811461103457600080fd5b809150509250929050565b6000806000806080858703121561105557600080fd5b61105e85610e78565b935061106c60208601610e78565b925060408501359150606085013567ffffffffffffffff81111561108f57600080fd5b8501601f810187136110a057600080fd5b6110af87823560208401610f2b565b91505092959194509250565b600080604083850312156110ce57600080fd5b6110d783610e78565b91506110e560208401610e78565b90509250929050565b600181811c9082168061110257607f821691505b60208210810361112257634e487b7160e01b600052602260045260246000fd5b50919050565b60006001820161114857634e487b7160e01b600052601160045260246000fd5b5060010190565b601f8211156103b357600081815260208120601f850160051c810160208610156111765750805b601f850160051c820191505b8181101561119557828155600101611182565b505050505050565b815167ffffffffffffffff8111156111b7576111b7610f15565b6111cb816111c584546110ee565b8461114f565b602080601f83116001811461120057600084156111e85750858301515b600019600386901b1c1916600185901b178555611195565b600085815260208120601f198616915b8281101561122f57888601518255948401946001909101908401611210565b508582101561124d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061129090830184610e20565b9695505050505050565b6000602082840312156112ac57600080fd5b8151610b8c81610dc6565b600083516112c9818460208801610dfc565b8351908301906112dd818360208801610dfc565b0194935050505056fea26469706673582212202ae538558007d53c3297f562c40afcec2396cb9d0ebb607b32602a8230c2107d64736f6c63430008150033a2646970667358221220d4f2d86d772a8e4ceb708dcf2ec2d06d3bbcc5f31bbebf2ba4a22ee3c8ada33264736f6c63430008150033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.