ERC-721
Overview
Max Total Supply
100 cvgIBO
Holders
78
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 cvgIBOLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Ibo
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 250 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be 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 override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @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 virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being 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`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * 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 caller. * * 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 v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `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 v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(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) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBondCalculator { function computeRoi( uint256 durationFromStart, uint256 totalDuration, uint256 composedFunction, uint256 totalTokenOut, uint256 amountTokenSold, uint256 gamma, uint256 scale, uint256 minRoi, uint256 maxRoi ) external pure returns (uint256 bondRoi); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "./IOracleStruct.sol"; interface ICvgOracle { function getPriceOracleUnverified(address erc20) external view returns (uint256); function getEthPriceOracleUnverified() external view returns (uint256); function getCvgPriceOracleUnverified() external view returns (uint256); function getAndVerifyCvgPrice() external view returns (uint256); function oracleParametersPerERC20(address erc20) external view returns (IOracleStruct.OracleParams memory); function getAndVerifyOracle(address erc20) external view returns (uint256); function getAndVerifyTwoPrices(address tokenIn, address tokenOut) external view returns (uint256, uint256); function getDataForVerification( address erc20Address ) external view returns (uint256, uint256, bool, bool, bool, bool, bool, bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; interface IOracleStruct { enum PoolType { STABLE, UNI_V2, UNI_V3, CURVE_DUO, CURVE_TRI } struct OracleParams { PoolType poolType; bool isReversed; bool isEthPriceRelated; uint32 twapOrK; address poolAddress; uint40 deltaLimitOracle; // 5 % => 500 & 100 % => 10 000 uint96 maxLastUpdate; // Buffer time before a not updated price is considered as stale AggregatorV3Interface aggregatorOracle; uint128 minPrice; uint128 maxPrice; address[] stablesToCheck; } }
// SPDX-License-Identifier: MIT /** _____ / __ \ | / \/ ___ _ ____ _____ _ __ __ _ ___ _ __ ___ ___ | | / _ \| '_ \ \ / / _ \ '__/ _` |/ _ \ '_ \ / __/ _ \ | \__/\ (_) | | | \ V / __/ | | (_| | __/ | | | (_| __/ \____/\___/|_| |_|\_/ \___|_| \__, |\___|_| |_|\___\___| __/ | |___/ */ import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "../interfaces/IBondCalculator.sol"; import "../interfaces/ICvgOracle.sol"; import "../interfaces/IOracleStruct.sol"; pragma solidity ^0.8.0; contract Ibo is ERC721Enumerable, Ownable2Step { struct BondParams { uint8 composedFunction; IERC20Metadata token; uint24 gamma; uint16 scale; uint24 minRoi; // Min bond ROI, divide by 1000 to get the roi in % uint24 maxRoi; // Max bond ROI, divide by 1000 to get the roi in % uint256 percentageMaxCvgToMint; // Percentage maximum of the maxCvgToMint that an user can mint in one deposit uint256 maxCvgToMint; // Limit of Max CVG to mint } struct BondView { address bondAddress; uint88 bondRoi; bool isValid; uint256 totalCvgMinted; uint256 maxCvgToMint; uint256 assetPriceUsdCvgOracle; uint256 assetPriceUsdAggregator; uint256 bondPriceAsset; uint256 bondPriceUsd; uint256 percentageMaxCvgToMint; ERC20View token; } struct ERC20View { string token; address tokenAddress; uint256 decimals; } event BondDeposit( uint256 indexed tokenId, uint256 amountDeposited, uint256 cvgAdded, uint256 amountDepositedUsd, IERC20Metadata token ); string internal baseURI; address public immutable treasuryBonds; /// @dev bond ROI calculator IBondCalculator public immutable bondCalculator; /// @dev oracle fetching prices in LP ICvgOracle public immutable cvgOracle; uint256 public iboStartTimestamp; /// @dev 0.33$ uint256 public constant CVG_PRICE_NO_ROI = 33 * 10 ** 16; uint256 public constant IBO_DURATION = 6 hours; uint256 public constant MAX_CVG_PEPE_PRIVILEGE = 15_000 * 10 ** 18; uint256 public constant MAX_CVG_WL_PRIVILEGE = 7_500 * 10 ** 18; /// @dev The ID of the next token that will be minted. Skips 0 uint256 public nextIdToken = 1; uint256 public nextIdBond = 1; bytes32 public merkleRootPepe; bytes32 public merkleRootWl; mapping(address => uint256) public soldDuringPrivilege; mapping(uint256 => BondParams) public bondsParams; mapping(uint256 => uint256) public totalCvgDuePerBond; mapping(uint256 => uint256) public totalCvgPerToken; constructor( address _treasuryBonds, IBondCalculator _bondCalculator, ICvgOracle _cvgOracle, bytes32 _merklePepe, bytes32 _merkleWl ) ERC721("IBO Cvg", "cvgIBO") { _transferOwnership(_treasuryBonds); treasuryBonds = _treasuryBonds; bondCalculator = _bondCalculator; cvgOracle = _cvgOracle; merkleRootPepe = _merklePepe; merkleRootWl = _merkleWl; } /** * @notice Create a new bond with associated bondParams * @param bondParams BondParams * */ function createBond(BondParams calldata bondParams) external onlyOwner { bondsParams[nextIdBond++] = bondParams; } /** * @notice Set the id of the curve related to the bond, 0 for square root, 1 for the logarithm and 2 for square and 3 linear * @param bondId uint256 * @param newComposedFunction uint8 */ function setComposedFunction(uint256 bondId, uint8 newComposedFunction) external onlyOwner { require(newComposedFunction < 4, "INVALID_COMPOSED_FUNCTION"); bondsParams[bondId].composedFunction = newComposedFunction; } /** * @notice Kicks in the IBO * @param startTimestamp uint256 */ function setStartTimestamp(uint256 startTimestamp) external onlyOwner { iboStartTimestamp = startTimestamp; } /** * @notice deposit into a bond to get an NFT with an underlaying value of CVG * @param tokenId uint256 * @param bondId uint256 * @param amountIn uint256 * @param amountOutMin uint256 * @param privilegeType uint256 * @param _merkleProof bytes32[] */ function deposit( uint256 tokenId, uint256 bondId, uint256 amountIn, uint256 amountOutMin, uint256 privilegeType, bytes32[] calldata _merkleProof ) external { require(amountIn > 0, "LTE"); BondParams memory _bondParams = bondsParams[bondId]; uint256 cvgToSold; uint256 _tokenId; uint256 depositedUsdValue; uint256 _totalCvgDue = totalCvgDuePerBond[bondId]; { bool isPrivilege; uint256 _iboStartTimestamp = iboStartTimestamp; /// @dev peprivilege if (block.timestamp < _iboStartTimestamp + 45 * 1 minutes) { require(merkleVerifyWl(_merkleProof, privilegeType), "INVALID_PROOF"); isPrivilege = true; } /// @dev Bond expired after 6h require(block.timestamp <= _iboStartTimestamp + IBO_DURATION, "BOND_INACTIVE"); if (tokenId == 0) { _tokenId = nextIdToken++; } else { require(ownerOf(tokenId) == msg.sender, "TOKEN_NOT_OWNED"); _tokenId = tokenId; } /// @dev Compute the amount deposited in dollar depositedUsdValue = amountIn * cvgOracle.getAndVerifyOracle(address(_bondParams.token)) * 10 ** (18 - IERC20Metadata(_bondParams.token).decimals()); /// @dev Compute the number of CVG to vest cvgToSold = depositedUsdValue / _computeCvgBondUsdPrice(CVG_PRICE_NO_ROI, _bondParams, _iboStartTimestamp, _totalCvgDue); if (isPrivilege) { uint256 newValueSold = soldDuringPrivilege[msg.sender] + cvgToSold; if (privilegeType == 0) { require(newValueSold <= MAX_CVG_PEPE_PRIVILEGE, "MAX_CVG_PEPE_PRIVILEGE"); } else { require(newValueSold <= MAX_CVG_WL_PRIVILEGE, "MAX_CVG_WL_PRIVILEGE"); } soldDuringPrivilege[msg.sender] = newValueSold; } } /// @dev Verify if ROI has not decreased require(cvgToSold >= amountOutMin, "OUT_MIN_NOT_REACHED"); require( cvgToSold <= (_bondParams.percentageMaxCvgToMint * _bondParams.maxCvgToMint) / 10 ** 3, "MAX_CVG_PER_BOND" ); { require(cvgToSold + _totalCvgDue <= _bondParams.maxCvgToMint, "MAX_CVG_ALREADY_MINTED"); totalCvgDuePerBond[bondId] = _totalCvgDue + cvgToSold; totalCvgPerToken[_tokenId] += cvgToSold; } /// @dev deposit asset in the bondContract IERC20Metadata(_bondParams.token).transferFrom(msg.sender, treasuryBonds, amountIn); if (tokenId == 0) { _mint(msg.sender, _tokenId); } emit BondDeposit(_tokenId, amountIn, cvgToSold, depositedUsdValue / 10 ** 18, _bondParams.token); } /** * @notice Compute the ROI thanks to the BondCalculator * @return uint256 the ROI discount on the token price */ function _depositRoi(uint256 bondId) internal view returns (uint256) { BondParams memory _bondParams = bondsParams[bondId]; return bondCalculator.computeRoi( block.timestamp - iboStartTimestamp, IBO_DURATION, _bondParams.composedFunction, _bondParams.maxCvgToMint, totalCvgDuePerBond[bondId], _bondParams.gamma, _bondParams.scale, _bondParams.minRoi, _bondParams.maxRoi ); } function _computeCvgBondUsdPrice( uint256 realCvgPrice, BondParams memory _bondParams, uint256 startTimestamp, uint256 alreadySold ) internal view returns (uint256) { return (realCvgPrice * (1_000_000 - bondCalculator.computeRoi( block.timestamp - startTimestamp, IBO_DURATION, _bondParams.composedFunction, _bondParams.maxCvgToMint, alreadySold, _bondParams.gamma, _bondParams.scale, _bondParams.minRoi, _bondParams.maxRoi ))) / 10 ** 6; } function getTotalCvgDue() external view returns (uint256) { return totalCvgDuePerBond[1] + totalCvgDuePerBond[2] + totalCvgDuePerBond[3]; } function getBondView(uint256 bondId) external view returns (BondView memory bondView) { BondParams memory _bondParams = bondsParams[bondId]; IERC20Metadata token = _bondParams.token; uint256 alreadySold = totalCvgDuePerBond[bondId]; bool isValid = true; uint256 assetUsdPrice; uint256 assetPriceUsdAggregator; { ( uint256 _assetUsdPrice, uint256 _assetPriceUsdAggregator, bool verify1, bool verify2, bool verify3, bool verify4, bool areStableVerified, bool areLimitsVerified ) = cvgOracle.getDataForVerification(address(_bondParams.token)); assetUsdPrice = _assetUsdPrice; assetPriceUsdAggregator = _assetPriceUsdAggregator; isValid = verify1 && verify2 && verify3 && verify4 && areStableVerified && areLimitsVerified; } uint256 bondPriceUsd = _computeCvgBondUsdPrice(CVG_PRICE_NO_ROI, _bondParams, iboStartTimestamp, alreadySold); bondView = BondView({ bondAddress: address(this), bondRoi: uint88(_depositRoi(bondId)), maxCvgToMint: _bondParams.maxCvgToMint, totalCvgMinted: alreadySold, token: ERC20View({decimals: token.decimals(), token: token.symbol(), tokenAddress: address(token)}), assetPriceUsdCvgOracle: assetUsdPrice, assetPriceUsdAggregator: assetPriceUsdAggregator, bondPriceUsd: bondPriceUsd, bondPriceAsset: (bondPriceUsd * 10 ** 18) / assetUsdPrice, percentageMaxCvgToMint: _bondParams.percentageMaxCvgToMint, isValid: isValid }); } /// @dev Check if a given address is on the White list S function merkleVerifyWl(bytes32[] calldata _merkleProofWl, uint256 _privilegeType) internal view returns (bool) { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); if (_privilegeType == 0) { return MerkleProof.verify(_merkleProofWl, merkleRootPepe, leaf); } else { return MerkleProof.verify(_merkleProofWl, merkleRootWl, leaf); } } function getTokenIdsForWallet(address _wallet) external view returns (uint256[] memory) { uint256 range = balanceOf(_wallet); uint256[] memory tokenIds = new uint256[](range); for (uint256 i = 0; i < range; i++) { tokenIds[i] = tokenOfOwnerByIndex(_wallet, i); } return tokenIds; } function setBaseURI(string memory baseURI_) external onlyOwner { baseURI = baseURI_; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); return string(abi.encodePacked(baseURI)); } }
{ "optimizer": { "enabled": true, "runs": 250 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_treasuryBonds","type":"address"},{"internalType":"contract IBondCalculator","name":"_bondCalculator","type":"address"},{"internalType":"contract ICvgOracle","name":"_cvgOracle","type":"address"},{"internalType":"bytes32","name":"_merklePepe","type":"bytes32"},{"internalType":"bytes32","name":"_merkleWl","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountDeposited","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cvgAdded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountDepositedUsd","type":"uint256"},{"indexed":false,"internalType":"contract IERC20Metadata","name":"token","type":"address"}],"name":"BondDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"CVG_PRICE_NO_ROI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IBO_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CVG_PEPE_PRIVILEGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CVG_WL_PRIVILEGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bondCalculator","outputs":[{"internalType":"contract IBondCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bondsParams","outputs":[{"internalType":"uint8","name":"composedFunction","type":"uint8"},{"internalType":"contract IERC20Metadata","name":"token","type":"address"},{"internalType":"uint24","name":"gamma","type":"uint24"},{"internalType":"uint16","name":"scale","type":"uint16"},{"internalType":"uint24","name":"minRoi","type":"uint24"},{"internalType":"uint24","name":"maxRoi","type":"uint24"},{"internalType":"uint256","name":"percentageMaxCvgToMint","type":"uint256"},{"internalType":"uint256","name":"maxCvgToMint","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"composedFunction","type":"uint8"},{"internalType":"contract IERC20Metadata","name":"token","type":"address"},{"internalType":"uint24","name":"gamma","type":"uint24"},{"internalType":"uint16","name":"scale","type":"uint16"},{"internalType":"uint24","name":"minRoi","type":"uint24"},{"internalType":"uint24","name":"maxRoi","type":"uint24"},{"internalType":"uint256","name":"percentageMaxCvgToMint","type":"uint256"},{"internalType":"uint256","name":"maxCvgToMint","type":"uint256"}],"internalType":"struct Ibo.BondParams","name":"bondParams","type":"tuple"}],"name":"createBond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cvgOracle","outputs":[{"internalType":"contract ICvgOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bondId","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"privilegeType","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bondId","type":"uint256"}],"name":"getBondView","outputs":[{"components":[{"internalType":"address","name":"bondAddress","type":"address"},{"internalType":"uint88","name":"bondRoi","type":"uint88"},{"internalType":"bool","name":"isValid","type":"bool"},{"internalType":"uint256","name":"totalCvgMinted","type":"uint256"},{"internalType":"uint256","name":"maxCvgToMint","type":"uint256"},{"internalType":"uint256","name":"assetPriceUsdCvgOracle","type":"uint256"},{"internalType":"uint256","name":"assetPriceUsdAggregator","type":"uint256"},{"internalType":"uint256","name":"bondPriceAsset","type":"uint256"},{"internalType":"uint256","name":"bondPriceUsd","type":"uint256"},{"internalType":"uint256","name":"percentageMaxCvgToMint","type":"uint256"},{"components":[{"internalType":"string","name":"token","type":"string"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"internalType":"struct Ibo.ERC20View","name":"token","type":"tuple"}],"internalType":"struct Ibo.BondView","name":"bondView","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"getTokenIdsForWallet","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalCvgDue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"iboStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPepe","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootWl","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextIdBond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextIdToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bondId","type":"uint256"},{"internalType":"uint8","name":"newComposedFunction","type":"uint8"}],"name":"setComposedFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"name":"setStartTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"soldDuringPrivilege","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalCvgDuePerBond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalCvgPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryBonds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e06040526001600e556001600f553480156200001b57600080fd5b5060405162003810380380620038108339810160408190526200003e9162000183565b6040518060400160405280600781526020016649424f2043766760c81b8152506040518060400160405280600681526020016563766749424f60d01b81525081600090816200008e91906200028d565b5060016200009d82826200028d565b505050620000ba620000b4620000ed60201b60201c565b620000f1565b620000c585620000f1565b6001600160a01b0394851660805292841660a052921660c05260109190915560115562000359565b3390565b600b80546001600160a01b031916905562000118816200011b602090811b6200189717901c565b50565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146200011857600080fd5b600080600080600060a086880312156200019c57600080fd5b8551620001a9816200016d565b6020870151909550620001bc816200016d565b6040870151909450620001cf816200016d565b6060870151608090970151959894975095949392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200021357607f821691505b6020821081036200023457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028857600081815260208120601f850160051c81016020861015620002635750805b601f850160051c820191505b8181101562000284578281556001016200026f565b5050505b505050565b81516001600160401b03811115620002a957620002a9620001e8565b620002c181620002ba8454620001fe565b846200023a565b602080601f831160018114620002f95760008415620002e05750858301515b600019600386901b1c1916600185901b17855562000284565b600085815260208120601f198616915b828110156200032a5788860151825594840194600190910190840162000309565b5085821015620003495787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c051613464620003ac6000396000818161034b015281816110c501526115cd01526000818161062001528181611e4e015261215a0152600081816104c201526113bc01526134646000f3fe608060405234801561001057600080fd5b506004361061027f5760003560e01c80638bf2d8621161015c578063b88d4fde116100ce578063d690bfb811610087578063d690bfb81461065e578063e232d9951461067e578063e30c39781461068d578063e985e9c51461069e578063ef8319cd146106da578063f2fde38b146106e357600080fd5b8063b88d4fde146105e2578063bd47efdc146105f5578063c44bef7514610608578063c5332b7c1461061b578063c87b56dd14610642578063d1af677c1461065557600080fd5b8063a22cb46511610120578063a22cb46514610562578063a915cc4c14610575578063aa95cd5214610595578063ac7f7f81146105b5578063ac90245c146105c6578063b134268f146105cf57600080fd5b80638bf2d862146105275780638da5cb5b146105385780638e2d4fdb146105495780639320d63e1461055257806395d89b411461055a57600080fd5b806342842e0e116101f55780636352211e116101b95780636352211e146104aa5780636fc57a91146104bd57806370a08231146104e4578063715018a6146104f757806379ba5097146104ff5780637e5112021461050757600080fd5b806342842e0e146103895780634f6ccce71461039c57806355f804b3146103af578063583e82a3146103c2578063610edf93146103e257600080fd5b806310895cfa1161024757806310895cfa1461031857806318160ddd1461032b57806323b872dd146103335780632c36c33e146103465780632f745c591461036d578063354fe7aa1461038057600080fd5b806301ffc9a71461028457806305a2bd33146102ac57806306fdde03146102c3578063081812fc146102d8578063095ea7b314610303575b600080fd5b610297610292366004612716565b6106f6565b60405190151581526020015b60405180910390f35b6102b560105481565b6040519081526020016102a3565b6102cb610721565b6040516102a39190612783565b6102eb6102e6366004612796565b6107b3565b6040516001600160a01b0390911681526020016102a3565b6103166103113660046127c4565b6107da565b005b6103166103263660046127ff565b6108f4565b6008546102b5565b61031661034136600461282f565b610971565b6102eb7f000000000000000000000000000000000000000000000000000000000000000081565b6102b561037b3660046127c4565b6109a2565b6102b561546081565b61031661039736600461282f565b610a38565b6102b56103aa366004612796565b610a53565b6103166103bd36600461291d565b610ae6565b6102b56103d0366004612966565b60126020526000908152604090205481565b6104526103f0366004612796565b60136020526000908152604090208054600182015460029092015460ff8216926001600160a01b036101008404169262ffffff600160a81b820481169361ffff600160c01b84041693600160d01b8404831693600160e81b9004909216919088565b6040805160ff90991689526001600160a01b03909716602089015262ffffff9586169688019690965261ffff909316606087015290831660808601529190911660a084015260c083015260e0820152610100016102a3565b6102eb6104b8366004612796565b610afe565b6102eb7f000000000000000000000000000000000000000000000000000000000000000081565b6102b56104f2366004612966565b610b5e565b610316610be4565b610316610bf8565b61051a610515366004612966565b610c72565b6040516102a39190612983565b6102b569032d26d12e980b60000081565b600a546001600160a01b03166102eb565b6102b5600e5481565b6102b5610d14565b6102cb610da1565b6103166105703660046129d5565b610db0565b6102b5610583366004612796565b60156020526000908152604090205481565b6102b56105a3366004612796565b60146020526000908152604090205481565b6102b56901969368974c05b0000081565b6102b5600f5481565b6103166105dd366004612a03565b610dbb565b6103166105f0366004612a1c565b610df7565b610316610603366004612a9c565b610e2f565b610316610616366004612796565b6114c0565b6102eb7f000000000000000000000000000000000000000000000000000000000000000081565b6102cb610650366004612796565b6114cd565b6102b5600d5481565b61067161066c366004612796565b611500565b6040516102a39190612b80565b6102b5670494654067e1000081565b600b546001600160a01b03166102eb565b6102976106ac366004612c36565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102b560115481565b6103166106f1366004612966565b611826565b60006001600160e01b0319821663780e9d6360e01b148061071b575061071b826118e9565b92915050565b60606000805461073090612c64565b80601f016020809104026020016040519081016040528092919081815260200182805461075c90612c64565b80156107a95780601f1061077e576101008083540402835291602001916107a9565b820191906000526020600020905b81548152906001019060200180831161078c57829003601f168201915b5050505050905090565b60006107be82611939565b506000908152600460205260409020546001600160a01b031690565b60006107e582610afe565b9050806001600160a01b0316836001600160a01b0316036108575760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610873575061087381336106ac565b6108e55760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161084e565b6108ef8383611998565b505050565b6108fc611a06565b60048160ff161061094f5760405162461bcd60e51b815260206004820152601960248201527f494e56414c49445f434f4d504f5345445f46554e4354494f4e00000000000000604482015260640161084e565b600091825260136020526040909120805460ff191660ff909216919091179055565b61097b3382611a60565b6109975760405162461bcd60e51b815260040161084e90612c98565b6108ef838383611adf565b60006109ad83610b5e565b8210610a0f5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161084e565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6108ef83838360405180602001604052806000815250610df7565b6000610a5e60085490565b8210610ac15760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161084e565b60088281548110610ad457610ad4612ce5565b90600052602060002001549050919050565b610aee611a06565b600c610afa8282612d49565b5050565b6000818152600260205260408120546001600160a01b03168061071b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161084e565b60006001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161084e565b506001600160a01b031660009081526003602052604090205490565b610bec611a06565b610bf66000611c50565b565b600b5433906001600160a01b03168114610c665760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840161084e565b610c6f81611c50565b50565b60606000610c7f83610b5e565b905060008167ffffffffffffffff811115610c9c57610c9c612870565b604051908082528060200260200182016040528015610cc5578160200160208202803683370190505b50905060005b82811015610d0c57610cdd85826109a2565b828281518110610cef57610cef612ce5565b602090810291909101015280610d0481612e1f565b915050610ccb565b509392505050565b60146020527f63d87a887046e0430be80fdeb014107d7198c879cbf2cddf39a6df195c86cb38547fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7a54600160009081527fb6c61a840592cc84133e4b25bd509abf4659307c57b160799b38490a5aa48f2c54909291610d9291612e38565b610d9c9190612e38565b905090565b60606001805461073090612c64565b610afa338383611c69565b610dc3611a06565b600f8054829160139160009182610dd983612e1f565b91905055815260200190815260200160002081816108ef9190612e74565b610e013383611a60565b610e1d5760405162461bcd60e51b815260040161084e90612c98565b610e2984848484611d37565b50505050565b60008511610e655760405162461bcd60e51b81526020600482015260036024820152624c544560e81b604482015260640161084e565b600086815260136020908152604080832081516101008082018452825460ff811683529081046001600160a01b031682860152600160a81b810462ffffff90811683860152600160c01b820461ffff166060840152600160d01b820481166080840152600160e81b9091041660a0820152600182015460c082015260029091015460e08201528984526014909252822054600d54919291829182918290610f0e81610a8c612e38565b421015610f6157610f2089898c611d6a565b610f5c5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa82927a7a360991b604482015260640161084e565b600191505b610f6d61546082612e38565b421115610fac5760405162461bcd60e51b815260206004820152600d60248201526c424f4e445f494e41435449564560981b604482015260640161084e565b8d600003610fcf57600e8054906000610fc483612e1f565b919050559450611025565b33610fd98f610afe565b6001600160a01b0316146110215760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15397d393d517d3d5d39151608a1b604482015260640161084e565b8d94505b86602001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108b9190612faa565b611096906012612fc7565b6110a190600a6130c4565b602088015160405163f10f4ed360e01b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063f10f4ed390602401602060405180830381865afa15801561110e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113291906130d3565b61113c908e6130ec565b61114691906130ec565b935061115c670494654067e10000888386611e3e565b6111669085613103565b955081156112545733600090815260126020526040812054611189908890612e38565b90508a6000036111f25769032d26d12e980b6000008111156111ed5760405162461bcd60e51b815260206004820152601660248201527f4d41585f4356475f504550455f50524956494c45474500000000000000000000604482015260640161084e565b611243565b6901969368974c05b000008111156112435760405162461bcd60e51b81526020600482015260146024820152734d41585f4356475f574c5f50524956494c45474560601b604482015260640161084e565b336000908152601260205260409020555b50508884101561129c5760405162461bcd60e51b815260206004820152601360248201527213d55517d3525397d393d517d4915050d21151606a1b604482015260640161084e565b6103e88560e001518660c001516112b391906130ec565b6112bd9190613103565b8411156112ff5760405162461bcd60e51b815260206004820152601060248201526f13505617d0d591d7d4115497d093d39160821b604482015260640161084e565b60e085015161130e8286612e38565b111561135c5760405162461bcd60e51b815260206004820152601660248201527f4d41585f4356475f414c52454144595f4d494e54454400000000000000000000604482015260640161084e565b6113668482612e38565b60008c815260146020908152604080832093909355858252601590529081208054869290611395908490612e38565b909155505060208501516040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018d9052909116906323b872dd906064016020604051808303816000875af1158015611415573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114399190613125565b508b60000361144c5761144c3384611f2e565b827f258a82075e3cc92b5df9d5974671a615c99e2b4790d1b9b86e5d16910a07d20f8b86611482670de0b6b3a764000087613103565b6020808b015160408051958652918501939093528301526001600160a01b0316606082015260800160405180910390a2505050505050505050505050565b6114c8611a06565b600d55565b60606114d882611939565b600c6040516020016114ea9190613142565b6040516020818303038152906040529050919050565b611508612668565b600082815260136020908152604080832081516101008082018452825460ff811683526001600160a01b03918104821683870181815262ffffff600160a81b840481168689015261ffff600160c01b8504166060870152600160d01b840481166080870152600160e81b90930490921660a085015260018086015460c086015260029095015460e085015289885260149096528487205490519451630261618960e01b81529482166004860152919591938291829182918291829182918291829182917f0000000000000000000000000000000000000000000000000000000000000000169063026161899060240161010060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163991906131b8565b975097509750975097509750975097508799508698508580156116595750845b80156116625750835b801561166b5750825b80156116745750815b801561167d5750805b9a505050505050505050600061169f670494654067e1000088600d5488611e3e565b9050604051806101600160405280306001600160a01b031681526020016116c58b6120c7565b6001600160581b0316815260200185151581526020018681526020018860e0015181526020018481526020018381526020018483670de0b6b3a764000061170c91906130ec565b6117169190613103565b81526020018281526020018860c0015181526020016040518060600160405280896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611774573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261179c9190810190613254565b8152602001896001600160a01b03168152602001896001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118129190612faa565b60ff16905290529998505050505050505050565b61182e611a06565b600b80546001600160a01b0383166001600160a01b0319909116811790915561185f600a546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160e01b031982166380ac58cd60e01b148061191a57506001600160e01b03198216635b5e139f60e01b145b8061071b57506301ffc9a760e01b6001600160e01b031983161461071b565b6000818152600260205260409020546001600160a01b0316610c6f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161084e565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119cd82610afe565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610bf65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161084e565b600080611a6c83610afe565b9050806001600160a01b0316846001600160a01b03161480611ab357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611ad75750836001600160a01b0316611acc846107b3565b6001600160a01b0316145b949350505050565b826001600160a01b0316611af282610afe565b6001600160a01b031614611b185760405162461bcd60e51b815260040161084e906132c2565b6001600160a01b038216611b7a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161084e565b611b87838383600161221f565b826001600160a01b0316611b9a82610afe565b6001600160a01b031614611bc05760405162461bcd60e51b815260040161084e906132c2565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b0319169055610c6f81611897565b816001600160a01b0316836001600160a01b031603611cca5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161084e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611d42848484611adf565b611d4e84848484612353565b610e295760405162461bcd60e51b815260040161084e90613307565b6040516bffffffffffffffffffffffff193360601b166020820152600090819060340160405160208183030381529060405280519060200120905082600003611df657611dee858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506010549150849050612451565b915050611e37565b611dee858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506011549150849050612451565b9392505050565b6000620f42406001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663841a2aa7611e7d8642613359565b61546088600001518960e00151888b604001518c606001518d608001518e60a001516040518a63ffffffff1660e01b8152600401611ec39998979695949392919061336c565b602060405180830381865afa158015611ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0491906130d3565b611f1190620f4240613359565b611f1b90876130ec565b611f259190613103565b95945050505050565b6001600160a01b038216611f845760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161084e565b6000818152600260205260409020546001600160a01b031615611fe95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161084e565b611ff760008383600161221f565b6000818152600260205260409020546001600160a01b03161561205c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161084e565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260136020908152604080832081516101008082018452825460ff811683526001600160a01b0391810482169583019590955262ffffff600160a81b860481169483019490945261ffff600160c01b8604166060830152600160d01b850484166080830152600160e81b90940490921660a0830152600181015460c08301526002015460e0820152600d5490917f0000000000000000000000000000000000000000000000000000000000000000169063841a2aa79061218b9042613359565b835160e08086015160008981526014602052604090819020548189015160608a015160808b015160a08c01519451968a901b6001600160e01b03191687526121de9897615460979096959060040161336c565b602060405180830381865afa1580156121fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906130d3565b600181111561228e5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b606482015260840161084e565b816001600160a01b0385166122ea576122e581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61230d565b836001600160a01b0316856001600160a01b03161461230d5761230d8582612467565b6001600160a01b0384166123295761232481612504565b61234c565b846001600160a01b0316846001600160a01b03161461234c5761234c84826125b3565b5050505050565b60006001600160a01b0384163b1561244957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906123979033908990889088906004016133bf565b6020604051808303816000875af19250505080156123d2575060408051601f3d908101601f191682019092526123cf918101906133fb565b60015b61242f573d808015612400576040519150601f19603f3d011682016040523d82523d6000602084013e612405565b606091505b5080516000036124275760405162461bcd60e51b815260040161084e90613307565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ad7565b506001611ad7565b60008261245e85846125f7565b14949350505050565b6000600161247484610b5e565b61247e9190613359565b6000838152600760205260409020549091508082146124d1576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061251690600190613359565b6000838152600960205260408120546008805493945090928490811061253e5761253e612ce5565b90600052602060002001549050806008838154811061255f5761255f612ce5565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061259757612597613418565b6001900381819060005260206000200160009055905550505050565b60006125be83610b5e565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b600081815b8451811015610d0c576126288286838151811061261b5761261b612ce5565b602002602001015161263c565b91508061263481612e1f565b9150506125fc565b6000818310612658576000828152602084905260409020611e37565b5060009182526020526040902090565b60405180610160016040528060006001600160a01b0316815260200160006001600160581b03168152602001600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016126fb60405180606001604052806060815260200160006001600160a01b03168152602001600081525090565b905290565b6001600160e01b031981168114610c6f57600080fd5b60006020828403121561272857600080fd5b8135611e3781612700565b60005b8381101561274e578181015183820152602001612736565b50506000910152565b6000815180845261276f816020860160208601612733565b601f01601f19169290920160200192915050565b602081526000611e376020830184612757565b6000602082840312156127a857600080fd5b5035919050565b6001600160a01b0381168114610c6f57600080fd5b600080604083850312156127d757600080fd5b82356127e2816127af565b946020939093013593505050565b60ff81168114610c6f57600080fd5b6000806040838503121561281257600080fd5b823591506020830135612824816127f0565b809150509250929050565b60008060006060848603121561284457600080fd5b833561284f816127af565b9250602084013561285f816127af565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128af576128af612870565b604052919050565b600067ffffffffffffffff8211156128d1576128d1612870565b50601f01601f191660200190565b60006128f26128ed846128b7565b612886565b905082815283838301111561290657600080fd5b828260208301376000602084830101529392505050565b60006020828403121561292f57600080fd5b813567ffffffffffffffff81111561294657600080fd5b8201601f8101841361295757600080fd5b611ad7848235602084016128df565b60006020828403121561297857600080fd5b8135611e37816127af565b6020808252825182820181905260009190848201906040850190845b818110156129bb5783518352928401929184019160010161299f565b50909695505050505050565b8015158114610c6f57600080fd5b600080604083850312156129e857600080fd5b82356129f3816127af565b91506020830135612824816129c7565b60006101008284031215612a1657600080fd5b50919050565b60008060008060808587031215612a3257600080fd5b8435612a3d816127af565b93506020850135612a4d816127af565b925060408501359150606085013567ffffffffffffffff811115612a7057600080fd5b8501601f81018713612a8157600080fd5b612a90878235602084016128df565b91505092959194509250565b600080600080600080600060c0888a031215612ab757600080fd5b873596506020880135955060408801359450606088013593506080880135925060a088013567ffffffffffffffff80821115612af257600080fd5b818a0191508a601f830112612b0657600080fd5b813581811115612b1557600080fd5b8b60208260051b8501011115612b2a57600080fd5b60208301945080935050505092959891949750929550565b6000815160608452612b576060850182612757565b90506001600160a01b036020840151166020850152604083015160408501528091505092915050565b60208152612b9a6020820183516001600160a01b03169052565b60006020830151612bb660408401826001600160581b03169052565b50604083015180151560608401525060608301516080830152608083015160a083015260a083015160c083015260c083015160e083015260e0830151610100818185015280850151915050610120818185015280850151915050610140818185015280850151915050610160808185015250611ad7610180840182612b42565b60008060408385031215612c4957600080fd5b8235612c54816127af565b91506020830135612824816127af565b600181811c90821680612c7857607f821691505b602082108103612a1657634e487b7160e01b600052602260045260246000fd5b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f8211156108ef57600081815260208120601f850160051c81016020861015612d225750805b601f850160051c820191505b81811015612d4157828155600101612d2e565b505050505050565b815167ffffffffffffffff811115612d6357612d63612870565b612d7781612d718454612c64565b84612cfb565b602080601f831160018114612dac5760008415612d945750858301515b600019600386901b1c1916600185901b178555612d41565b600085815260208120601f198616915b82811015612ddb57888601518255948401946001909101908401612dbc565b5085821015612df95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600060018201612e3157612e31612e09565b5060010190565b8082018082111561071b5761071b612e09565b6000813562ffffff8116811461071b57600080fd5b6000813561ffff8116811461071b57600080fd5b8135612e7f816127f0565b60ff8116905081548160ff1982161783556020840135612e9e816127af565b74ffffffffffffffffffffffffffffffffffffffff008160081b16836001600160581b0360a81b841617178455505050612eff612edd60408401612e4b565b82805462ffffff60a81b191660a89290921b62ffffff60a81b16919091179055565b612f2e612f0e60608401612e60565b82805461ffff60c01b191660c09290921b61ffff60c01b16919091179055565b612f5f612f3d60808401612e4b565b82805462ffffff60d01b191660d09290921b62ffffff60d01b16919091179055565b612f92612f6e60a08401612e4b565b8280546001600160e81b031660e89290921b6001600160e81b031916919091179055565b60c0820135600182015560e082013560028201555050565b600060208284031215612fbc57600080fd5b8151611e37816127f0565b60ff828116828216039081111561071b5761071b612e09565b600181815b8085111561301b57816000190482111561300157613001612e09565b8085161561300e57918102915b93841c9390800290612fe5565b509250929050565b6000826130325750600161071b565b8161303f5750600061071b565b8160018114613055576002811461305f5761307b565b600191505061071b565b60ff84111561307057613070612e09565b50506001821b61071b565b5060208310610133831016604e8410600b841016171561309e575081810a61071b565b6130a88383612fe0565b80600019048211156130bc576130bc612e09565b029392505050565b6000611e3760ff841683613023565b6000602082840312156130e557600080fd5b5051919050565b808202811582820484141761071b5761071b612e09565b60008261312057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561313757600080fd5b8151611e37816129c7565b600080835461315081612c64565b60018281168015613168576001811461317d576131ac565b60ff19841687528215158302870194506131ac565b8760005260208060002060005b858110156131a35781548a82015290840190820161318a565b50505082870194505b50929695505050505050565b600080600080600080600080610100898b0312156131d557600080fd5b885197506020890151965060408901516131ee816129c7565b60608a01519096506131ff816129c7565b60808a0151909550613210816129c7565b60a08a0151909450613221816129c7565b60c08a0151909350613232816129c7565b60e08a0151909250613243816129c7565b809150509295985092959890939650565b60006020828403121561326657600080fd5b815167ffffffffffffffff81111561327d57600080fd5b8201601f8101841361328e57600080fd5b805161329c6128ed826128b7565b8181528560208385010111156132b157600080fd5b611f25826020830160208601612733565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8181038181111561071b5761071b612e09565b988952602089019790975260ff9590951660408801526060870193909352608086019190915262ffffff90811660a086015261ffff90911660c085015290811660e0840152166101008201526101200190565b60006001600160a01b038087168352808616602084015250836040830152608060608301526133f16080830184612757565b9695505050505050565b60006020828403121561340d57600080fd5b8151611e3781612700565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d3e15321e2cbaeeec07d874caacfbfcc7bdf63ddaa66c5ca615e8770d3776e1a64736f6c63430008110033000000000000000000000000d2c46b4c28f4b7976d9f87687863c46bb2f71dbb00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d57c4c7aeff8cc91f66e44b62fda601901ab6bcc422bba6fe1bc960f0a59d8c57a3598d52d1116f965b71169aadea9cb5b680de950b4fd0fe0c0ba11e42bf16d6f
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061027f5760003560e01c80638bf2d8621161015c578063b88d4fde116100ce578063d690bfb811610087578063d690bfb81461065e578063e232d9951461067e578063e30c39781461068d578063e985e9c51461069e578063ef8319cd146106da578063f2fde38b146106e357600080fd5b8063b88d4fde146105e2578063bd47efdc146105f5578063c44bef7514610608578063c5332b7c1461061b578063c87b56dd14610642578063d1af677c1461065557600080fd5b8063a22cb46511610120578063a22cb46514610562578063a915cc4c14610575578063aa95cd5214610595578063ac7f7f81146105b5578063ac90245c146105c6578063b134268f146105cf57600080fd5b80638bf2d862146105275780638da5cb5b146105385780638e2d4fdb146105495780639320d63e1461055257806395d89b411461055a57600080fd5b806342842e0e116101f55780636352211e116101b95780636352211e146104aa5780636fc57a91146104bd57806370a08231146104e4578063715018a6146104f757806379ba5097146104ff5780637e5112021461050757600080fd5b806342842e0e146103895780634f6ccce71461039c57806355f804b3146103af578063583e82a3146103c2578063610edf93146103e257600080fd5b806310895cfa1161024757806310895cfa1461031857806318160ddd1461032b57806323b872dd146103335780632c36c33e146103465780632f745c591461036d578063354fe7aa1461038057600080fd5b806301ffc9a71461028457806305a2bd33146102ac57806306fdde03146102c3578063081812fc146102d8578063095ea7b314610303575b600080fd5b610297610292366004612716565b6106f6565b60405190151581526020015b60405180910390f35b6102b560105481565b6040519081526020016102a3565b6102cb610721565b6040516102a39190612783565b6102eb6102e6366004612796565b6107b3565b6040516001600160a01b0390911681526020016102a3565b6103166103113660046127c4565b6107da565b005b6103166103263660046127ff565b6108f4565b6008546102b5565b61031661034136600461282f565b610971565b6102eb7f00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d581565b6102b561037b3660046127c4565b6109a2565b6102b561546081565b61031661039736600461282f565b610a38565b6102b56103aa366004612796565b610a53565b6103166103bd36600461291d565b610ae6565b6102b56103d0366004612966565b60126020526000908152604090205481565b6104526103f0366004612796565b60136020526000908152604090208054600182015460029092015460ff8216926001600160a01b036101008404169262ffffff600160a81b820481169361ffff600160c01b84041693600160d01b8404831693600160e81b9004909216919088565b6040805160ff90991689526001600160a01b03909716602089015262ffffff9586169688019690965261ffff909316606087015290831660808601529190911660a084015260c083015260e0820152610100016102a3565b6102eb6104b8366004612796565b610afe565b6102eb7f000000000000000000000000d2c46b4c28f4b7976d9f87687863c46bb2f71dbb81565b6102b56104f2366004612966565b610b5e565b610316610be4565b610316610bf8565b61051a610515366004612966565b610c72565b6040516102a39190612983565b6102b569032d26d12e980b60000081565b600a546001600160a01b03166102eb565b6102b5600e5481565b6102b5610d14565b6102cb610da1565b6103166105703660046129d5565b610db0565b6102b5610583366004612796565b60156020526000908152604090205481565b6102b56105a3366004612796565b60146020526000908152604090205481565b6102b56901969368974c05b0000081565b6102b5600f5481565b6103166105dd366004612a03565b610dbb565b6103166105f0366004612a1c565b610df7565b610316610603366004612a9c565b610e2f565b610316610616366004612796565b6114c0565b6102eb7f00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb81565b6102cb610650366004612796565b6114cd565b6102b5600d5481565b61067161066c366004612796565b611500565b6040516102a39190612b80565b6102b5670494654067e1000081565b600b546001600160a01b03166102eb565b6102976106ac366004612c36565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102b560115481565b6103166106f1366004612966565b611826565b60006001600160e01b0319821663780e9d6360e01b148061071b575061071b826118e9565b92915050565b60606000805461073090612c64565b80601f016020809104026020016040519081016040528092919081815260200182805461075c90612c64565b80156107a95780601f1061077e576101008083540402835291602001916107a9565b820191906000526020600020905b81548152906001019060200180831161078c57829003601f168201915b5050505050905090565b60006107be82611939565b506000908152600460205260409020546001600160a01b031690565b60006107e582610afe565b9050806001600160a01b0316836001600160a01b0316036108575760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610873575061087381336106ac565b6108e55760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161084e565b6108ef8383611998565b505050565b6108fc611a06565b60048160ff161061094f5760405162461bcd60e51b815260206004820152601960248201527f494e56414c49445f434f4d504f5345445f46554e4354494f4e00000000000000604482015260640161084e565b600091825260136020526040909120805460ff191660ff909216919091179055565b61097b3382611a60565b6109975760405162461bcd60e51b815260040161084e90612c98565b6108ef838383611adf565b60006109ad83610b5e565b8210610a0f5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161084e565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6108ef83838360405180602001604052806000815250610df7565b6000610a5e60085490565b8210610ac15760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161084e565b60088281548110610ad457610ad4612ce5565b90600052602060002001549050919050565b610aee611a06565b600c610afa8282612d49565b5050565b6000818152600260205260408120546001600160a01b03168061071b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161084e565b60006001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161084e565b506001600160a01b031660009081526003602052604090205490565b610bec611a06565b610bf66000611c50565b565b600b5433906001600160a01b03168114610c665760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840161084e565b610c6f81611c50565b50565b60606000610c7f83610b5e565b905060008167ffffffffffffffff811115610c9c57610c9c612870565b604051908082528060200260200182016040528015610cc5578160200160208202803683370190505b50905060005b82811015610d0c57610cdd85826109a2565b828281518110610cef57610cef612ce5565b602090810291909101015280610d0481612e1f565b915050610ccb565b509392505050565b60146020527f63d87a887046e0430be80fdeb014107d7198c879cbf2cddf39a6df195c86cb38547fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7a54600160009081527fb6c61a840592cc84133e4b25bd509abf4659307c57b160799b38490a5aa48f2c54909291610d9291612e38565b610d9c9190612e38565b905090565b60606001805461073090612c64565b610afa338383611c69565b610dc3611a06565b600f8054829160139160009182610dd983612e1f565b91905055815260200190815260200160002081816108ef9190612e74565b610e013383611a60565b610e1d5760405162461bcd60e51b815260040161084e90612c98565b610e2984848484611d37565b50505050565b60008511610e655760405162461bcd60e51b81526020600482015260036024820152624c544560e81b604482015260640161084e565b600086815260136020908152604080832081516101008082018452825460ff811683529081046001600160a01b031682860152600160a81b810462ffffff90811683860152600160c01b820461ffff166060840152600160d01b820481166080840152600160e81b9091041660a0820152600182015460c082015260029091015460e08201528984526014909252822054600d54919291829182918290610f0e81610a8c612e38565b421015610f6157610f2089898c611d6a565b610f5c5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa82927a7a360991b604482015260640161084e565b600191505b610f6d61546082612e38565b421115610fac5760405162461bcd60e51b815260206004820152600d60248201526c424f4e445f494e41435449564560981b604482015260640161084e565b8d600003610fcf57600e8054906000610fc483612e1f565b919050559450611025565b33610fd98f610afe565b6001600160a01b0316146110215760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15397d393d517d3d5d39151608a1b604482015260640161084e565b8d94505b86602001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108b9190612faa565b611096906012612fc7565b6110a190600a6130c4565b602088015160405163f10f4ed360e01b81526001600160a01b0391821660048201527f00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d59091169063f10f4ed390602401602060405180830381865afa15801561110e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113291906130d3565b61113c908e6130ec565b61114691906130ec565b935061115c670494654067e10000888386611e3e565b6111669085613103565b955081156112545733600090815260126020526040812054611189908890612e38565b90508a6000036111f25769032d26d12e980b6000008111156111ed5760405162461bcd60e51b815260206004820152601660248201527f4d41585f4356475f504550455f50524956494c45474500000000000000000000604482015260640161084e565b611243565b6901969368974c05b000008111156112435760405162461bcd60e51b81526020600482015260146024820152734d41585f4356475f574c5f50524956494c45474560601b604482015260640161084e565b336000908152601260205260409020555b50508884101561129c5760405162461bcd60e51b815260206004820152601360248201527213d55517d3525397d393d517d4915050d21151606a1b604482015260640161084e565b6103e88560e001518660c001516112b391906130ec565b6112bd9190613103565b8411156112ff5760405162461bcd60e51b815260206004820152601060248201526f13505617d0d591d7d4115497d093d39160821b604482015260640161084e565b60e085015161130e8286612e38565b111561135c5760405162461bcd60e51b815260206004820152601660248201527f4d41585f4356475f414c52454144595f4d494e54454400000000000000000000604482015260640161084e565b6113668482612e38565b60008c815260146020908152604080832093909355858252601590529081208054869290611395908490612e38565b909155505060208501516040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000d2c46b4c28f4b7976d9f87687863c46bb2f71dbb81166024830152604482018d9052909116906323b872dd906064016020604051808303816000875af1158015611415573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114399190613125565b508b60000361144c5761144c3384611f2e565b827f258a82075e3cc92b5df9d5974671a615c99e2b4790d1b9b86e5d16910a07d20f8b86611482670de0b6b3a764000087613103565b6020808b015160408051958652918501939093528301526001600160a01b0316606082015260800160405180910390a2505050505050505050505050565b6114c8611a06565b600d55565b60606114d882611939565b600c6040516020016114ea9190613142565b6040516020818303038152906040529050919050565b611508612668565b600082815260136020908152604080832081516101008082018452825460ff811683526001600160a01b03918104821683870181815262ffffff600160a81b840481168689015261ffff600160c01b8504166060870152600160d01b840481166080870152600160e81b90930490921660a085015260018086015460c086015260029095015460e085015289885260149096528487205490519451630261618960e01b81529482166004860152919591938291829182918291829182918291829182917f00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d5169063026161899060240161010060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163991906131b8565b975097509750975097509750975097508799508698508580156116595750845b80156116625750835b801561166b5750825b80156116745750815b801561167d5750805b9a505050505050505050600061169f670494654067e1000088600d5488611e3e565b9050604051806101600160405280306001600160a01b031681526020016116c58b6120c7565b6001600160581b0316815260200185151581526020018681526020018860e0015181526020018481526020018381526020018483670de0b6b3a764000061170c91906130ec565b6117169190613103565b81526020018281526020018860c0015181526020016040518060600160405280896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611774573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261179c9190810190613254565b8152602001896001600160a01b03168152602001896001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118129190612faa565b60ff16905290529998505050505050505050565b61182e611a06565b600b80546001600160a01b0383166001600160a01b0319909116811790915561185f600a546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160e01b031982166380ac58cd60e01b148061191a57506001600160e01b03198216635b5e139f60e01b145b8061071b57506301ffc9a760e01b6001600160e01b031983161461071b565b6000818152600260205260409020546001600160a01b0316610c6f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161084e565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119cd82610afe565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610bf65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161084e565b600080611a6c83610afe565b9050806001600160a01b0316846001600160a01b03161480611ab357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611ad75750836001600160a01b0316611acc846107b3565b6001600160a01b0316145b949350505050565b826001600160a01b0316611af282610afe565b6001600160a01b031614611b185760405162461bcd60e51b815260040161084e906132c2565b6001600160a01b038216611b7a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161084e565b611b87838383600161221f565b826001600160a01b0316611b9a82610afe565b6001600160a01b031614611bc05760405162461bcd60e51b815260040161084e906132c2565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b0319169055610c6f81611897565b816001600160a01b0316836001600160a01b031603611cca5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161084e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611d42848484611adf565b611d4e84848484612353565b610e295760405162461bcd60e51b815260040161084e90613307565b6040516bffffffffffffffffffffffff193360601b166020820152600090819060340160405160208183030381529060405280519060200120905082600003611df657611dee858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506010549150849050612451565b915050611e37565b611dee858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506011549150849050612451565b9392505050565b6000620f42406001600160a01b037f00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb1663841a2aa7611e7d8642613359565b61546088600001518960e00151888b604001518c606001518d608001518e60a001516040518a63ffffffff1660e01b8152600401611ec39998979695949392919061336c565b602060405180830381865afa158015611ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0491906130d3565b611f1190620f4240613359565b611f1b90876130ec565b611f259190613103565b95945050505050565b6001600160a01b038216611f845760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161084e565b6000818152600260205260409020546001600160a01b031615611fe95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161084e565b611ff760008383600161221f565b6000818152600260205260409020546001600160a01b03161561205c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161084e565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260136020908152604080832081516101008082018452825460ff811683526001600160a01b0391810482169583019590955262ffffff600160a81b860481169483019490945261ffff600160c01b8604166060830152600160d01b850484166080830152600160e81b90940490921660a0830152600181015460c08301526002015460e0820152600d5490917f00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb169063841a2aa79061218b9042613359565b835160e08086015160008981526014602052604090819020548189015160608a015160808b015160a08c01519451968a901b6001600160e01b03191687526121de9897615460979096959060040161336c565b602060405180830381865afa1580156121fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906130d3565b600181111561228e5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b606482015260840161084e565b816001600160a01b0385166122ea576122e581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61230d565b836001600160a01b0316856001600160a01b03161461230d5761230d8582612467565b6001600160a01b0384166123295761232481612504565b61234c565b846001600160a01b0316846001600160a01b03161461234c5761234c84826125b3565b5050505050565b60006001600160a01b0384163b1561244957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906123979033908990889088906004016133bf565b6020604051808303816000875af19250505080156123d2575060408051601f3d908101601f191682019092526123cf918101906133fb565b60015b61242f573d808015612400576040519150601f19603f3d011682016040523d82523d6000602084013e612405565b606091505b5080516000036124275760405162461bcd60e51b815260040161084e90613307565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ad7565b506001611ad7565b60008261245e85846125f7565b14949350505050565b6000600161247484610b5e565b61247e9190613359565b6000838152600760205260409020549091508082146124d1576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061251690600190613359565b6000838152600960205260408120546008805493945090928490811061253e5761253e612ce5565b90600052602060002001549050806008838154811061255f5761255f612ce5565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061259757612597613418565b6001900381819060005260206000200160009055905550505050565b60006125be83610b5e565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b600081815b8451811015610d0c576126288286838151811061261b5761261b612ce5565b602002602001015161263c565b91508061263481612e1f565b9150506125fc565b6000818310612658576000828152602084905260409020611e37565b5060009182526020526040902090565b60405180610160016040528060006001600160a01b0316815260200160006001600160581b03168152602001600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016126fb60405180606001604052806060815260200160006001600160a01b03168152602001600081525090565b905290565b6001600160e01b031981168114610c6f57600080fd5b60006020828403121561272857600080fd5b8135611e3781612700565b60005b8381101561274e578181015183820152602001612736565b50506000910152565b6000815180845261276f816020860160208601612733565b601f01601f19169290920160200192915050565b602081526000611e376020830184612757565b6000602082840312156127a857600080fd5b5035919050565b6001600160a01b0381168114610c6f57600080fd5b600080604083850312156127d757600080fd5b82356127e2816127af565b946020939093013593505050565b60ff81168114610c6f57600080fd5b6000806040838503121561281257600080fd5b823591506020830135612824816127f0565b809150509250929050565b60008060006060848603121561284457600080fd5b833561284f816127af565b9250602084013561285f816127af565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128af576128af612870565b604052919050565b600067ffffffffffffffff8211156128d1576128d1612870565b50601f01601f191660200190565b60006128f26128ed846128b7565b612886565b905082815283838301111561290657600080fd5b828260208301376000602084830101529392505050565b60006020828403121561292f57600080fd5b813567ffffffffffffffff81111561294657600080fd5b8201601f8101841361295757600080fd5b611ad7848235602084016128df565b60006020828403121561297857600080fd5b8135611e37816127af565b6020808252825182820181905260009190848201906040850190845b818110156129bb5783518352928401929184019160010161299f565b50909695505050505050565b8015158114610c6f57600080fd5b600080604083850312156129e857600080fd5b82356129f3816127af565b91506020830135612824816129c7565b60006101008284031215612a1657600080fd5b50919050565b60008060008060808587031215612a3257600080fd5b8435612a3d816127af565b93506020850135612a4d816127af565b925060408501359150606085013567ffffffffffffffff811115612a7057600080fd5b8501601f81018713612a8157600080fd5b612a90878235602084016128df565b91505092959194509250565b600080600080600080600060c0888a031215612ab757600080fd5b873596506020880135955060408801359450606088013593506080880135925060a088013567ffffffffffffffff80821115612af257600080fd5b818a0191508a601f830112612b0657600080fd5b813581811115612b1557600080fd5b8b60208260051b8501011115612b2a57600080fd5b60208301945080935050505092959891949750929550565b6000815160608452612b576060850182612757565b90506001600160a01b036020840151166020850152604083015160408501528091505092915050565b60208152612b9a6020820183516001600160a01b03169052565b60006020830151612bb660408401826001600160581b03169052565b50604083015180151560608401525060608301516080830152608083015160a083015260a083015160c083015260c083015160e083015260e0830151610100818185015280850151915050610120818185015280850151915050610140818185015280850151915050610160808185015250611ad7610180840182612b42565b60008060408385031215612c4957600080fd5b8235612c54816127af565b91506020830135612824816127af565b600181811c90821680612c7857607f821691505b602082108103612a1657634e487b7160e01b600052602260045260246000fd5b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f8211156108ef57600081815260208120601f850160051c81016020861015612d225750805b601f850160051c820191505b81811015612d4157828155600101612d2e565b505050505050565b815167ffffffffffffffff811115612d6357612d63612870565b612d7781612d718454612c64565b84612cfb565b602080601f831160018114612dac5760008415612d945750858301515b600019600386901b1c1916600185901b178555612d41565b600085815260208120601f198616915b82811015612ddb57888601518255948401946001909101908401612dbc565b5085821015612df95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600060018201612e3157612e31612e09565b5060010190565b8082018082111561071b5761071b612e09565b6000813562ffffff8116811461071b57600080fd5b6000813561ffff8116811461071b57600080fd5b8135612e7f816127f0565b60ff8116905081548160ff1982161783556020840135612e9e816127af565b74ffffffffffffffffffffffffffffffffffffffff008160081b16836001600160581b0360a81b841617178455505050612eff612edd60408401612e4b565b82805462ffffff60a81b191660a89290921b62ffffff60a81b16919091179055565b612f2e612f0e60608401612e60565b82805461ffff60c01b191660c09290921b61ffff60c01b16919091179055565b612f5f612f3d60808401612e4b565b82805462ffffff60d01b191660d09290921b62ffffff60d01b16919091179055565b612f92612f6e60a08401612e4b565b8280546001600160e81b031660e89290921b6001600160e81b031916919091179055565b60c0820135600182015560e082013560028201555050565b600060208284031215612fbc57600080fd5b8151611e37816127f0565b60ff828116828216039081111561071b5761071b612e09565b600181815b8085111561301b57816000190482111561300157613001612e09565b8085161561300e57918102915b93841c9390800290612fe5565b509250929050565b6000826130325750600161071b565b8161303f5750600061071b565b8160018114613055576002811461305f5761307b565b600191505061071b565b60ff84111561307057613070612e09565b50506001821b61071b565b5060208310610133831016604e8410600b841016171561309e575081810a61071b565b6130a88383612fe0565b80600019048211156130bc576130bc612e09565b029392505050565b6000611e3760ff841683613023565b6000602082840312156130e557600080fd5b5051919050565b808202811582820484141761071b5761071b612e09565b60008261312057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561313757600080fd5b8151611e37816129c7565b600080835461315081612c64565b60018281168015613168576001811461317d576131ac565b60ff19841687528215158302870194506131ac565b8760005260208060002060005b858110156131a35781548a82015290840190820161318a565b50505082870194505b50929695505050505050565b600080600080600080600080610100898b0312156131d557600080fd5b885197506020890151965060408901516131ee816129c7565b60608a01519096506131ff816129c7565b60808a0151909550613210816129c7565b60a08a0151909450613221816129c7565b60c08a0151909350613232816129c7565b60e08a0151909250613243816129c7565b809150509295985092959890939650565b60006020828403121561326657600080fd5b815167ffffffffffffffff81111561327d57600080fd5b8201601f8101841361328e57600080fd5b805161329c6128ed826128b7565b8181528560208385010111156132b157600080fd5b611f25826020830160208601612733565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8181038181111561071b5761071b612e09565b988952602089019790975260ff9590951660408801526060870193909352608086019190915262ffffff90811660a086015261ffff90911660c085015290811660e0840152166101008201526101200190565b60006001600160a01b038087168352808616602084015250836040830152608060608301526133f16080830184612757565b9695505050505050565b60006020828403121561340d57600080fd5b8151611e3781612700565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d3e15321e2cbaeeec07d874caacfbfcc7bdf63ddaa66c5ca615e8770d3776e1a64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d2c46b4c28f4b7976d9f87687863c46bb2f71dbb00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d57c4c7aeff8cc91f66e44b62fda601901ab6bcc422bba6fe1bc960f0a59d8c57a3598d52d1116f965b71169aadea9cb5b680de950b4fd0fe0c0ba11e42bf16d6f
-----Decoded View---------------
Arg [0] : _treasuryBonds (address): 0xd2c46b4c28f4B7976d9f87687863c46Bb2f71Dbb
Arg [1] : _bondCalculator (address): 0x17E98c8daf87f6bfD5E9550803Aa90f2D6d1e4bb
Arg [2] : _cvgOracle (address): 0x19B4026B042Cc1424F7F4A71A0671C60368D42d5
Arg [3] : _merklePepe (bytes32): 0x7c4c7aeff8cc91f66e44b62fda601901ab6bcc422bba6fe1bc960f0a59d8c57a
Arg [4] : _merkleWl (bytes32): 0x3598d52d1116f965b71169aadea9cb5b680de950b4fd0fe0c0ba11e42bf16d6f
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000d2c46b4c28f4b7976d9f87687863c46bb2f71dbb
Arg [1] : 00000000000000000000000017e98c8daf87f6bfd5e9550803aa90f2d6d1e4bb
Arg [2] : 00000000000000000000000019b4026b042cc1424f7f4a71a0671c60368d42d5
Arg [3] : 7c4c7aeff8cc91f66e44b62fda601901ab6bcc422bba6fe1bc960f0a59d8c57a
Arg [4] : 3598d52d1116f965b71169aadea9cb5b680de950b4fd0fe0c0ba11e42bf16d6f
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.