Overview
ETH Balance
0.210000000000000006 ETH
Eth Value
$425.01 (@ $2,023.88/ETH)More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 44 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Payee | 15315837 | 959 days ago | IN | 0 ETH | 0.00346442 | ||||
Add Payee | 15315836 | 959 days ago | IN | 0 ETH | 0.00300897 | ||||
Add Payee | 15315833 | 959 days ago | IN | 0 ETH | 0.00337737 | ||||
Add Payee | 15315830 | 959 days ago | IN | 0 ETH | 0.00315955 | ||||
Add Payee | 15315830 | 959 days ago | IN | 0 ETH | 0.00315955 | ||||
Add Payee | 15315829 | 959 days ago | IN | 0 ETH | 0.00282701 | ||||
Add Payee | 15315828 | 959 days ago | IN | 0 ETH | 0.00300864 | ||||
Add Payee | 15315825 | 959 days ago | IN | 0 ETH | 0.00278254 | ||||
Add Payee | 15315821 | 959 days ago | IN | 0 ETH | 0.00306335 | ||||
Add Payee | 15315821 | 959 days ago | IN | 0 ETH | 0.00306279 | ||||
Add Payee | 15315657 | 959 days ago | IN | 0 ETH | 0.00515413 | ||||
Add Payee | 15315599 | 959 days ago | IN | 0 ETH | 0.0031395 | ||||
Release | 14743674 | 1052 days ago | IN | 0 ETH | 0.00565711 | ||||
Release | 14743655 | 1052 days ago | IN | 0 ETH | 0.0075791 | ||||
Release | 14743630 | 1052 days ago | IN | 0 ETH | 0.00596897 | ||||
Add Payee | 14494803 | 1091 days ago | IN | 0 ETH | 0.00572608 | ||||
Add Payee | 14494802 | 1091 days ago | IN | 0 ETH | 0.00818045 | ||||
Release | 14227453 | 1132 days ago | IN | 0 ETH | 0.00342016 | ||||
Release | 14205242 | 1136 days ago | IN | 0 ETH | 0.00410992 | ||||
Release | 14121772 | 1149 days ago | IN | 0 ETH | 0.0090248 | ||||
Release | 14121716 | 1149 days ago | IN | 0 ETH | 0.00796118 | ||||
Release | 14120715 | 1149 days ago | IN | 0 ETH | 0.0055871 | ||||
Release | 14116430 | 1150 days ago | IN | 0 ETH | 0.00598786 | ||||
Release | 14116418 | 1150 days ago | IN | 0 ETH | 0.00759522 | ||||
Release | 14116406 | 1150 days ago | IN | 0 ETH | 0.00937599 |
Latest 24 internal transactions
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
- | 14743674 | 1052 days ago | 0.105 ETH | ||||
- | 14743655 | 1052 days ago | 0.035 ETH | ||||
- | 14743630 | 1052 days ago | 0.15 ETH | ||||
- | 14743609 | 1052 days ago | 0.5 ETH | ||||
- | 14227453 | 1132 days ago | 0.28 ETH | ||||
- | 14205242 | 1136 days ago | 0.28 ETH | ||||
- | 14121772 | 1149 days ago | 0.28 ETH | ||||
- | 14121716 | 1149 days ago | 0.56 ETH | ||||
- | 14120715 | 1149 days ago | 0.28 ETH | ||||
- | 14116430 | 1150 days ago | 0.84 ETH | ||||
- | 14116418 | 1150 days ago | 1.2 ETH | ||||
- | 14116406 | 1150 days ago | 0.28 ETH | ||||
- | 14116361 | 1150 days ago | 4 ETH | ||||
- | 13725006 | 1210 days ago | 1.05072761 ETH | ||||
- | 13700388 | 1214 days ago | 1.05072761 ETH | ||||
- | 13697918 | 1215 days ago | 3.15218283 ETH | ||||
- | 13697898 | 1215 days ago | 4.50311833 ETH | ||||
- | 13690526 | 1216 days ago | 2.10145522 ETH | ||||
- | 13684260 | 1217 days ago | 1.05072761 ETH | ||||
- | 13684127 | 1217 days ago | 1.05072761 ETH | ||||
- | 13680931 | 1217 days ago | 0.19322761 ETH | ||||
- | 13678856 | 1218 days ago | 2.75 ETH | ||||
- | 13678806 | 1218 days ago | 0.8575 ETH | ||||
- | 13678728 | 1218 days ago | 12.25 ETH |
Loading...
Loading
Contract Name:
ArchiveRoyalties
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./TheArchive.sol"; contract ArchiveRoyalties is Context, Ownable { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; uint256 public _totalPayees; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; address private archiveAddress; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } modifier onlyTeam() { require(TheArchive(archiveAddress).isTeam(msg.sender), "Restricted"); _; } function release() public { release(payable(msg.sender)); } function getOwed(address payable account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return totalReceived * shares(account) / totalShares() - released(account); } function addPayee(address account, uint256 shares_) public onlyTeam { _addPayee(account, shares_); } function setArchiveAddress(address _archive) public onlyOwner { archiveAddress = _archive; } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + _totalReleased; uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account]; require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] = _released[account] + payment; _totalReleased = _totalReleased + payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); bool payeeFound; for(uint256 i=0; i<_totalPayees; i++) { if(_payees[i] == account) { payeeFound = true; _totalShares = _totalShares - _shares[account] + shares_; _shares[account] = shares_; } } if(!payeeFound) { _payees.push(account); _totalShares = _totalShares + shares_; _shares[account] = shares_; _totalPayees++; } emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @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 pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import "./Archival.sol"; contract TheArchive is ERC721, AccessControl { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter public _tokens; uint256 public price = 0.25 * 1e18; uint256 public rollMintLimit = 2; uint256 public mintLimitSize = 36; string public baseUri = 'https://ipfs.infura.io/ipfs/'; string public imageUri = 'https://api.thedigitalarchive.art/image/'; bool public onchain=true; string public description; address withdrawalAddress; struct Token { bool exists; string cid; bool snippet; uint256 rotation; string film; string color; } mapping (uint256 => Token) public Tokens; bool public saleStart; bool public requireIncludeList; mapping (address => bool) public IncludeList; mapping (uint256 => mapping (address => uint256)) public RollWallet; constructor(address _withdraw) ERC721("TheArchive", "ARCHIVE") { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); withdrawalAddress = _withdraw; } modifier onlyTeam() { require(isTeam(msg.sender)); _; } function isTeam(address account) public virtual view returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, account); } function mint(uint256 tokenId) public payable { require(saleStart && !_exists(tokenId) && Tokens[tokenId].exists && msg.value == price); if(requireIncludeList) { require(IncludeList[msg.sender]); } uint256 roll = tokenId.div(mintLimitSize); require(RollWallet[roll][msg.sender]+1 <= rollMintLimit); _safeMint(msg.sender, tokenId); RollWallet[roll][msg.sender]++; } function mintTeam(uint256 tokenId, address receiver) public onlyTeam { require(!_exists(tokenId) && Tokens[tokenId].exists); _safeMint(receiver, tokenId); } function createToken(string memory cid, uint256 rotation, string memory film, bool exists, string memory color) public onlyTeam { _tokens.increment(); Tokens[_tokens.current()] = Token(exists, cid, true, rotation, film, color); } function editToken(uint256 tokenId, string memory cid, uint256 rotation, string memory film, bool exists, string memory color) public onlyTeam { Tokens[tokenId].exists = exists; Tokens[tokenId].cid = cid; Tokens[tokenId].rotation = rotation; Tokens[tokenId].film = film; Tokens[tokenId].color = color; } function ownerTokenSettings(uint256 tokenId, bool snippet, uint256 rotation) public { require(ownerOf(tokenId) == msg.sender && rotation < 4); Tokens[tokenId].rotation = rotation; Tokens[tokenId].snippet = snippet; } function tokenExists(uint256 tokenId) public view returns(bool) { return _exists(tokenId); } function getTokensForSale() public view returns(uint256[] memory tokens) { uint256 saleCount = 0; for(uint256 i=1; i<= _tokens.current(); i++) { if(Tokens[i].exists && !tokenExists(i)) { saleCount++; } } tokens = new uint256[](saleCount); uint256 index; for(uint256 i=1; i<= _tokens.current(); i++) { if(Tokens[i].exists && !tokenExists(i)) { tokens[index] = i; index++; } } } function contractSettings(bool _saleStart, bool _requireIncludeList, uint256 _price, string memory _baseUri, string memory _imageUri, bool _onchain, string memory _description, uint256 _rollMintLimit, uint256 _mintLimitSize) public onlyTeam { saleStart = _saleStart; requireIncludeList = _requireIncludeList; price = _price; baseUri = _baseUri; imageUri = _imageUri; onchain = _onchain; description = _description; rollMintLimit = _rollMintLimit; mintLimitSize = _mintLimitSize; } function addIncludeListBulk(address[] memory include, uint256 total) public onlyTeam { for(uint256 i=0; i<total; i++) { IncludeList[include[i]] = true; } } function removeIncludeListBulk(address[] memory include, uint256 total) public onlyTeam { for(uint256 i=0; i<total; i++) { IncludeList[include[i]] = false; } } function tokenURI(uint256 tokenId) override public view returns (string memory output) { if(!onchain) { output = string(abi.encodePacked(baseUri, tokenId)); } else { string memory attributes = Archival.makeAttributes(Tokens[tokenId].film); string memory svg; if(!Tokens[tokenId].snippet) { svg = string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(bytes(Archival.makeSVG(baseUri, Tokens[tokenId].cid, Tokens[tokenId].snippet, Tokens[tokenId].rotation))))); } else { svg = string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(bytes(Archival.makeSVGSnippet(baseUri, Tokens[tokenId].cid, Tokens[tokenId].snippet, Tokens[tokenId].rotation, tokenId, Tokens[tokenId].film, Tokens[tokenId].color))))); } string memory image = string(abi.encodePacked(imageUri, Archival.toString(tokenId))); string memory json = Base64.encode(bytes(Archival.makeJson(Archival.tokenName(tokenId), description, image, svg, attributes))); output = string(abi.encodePacked('data:application/json;base64,', json)); } } /** * External function for getting all tokens by a specific owner. */ function getByOwner(address _owner) view public returns(uint256[] memory result) { result = new uint256[](balanceOf(_owner)); uint256 resultIndex = 0; for (uint256 t = 1; t <= _tokens.current(); t++) { if (_exists(t) && ownerOf(t) == _owner) { result[resultIndex] = t; resultIndex++; } } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } function withdraw() public payable onlyTeam { require(payable(withdrawalAddress).send(address(this).balance)); } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; library Archival { using SafeMath for uint256; function tokenName(uint256 tokenId) public pure returns (string memory name) { uint256 number = tokenId.mod(36); if(number == 0) { number = 36; } name = string(abi.encodePacked(toString(36), rollCode(tokenId), toString(number))); } function rollCode(uint256 tokenId) public pure returns (string memory code) { uint256 roll = tokenId.sub(1).div(36); uint256 rollPrefix = roll.div(26); uint256 rollSuffix = roll.mod(26); code = string(abi.encodePacked(letterMap(rollPrefix), letterMap(rollSuffix))); } function letterMap(uint256 num) public pure returns (string memory letter) { string[26] memory letters; letters[0] = 'A'; letters[1] = 'B'; letters[2] = 'C'; letters[3] = 'D'; letters[4] = 'E'; letters[5] = 'F'; letters[6] = 'G'; letters[7] = 'H'; letters[8] = 'I'; letters[9] = 'J'; letters[10] = 'K'; letters[11] = 'L'; letters[12] = 'M'; letters[13] = 'N'; letters[14] = 'O'; letters[15] = 'P'; letters[16] = 'Q'; letters[17] = 'R'; letters[18] = 'S'; letters[19] = 'T'; letters[20] = 'U'; letters[21] = 'V'; letters[22] = 'W'; letters[23] = 'X'; letters[24] = 'Y'; letters[25] = 'Z'; letter = letters[num]; } function getDefaultSizes() public pure returns (uint256 default_width, uint256 default_height) { default_width = 10200; default_height = 6900; } function getWidthAndHeight(bool snippet, uint256 rotation) public pure returns (uint256 s_width, uint256 s_height) { (uint256 default_width, uint256 default_height) = getDefaultSizes(); s_width = default_width; s_height = default_height; if(snippet) { s_height = (default_width / 38) * 35; if(rotation == 1 || rotation == 3) { s_width = s_height; s_height = default_width; } } else if(rotation == 1 || rotation == 3) { s_width = s_height; s_height = default_width; } } function makeSVG(string memory baseUri, string memory cid, bool snippet, uint256 rotation) public pure returns (string memory svg){ (uint256 default_width, uint256 default_height) = getDefaultSizes(); (uint256 s_width, uint256 s_height) = getWidthAndHeight(snippet, rotation); string memory transform; if(rotation == 1) { transform = string(abi.encodePacked('transform="rotate(90, ', toString(s_width / 2), ', ', toString(s_width / 2), ')"')); } else if(rotation == 2) { transform = string(abi.encodePacked('transform="rotate(180, ', toString(s_width / 2), ', ', toString(s_height / 2), ')"')); } else if(rotation == 3) { transform = string(abi.encodePacked('transform="rotate(270, ', toString(s_height / 2), ', ', toString(s_height / 2), ')"')); } svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '; svg = string(abi.encodePacked(svg, toString(s_width), ' ', toString(s_height), '"><image href="', baseUri, cid, '" height="', toString(default_height), '" width="', toString(default_width), '" ', transform, ' /></svg>')); } function makeSVGSnippet(string memory baseUri, string memory cid, bool snippet, uint256 rotation, uint256 tokenId, string memory film, string memory color) public pure returns (string memory svg){ (uint256 default_width, uint256 default_height) = getDefaultSizes(); (uint256 s_width, uint256 s_height) = getWidthAndHeight(snippet, rotation); uint256 number = tokenId.mod(36); if(number == 0) { number = 36; } string[11] memory parts; parts[0] = string(abi.encodePacked('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ', toString(s_width), ' ', toString(s_height), '"><g ')); if(rotation == 1) { parts[1] = string(abi.encodePacked('transform="rotate(90, ', toString(s_width / 2), ', ', toString(s_width / 2), ')"')); } else if(rotation == 2) { parts[1] = string(abi.encodePacked('transform="rotate(180, ', toString(s_width / 2), ', ', toString(s_height / 2), ')"')); } else if(rotation == 3) { parts[1] = string(abi.encodePacked('transform="rotate(270, ', toString(s_height / 2), ', ', toString(s_height / 2), ')"')); } parts[2] = string(abi.encodePacked('><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3800 3500" height="', toString((default_width / 38) * 35), '" width="', toString(default_width), '"><path fill="#', color, '" d="M-8.2,3510.8V-8.6h3812.7v3519.4H-8.2z M849.9,343.4c-1.6-34.6,3.6-70-2.9-104.1c-18-59.1-90.5-37.1-136.9-41c-38.5-3.6-67.7,28.1-65.8,63.8c2.3,61.6-4.7,124.5,3.1,185.6c18.4,61.8,96.6,37,145,41.6C870.2,485.1,846.4,396.4,849.9,343.4z M849.9,3154.6c-0.1-30,0.3-60.1-0.2-90.1c-0.8-27.8-22.7-54.3-51.4-55.1c-30-0.8-59.9-0.1-89.9-0.3c-28.8-2.6-55.2,14.7-61.7,43.6c-6,59-0.6,119.2-2.4,178.6c-2.8,33.1,19.9,68.3,55.6,67.8c48.3-5.3,126.5,21.1,146.7-39C854.1,3225.8,848.1,3189.6,849.9,3154.6z M2034.9,343.7c-0.1,30.5,0.3,61.1,0,91.6c-0.2,33.7,32,56.6,64.1,54.2c49.2-2.4,135.5,17.1,139.3-54.7c0.1-60.6-0.2-121.2,0.1-181.7c0-31.2-28.6-56.2-59.3-54.9c-35.4,1.9-72.1-4.4-106.7,3.4c-28.6,9.2-40.6,38-37.5,66.4C2034.9,293.2,2034.9,318.5,2034.9,343.7z M2960.8,342.1c0.2,32.9-0.6,65.8,0.5,98.6c3,28.9,30.8,50,59.3,48.6c34.9-1.4,70.9,3.9,105.3-3.1c24.6-7.2,40.7-33.1,38.6-58.5c0-55.8,0-111.5,0-167.3c2.2-26.1-13-50.3-38.1-58.9c-34.2-7.4-70.3-1.5-105.2-3.3C2940.4,198.8,2964.1,288.2,2960.8,342.1L2960.8,342.1z M1312.4,343.6c-0.7-33.8,1.5-67.8-1.1-101.4c-16.7-62.7-92.7-39.8-140.8-43.9c-32.3-2.4-62.7,23.1-61.8,56.5c0.1,60.1,0.2,120.1,0,180.2c0,24.1,17.7,46.7,41.1,52.1c32.3,5.4,65.6,1.1,98.3,2.4C1334.3,490.2,1308.7,401.2,1312.4,343.6z M2702.2,343.5L2702.2,343.5c-3.2-50.4,18.8-136.9-52.7-144.8c-28.5-1.1-57.1-0.2-85.6-0.5c-37.3-3.7-68.1,24.8-66.7,59.4c0.1,58.6,0.1,117.2,0,175.9c0.5,13.5,5.7,26.4,14.6,36.6c11.8,14.7,30.6,19.5,48.7,19.4c28.5-0.4,57.1,0.4,85.6-0.2C2722.1,484.2,2698.7,395.7,2702.2,343.5z M386.3,345.2c-0.1-31.4,0.2-62.9-0.2-94.4c-1.5-31.8-30.4-54.4-61.4-52.6c-38,3.8-101.5-12.4-127.5,18.6c-11.6,12.2-15.8,27.9-14.4,44.8c0,58.2,0,116.3,0,174.4c0.4,20.6,13.2,38.5,31.4,47.6c35.5,12.1,75,3.1,111.9,5.8c29.8,1.4,59.1-21.8,59.8-52.7C386.6,406.2,386.2,375.7,386.3,345.2L386.3,345.2z M1776.1,344.8c-2.9-58,20.3-149.7-67.1-146.5c-34.8,3.1-91.9-9.8-117.9,14c-13.8,12.1-20,27.5-20.1,45.6c0,57.2-0.1,114.4-0.1,171.6c-1,36.7,30.4,63,66.3,60c33.4-1.9,68.2,4.3,100.9-3.6C1794.9,464.2,1771.3,391.8,1776.1,344.8L1776.1,344.8z M3423.3,343.4c2.7,81.4-22.6,155.1,91.5,146.1c24.8-1.3,51.1,3.4,75.2-3.6c25.4-8.4,38.8-33.3,38.2-59.3c-0.1-55.3-0.1-110.6,0-165.8c-0.2-80.3-86-60.2-141-62.4C3402.4,197.4,3426.7,288.5,3423.3,343.4L3423.3,343.4z M386.3,3155.1c-0.9-34.7,2-69.8-1.5-104.2c-6-21.2-24.9-40.1-47.7-41.3c-29.9-1-59.9-0.3-89.9-0.5c-32.7-3.6-65.1,19.7-64.4,54.5c-0.2,60.5,0,121.1-0.2,181.6c0.8,29.1,24.3,54,53.9,53.7c37.6-1.6,76.9,4.8,113.7-3.3c26.8-9.4,38.8-37.8,36-64.7C386.3,3205.6,386.3,3180.4,386.3,3155.1z M1108.9,3153.8c0.8,34.2-1.7,68.8,1,102.9c6.4,23.7,27.8,42.6,52.9,42.4c31.9,0.1,63.8,0,95.6,0c29.1,0.2,54.2-26.4,53.9-55.5c-0.2-60.1-0.2-120.1,0-180.2c-0.3-33.2-30.8-58.1-63.5-54.3c-25.7,0-51.4,0-77.1,0c-16.2-0.6-32.9,2.2-44.8,14.2c-11.9,11.4-18.3,25-18.1,41.8C1109.1,3094.7,1108.9,3124.3,1108.9,3153.8z M2034.9,3153.9L2034.9,3153.9c-0.1,30.5,0.4,61,0,91.5c0.3,28.9,25,53.9,54,53.5c37.2-1.7,75.8,4.3,112.3-3c21.9-7.6,37-29.2,37.1-52.5c-0.2-60.1-0.2-120.1,0-180.2c-0.4-28.1-23.4-53.4-52.1-54c-29.5-0.6-59-0.1-88.5-0.3c-31.6-3.5-62.8,20.2-62.7,53.3C2034.8,3092.9,2035,3123.4,2034.9,3153.9z M2497.2,3153.4L2497.2,3153.4c1.9,51.3-17.1,146,57.2,145.9c34.1-1.5,68.7,1.6,102.7-1c29.8-6.8,46.9-34.5,45.1-64.4c-0.2-56.2,0.2-112.5-0.1-168.8c-0.8-12.6-4.3-24.4-12.3-34.4c-12-16.2-30.2-22.8-50.2-21.6c-31.4,0.4-62.8-0.8-94.2,0.6C2477.3,3019.4,2501.4,3105,2497.2,3153.4z M1571,3153.3L1571,3153.3c1.2,34.2-2.6,68.9,2,102.8c17.2,64.5,98.6,37.7,147.9,43c33.5,0,57-31.3,55.2-63.6c-0.2-57.2,0.2-114.4-0.1-171.6c-1.5-32.3-29.7-58.3-62.2-54.8c-32.3,0.4-64.7-1-97,0.8C1551.3,3023.7,1575.4,3104.8,1571,3153.3z M2960.8,3153.8c1.8,35.9-4,73.1,3.1,108.2c23.4,58.7,97,30.7,145.2,37.2c33.5,0.7,59.2-31.7,55.3-64.1c-0.4-8.5,0.4-171.7-0.1-175.9c-1-13.9-8.3-26.6-18.4-36c-11.8-11.6-27.4-14.7-43.4-14.1c-30.4,0.2-60.9-0.5-91.3,0.4c-27.1,1-49.8,25.7-50.1,52.8C2960.4,3092.8,2960.9,3123.3,2960.8,3153.8z M3423.3,3153.6L3423.3,3153.6c1.6,35-3.6,71,2.8,105.5c19,60.1,95.4,35.2,143.1,40c36.8,2.4,62.1-31.7,59.1-66.8c-0.1-55.8,0.2-111.5-0.1-167.3c-0.7-9.6-2.6-18.9-7.6-27.3c-11.6-21.1-32.6-30.3-56.3-28.6c-31.4,0.4-62.8-0.9-94.1,0.7C3403.6,3022.6,3427.5,3104.9,3423.3,3153.6z"/></svg>')); parts[3] = '<style type="text/css"> @font-face { font-family: Teletactile; src: url("https://archive-app.netlify.app/Teletactile.ttf"); } .t0{font:300px "Teletactile", sans-serif;} </style>'; parts[4] = '<text x="1850" y="400" class="t0" fill="orange">LH / ARCH</text>'; parts[5] = string(abi.encodePacked('<text x="9150" y="400" class="t0" fill="orange">', toString(number), '</text>')); parts[6] = string(abi.encodePacked('<text x="9150" y="9250" class="t0" fill="orange">', toString(number), '</text>')); parts[7] = string(abi.encodePacked('<text x="1850" y="9250" class="t0" fill="orange">36', rollCode(tokenId), '</text>')); parts[8] = string(abi.encodePacked('<text x="3650" y="9250" class="t0" fill="orange">', film, '</text>')); parts[9] = string(abi.encodePacked('<image href="', baseUri, cid, '" height="6697" width="9900" x="150" y="1341" />')); parts[10] = '<g transform="scale(0.049)"><svg xmlns="http://www.w3.org/2000/svg" x="61500" y="181500" viewBox="0 0 130 70" style="enable-background:new 0 0 130 70;" xml:space="preserve"><style type="text/css">.st0{fill:none;stroke:orange;stroke-width:5;stroke-miterlimit:10;}</style><g><line class="st0" x1="3.5" y1="3.4" x2="3.5" y2="68.3"/><line class="st0" x1="5.9" y1="65.8" x2="19.1" y2="65.8"/><line class="st0" x1="19.1" y1="60.7" x2="39.2" y2="60.7"/><line class="st0" x1="5.9" y1="5.9" x2="19" y2="5.9"/><line class="st0" x1="19" y1="10.9" x2="39.1" y2="10.9"/><line class="st0" x1="39.2" y1="55.8" x2="59.3" y2="55.8"/><line class="st0" x1="39.2" y1="15.9" x2="59.2" y2="15.9"/><line class="st0" x1="59.3" y1="50.8" x2="79.4" y2="50.8"/><line class="st0" x1="59.2" y1="20.8" x2="79.3" y2="20.8"/><line class="st0" x1="79.3" y1="45.8" x2="99.4" y2="45.8"/><line class="st0" x1="79.3" y1="25.8" x2="99.4" y2="25.8"/><line class="st0" x1="99.4" y1="30.8" x2="114.4" y2="30.8"/><line class="st0" x1="99.4" y1="40.8" x2="114.4" y2="40.8"/><line class="st0" x1="114.4" y1="35.8" x2="129.3" y2="35.8"/></g></svg></g>'; svg = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], parts[8], parts[9], parts[10], '</g></svg>')); } function makeAttributes(string memory film) public pure returns (string memory attributes) { attributes = string(abi.encodePacked('{"trait_type":"Film Type","value":"', film, '"}')); } function makeJson(string memory name, string memory description, string memory image, string memory svg, string memory attributes) public pure returns (string memory) { return string(abi.encodePacked('{"name": "', name, '", "description": "', description, '", "image": "', image, '", "svg": "', svg, '", "attributes": [', attributes, ']}')); } function toString(uint256 value) public pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT license // 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); } }
{ "remappings": [], "optimizer": { "enabled": false, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares_","type":"uint256[]"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"inputs":[],"name":"_totalPayees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"}],"name":"addPayee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"getOwed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_archive","type":"address"}],"name":"setArchiveAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052604051620024ac380380620024ac8339818101604052810190620000299190620006d5565b620000496200003d6200019760201b60201c565b6200019f60201b60201c565b805182511462000090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000087906200082e565b60405180910390fd5b6000825111620000d7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000ce9062000850565b60405180910390fd5b60005b82518110156200018e576200017883828151811062000122577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015183838151811062000164577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516200026360201b60201c565b8080620001859062000a16565b915050620000da565b50505062000bce565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415620002d6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002cd906200080c565b60405180910390fd5b600080600090505b60035481101562000444578373ffffffffffffffffffffffffffffffffffffffff16600682815481106200033b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156200042e576001915082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154620003d7919062000967565b620003e391906200090a565b60018190555082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80806200043b9062000a16565b915050620002de565b508062000523576006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600154620004be91906200090a565b60018190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360008154809291906200051d9062000a16565b91905055505b7f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac838360405162000556929190620007df565b60405180910390a1505050565b60006200057a62000574846200089b565b62000872565b905080838252602082019050828560208602820111156200059a57600080fd5b60005b85811015620005ce5781620005b388826200064d565b8452602084019350602083019250506001810190506200059d565b5050509392505050565b6000620005ef620005e984620008ca565b62000872565b905080838252602082019050828560208602820111156200060f57600080fd5b60005b85811015620006435781620006288882620006be565b84526020840193506020830192505060018101905062000612565b5050509392505050565b6000815190506200065e8162000b9a565b92915050565b600082601f8301126200067657600080fd5b81516200068884826020860162000563565b91505092915050565b600082601f830112620006a357600080fd5b8151620006b5848260208601620005d8565b91505092915050565b600081519050620006cf8162000bb4565b92915050565b60008060408385031215620006e957600080fd5b600083015167ffffffffffffffff8111156200070457600080fd5b620007128582860162000664565b925050602083015167ffffffffffffffff8111156200073057600080fd5b6200073e8582860162000691565b9150509250929050565b6200075381620009a2565b82525050565b600062000768602c83620008f9565b9150620007758262000ad3565b604082019050919050565b60006200078f603283620008f9565b91506200079c8262000b22565b604082019050919050565b6000620007b6601a83620008f9565b9150620007c38262000b71565b602082019050919050565b620007d981620009d6565b82525050565b6000604082019050620007f6600083018562000748565b620008056020830184620007ce565b9392505050565b60006020820190508181036000830152620008278162000759565b9050919050565b60006020820190508181036000830152620008498162000780565b9050919050565b600060208201905081810360008301526200086b81620007a7565b9050919050565b60006200087e62000891565b90506200088c8282620009e0565b919050565b6000604051905090565b600067ffffffffffffffff821115620008b957620008b862000a93565b5b602082029050602081019050919050565b600067ffffffffffffffff821115620008e857620008e762000a93565b5b602082029050602081019050919050565b600082825260208201905092915050565b60006200091782620009d6565b91506200092483620009d6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156200095c576200095b62000a64565b5b828201905092915050565b60006200097482620009d6565b91506200098183620009d6565b92508282101562000997576200099662000a64565b5b828203905092915050565b6000620009af82620009b6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620009eb8262000ac2565b810181811067ffffffffffffffff8211171562000a0d5762000a0c62000a93565b5b80604052505050565b600062000a2382620009d6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141562000a595762000a5862000a64565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f5061796d656e7453706c69747465723a206163636f756e74206973207468652060008201527f7a65726f20616464726573730000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a2070617965657320616e64207368617260008201527f6573206c656e677468206d69736d617463680000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206e6f20706179656573000000000000600082015250565b62000ba581620009a2565b811462000bb157600080fd5b50565b62000bbf81620009d6565b811462000bcb57600080fd5b50565b6118ce8062000bde6000396000f3fe6080604052600436106100e15760003560e01c80638b83209b1161007f578063b2def3cb11610059578063b2def3cb146102e5578063ce7c2ac21461030e578063e33b7de31461034b578063f2fde38b1461037657610128565b80638b83209b146102405780638da5cb5b1461027d5780639852595c146102a857610128565b806370c0b647116100bb57806370c0b647146101aa578063715018a6146101e757806382057875146101fe57806386d1a69f1461022957610128565b806318f9b0231461012d57806319165587146101565780633a98ef391461017f57610128565b36610128577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061010f61039f565b3460405161011e929190611287565b60405180910390a1005b600080fd5b34801561013957600080fd5b50610154600480360381019061014f9190611038565b6103a7565b005b34801561016257600080fd5b5061017d6004803603810190610178919061100f565b61049f565b005b34801561018b57600080fd5b50610194610707565b6040516101a191906113b0565b60405180910390f35b3480156101b657600080fd5b506101d160048036038101906101cc919061100f565b610711565b6040516101de91906113b0565b60405180910390f35b3480156101f357600080fd5b506101fc61076a565b005b34801561020a57600080fd5b506102136107f2565b60405161022091906113b0565b60405180910390f35b34801561023557600080fd5b5061023e6107f8565b005b34801561024c57600080fd5b506102676004803603810190610262919061109d565b610803565b6040516102749190611243565b60405180910390f35b34801561028957600080fd5b50610292610871565b60405161029f9190611243565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190610fe6565b61089a565b6040516102dc91906113b0565b60405180910390f35b3480156102f157600080fd5b5061030c60048036038101906103079190610fe6565b6108e3565b005b34801561031a57600080fd5b5061033560048036038101906103309190610fe6565b6109a3565b60405161034291906113b0565b60405180910390f35b34801561035757600080fd5b506103606109ec565b60405161036d91906113b0565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190610fe6565b6109f6565b005b600033905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324851914336040518263ffffffff1660e01b81526004016104029190611243565b60206040518083038186803b15801561041a57600080fd5b505afa15801561042e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104529190611074565b610491576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610488906112f0565b60405180910390fd5b61049b8282610aee565b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610521576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051890611310565b60405180910390fd5b60006002544761053191906113e7565b90506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846105c3919061146e565b6105cd919061143d565b6105d791906114c8565b9050600081141561061d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061490611370565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461066891906113e7565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806002546106b991906113e7565b6002819055506106c98382610dda565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b05683826040516106fa92919061125e565b60405180910390a1505050565b6000600154905090565b60008061071c6109ec565b4761072791906113e7565b90506107328361089a565b61073a610707565b610743856109a3565b8361074e919061146e565b610758919061143d565b61076291906114c8565b915050919050565b61077261039f565b73ffffffffffffffffffffffffffffffffffffffff16610790610871565b73ffffffffffffffffffffffffffffffffffffffff16146107e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dd90611390565b60405180910390fd5b6107f06000610ece565b565b60035481565b6108013361049f565b565b60006006828154811061083f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108eb61039f565b73ffffffffffffffffffffffffffffffffffffffff16610909610871565b73ffffffffffffffffffffffffffffffffffffffff161461095f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095690611390565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b6109fe61039f565b73ffffffffffffffffffffffffffffffffffffffff16610a1c610871565b73ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990611390565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad9906112d0565b60405180910390fd5b610aeb81610ece565b50565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b55906112b0565b60405180910390fd5b600080600090505b600354811015610cc2578373ffffffffffffffffffffffffffffffffffffffff1660068281548110610bc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610caf576001915082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154610c5a91906114c8565b610c6491906113e7565b60018190555082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8080610cba9061158c565b915050610b66565b5080610d9c576006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600154610d3991906113e7565b60018190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060036000815480929190610d969061158c565b91905055505b7f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac8383604051610dcd929190611287565b60405180910390a1505050565b80471015610e1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1490611350565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1682604051610e439061122e565b60006040518083038185875af1925050503d8060008114610e80576040519150601f19603f3d011682016040523d82523d6000602084013e610e85565b606091505b5050905080610ec9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec090611330565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050610fa18161183c565b92915050565b600081359050610fb681611853565b92915050565b600081519050610fcb8161186a565b92915050565b600081359050610fe081611881565b92915050565b600060208284031215610ff857600080fd5b600061100684828501610f92565b91505092915050565b60006020828403121561102157600080fd5b600061102f84828501610fa7565b91505092915050565b6000806040838503121561104b57600080fd5b600061105985828601610f92565b925050602061106a85828601610fd1565b9150509250929050565b60006020828403121561108657600080fd5b600061109484828501610fbc565b91505092915050565b6000602082840312156110af57600080fd5b60006110bd84828501610fd1565b91505092915050565b6110cf81611556565b82525050565b6110de816114fc565b82525050565b60006110f1602c836113d6565b91506110fc82611633565b604082019050919050565b60006111146026836113d6565b915061111f82611682565b604082019050919050565b6000611137600a836113d6565b9150611142826116d1565b602082019050919050565b600061115a6026836113d6565b9150611165826116fa565b604082019050919050565b600061117d603a836113d6565b915061118882611749565b604082019050919050565b60006111a0601d836113d6565b91506111ab82611798565b602082019050919050565b60006111c3602b836113d6565b91506111ce826117c1565b604082019050919050565b60006111e66020836113d6565b91506111f182611810565b602082019050919050565b60006112096000836113cb565b915061121482611839565b600082019050919050565b6112288161154c565b82525050565b6000611239826111fc565b9150819050919050565b600060208201905061125860008301846110d5565b92915050565b600060408201905061127360008301856110c6565b611280602083018461121f565b9392505050565b600060408201905061129c60008301856110d5565b6112a9602083018461121f565b9392505050565b600060208201905081810360008301526112c9816110e4565b9050919050565b600060208201905081810360008301526112e981611107565b9050919050565b600060208201905081810360008301526113098161112a565b9050919050565b600060208201905081810360008301526113298161114d565b9050919050565b6000602082019050818103600083015261134981611170565b9050919050565b6000602082019050818103600083015261136981611193565b9050919050565b60006020820190508181036000830152611389816111b6565b9050919050565b600060208201905081810360008301526113a9816111d9565b9050919050565b60006020820190506113c5600083018461121f565b92915050565b600081905092915050565b600082825260208201905092915050565b60006113f28261154c565b91506113fd8361154c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611432576114316115d5565b5b828201905092915050565b60006114488261154c565b91506114538361154c565b92508261146357611462611604565b5b828204905092915050565b60006114798261154c565b91506114848361154c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114bd576114bc6115d5565b5b828202905092915050565b60006114d38261154c565b91506114de8361154c565b9250828210156114f1576114f06115d5565b5b828203905092915050565b60006115078261152c565b9050919050565b60006115198261152c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061156182611568565b9050919050565b60006115738261157a565b9050919050565b60006115858261152c565b9050919050565b60006115978261154c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156115ca576115c96115d5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f5061796d656e7453706c69747465723a206163636f756e74206973207468652060008201527f7a65726f20616464726573730000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265737472696374656400000000000000000000000000000000000000000000600082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060008201527f7368617265730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060008201527f647565207061796d656e74000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b50565b611845816114fc565b811461185057600080fd5b50565b61185c8161150e565b811461186757600080fd5b50565b61187381611520565b811461187e57600080fd5b50565b61188a8161154c565b811461189557600080fd5b5056fea26469706673582212204f0965e4233584cf19d97fd3aa34a13b226ebc4dbff428845c14e94e3635062264736f6c63430008040033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000796e910bd0228ddf4cd79e3f353871a61c351c000000000000000000000000086483912181d617292c646a3df45b90e99c903e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002bc0000000000000000000000000000000000000000000000000000000000002454
Deployed Bytecode
0x6080604052600436106100e15760003560e01c80638b83209b1161007f578063b2def3cb11610059578063b2def3cb146102e5578063ce7c2ac21461030e578063e33b7de31461034b578063f2fde38b1461037657610128565b80638b83209b146102405780638da5cb5b1461027d5780639852595c146102a857610128565b806370c0b647116100bb57806370c0b647146101aa578063715018a6146101e757806382057875146101fe57806386d1a69f1461022957610128565b806318f9b0231461012d57806319165587146101565780633a98ef391461017f57610128565b36610128577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061010f61039f565b3460405161011e929190611287565b60405180910390a1005b600080fd5b34801561013957600080fd5b50610154600480360381019061014f9190611038565b6103a7565b005b34801561016257600080fd5b5061017d6004803603810190610178919061100f565b61049f565b005b34801561018b57600080fd5b50610194610707565b6040516101a191906113b0565b60405180910390f35b3480156101b657600080fd5b506101d160048036038101906101cc919061100f565b610711565b6040516101de91906113b0565b60405180910390f35b3480156101f357600080fd5b506101fc61076a565b005b34801561020a57600080fd5b506102136107f2565b60405161022091906113b0565b60405180910390f35b34801561023557600080fd5b5061023e6107f8565b005b34801561024c57600080fd5b506102676004803603810190610262919061109d565b610803565b6040516102749190611243565b60405180910390f35b34801561028957600080fd5b50610292610871565b60405161029f9190611243565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190610fe6565b61089a565b6040516102dc91906113b0565b60405180910390f35b3480156102f157600080fd5b5061030c60048036038101906103079190610fe6565b6108e3565b005b34801561031a57600080fd5b5061033560048036038101906103309190610fe6565b6109a3565b60405161034291906113b0565b60405180910390f35b34801561035757600080fd5b506103606109ec565b60405161036d91906113b0565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190610fe6565b6109f6565b005b600033905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324851914336040518263ffffffff1660e01b81526004016104029190611243565b60206040518083038186803b15801561041a57600080fd5b505afa15801561042e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104529190611074565b610491576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610488906112f0565b60405180910390fd5b61049b8282610aee565b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610521576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051890611310565b60405180910390fd5b60006002544761053191906113e7565b90506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846105c3919061146e565b6105cd919061143d565b6105d791906114c8565b9050600081141561061d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061490611370565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461066891906113e7565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806002546106b991906113e7565b6002819055506106c98382610dda565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b05683826040516106fa92919061125e565b60405180910390a1505050565b6000600154905090565b60008061071c6109ec565b4761072791906113e7565b90506107328361089a565b61073a610707565b610743856109a3565b8361074e919061146e565b610758919061143d565b61076291906114c8565b915050919050565b61077261039f565b73ffffffffffffffffffffffffffffffffffffffff16610790610871565b73ffffffffffffffffffffffffffffffffffffffff16146107e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dd90611390565b60405180910390fd5b6107f06000610ece565b565b60035481565b6108013361049f565b565b60006006828154811061083f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108eb61039f565b73ffffffffffffffffffffffffffffffffffffffff16610909610871565b73ffffffffffffffffffffffffffffffffffffffff161461095f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095690611390565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b6109fe61039f565b73ffffffffffffffffffffffffffffffffffffffff16610a1c610871565b73ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990611390565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad9906112d0565b60405180910390fd5b610aeb81610ece565b50565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b55906112b0565b60405180910390fd5b600080600090505b600354811015610cc2578373ffffffffffffffffffffffffffffffffffffffff1660068281548110610bc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610caf576001915082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154610c5a91906114c8565b610c6491906113e7565b60018190555082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8080610cba9061158c565b915050610b66565b5080610d9c576006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600154610d3991906113e7565b60018190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060036000815480929190610d969061158c565b91905055505b7f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac8383604051610dcd929190611287565b60405180910390a1505050565b80471015610e1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1490611350565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1682604051610e439061122e565b60006040518083038185875af1925050503d8060008114610e80576040519150601f19603f3d011682016040523d82523d6000602084013e610e85565b606091505b5050905080610ec9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec090611330565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050610fa18161183c565b92915050565b600081359050610fb681611853565b92915050565b600081519050610fcb8161186a565b92915050565b600081359050610fe081611881565b92915050565b600060208284031215610ff857600080fd5b600061100684828501610f92565b91505092915050565b60006020828403121561102157600080fd5b600061102f84828501610fa7565b91505092915050565b6000806040838503121561104b57600080fd5b600061105985828601610f92565b925050602061106a85828601610fd1565b9150509250929050565b60006020828403121561108657600080fd5b600061109484828501610fbc565b91505092915050565b6000602082840312156110af57600080fd5b60006110bd84828501610fd1565b91505092915050565b6110cf81611556565b82525050565b6110de816114fc565b82525050565b60006110f1602c836113d6565b91506110fc82611633565b604082019050919050565b60006111146026836113d6565b915061111f82611682565b604082019050919050565b6000611137600a836113d6565b9150611142826116d1565b602082019050919050565b600061115a6026836113d6565b9150611165826116fa565b604082019050919050565b600061117d603a836113d6565b915061118882611749565b604082019050919050565b60006111a0601d836113d6565b91506111ab82611798565b602082019050919050565b60006111c3602b836113d6565b91506111ce826117c1565b604082019050919050565b60006111e66020836113d6565b91506111f182611810565b602082019050919050565b60006112096000836113cb565b915061121482611839565b600082019050919050565b6112288161154c565b82525050565b6000611239826111fc565b9150819050919050565b600060208201905061125860008301846110d5565b92915050565b600060408201905061127360008301856110c6565b611280602083018461121f565b9392505050565b600060408201905061129c60008301856110d5565b6112a9602083018461121f565b9392505050565b600060208201905081810360008301526112c9816110e4565b9050919050565b600060208201905081810360008301526112e981611107565b9050919050565b600060208201905081810360008301526113098161112a565b9050919050565b600060208201905081810360008301526113298161114d565b9050919050565b6000602082019050818103600083015261134981611170565b9050919050565b6000602082019050818103600083015261136981611193565b9050919050565b60006020820190508181036000830152611389816111b6565b9050919050565b600060208201905081810360008301526113a9816111d9565b9050919050565b60006020820190506113c5600083018461121f565b92915050565b600081905092915050565b600082825260208201905092915050565b60006113f28261154c565b91506113fd8361154c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611432576114316115d5565b5b828201905092915050565b60006114488261154c565b91506114538361154c565b92508261146357611462611604565b5b828204905092915050565b60006114798261154c565b91506114848361154c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114bd576114bc6115d5565b5b828202905092915050565b60006114d38261154c565b91506114de8361154c565b9250828210156114f1576114f06115d5565b5b828203905092915050565b60006115078261152c565b9050919050565b60006115198261152c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061156182611568565b9050919050565b60006115738261157a565b9050919050565b60006115858261152c565b9050919050565b60006115978261154c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156115ca576115c96115d5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f5061796d656e7453706c69747465723a206163636f756e74206973207468652060008201527f7a65726f20616464726573730000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265737472696374656400000000000000000000000000000000000000000000600082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060008201527f7368617265730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060008201527f647565207061796d656e74000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b50565b611845816114fc565b811461185057600080fd5b50565b61185c8161150e565b811461186757600080fd5b50565b61187381611520565b811461187e57600080fd5b50565b61188a8161154c565b811461189557600080fd5b5056fea26469706673582212204f0965e4233584cf19d97fd3aa34a13b226ebc4dbff428845c14e94e3635062264736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000796e910bd0228ddf4cd79e3f353871a61c351c000000000000000000000000086483912181d617292c646a3df45b90e99c903e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002bc0000000000000000000000000000000000000000000000000000000000002454
-----Decoded View---------------
Arg [0] : payees (address[]): 0x00796e910Bd0228ddF4cd79e3f353871a61C351C,0x086483912181D617292C646A3dF45b90e99C903E
Arg [1] : shares_ (uint256[]): 700,9300
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 00000000000000000000000000796e910bd0228ddf4cd79e3f353871a61c351c
Arg [4] : 000000000000000000000000086483912181d617292c646a3df45b90e99c903e
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 00000000000000000000000000000000000000000000000000000000000002bc
Arg [7] : 0000000000000000000000000000000000000000000000000000000000002454
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $2,023.74 | 0.21 | $424.99 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.