ERC-721
Overview
Max Total Supply
0 JUICEBOX
Holders
3
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 JUICEBOXLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
JBProjects
Compiler Version
v0.8.6+commit.11564f7e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/draft-ERC721Votes.sol'; import './abstract/JBOperatable.sol'; import './interfaces/IJBProjects.sol'; import './libraries/JBOperations.sol'; /** @notice Stores project ownership and metadata. @dev Projects are represented as ERC-721's. @dev Adheres to: IJBProjects: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules. @dev Inherits from: JBOperatable: Includes convenience functionality for checking a message sender's permissions before executing certain transactions. ERC721Votes: A checkpointable standard definition for non-fungible tokens (NFTs). Ownable: Includes convenience functionality for checking a message sender's permissions before executing certain transactions. */ contract JBProjects is IJBProjects, JBOperatable, ERC721Votes, Ownable { //*********************************************************************// // --------------------- public stored properties -------------------- // //*********************************************************************// /** @notice The number of projects that have been created using this contract. @dev The count is incremented with each new project created. The resulting ERC-721 token ID for each project is the newly incremented count value. */ uint256 public override count = 0; /** @notice The metadata for each project, which can be used across several domains. _projectId The ID of the project to which the metadata belongs. _domain The domain within which the metadata applies. Applications can use the domain namespace as they wish. */ mapping(uint256 => mapping(uint256 => string)) public override metadataContentOf; /** @notice The contract resolving each project ID to its ERC721 URI. */ IJBTokenUriResolver public override tokenUriResolver; //*********************************************************************// // ------------------------- external views -------------------------- // //*********************************************************************// /** @notice Returns the URI where the ERC-721 standard JSON of a project is hosted. @param _projectId The ID of the project to get a URI of. @return The token URI to use for the provided `_projectId`. */ function tokenURI(uint256 _projectId) public view override returns (string memory) { // If there's no resolver, there's no URI. if (tokenUriResolver == IJBTokenUriResolver(address(0))) return ''; // Return the resolved URI. return tokenUriResolver.getUri(_projectId); } //*********************************************************************// // -------------------------- constructor ---------------------------- // //*********************************************************************// /** @param _operatorStore A contract storing operator assignments. */ constructor(IJBOperatorStore _operatorStore) ERC721('Juicebox Projects', 'JUICEBOX') EIP712('Juicebox Projects', '1') JBOperatable(_operatorStore) // solhint-disable-next-line no-empty-blocks { } //*********************************************************************// // ---------------------- external transactions ---------------------- // //*********************************************************************// /** @notice Create a new project for the specified owner, which mints an NFT (ERC-721) into their wallet. @dev Anyone can create a project on an owner's behalf. @param _owner The address that will be the owner of the project. @param _metadata A struct containing metadata content about the project, and domain within which the metadata applies. @return projectId The token ID of the newly created project. */ function createFor(address _owner, JBProjectMetadata calldata _metadata) external override returns (uint256 projectId) { // Increment the count, which will be used as the ID. projectId = ++count; // Mint the project. _safeMint(_owner, projectId); // Set the metadata if one was provided. if (bytes(_metadata.content).length > 0) metadataContentOf[projectId][_metadata.domain] = _metadata.content; emit Create(projectId, _owner, _metadata, msg.sender); } /** @notice Allows a project owner to set the project's metadata content for a particular domain namespace. @dev Only a project's owner or operator can set its metadata. @dev Applications can use the domain namespace as they wish. @param _projectId The ID of the project who's metadata is being changed. @param _metadata A struct containing metadata content, and domain within which the metadata applies. */ function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata) external override requirePermission(ownerOf(_projectId), _projectId, JBOperations.SET_METADATA) { // Set the project's new metadata content within the specified domain. metadataContentOf[_projectId][_metadata.domain] = _metadata.content; emit SetMetadata(_projectId, _metadata, msg.sender); } /** @notice Sets the address of the resolver used to retrieve the tokenURI of projects. @param _newResolver The address of the new resolver. */ function setTokenUriResolver(IJBTokenUriResolver _newResolver) external override onlyOwner { // Store the new resolver. tokenUriResolver = _newResolver; emit SetTokenUriResolver(_newResolver, msg.sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _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.5.0-rc.0) (governance/utils/IVotes.sol) pragma solidity ^0.8.0; /** * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. * * _Available since v4.5._ */ interface IVotes { /** * @dev Emitted when an account changes their delegate. */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes. */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** * @dev Returns the current amount of votes that `account` has. */ function getVotes(address account) external view returns (uint256); /** * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`). */ function getPastVotes(address account, uint256 blockNumber) external view returns (uint256); /** * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`). * * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. * Votes that have not been delegated are still part of total supply, even though they would not participate in a * vote. */ function getPastTotalSupply(uint256 blockNumber) external view returns (uint256); /** * @dev Returns the delegate that `account` has chosen. */ function delegates(address account) external view returns (address); /** * @dev Delegates votes from the sender to `delegatee`. */ function delegate(address delegatee) external; /** * @dev Delegates votes from signer to `delegatee`. */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0-rc.0) (governance/utils/Votes.sol) pragma solidity ^0.8.0; import "../../utils/Context.sol"; import "../../utils/Counters.sol"; import "../../utils/Checkpoints.sol"; import "../../utils/cryptography/draft-EIP712.sol"; import "./IVotes.sol"; /** * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of * "representative" that will pool delegated voting units from different accounts and can then use it to vote in * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative. * * This contract is often combined with a token contract such that voting units correspond to token units. For an * example, see {ERC721Votes}. * * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the * cost of this history tracking optional. * * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the * previous example, it would be included in {ERC721-_beforeTokenTransfer}). * * _Available since v4.5._ */ abstract contract Votes is IVotes, Context, EIP712 { using Checkpoints for Checkpoints.History; using Counters for Counters.Counter; bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); mapping(address => address) private _delegation; mapping(address => Checkpoints.History) private _delegateCheckpoints; Checkpoints.History private _totalCheckpoints; mapping(address => Counters.Counter) private _nonces; /** * @dev Returns the current amount of votes that `account` has. */ function getVotes(address account) public view virtual override returns (uint256) { return _delegateCheckpoints[account].latest(); } /** * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`). * * Requirements: * * - `blockNumber` must have been already mined */ function getPastVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { return _delegateCheckpoints[account].getAtBlock(blockNumber); } /** * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`). * * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. * Votes that have not been delegated are still part of total supply, even though they would not participate in a * vote. * * Requirements: * * - `blockNumber` must have been already mined */ function getPastTotalSupply(uint256 blockNumber) public view virtual override returns (uint256) { require(blockNumber < block.number, "Votes: block not yet mined"); return _totalCheckpoints.getAtBlock(blockNumber); } /** * @dev Returns the current total supply of votes. */ function _getTotalSupply() internal view virtual returns (uint256) { return _totalCheckpoints.latest(); } /** * @dev Returns the delegate that `account` has chosen. */ function delegates(address account) public view virtual override returns (address) { return _delegation[account]; } /** * @dev Delegates votes from the sender to `delegatee`. */ function delegate(address delegatee) public virtual override { address account = _msgSender(); _delegate(account, delegatee); } /** * @dev Delegates votes from signer to `delegatee`. */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= expiry, "Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), v, r, s ); require(nonce == _useNonce(signer), "Votes: invalid nonce"); _delegate(signer, delegatee); } /** * @dev Delegate all of `account`'s voting units to `delegatee`. * * Emits events {DelegateChanged} and {DelegateVotesChanged}. */ function _delegate(address account, address delegatee) internal virtual { address oldDelegate = delegates(account); _delegation[account] = delegatee; emit DelegateChanged(account, oldDelegate, delegatee); _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account)); } /** * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to` * should be zero. Total supply of voting units will be adjusted with mints and burns. */ function _transferVotingUnits( address from, address to, uint256 amount ) internal virtual { if (from == address(0)) { _totalCheckpoints.push(_add, amount); } if (to == address(0)) { _totalCheckpoints.push(_subtract, amount); } _moveDelegateVotes(delegates(from), delegates(to), amount); } /** * @dev Moves delegated votes from one delegate to another. */ function _moveDelegateVotes( address from, address to, uint256 amount ) private { if (from != to && amount > 0) { if (from != address(0)) { (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount); emit DelegateVotesChanged(from, oldValue, newValue); } if (to != address(0)) { (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[to].push(_add, amount); emit DelegateVotesChanged(to, oldValue, newValue); } } } function _add(uint256 a, uint256 b) private pure returns (uint256) { return a + b; } function _subtract(uint256 a, uint256 b) private pure returns (uint256) { return a - b; } /** * @dev Consumes a nonce. * * Returns the current value and increments nonce. */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } /** * @dev Returns an address nonce. */ function nonces(address owner) public view virtual returns (uint256) { return _nonces[owner].current(); } /** * @dev Returns the contract's {EIP712} domain separator. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32) { return _domainSeparatorV4(); } /** * @dev Must return the voting units held by an account. */ function _getVotingUnits(address) internal virtual returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0-rc.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: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _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: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {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 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 { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// 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.5.0-rc.0) (token/ERC721/extensions/draft-ERC721Votes.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../governance/utils/Votes.sol"; /** * @dev Extension of ERC721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts * as 1 vote unit. * * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of * the votes in governance decisions, or they can delegate to themselves to be their own representative. * * _Available since v4.5._ */ abstract contract ERC721Votes is ERC721, Votes { /** * @dev Adjusts votes when tokens are transferred. * * Emits a {Votes-DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { _transferVotingUnits(from, to, 1); super._afterTokenTransfer(from, to, tokenId); } /** * @dev Returns the balance of `account`. */ function _getVotingUnits(address account) internal virtual override returns (uint256) { return balanceOf(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0-rc.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 * ==== * * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Checkpoints.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SafeCast.sol"; /** * @dev This library defines the `History` struct, for checkpointing values as they change at different points in * time, and later looking up past values by block number. See {Votes} as an example. * * To create a history of checkpoints define a variable type `Checkpoints.History` in your contract, and store a new * checkpoint for the current transaction block using the {push} function. * * _Available since v4.5._ */ library Checkpoints { struct Checkpoint { uint32 _blockNumber; uint224 _value; } struct History { Checkpoint[] _checkpoints; } /** * @dev Returns the value in the latest checkpoint, or zero if there are no checkpoints. */ function latest(History storage self) internal view returns (uint256) { uint256 pos = self._checkpoints.length; return pos == 0 ? 0 : self._checkpoints[pos - 1]._value; } /** * @dev Returns the value at a given block number. If a checkpoint is not available at that block, the closest one * before it is returned, or zero otherwise. */ function getAtBlock(History storage self, uint256 blockNumber) internal view returns (uint256) { require(blockNumber < block.number, "Checkpoints: block not yet mined"); uint256 high = self._checkpoints.length; uint256 low = 0; while (low < high) { uint256 mid = Math.average(low, high); if (self._checkpoints[mid]._blockNumber > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? 0 : self._checkpoints[high - 1]._value; } /** * @dev Pushes a value onto a History so that it is stored as the checkpoint for the current block. * * Returns previous value and new value. */ function push(History storage self, uint256 value) internal returns (uint256, uint256) { uint256 pos = self._checkpoints.length; uint256 old = latest(self); if (pos > 0 && self._checkpoints[pos - 1]._blockNumber == block.number) { self._checkpoints[pos - 1]._value = SafeCast.toUint224(value); } else { self._checkpoints.push( Checkpoint({_blockNumber: SafeCast.toUint32(block.number), _value: SafeCast.toUint224(value)}) ); } return (old, value); } /** * @dev Pushes a value onto a History, by updating the latest value using binary operation `op`. The new value will * be set to `op(latest, delta)`. * * Returns previous value and new value. */ function push( History storage self, function(uint256, uint256) view returns (uint256) op, uint256 delta ) internal returns (uint256, uint256) { return push(self, op(latest(self), delta)); } }
// 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 v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// 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.5.0-rc.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. 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 / b + (a % b == 0 ? 0 : 1); } /** * @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 v4.4.1 (utils/math/SafeCast.sol) pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBOperatable.sol'; //*********************************************************************// // --------------------------- custom errors -------------------------- // //*********************************************************************// error UNAUTHORIZED(); /** @notice Modifiers to allow access to functions based on the message sender's operator status. */ abstract contract JBOperatable is IJBOperatable { //*********************************************************************// // ---------------------------- modifiers ---------------------------- // //*********************************************************************// modifier requirePermission( address _account, uint256 _domain, uint256 _permissionIndex ) { _requirePermission(_account, _domain, _permissionIndex); _; } modifier requirePermissionAllowingOverride( address _account, uint256 _domain, uint256 _permissionIndex, bool _override ) { _requirePermissionAllowingOverride(_account, _domain, _permissionIndex, _override); _; } //*********************************************************************// // ---------------- public immutable stored properties --------------- // //*********************************************************************// /** @notice A contract storing operator assignments. */ IJBOperatorStore public immutable override operatorStore; //*********************************************************************// // -------------------------- constructor ---------------------------- // //*********************************************************************// /** @param _operatorStore A contract storing operator assignments. */ constructor(IJBOperatorStore _operatorStore) { operatorStore = _operatorStore; } //*********************************************************************// // -------------------------- internal views ------------------------- // //*********************************************************************// /** @notice Require the message sender is either the account or has the specified permission. @param _account The account to allow. @param _domain The domain within which the permission index will be checked. @param _domain The permission index that an operator must have within the specified domain to be allowed. */ function _requirePermission( address _account, uint256 _domain, uint256 _permissionIndex ) internal view { if ( msg.sender != _account && !operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) && !operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex) ) revert UNAUTHORIZED(); } /** @notice Require the message sender is either the account, has the specified permission, or the override condition is true. @param _account The account to allow. @param _domain The domain within which the permission index will be checked. @param _domain The permission index that an operator must have within the specified domain to be allowed. @param _override The override condition to allow. */ function _requirePermissionAllowingOverride( address _account, uint256 _domain, uint256 _permissionIndex, bool _override ) internal view { if ( !_override && msg.sender != _account && !operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) && !operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex) ) revert UNAUTHORIZED(); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; enum JBBallotState { Active, Approved, Failed }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../structs/JBFundingCycleData.sol'; import './../structs/JBFundingCycleMetadata.sol'; import './../structs/JBProjectMetadata.sol'; import './../structs/JBGroupedSplits.sol'; import './../structs/JBFundAccessConstraints.sol'; import './../structs/JBProjectMetadata.sol'; import './IJBDirectory.sol'; import './IJBToken.sol'; import './IJBPaymentTerminal.sol'; import './IJBFundingCycleStore.sol'; import './IJBTokenStore.sol'; import './IJBSplitsStore.sol'; interface IJBController { event LaunchProject(uint256 configuration, uint256 projectId, string memo, address caller); event LaunchFundingCycles(uint256 configuration, uint256 projectId, string memo, address caller); event ReconfigureFundingCycles( uint256 configuration, uint256 projectId, string memo, address caller ); event SetFundAccessConstraints( uint256 indexed fundingCycleConfiguration, uint256 indexed fundingCycleNumber, uint256 indexed projectId, JBFundAccessConstraints constraints, address caller ); event DistributeReservedTokens( uint256 indexed fundingCycleConfiguration, uint256 indexed fundingCycleNumber, uint256 indexed projectId, address beneficiary, uint256 tokenCount, uint256 beneficiaryTokenCount, string memo, address caller ); event DistributeToReservedTokenSplit( uint256 indexed projectId, uint256 indexed domain, uint256 indexed group, JBSplit split, uint256 tokenCount, address caller ); event MintTokens( address indexed beneficiary, uint256 indexed projectId, uint256 tokenCount, uint256 beneficiaryTokenCount, string memo, uint256 reservedRate, address caller ); event BurnTokens( address indexed holder, uint256 indexed projectId, uint256 tokenCount, string memo, address caller ); event Migrate(uint256 indexed projectId, IJBController to, address caller); event PrepMigration(uint256 indexed projectId, IJBController from, address caller); function projects() external view returns (IJBProjects); function fundingCycleStore() external view returns (IJBFundingCycleStore); function tokenStore() external view returns (IJBTokenStore); function splitsStore() external view returns (IJBSplitsStore); function directory() external view returns (IJBDirectory); function reservedTokenBalanceOf(uint256 _projectId, uint256 _reservedRate) external view returns (uint256); function distributionLimitOf( uint256 _projectId, uint256 _configuration, IJBPaymentTerminal _terminal, address _token ) external view returns (uint256 distributionLimit, uint256 distributionLimitCurrency); function overflowAllowanceOf( uint256 _projectId, uint256 _configuration, IJBPaymentTerminal _terminal, address _token ) external view returns (uint256 overflowAllowance, uint256 overflowAllowanceCurrency); function totalOutstandingTokensOf(uint256 _projectId, uint256 _reservedRate) external view returns (uint256); function currentFundingCycleOf(uint256 _projectId) external returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata); function queuedFundingCycleOf(uint256 _projectId) external returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata); function launchProjectFor( address _owner, JBProjectMetadata calldata _projectMetadata, JBFundingCycleData calldata _data, JBFundingCycleMetadata calldata _metadata, uint256 _mustStartAtOrAfter, JBGroupedSplits[] memory _groupedSplits, JBFundAccessConstraints[] memory _fundAccessConstraints, IJBPaymentTerminal[] memory _terminals, string calldata _memo ) external returns (uint256 projectId); function launchFundingCyclesFor( uint256 _projectId, JBFundingCycleData calldata _data, JBFundingCycleMetadata calldata _metadata, uint256 _mustStartAtOrAfter, JBGroupedSplits[] memory _groupedSplits, JBFundAccessConstraints[] memory _fundAccessConstraints, IJBPaymentTerminal[] memory _terminals, string calldata _memo ) external returns (uint256 configuration); function reconfigureFundingCyclesOf( uint256 _projectId, JBFundingCycleData calldata _data, JBFundingCycleMetadata calldata _metadata, uint256 _mustStartAtOrAfter, JBGroupedSplits[] memory _groupedSplits, JBFundAccessConstraints[] memory _fundAccessConstraints, string calldata _memo ) external returns (uint256); function issueTokenFor( uint256 _projectId, string calldata _name, string calldata _symbol ) external returns (IJBToken token); function changeTokenOf( uint256 _projectId, IJBToken _token, address _newOwner ) external; function mintTokensOf( uint256 _projectId, uint256 _tokenCount, address _beneficiary, string calldata _memo, bool _preferClaimedTokens, bool _useReservedRate ) external returns (uint256 beneficiaryTokenCount); function burnTokensOf( address _holder, uint256 _projectId, uint256 _tokenCount, string calldata _memo, bool _preferClaimedTokens ) external; function distributeReservedTokensOf(uint256 _projectId, string memory _memo) external returns (uint256); function prepForMigrationOf(uint256 _projectId, IJBController _from) external; function migrate(uint256 _projectId, IJBController _to) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBPaymentTerminal.sol'; import './IJBProjects.sol'; import './IJBFundingCycleStore.sol'; import './IJBController.sol'; interface IJBDirectory { event SetController(uint256 indexed projectId, IJBController indexed controller, address caller); event AddTerminal(uint256 indexed projectId, IJBPaymentTerminal indexed terminal, address caller); event SetTerminals(uint256 indexed projectId, IJBPaymentTerminal[] terminals, address caller); event SetPrimaryTerminal( uint256 indexed projectId, address indexed token, IJBPaymentTerminal indexed terminal, address caller ); event SetIsAllowedToSetFirstController(address indexed addr, bool indexed flag, address caller); function projects() external view returns (IJBProjects); function fundingCycleStore() external view returns (IJBFundingCycleStore); function controllerOf(uint256 _projectId) external view returns (IJBController); function isAllowedToSetFirstController(address _address) external view returns (bool); function terminalsOf(uint256 _projectId) external view returns (IJBPaymentTerminal[] memory); function isTerminalOf(uint256 _projectId, IJBPaymentTerminal _terminal) external view returns (bool); function primaryTerminalOf(uint256 _projectId, address _token) external view returns (IJBPaymentTerminal); function setControllerOf(uint256 _projectId, IJBController _controller) external; function setTerminalsOf(uint256 _projectId, IJBPaymentTerminal[] calldata _terminals) external; function setPrimaryTerminalOf( uint256 _projectId, address _token, IJBPaymentTerminal _terminal ) external; function setIsAllowedToSetFirstController(address _address, bool _flag) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBFundingCycleStore.sol'; import './../enums/JBBallotState.sol'; interface IJBFundingCycleBallot { function duration() external view returns (uint256); function stateOf( uint256 _projectId, uint256 _configuration, uint256 _start ) external view returns (JBBallotState); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBFundingCycleStore.sol'; import './IJBPayDelegate.sol'; import './IJBRedemptionDelegate.sol'; import './../structs/JBPayParamsData.sol'; import './../structs/JBRedeemParamsData.sol'; interface IJBFundingCycleDataSource { function payParams(JBPayParamsData calldata _data) external view returns ( uint256 weight, string memory memo, IJBPayDelegate delegate ); function redeemParams(JBRedeemParamsData calldata _data) external view returns ( uint256 reclaimAmount, string memory memo, IJBRedemptionDelegate delegate ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBFundingCycleBallot.sol'; import './../enums/JBBallotState.sol'; import './../structs/JBFundingCycle.sol'; import './../structs/JBFundingCycleData.sol'; interface IJBFundingCycleStore { event Configure( uint256 indexed configuration, uint256 indexed projectId, JBFundingCycleData data, uint256 metadata, uint256 mustStartAtOrAfter, address caller ); event Init(uint256 indexed configuration, uint256 indexed projectId, uint256 indexed basedOn); function latestConfigurationOf(uint256 _projectId) external view returns (uint256); function get(uint256 _projectId, uint256 _configuration) external view returns (JBFundingCycle memory); function queuedOf(uint256 _projectId) external view returns (JBFundingCycle memory); function currentOf(uint256 _projectId) external view returns (JBFundingCycle memory); function currentBallotStateOf(uint256 _projectId) external view returns (JBBallotState); function configureFor( uint256 _projectId, JBFundingCycleData calldata _data, uint256 _metadata, uint256 _mustStartAtOrAfter ) external returns (JBFundingCycle memory fundingCycle); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBOperatorStore.sol'; interface IJBOperatable { function operatorStore() external view returns (IJBOperatorStore); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../structs/JBOperatorData.sol'; interface IJBOperatorStore { event SetOperator( address indexed operator, address indexed account, uint256 indexed domain, uint256[] permissionIndexes, uint256 packed ); function permissionsOf( address _operator, address _account, uint256 _domain ) external view returns (uint256); function hasPermission( address _operator, address _account, uint256 _domain, uint256 _permissionIndex ) external view returns (bool); function hasPermissions( address _operator, address _account, uint256 _domain, uint256[] calldata _permissionIndexes ) external view returns (bool); function setOperator(JBOperatorData calldata _operatorData) external; function setOperators(JBOperatorData[] calldata _operatorData) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../structs/JBDidPayData.sol'; interface IJBPayDelegate { function didPay(JBDidPayData calldata _data) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBDirectory.sol'; interface IJBPaymentTerminal { function acceptsToken(address _token) external view returns (bool); function currencyForToken(address _token) external view returns (uint256); function decimalsForToken(address _token) external view returns (uint256); // Return value must be a fixed point number with 18 decimals. function currentEthOverflowOf(uint256 _projectId) external view returns (uint256); function pay( uint256 _projectId, uint256 _amount, address _token, address _beneficiary, uint256 _minReturnedTokens, bool _preferClaimedTokens, string calldata _memo, bytes calldata _metadata ) external payable returns (uint256 beneficiaryTokenCount); function addToBalanceOf( uint256 _projectId, uint256 _amount, address _token, string calldata _memo ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import './IJBPaymentTerminal.sol'; import './IJBTokenUriResolver.sol'; import './../structs/JBProjectMetadata.sol'; import './IJBTokenUriResolver.sol'; interface IJBProjects is IERC721 { event Create( uint256 indexed projectId, address indexed owner, JBProjectMetadata metadata, address caller ); event SetMetadata(uint256 indexed projectId, JBProjectMetadata metadata, address caller); event SetTokenUriResolver(IJBTokenUriResolver resolver, address caller); function count() external view returns (uint256); function metadataContentOf(uint256 _projectId, uint256 _domain) external view returns (string memory); function tokenUriResolver() external view returns (IJBTokenUriResolver); function createFor(address _owner, JBProjectMetadata calldata _metadata) external returns (uint256 projectId); function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata) external; function setTokenUriResolver(IJBTokenUriResolver _newResolver) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBFundingCycleStore.sol'; import './../structs/JBDidRedeemData.sol'; interface IJBRedemptionDelegate { function didRedeem(JBDidRedeemData calldata _data) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import '../structs/JBSplitAllocationData.sol'; interface IJBSplitAllocator { function allocate(JBSplitAllocationData calldata _data) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBOperatorStore.sol'; import './IJBProjects.sol'; import './IJBDirectory.sol'; import './IJBSplitAllocator.sol'; import './../structs/JBSplit.sol'; interface IJBSplitsStore { event SetSplit( uint256 indexed projectId, uint256 indexed domain, uint256 indexed group, JBSplit split, address caller ); function projects() external view returns (IJBProjects); function directory() external view returns (IJBDirectory); function splitsOf( uint256 _projectId, uint256 _domain, uint256 _group ) external view returns (JBSplit[] memory); function set( uint256 _projectId, uint256 _domain, uint256 _group, JBSplit[] memory _splits ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; interface IJBToken { function decimals() external view returns (uint8); function totalSupply(uint256 _projectId) external view returns (uint256); function balanceOf(address _account, uint256 _projectId) external view returns (uint256); function mint( uint256 _projectId, address _account, uint256 _amount ) external; function burn( uint256 _projectId, address _account, uint256 _amount ) external; function approve( uint256, address _spender, uint256 _amount ) external; function transfer( uint256 _projectId, address _to, uint256 _amount ) external; function transferFrom( uint256 _projectId, address _from, address _to, uint256 _amount ) external; function transferOwnership(address _newOwner) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './IJBProjects.sol'; import './IJBToken.sol'; interface IJBTokenStore { event Issue( uint256 indexed projectId, IJBToken indexed token, string name, string symbol, address caller ); event Mint( address indexed holder, uint256 indexed projectId, uint256 amount, bool tokensWereClaimed, bool preferClaimedTokens, address caller ); event Burn( address indexed holder, uint256 indexed projectId, uint256 amount, uint256 initialUnclaimedBalance, uint256 initialClaimedBalance, bool preferClaimedTokens, address caller ); event Claim( address indexed holder, uint256 indexed projectId, uint256 initialUnclaimedBalance, uint256 amount, address caller ); event ShouldRequireClaim(uint256 indexed projectId, bool indexed flag, address caller); event Change( uint256 indexed projectId, IJBToken indexed newToken, IJBToken indexed oldToken, address owner, address caller ); event Transfer( address indexed holder, uint256 indexed projectId, address indexed recipient, uint256 amount, address caller ); function tokenOf(uint256 _projectId) external view returns (IJBToken); function projectOf(IJBToken _token) external view returns (uint256); function projects() external view returns (IJBProjects); function unclaimedBalanceOf(address _holder, uint256 _projectId) external view returns (uint256); function unclaimedTotalSupplyOf(uint256 _projectId) external view returns (uint256); function totalSupplyOf(uint256 _projectId) external view returns (uint256); function balanceOf(address _holder, uint256 _projectId) external view returns (uint256 _result); function requireClaimFor(uint256 _projectId) external view returns (bool); function issueFor( uint256 _projectId, string calldata _name, string calldata _symbol ) external returns (IJBToken token); function changeFor( uint256 _projectId, IJBToken _token, address _newOwner ) external returns (IJBToken oldToken); function burnFrom( address _holder, uint256 _projectId, uint256 _amount, bool _preferClaimedTokens ) external; function mintFor( address _holder, uint256 _projectId, uint256 _amount, bool _preferClaimedTokens ) external; function shouldRequireClaimingFor(uint256 _projectId, bool _flag) external; function claimFor( address _holder, uint256 _projectId, uint256 _amount ) external; function transferFrom( address _holder, uint256 _projectId, address _recipient, uint256 _amount ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; interface IJBTokenUriResolver { function getUri(uint256 _projectId) external view returns (string memory tokenUri); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; library JBOperations { uint256 public constant RECONFIGURE = 1; uint256 public constant REDEEM = 2; uint256 public constant MIGRATE_CONTROLLER = 3; uint256 public constant MIGRATE_TERMINAL = 4; uint256 public constant PROCESS_FEES = 5; uint256 public constant SET_METADATA = 6; uint256 public constant ISSUE = 7; uint256 public constant CHANGE_TOKEN = 8; uint256 public constant MINT = 9; uint256 public constant BURN = 10; uint256 public constant CLAIM = 11; uint256 public constant TRANSFER = 12; uint256 public constant REQUIRE_CLAIM = 13; uint256 public constant SET_CONTROLLER = 14; uint256 public constant SET_TERMINALS = 15; uint256 public constant SET_PRIMARY_TERMINAL = 16; uint256 public constant USE_ALLOWANCE = 17; uint256 public constant SET_SPLITS = 18; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; library JBSplitsGroups { uint256 public constant ETH_PAYOUT = 1; uint256 public constant RESERVED_TOKENS = 2; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './JBTokenAmount.sol'; struct JBDidPayData { // The address from which the payment originated. address payer; // The ID of the project for which the payment was made. uint256 projectId; // The amount of the payment. Includes the token being paid, the value, the number of decimals included, and the currency of the amount. JBTokenAmount amount; // The number of project tokens minted for the beneficiary. uint256 projectTokenCount; // The address to which the tokens were minted. address beneficiary; // The memo that is being emitted alongside the payment. string memo; // Metadata to send to the delegate. bytes metadata; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './JBTokenAmount.sol'; struct JBDidRedeemData { // The holder of the tokens being redeemed. address holder; // The project to which the redeemed tokens are associated. uint256 projectId; // The number of project tokens being redeemed. uint256 projectTokenCount; // The reclaimed amount. Includes the token being paid, the value, the number of decimals included, and the currency of the amount. JBTokenAmount reclaimedAmount; // The address to which the reclaimed amount will be sent. address payable beneficiary; // The memo that is being emitted alongside the redemption. string memo; // Metadata to send to the delegate. bytes metadata; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBPaymentTerminal.sol'; struct JBFundAccessConstraints { // The terminal within which the distribution limit and the overflow allowance applies. IJBPaymentTerminal terminal; // The token for which the fund access constraints apply. address token; // The amount of the distribution limit, as a fixed point number with the same number of decimals as the terminal within which the limit applies. uint256 distributionLimit; // The currency of the distribution limit. uint256 distributionLimitCurrency; // The amount of the allowance, as a fixed point number with the same number of decimals as the terminal within which the allowance applies. uint256 overflowAllowance; // The currency of the overflow allowance. uint256 overflowAllowanceCurrency; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBFundingCycleBallot.sol'; struct JBFundingCycle { // The funding cycle number for each project. // Each funding cycle has a number that is an increment of the cycle that directly preceded it. // Each project's first funding cycle has a number of 1. uint256 number; // The timestamp when the parameters for this funding cycle were configured. // This value will stay the same for subsequent funding cycles that roll over from an originally configured cycle. uint256 configuration; // The `configuration` of the funding cycle that was active when this cycle was created. uint256 basedOn; // The timestamp marking the moment from which the funding cycle is considered active. // It is a unix timestamp measured in seconds. uint256 start; // The number of seconds the funding cycle lasts for, after which a new funding cycle will start. // A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. // If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. // If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`. uint256 duration; // A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. // For example, payment terminals can use this to determine how many tokens should be minted when a payment is received. uint256 weight; // A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. // If it's 0, each funding cycle will have equal weight. // If the number is 90%, the next funding cycle will have a 10% smaller weight. // This weight is out of `JBConstants.MAX_DISCOUNT_RATE`. uint256 discountRate; // An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. // It can be used to create rules around how a project owner can change funding cycle parameters over time. IJBFundingCycleBallot ballot; // Extra data that can be associated with a funding cycle. uint256 metadata; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBFundingCycleBallot.sol'; struct JBFundingCycleData { // The number of seconds the funding cycle lasts for, after which a new funding cycle will start. // A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. // If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. // If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`. uint256 duration; // A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. // For example, payment terminals can use this to determine how many tokens should be minted when a payment is received. uint256 weight; // A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. // If it's 0, each funding cycle will have equal weight. // If the number is 90%, the next funding cycle will have a 10% smaller weight. // This weight is out of `JBConstants.MAX_DISCOUNT_RATE`. uint256 discountRate; // An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. // It can be used to create rules around how a project owner can change funding cycle parameters over time. IJBFundingCycleBallot ballot; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBFundingCycleDataSource.sol'; struct JBFundingCycleMetadata { // The reserved rate of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_RESERVED_RATE`. uint256 reservedRate; // The redemption rate of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_REDEMPTION_RATE`. uint256 redemptionRate; // The redemption rate to use during an active ballot of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_REDEMPTION_RATE`. uint256 ballotRedemptionRate; // If the pay functionality should be paused during the funding cycle. bool pausePay; // If the distribute functionality should be paused during the funding cycle. bool pauseDistributions; // If the redeem functionality should be paused during the funding cycle. bool pauseRedeem; // If the burn functionality should be paused during the funding cycle. bool pauseBurn; // If the mint functionality should be allowed during the funding cycle. bool allowMinting; // If changing tokens should be allowed during this funding cycle. bool allowChangeToken; // If migrating terminals should be allowed during this funding cycle. bool allowTerminalMigration; // If migrating controllers should be allowed during this funding cycle. bool allowControllerMigration; // If setting terminals should be allowed during this funding cycle. bool allowSetTerminals; // If setting a new controller should be allowed during this funding cycle. bool allowSetController; // If fees should be held during this funding cycle. bool holdFees; // If redemptions should use the project's balance held in all terminals instead of the project's local terminal balance from which the redemption is being fulfilled. bool useTotalOverflowForRedemptions; // If the data source should be used for pay transactions during this funding cycle. bool useDataSourceForPay; // If the data source should be used for redeem transactions during this funding cycle. bool useDataSourceForRedeem; // The data source to use during this funding cycle. IJBFundingCycleDataSource dataSource; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './JBSplit.sol'; import '../libraries/JBSplitsGroups.sol'; struct JBGroupedSplits { // The group indentifier. uint256 group; // The splits to associate with the group. JBSplit[] splits; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; struct JBOperatorData { // The address of the operator. address operator; // The domain within which the operator is being given permissions. // A domain of 0 is a wildcard domain, which gives an operator access to all domains. uint256 domain; // The indexes of the permissions the operator is being given. uint256[] permissionIndexes; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBPaymentTerminal.sol'; import './JBTokenAmount.sol'; struct JBPayParamsData { // The terminal that is facilitating the payment. IJBPaymentTerminal terminal; // The address from which the payment originated. address payer; // The amount of the payment. Includes the token being paid, the value, the number of decimals included, and the currency of the amount. JBTokenAmount amount; // The ID of the project being paid. uint256 projectId; // The weight of the funding cycle during which the payment is being made. uint256 weight; // The reserved rate of the funding cycle during which the payment is being made. uint256 reservedRate; // The memo that was sent alongside the payment. string memo; // Arbitrary metadata provided by the payer. bytes metadata; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; struct JBProjectMetadata { // Metadata content. string content; // The domain within which the metadata applies. uint256 domain; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBPaymentTerminal.sol'; struct JBRedeemParamsData { // The terminal that is facilitating the redemption. IJBPaymentTerminal terminal; // The holder of the tokens being redeemed. address holder; // The ID of the project whos tokens are being redeemed. uint256 projectId; // The proposed number of tokens being redeemed, as a fixed point number with 18 decimals. uint256 tokenCount; // The total supply of tokens used in the calculation, as a fixed point number with 18 decimals. uint256 totalSupply; // The amount of overflow used in the reclaim amount calculation. uint256 overflow; // The number of decimals included in the reclaim amount fixed point number. uint256 decimals; // The currency that the reclaim amount is expected to be in terms of. uint256 currency; // The amount that should be reclaimed by the redeemer using the protocol's standard bonding curve redemption formula. uint256 reclaimAmount; // If overflow across all of a project's terminals is being used when making redemptions. bool useTotalOverflow; // The redemption rate of the funding cycle during which the redemption is being made. uint256 redemptionRate; // The ballot redemption rate of the funding cycle during which the redemption is being made. uint256 ballotRedemptionRate; // The proposed memo that is being emitted alongside the redemption. string memo; // Arbitrary metadata provided by the redeemer. bytes metadata; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './../interfaces/IJBSplitAllocator.sol'; struct JBSplit { // A flag that only has effect if a projectId is also specified, and the project has a token contract attached. // If so, this flag indicates if the tokens that result from making a payment to the project should be delivered claimed into the beneficiary's wallet, or unclaimed to save gas. bool preferClaimed; // A flag indicating if a distribution to a project should prefer triggering it's addToBalance function instead of its pay function. bool preferAddToBalance; // The percent of the whole group that this split occupies. This number is out of `JBConstants.SPLITS_TOTAL_PERCENT`. uint256 percent; // If an allocator is not set but a projectId is set, funds will be sent to the protocol treasury belonging to the project who's ID is specified. // Resulting tokens will be routed to the beneficiary with the claimed token preference respected. uint256 projectId; // The role the of the beneficary depends on whether or not projectId is specified, and whether or not an allocator is specified. // If allocator is set, the beneficiary will be forwarded to the allocator for it to use. // If allocator is not set but projectId is set, the beneficiary is the address to which the project's tokens will be sent that result from a payment to it. // If neither allocator or projectId are set, the beneficiary is where the funds from the split will be sent. address payable beneficiary; // Specifies if the split should be unchangeable until the specified time, with the exception of extending the locked period. uint256 lockedUntil; // If an allocator is specified, funds will be sent to the allocator contract along with all properties of this split. IJBSplitAllocator allocator; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import './JBSplit.sol'; import './JBTokenAmount.sol'; struct JBSplitAllocationData { // The token being sent to the split allocator. address token; // The amount being sent to the split allocator, as a fixed point number. uint256 amount; // The number of decimals in the amount. uint256 decimals; // The project to which the split belongs. uint256 projectId; // The group to which the split belongs. uint256 group; // The split that caused the allocation. JBSplit split; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; struct JBTokenAmount { // The token the payment was made in. address token; // The amount of tokens that was paid, as a fixed point number. uint256 value; // The number of decimals included in the value fixed point number. uint256 decimals; // The expected currency of the value. uint256 currency; }
{ "evmVersion": "berlin", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 100000000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IJBOperatorStore","name":"_operatorStore","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"UNAUTHORIZED","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"components":[{"internalType":"string","name":"content","type":"string"},{"internalType":"uint256","name":"domain","type":"uint256"}],"indexed":false,"internalType":"struct JBProjectMetadata","name":"metadata","type":"tuple"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","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":"uint256","name":"projectId","type":"uint256"},{"components":[{"internalType":"string","name":"content","type":"string"},{"internalType":"uint256","name":"domain","type":"uint256"}],"indexed":false,"internalType":"struct JBProjectMetadata","name":"metadata","type":"tuple"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"SetMetadata","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IJBTokenUriResolver","name":"resolver","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"SetTokenUriResolver","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":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"components":[{"internalType":"string","name":"content","type":"string"},{"internalType":"uint256","name":"domain","type":"uint256"}],"internalType":"struct JBProjectMetadata","name":"_metadata","type":"tuple"}],"name":"createFor","outputs":[{"internalType":"uint256","name":"projectId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getVotes","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":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"metadataContentOf","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorStore","outputs":[{"internalType":"contract IJBOperatorStore","name":"","type":"address"}],"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":"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":"uint256","name":"_projectId","type":"uint256"},{"components":[{"internalType":"string","name":"content","type":"string"},{"internalType":"uint256","name":"domain","type":"uint256"}],"internalType":"struct JBProjectMetadata","name":"_metadata","type":"tuple"}],"name":"setMetadataOf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IJBTokenUriResolver","name":"_newResolver","type":"address"}],"name":"setTokenUriResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenUriResolver","outputs":[{"internalType":"contract IJBTokenUriResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101606040526000600b553480156200001757600080fd5b5060405162003b1c38038062003b1c8339810160408190526200003a916200028a565b6040805180820182526011808252704a75696365626f782050726f6a6563747360781b60208084018290528451808601865260018152603160f81b818301528551808701875293845283820192835285518087019096526008865267094aa92868a849eb60c31b918601919091526001600160601b0319606087901b166080528251939490939091620000d19160009190620001e4565b508051620000e7906001906020840190620001e4565b505082516020938401208251928401929092206101008390526101208190524660c0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8189018190528183019790975260608181019590955260808101939093523060a0808501829052825180860382018152949093019091528251929096019190912090529290921b60e05261014052506200018b3362000192565b50620002f9565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001f290620002bc565b90600052602060002090601f01602090048101928262000216576000855562000261565b82601f106200023157805160ff191683800117855562000261565b8280016001018555821562000261579182015b828111156200026157825182559160200191906001019062000244565b506200026f92915062000273565b5090565b5b808211156200026f576000815560010162000274565b6000602082840312156200029d57600080fd5b81516001600160a01b0381168114620002b557600080fd5b9392505050565b600181811c90821680620002d157607f821691505b60208210811415620002f357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160c05160e05160601c6101005161012051610140516137b4620003686000396000611912015260006119610152600061193c01526000611895015260006118bf015260006118e901526000818161040901528181611a290152611b0501526137b46000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c8063666d87a01161010f578063a22cb465116100a2578063c87b56dd11610071578063c87b56dd14610451578063e131fc0c14610464578063e985e9c514610484578063f2fde38b146104cd57600080fd5b8063a22cb465146103f1578063ad007d6314610404578063b88d4fde1461042b578063c3cda5201461043e57600080fd5b80638da5cb5b116100de5780638da5cb5b146103a55780638e539e8c146103c357806395d89b41146103d65780639ab24eb0146103de57600080fd5b8063666d87a01461036457806370a0823114610377578063715018a61461038a5780637ecebe001461039257600080fd5b80633644e5151161018757806342842e0e1161015657806342842e0e146102f2578063587cde1e146103055780635c19a95c1461033e5780636352211e1461035157600080fd5b80633644e515146102b157806336574975146102b957806339fbc775146102cc5780633a46b1a8146102df57600080fd5b8063081812fc116101c3578063081812fc1461023e578063095ea7b31461027657806323b872dd1461028b5780632407497e1461029e57600080fd5b806301ffc9a7146101ea57806306661abd1461021257806306fdde0314610229575b600080fd5b6101fd6101f83660046131b0565b6104e0565b60405190151581526020015b60405180910390f35b61021b600b5481565b604051908152602001610209565b6102316105c5565b6040516102099190613360565b61025161024c366004613261565b610657565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610209565b610289610284366004613105565b610736565b005b610289610299366004612f97565b6108c3565b6102896102ac366004612f41565b610964565b61021b610a63565b6102896102c736600461327a565b610a72565b6102316102da3660046132ab565b610afc565b61021b6102ed366004613105565b610ba1565b610289610300366004612f97565b610bd7565b610251610313366004612f41565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600660205260409020541690565b61028961034c366004612f41565b610bf2565b61025161035f366004613261565b610c01565b61021b6103723660046130b5565b610cb3565b61021b610385366004612f41565b610d73565b610289610e41565b61021b6103a0366004612f41565b610ece565b600a5473ffffffffffffffffffffffffffffffffffffffff16610251565b61021b6103d1366004613261565b610ef9565b610231610f6f565b61021b6103ec366004612f41565b610f7e565b6102896103ff366004613087565b610fac565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b610289610439366004612fd8565b610fb7565b61028961044c366004613131565b61105f565b61023161045f366004613261565b6111d6565b600d546102519073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd610492366004612f5e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102896104db366004612f41565b6112ce565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061057357507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806105bf57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6060600080546105d4906135dd565b80601f0160208091040260200160405190810160405280929190818152602001828054610600906135dd565b801561064d5780601f106106225761010080835404028352916020019161064d565b820191906000526020600020905b81548152906001019060200180831161063057829003601f168201915b5050505050905090565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061074182610c01565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610704565b3373ffffffffffffffffffffffffffffffffffffffff8216148061082857506108288133610492565b6108b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610704565b6108be83836113fe565b505050565b6108cd338261149e565b610959576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610704565b6108be83838361160e565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b600d80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155604080519182523360208301527fe7784d93cfbfa4408e19577e6cc0436f4dbb51214b70e100905dfce9def88c16910160405180910390a150565b6000610a6d61187b565b905090565b610a7b82610c01565b826006610a898383836119af565b610a93848061344d565b6000878152600c602090815260408083208983013584529091529020610aba929091612e81565b50847fd07720acb527321c9d1766f359139d0e0e3551bd99fb3ca353d4f008f3aad8e68533604051610aed929190613373565b60405180910390a25050505050565b600c60209081526000928352604080842090915290825290208054610b20906135dd565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4c906135dd565b8015610b995780601f10610b6e57610100808354040283529160200191610b99565b820191906000526020600020905b815481529060010190602001808311610b7c57829003601f168201915b505050505081565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600760205260408120610bd09083611bb8565b9392505050565b6108be83838360405180602001604052806000815250610fb7565b33610bfd8183611d0b565b5050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16806105bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610704565b6000600b60008154610cc49061362b565b91829055509050610cd58382611da2565b6000610ce1838061344d565b90501115610d1c57610cf3828061344d565b6000838152600c602090815260408083208783013584529091529020610d1a929091612e81565b505b8273ffffffffffffffffffffffffffffffffffffffff16817fa1c6fd563bcbc3222f6031d7c26ff58cd6c701abff0bfffe652d055ce40629d48433604051610d65929190613373565b60405180910390a392915050565b600073ffffffffffffffffffffffffffffffffffffffff8216610e18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610704565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610ec2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b610ecc6000611dbc565b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600960205260408120546105bf565b6000438210610f64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e65640000000000006044820152606401610704565b6105bf600883611bb8565b6060600180546105d4906135dd565b73ffffffffffffffffffffffffffffffffffffffff811660009081526007602052604081206105bf90611e33565b610bfd338383611eb9565b610fc1338361149e565b61104d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610704565b61105984848484611fe7565b50505050565b834211156110c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f566f7465733a207369676e6174757265206578706972656400000000000000006044820152606401610704565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf602082015273ffffffffffffffffffffffffffffffffffffffff8816918101919091526060810186905260808101859052600090611150906111489060a0016040516020818303038152906040528051906020012061208a565b8585856120f3565b905061115b8161211b565b86146111c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e63650000000000000000000000006044820152606401610704565b6111cd8188611d0b565b50505050505050565b600d5460609073ffffffffffffffffffffffffffffffffffffffff1661120a57505060408051602081019091526000815290565b600d546040517fda0544aa0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff9091169063da0544aa9060240160006040518083038186803b15801561127457600080fd5b505afa158015611288573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526105bf91908101906131ea565b600a5473ffffffffffffffffffffffffffffffffffffffff16331461134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff81166113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610704565b6113fb81611dbc565b50565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155819061145882610c01565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661154f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610704565b600061155a83610c01565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806115c957508373ffffffffffffffffffffffffffffffffffffffff166115b184610657565b73ffffffffffffffffffffffffffffffffffffffff16145b80611606575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b8273ffffffffffffffffffffffffffffffffffffffff1661162e82610c01565b73ffffffffffffffffffffffffffffffffffffffff16146116d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610704565b73ffffffffffffffffffffffffffffffffffffffff8216611773576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610704565b61177e6000826113fe565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906117b490849061359a565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054600192906117ef908490613547565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46108be838383612150565b60003073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156118e157507f000000000000000000000000000000000000000000000000000000000000000046145b1561190b57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b3373ffffffffffffffffffffffffffffffffffffffff841614801590611aa557506040517fc161c93f00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015260448201849052606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f9060840160206040518083038186803b158015611a6b57600080fd5b505afa158015611a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa39190613193565b155b8015611b8157506040517fc161c93f00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015260006044830152606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f9060840160206040518083038186803b158015611b4757600080fd5b505afa158015611b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7f9190613193565b155b156108be576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000438210611c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610704565b825460005b81811015611c88576000611c3c828461215c565b905084866000018281548110611c5457611c546136c2565b60009182526020909120015463ffffffff161115611c7457809250611c82565b611c7f816001613547565b91505b50611c28565b8115611ce15784611c9a60018461359a565b81548110611caa57611caa6136c2565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611ce4565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1695945050505050565b73ffffffffffffffffffffffffffffffffffffffff82811660008181526006602052604080822080548686167fffffffffffffffffffffffff0000000000000000000000000000000000000000821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108be8183611d9d86612177565b612182565b610bfd828260405180602001604052806000815250612318565b600a805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80546000908015611e915782611e4a60018361359a565b81548110611e5a57611e5a6136c2565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611e94565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ff284848461160e565b611ffe848484846123bb565b611059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b60006105bf61209761187b565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612104878787876125b7565b91509150612111816126cf565b5095945050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526009602052604090208054600181018255905b50919050565b6108be83836001612928565b600061216b600284841861355f565b610bd090848416613547565b60006105bf82610d73565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156121be5750600081115b156108be5773ffffffffffffffffffffffffffffffffffffffff8316156122735773ffffffffffffffffffffffffffffffffffffffff831660009081526007602052604081208190612213906129bf856129cb565b915091508473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051612268929190918252602082015260400190565b60405180910390a250505b73ffffffffffffffffffffffffffffffffffffffff8216156108be5773ffffffffffffffffffffffffffffffffffffffff8216600090815260076020526040812081906122c3906129f9856129cb565b915091508373ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051610aed929190918252602082015260400190565b6123228383612a05565b61232f60008484846123bb565b6108be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b600073ffffffffffffffffffffffffffffffffffffffff84163b156125af576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290612432903390899088908890600401613317565b602060405180830381600087803b15801561244c57600080fd5b505af192505050801561249a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612497918101906131cd565b60015b612564573d8080156124c8576040519150601f19603f3d011682016040523d82523d6000602084013e6124cd565b606091505b50805161255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611606565b506001611606565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156125ee57506000905060036126c6565b8460ff16601b1415801561260657508460ff16601c14155b1561261757506000905060046126c6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561266b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166126bf576000600192509250506126c6565b9150600090505b94509492505050565b60008160048111156126e3576126e3613693565b14156126ec5750565b600181600481111561270057612700613693565b1415612768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610704565b600281600481111561277c5761277c613693565b14156127e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610704565b60038160048111156127f8576127f8613693565b1415612886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610704565b600481600481111561289a5761289a613693565b14156113fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610704565b73ffffffffffffffffffffffffffffffffffffffff83166129545761295160086129f9836129cb565b50505b73ffffffffffffffffffffffffffffffffffffffff82166129805761297d60086129bf836129cb565b50505b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600660205260408082205485841683529120546108be92918216911683612182565b6000610bd0828461359a565b6000806129ed856129e86129de88611e33565b868863ffffffff16565b612bcf565b91509150935093915050565b6000610bd08284613547565b73ffffffffffffffffffffffffffffffffffffffff8216612a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610704565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612b0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612b44908490613547565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610bfd60008383612150565b8154600090819081612be086611e33565b9050600082118015612c1e57504386612bfa60018561359a565b81548110612c0a57612c0a6136c2565b60009182526020909120015463ffffffff16145b15612ca857612c2c85612d39565b86612c3860018561359a565b81548110612c4857612c486136c2565b9060005260206000200160000160046101000a8154817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550612d2b565b856000016040518060400160405280612cc043612deb565b63ffffffff168152602001612cd488612d39565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115612de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152608401610704565b5090565b600063ffffffff821115612de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610704565b828054612e8d906135dd565b90600052602060002090601f016020900481019282612eaf5760008555612f13565b82601f10612ee6578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555612f13565b82800160010185558215612f13579182015b82811115612f13578235825591602001919060010190612ef8565b50612de79291505b80821115612de75760008155600101612f1b565b60006040828403121561214a57600080fd5b600060208284031215612f5357600080fd5b8135610bd081613720565b60008060408385031215612f7157600080fd5b8235612f7c81613720565b91506020830135612f8c81613720565b809150509250929050565b600080600060608486031215612fac57600080fd5b8335612fb781613720565b92506020840135612fc781613720565b929592945050506040919091013590565b60008060008060808587031215612fee57600080fd5b8435612ff981613720565b9350602085013561300981613720565b925060408501359150606085013567ffffffffffffffff81111561302c57600080fd5b8501601f8101871361303d57600080fd5b803561305061304b82613501565b6134b2565b81815288602083850101111561306557600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561309a57600080fd5b82356130a581613720565b91506020830135612f8c81613742565b600080604083850312156130c857600080fd5b82356130d381613720565b9150602083013567ffffffffffffffff8111156130ef57600080fd5b6130fb85828601612f2f565b9150509250929050565b6000806040838503121561311857600080fd5b823561312381613720565b946020939093013593505050565b60008060008060008060c0878903121561314a57600080fd5b863561315581613720565b95506020870135945060408701359350606087013560ff8116811461317957600080fd5b9598949750929560808101359460a0909101359350915050565b6000602082840312156131a557600080fd5b8151610bd081613742565b6000602082840312156131c257600080fd5b8135610bd081613750565b6000602082840312156131df57600080fd5b8151610bd081613750565b6000602082840312156131fc57600080fd5b815167ffffffffffffffff81111561321357600080fd5b8201601f8101841361322457600080fd5b805161323261304b82613501565b81815285602083850101111561324757600080fd5b6132588260208301602086016135b1565b95945050505050565b60006020828403121561327357600080fd5b5035919050565b6000806040838503121561328d57600080fd5b82359150602083013567ffffffffffffffff8111156130ef57600080fd5b600080604083850312156132be57600080fd5b50508035926020909101359150565b600081518084526132e58160208601602086016135b1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261335660808301846132cd565b9695505050505050565b602081526000610bd060208301846132cd565b60408152600083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18536030181126133ab57600080fd5b8401803567ffffffffffffffff8111156133c457600080fd5b8036038613156133d357600080fd5b604080850152806080850152806020830160a0860137600060a082860101526020860135606085015260a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050610bd0602083018473ffffffffffffffffffffffffffffffffffffffff169052565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261348257600080fd5b83018035915067ffffffffffffffff82111561349d57600080fd5b602001915036819003821315612d3257600080fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156134f9576134f96136f1565b604052919050565b600067ffffffffffffffff82111561351b5761351b6136f1565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b6000821982111561355a5761355a613664565b500190565b600082613595577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000828210156135ac576135ac613664565b500390565b60005b838110156135cc5781810151838201526020016135b4565b838111156110595750506000910152565b600181811c908216806135f157607f821691505b6020821081141561214a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561365d5761365d613664565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146113fb57600080fd5b80151581146113fb57600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000811681146113fb57600080fdfea264697066735822122078d89e21549b5e087ba920bc9cff5d073bdc1868658c06e62673192c0fc6462164736f6c6343000806003300000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063666d87a01161010f578063a22cb465116100a2578063c87b56dd11610071578063c87b56dd14610451578063e131fc0c14610464578063e985e9c514610484578063f2fde38b146104cd57600080fd5b8063a22cb465146103f1578063ad007d6314610404578063b88d4fde1461042b578063c3cda5201461043e57600080fd5b80638da5cb5b116100de5780638da5cb5b146103a55780638e539e8c146103c357806395d89b41146103d65780639ab24eb0146103de57600080fd5b8063666d87a01461036457806370a0823114610377578063715018a61461038a5780637ecebe001461039257600080fd5b80633644e5151161018757806342842e0e1161015657806342842e0e146102f2578063587cde1e146103055780635c19a95c1461033e5780636352211e1461035157600080fd5b80633644e515146102b157806336574975146102b957806339fbc775146102cc5780633a46b1a8146102df57600080fd5b8063081812fc116101c3578063081812fc1461023e578063095ea7b31461027657806323b872dd1461028b5780632407497e1461029e57600080fd5b806301ffc9a7146101ea57806306661abd1461021257806306fdde0314610229575b600080fd5b6101fd6101f83660046131b0565b6104e0565b60405190151581526020015b60405180910390f35b61021b600b5481565b604051908152602001610209565b6102316105c5565b6040516102099190613360565b61025161024c366004613261565b610657565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610209565b610289610284366004613105565b610736565b005b610289610299366004612f97565b6108c3565b6102896102ac366004612f41565b610964565b61021b610a63565b6102896102c736600461327a565b610a72565b6102316102da3660046132ab565b610afc565b61021b6102ed366004613105565b610ba1565b610289610300366004612f97565b610bd7565b610251610313366004612f41565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600660205260409020541690565b61028961034c366004612f41565b610bf2565b61025161035f366004613261565b610c01565b61021b6103723660046130b5565b610cb3565b61021b610385366004612f41565b610d73565b610289610e41565b61021b6103a0366004612f41565b610ece565b600a5473ffffffffffffffffffffffffffffffffffffffff16610251565b61021b6103d1366004613261565b610ef9565b610231610f6f565b61021b6103ec366004612f41565b610f7e565b6102896103ff366004613087565b610fac565b6102517f00000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b81565b610289610439366004612fd8565b610fb7565b61028961044c366004613131565b61105f565b61023161045f366004613261565b6111d6565b600d546102519073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd610492366004612f5e565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102896104db366004612f41565b6112ce565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061057357507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806105bf57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6060600080546105d4906135dd565b80601f0160208091040260200160405190810160405280929190818152602001828054610600906135dd565b801561064d5780601f106106225761010080835404028352916020019161064d565b820191906000526020600020905b81548152906001019060200180831161063057829003601f168201915b5050505050905090565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061074182610c01565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610704565b3373ffffffffffffffffffffffffffffffffffffffff8216148061082857506108288133610492565b6108b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610704565b6108be83836113fe565b505050565b6108cd338261149e565b610959576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610704565b6108be83838361160e565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b600d80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155604080519182523360208301527fe7784d93cfbfa4408e19577e6cc0436f4dbb51214b70e100905dfce9def88c16910160405180910390a150565b6000610a6d61187b565b905090565b610a7b82610c01565b826006610a898383836119af565b610a93848061344d565b6000878152600c602090815260408083208983013584529091529020610aba929091612e81565b50847fd07720acb527321c9d1766f359139d0e0e3551bd99fb3ca353d4f008f3aad8e68533604051610aed929190613373565b60405180910390a25050505050565b600c60209081526000928352604080842090915290825290208054610b20906135dd565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4c906135dd565b8015610b995780601f10610b6e57610100808354040283529160200191610b99565b820191906000526020600020905b815481529060010190602001808311610b7c57829003601f168201915b505050505081565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600760205260408120610bd09083611bb8565b9392505050565b6108be83838360405180602001604052806000815250610fb7565b33610bfd8183611d0b565b5050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16806105bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610704565b6000600b60008154610cc49061362b565b91829055509050610cd58382611da2565b6000610ce1838061344d565b90501115610d1c57610cf3828061344d565b6000838152600c602090815260408083208783013584529091529020610d1a929091612e81565b505b8273ffffffffffffffffffffffffffffffffffffffff16817fa1c6fd563bcbc3222f6031d7c26ff58cd6c701abff0bfffe652d055ce40629d48433604051610d65929190613373565b60405180910390a392915050565b600073ffffffffffffffffffffffffffffffffffffffff8216610e18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610704565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610ec2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b610ecc6000611dbc565b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600960205260408120546105bf565b6000438210610f64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e65640000000000006044820152606401610704565b6105bf600883611bb8565b6060600180546105d4906135dd565b73ffffffffffffffffffffffffffffffffffffffff811660009081526007602052604081206105bf90611e33565b610bfd338383611eb9565b610fc1338361149e565b61104d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610704565b61105984848484611fe7565b50505050565b834211156110c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f566f7465733a207369676e6174757265206578706972656400000000000000006044820152606401610704565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf602082015273ffffffffffffffffffffffffffffffffffffffff8816918101919091526060810186905260808101859052600090611150906111489060a0016040516020818303038152906040528051906020012061208a565b8585856120f3565b905061115b8161211b565b86146111c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e63650000000000000000000000006044820152606401610704565b6111cd8188611d0b565b50505050505050565b600d5460609073ffffffffffffffffffffffffffffffffffffffff1661120a57505060408051602081019091526000815290565b600d546040517fda0544aa0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff9091169063da0544aa9060240160006040518083038186803b15801561127457600080fd5b505afa158015611288573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526105bf91908101906131ea565b600a5473ffffffffffffffffffffffffffffffffffffffff16331461134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff81166113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610704565b6113fb81611dbc565b50565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155819061145882610c01565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661154f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610704565b600061155a83610c01565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806115c957508373ffffffffffffffffffffffffffffffffffffffff166115b184610657565b73ffffffffffffffffffffffffffffffffffffffff16145b80611606575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b8273ffffffffffffffffffffffffffffffffffffffff1661162e82610c01565b73ffffffffffffffffffffffffffffffffffffffff16146116d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610704565b73ffffffffffffffffffffffffffffffffffffffff8216611773576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610704565b61177e6000826113fe565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906117b490849061359a565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054600192906117ef908490613547565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46108be838383612150565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b9ee9d8203467f6ec0eac81163d210bd1a7d3b55161480156118e157507f000000000000000000000000000000000000000000000000000000000000000146145b1561190b57507f2eb9e749d56f0c873be33acc963fda61e4fb563f8f40be37460149b9b5bc81fd90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f2e5c5c1c4affeaeda2d3db263faddbd323c18ac7d44a6ca994665583d3b15dad828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b3373ffffffffffffffffffffffffffffffffffffffff841614801590611aa557506040517fc161c93f00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015260448201849052606482018390527f00000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b169063c161c93f9060840160206040518083038186803b158015611a6b57600080fd5b505afa158015611a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa39190613193565b155b8015611b8157506040517fc161c93f00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015260006044830152606482018390527f00000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b169063c161c93f9060840160206040518083038186803b158015611b4757600080fd5b505afa158015611b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7f9190613193565b155b156108be576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000438210611c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610704565b825460005b81811015611c88576000611c3c828461215c565b905084866000018281548110611c5457611c546136c2565b60009182526020909120015463ffffffff161115611c7457809250611c82565b611c7f816001613547565b91505b50611c28565b8115611ce15784611c9a60018461359a565b81548110611caa57611caa6136c2565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611ce4565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1695945050505050565b73ffffffffffffffffffffffffffffffffffffffff82811660008181526006602052604080822080548686167fffffffffffffffffffffffff0000000000000000000000000000000000000000821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108be8183611d9d86612177565b612182565b610bfd828260405180602001604052806000815250612318565b600a805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80546000908015611e915782611e4a60018361359a565b81548110611e5a57611e5a6136c2565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611e94565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ff284848461160e565b611ffe848484846123bb565b611059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b60006105bf61209761187b565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612104878787876125b7565b91509150612111816126cf565b5095945050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526009602052604090208054600181018255905b50919050565b6108be83836001612928565b600061216b600284841861355f565b610bd090848416613547565b60006105bf82610d73565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156121be5750600081115b156108be5773ffffffffffffffffffffffffffffffffffffffff8316156122735773ffffffffffffffffffffffffffffffffffffffff831660009081526007602052604081208190612213906129bf856129cb565b915091508473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051612268929190918252602082015260400190565b60405180910390a250505b73ffffffffffffffffffffffffffffffffffffffff8216156108be5773ffffffffffffffffffffffffffffffffffffffff8216600090815260076020526040812081906122c3906129f9856129cb565b915091508373ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051610aed929190918252602082015260400190565b6123228383612a05565b61232f60008484846123bb565b6108be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b600073ffffffffffffffffffffffffffffffffffffffff84163b156125af576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290612432903390899088908890600401613317565b602060405180830381600087803b15801561244c57600080fd5b505af192505050801561249a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612497918101906131cd565b60015b612564573d8080156124c8576040519150601f19603f3d011682016040523d82523d6000602084013e6124cd565b606091505b50805161255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610704565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611606565b506001611606565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156125ee57506000905060036126c6565b8460ff16601b1415801561260657508460ff16601c14155b1561261757506000905060046126c6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561266b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166126bf576000600192509250506126c6565b9150600090505b94509492505050565b60008160048111156126e3576126e3613693565b14156126ec5750565b600181600481111561270057612700613693565b1415612768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610704565b600281600481111561277c5761277c613693565b14156127e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610704565b60038160048111156127f8576127f8613693565b1415612886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610704565b600481600481111561289a5761289a613693565b14156113fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610704565b73ffffffffffffffffffffffffffffffffffffffff83166129545761295160086129f9836129cb565b50505b73ffffffffffffffffffffffffffffffffffffffff82166129805761297d60086129bf836129cb565b50505b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600660205260408082205485841683529120546108be92918216911683612182565b6000610bd0828461359a565b6000806129ed856129e86129de88611e33565b868863ffffffff16565b612bcf565b91509150935093915050565b6000610bd08284613547565b73ffffffffffffffffffffffffffffffffffffffff8216612a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610704565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612b0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610704565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612b44908490613547565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610bfd60008383612150565b8154600090819081612be086611e33565b9050600082118015612c1e57504386612bfa60018561359a565b81548110612c0a57612c0a6136c2565b60009182526020909120015463ffffffff16145b15612ca857612c2c85612d39565b86612c3860018561359a565b81548110612c4857612c486136c2565b9060005260206000200160000160046101000a8154817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550612d2b565b856000016040518060400160405280612cc043612deb565b63ffffffff168152602001612cd488612d39565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115612de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152608401610704565b5090565b600063ffffffff821115612de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610704565b828054612e8d906135dd565b90600052602060002090601f016020900481019282612eaf5760008555612f13565b82601f10612ee6578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555612f13565b82800160010185558215612f13579182015b82811115612f13578235825591602001919060010190612ef8565b50612de79291505b80821115612de75760008155600101612f1b565b60006040828403121561214a57600080fd5b600060208284031215612f5357600080fd5b8135610bd081613720565b60008060408385031215612f7157600080fd5b8235612f7c81613720565b91506020830135612f8c81613720565b809150509250929050565b600080600060608486031215612fac57600080fd5b8335612fb781613720565b92506020840135612fc781613720565b929592945050506040919091013590565b60008060008060808587031215612fee57600080fd5b8435612ff981613720565b9350602085013561300981613720565b925060408501359150606085013567ffffffffffffffff81111561302c57600080fd5b8501601f8101871361303d57600080fd5b803561305061304b82613501565b6134b2565b81815288602083850101111561306557600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561309a57600080fd5b82356130a581613720565b91506020830135612f8c81613742565b600080604083850312156130c857600080fd5b82356130d381613720565b9150602083013567ffffffffffffffff8111156130ef57600080fd5b6130fb85828601612f2f565b9150509250929050565b6000806040838503121561311857600080fd5b823561312381613720565b946020939093013593505050565b60008060008060008060c0878903121561314a57600080fd5b863561315581613720565b95506020870135945060408701359350606087013560ff8116811461317957600080fd5b9598949750929560808101359460a0909101359350915050565b6000602082840312156131a557600080fd5b8151610bd081613742565b6000602082840312156131c257600080fd5b8135610bd081613750565b6000602082840312156131df57600080fd5b8151610bd081613750565b6000602082840312156131fc57600080fd5b815167ffffffffffffffff81111561321357600080fd5b8201601f8101841361322457600080fd5b805161323261304b82613501565b81815285602083850101111561324757600080fd5b6132588260208301602086016135b1565b95945050505050565b60006020828403121561327357600080fd5b5035919050565b6000806040838503121561328d57600080fd5b82359150602083013567ffffffffffffffff8111156130ef57600080fd5b600080604083850312156132be57600080fd5b50508035926020909101359150565b600081518084526132e58160208601602086016135b1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261335660808301846132cd565b9695505050505050565b602081526000610bd060208301846132cd565b60408152600083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18536030181126133ab57600080fd5b8401803567ffffffffffffffff8111156133c457600080fd5b8036038613156133d357600080fd5b604080850152806080850152806020830160a0860137600060a082860101526020860135606085015260a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050610bd0602083018473ffffffffffffffffffffffffffffffffffffffff169052565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261348257600080fd5b83018035915067ffffffffffffffff82111561349d57600080fd5b602001915036819003821315612d3257600080fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156134f9576134f96136f1565b604052919050565b600067ffffffffffffffff82111561351b5761351b6136f1565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b6000821982111561355a5761355a613664565b500190565b600082613595577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000828210156135ac576135ac613664565b500390565b60005b838110156135cc5781810151838201526020016135b4565b838111156110595750506000910152565b600181811c908216806135f157607f821691505b6020821081141561214a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561365d5761365d613664565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146113fb57600080fd5b80151581146113fb57600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000811681146113fb57600080fdfea264697066735822122078d89e21549b5e087ba920bc9cff5d073bdc1868658c06e62673192c0fc6462164736f6c63430008060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b
-----Decoded View---------------
Arg [0] : _operatorStore (address): 0x21263a042aFE4bAE34F08Bb318056C181bD96D3b
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000021263a042afe4bae34f08bb318056c181bd96d3b
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.