Overview
APE Balance
222 APE
APE Value
$225.91 (@ $1.02/APE)More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 66 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x45977d03 | 8468203 | 2 days ago | IN | 222 APE | 0.00250861 | ||||
Release All | 8338695 | 3 days ago | IN | 0 APE | 0.00304888 | ||||
0x45977d03 | 8290198 | 4 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 8280101 | 5 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 8278742 | 5 days ago | IN | 222 APE | 0.00250861 | ||||
Release All | 8233069 | 5 days ago | IN | 0 APE | 0.00304888 | ||||
0x45977d03 | 8198222 | 6 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 8133289 | 7 days ago | IN | 222 APE | 0.00250858 | ||||
Release All | 8114325 | 8 days ago | IN | 0 APE | 0.00304888 | ||||
0x45977d03 | 8082021 | 8 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 8060730 | 8 days ago | IN | 222 APE | 0.00250858 | ||||
0x45977d03 | 8008139 | 9 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 7938525 | 10 days ago | IN | 222 APE | 0.00263063 | ||||
0x45977d03 | 7928336 | 10 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 7920853 | 10 days ago | IN | 222 APE | 0.00263063 | ||||
Release All | 7909594 | 11 days ago | IN | 0 APE | 0.00304888 | ||||
0x45977d03 | 7907812 | 11 days ago | IN | 222 APE | 0.0026306 | ||||
0x45977d03 | 7903954 | 11 days ago | IN | 222 APE | 0.00250858 | ||||
0x45977d03 | 7903120 | 11 days ago | IN | 222 APE | 0.0026306 | ||||
0x45977d03 | 7903114 | 11 days ago | IN | 222 APE | 0.00250861 | ||||
0x45977d03 | 7880511 | 11 days ago | IN | 222 APE | 0.0026303 | ||||
0x45977d03 | 7880487 | 11 days ago | IN | 222 APE | 0.00196992 | ||||
0x45977d03 | 7874800 | 11 days ago | IN | 222 APE | 0.00263063 | ||||
0x45977d03 | 7858985 | 11 days ago | IN | 222 APE | 0.00263063 | ||||
0x45977d03 | 7851365 | 11 days ago | IN | 222 APE | 0.00263063 |
Latest 24 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
8338695 | 3 days ago | 333 APE | ||||
8338695 | 3 days ago | 99.9 APE | ||||
8338695 | 3 days ago | 133.2 APE | ||||
8338695 | 3 days ago | 99.9 APE | ||||
8233069 | 5 days ago | 222 APE | ||||
8233069 | 5 days ago | 66.6 APE | ||||
8233069 | 5 days ago | 88.8 APE | ||||
8233069 | 5 days ago | 66.6 APE | ||||
8114325 | 8 days ago | 666 APE | ||||
8114325 | 8 days ago | 199.8 APE | ||||
8114325 | 8 days ago | 266.4 APE | ||||
8114325 | 8 days ago | 199.8 APE | ||||
7909594 | 11 days ago | 1,221 APE | ||||
7909594 | 11 days ago | 366.3 APE | ||||
7909594 | 11 days ago | 488.4 APE | ||||
7909594 | 11 days ago | 366.3 APE | ||||
7724198 | 13 days ago | 1,887 APE | ||||
7724198 | 13 days ago | 566.1 APE | ||||
7724198 | 13 days ago | 754.8 APE | ||||
7724198 | 13 days ago | 566.1 APE | ||||
7459007 | 18 days ago | 1,776 APE | ||||
7459007 | 18 days ago | 532.8 APE | ||||
7459007 | 18 days ago | 710.4 APE | ||||
7459007 | 18 days ago | 532.8 APE |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
OogiesRelicUpgrader
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/** *Submitted for verification at apescan.io on 2024-12-30 */ // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); } // File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } // File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } } // File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } } // File: @openzeppelin/contracts/finance/PaymentSplitter.sol // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @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 amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @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 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } } // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); } // File: @openzeppelin/contracts/token/ERC1155/IERC1155.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; /** * @dev Required interface of an ERC-1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[ERC]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the value of tokens of token type `id` owned by `account`. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; } // File: @openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.20; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[ERC]. */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); } // File: @openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC-1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC-1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } // File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); } // File: @openzeppelin/contracts/token/ERC1155/utils/ERC1155Utils.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/utils/ERC1155Utils.sol) pragma solidity ^0.8.20; /** * @dev Library that provide common ERC-1155 utility functions. * * See https://eips.ethereum.org/EIPS/eip-1155[ERC-1155]. * * _Available since v5.1._ */ library ERC1155Utils { /** * @dev Performs an acceptance check for the provided `operator` by calling {IERC1155-onERC1155Received} * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`). * * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA). * Otherwise, the recipient must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value to accept * the transfer. */ function checkOnERC1155Received( address operator, address from, address to, uint256 id, uint256 value, bytes memory data ) internal { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { // Tokens rejected revert IERC1155Errors.ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-IERC1155Receiver implementer revert IERC1155Errors.ERC1155InvalidReceiver(to); } else { assembly ("memory-safe") { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Performs a batch acceptance check for the provided `operator` by calling {IERC1155-onERC1155BatchReceived} * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`). * * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA). * Otherwise, the recipient must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value to accept * the transfer. */ function checkOnERC1155BatchReceived( address operator, address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { // Tokens rejected revert IERC1155Errors.ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-IERC1155Receiver implementer revert IERC1155Errors.ERC1155InvalidReceiver(to); } else { assembly ("memory-safe") { revert(add(32, reason), mload(reason)) } } } } } } // File: @openzeppelin/contracts/utils/introspection/ERC165.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: @openzeppelin/contracts/utils/Comparators.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/Comparators.sol) pragma solidity ^0.8.20; /** * @dev Provides a set of functions to compare values. * * _Available since v5.1._ */ library Comparators { function lt(uint256 a, uint256 b) internal pure returns (bool) { return a < b; } function gt(uint256 a, uint256 b) internal pure returns (bool) { return a > b; } } // File: @openzeppelin/contracts/utils/SlotDerivation.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/SlotDerivation.sol) // This file was procedurally generated from scripts/generate/templates/SlotDerivation.js. pragma solidity ^0.8.20; /** * @dev Library for computing storage (and transient storage) locations from namespaces and deriving slots * corresponding to standard patterns. The derivation method for array and mapping matches the storage layout used by * the solidity language / compiler. * * See https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays[Solidity docs for mappings and dynamic arrays.]. * * Example usage: * ```solidity * contract Example { * // Add the library methods * using StorageSlot for bytes32; * using SlotDerivation for bytes32; * * // Declare a namespace * string private constant _NAMESPACE = "<namespace>" // eg. OpenZeppelin.Slot * * function setValueInNamespace(uint256 key, address newValue) internal { * _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value = newValue; * } * * function getValueInNamespace(uint256 key) internal view returns (address) { * return _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value; * } * } * ``` * * TIP: Consider using this library along with {StorageSlot}. * * NOTE: This library provides a way to manipulate storage locations in a non-standard way. Tooling for checking * upgrade safety will ignore the slots accessed through this library. * * _Available since v5.1._ */ library SlotDerivation { /** * @dev Derive an ERC-7201 slot from a string (namespace). */ function erc7201Slot(string memory namespace) internal pure returns (bytes32 slot) { assembly ("memory-safe") { mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1)) slot := and(keccak256(0x00, 0x20), not(0xff)) } } /** * @dev Add an offset to a slot to get the n-th element of a structure or an array. */ function offset(bytes32 slot, uint256 pos) internal pure returns (bytes32 result) { unchecked { return bytes32(uint256(slot) + pos); } } /** * @dev Derive the location of the first element in an array from the slot where the length is stored. */ function deriveArray(bytes32 slot) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, slot) result := keccak256(0x00, 0x20) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, address key) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, and(key, shr(96, not(0)))) mstore(0x20, slot) result := keccak256(0x00, 0x40) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, bool key) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, iszero(iszero(key))) mstore(0x20, slot) result := keccak256(0x00, 0x40) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, bytes32 key) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, key) mstore(0x20, slot) result := keccak256(0x00, 0x40) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, uint256 key) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, key) mstore(0x20, slot) result := keccak256(0x00, 0x40) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, int256 key) internal pure returns (bytes32 result) { assembly ("memory-safe") { mstore(0x00, key) mstore(0x20, slot) result := keccak256(0x00, 0x40) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, string memory key) internal pure returns (bytes32 result) { assembly ("memory-safe") { let length := mload(key) let begin := add(key, 0x20) let end := add(begin, length) let cache := mload(end) mstore(end, slot) result := keccak256(begin, add(length, 0x20)) mstore(end, cache) } } /** * @dev Derive the location of a mapping element from the key. */ function deriveMapping(bytes32 slot, bytes memory key) internal pure returns (bytes32 result) { assembly ("memory-safe") { let length := mload(key) let begin := add(key, 0x20) let end := add(begin, length) let cache := mload(end) mstore(end, slot) result := keccak256(begin, add(length, 0x20)) mstore(end, cache) } } } // File: @openzeppelin/contracts/utils/StorageSlot.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC-1967 implementation slot: * ```solidity * contract ERC1967 { * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot. * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * TIP: Consider using this library along with {SlotDerivation}. */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct Int256Slot { int256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Int256Slot` with member `value` located at `slot`. */ function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } /** * @dev Returns a `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // File: @openzeppelin/contracts/utils/Arrays.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/Arrays.sol) // This file was procedurally generated from scripts/generate/templates/Arrays.js. pragma solidity ^0.8.20; /** * @dev Collection of functions related to array types. */ library Arrays { using SlotDerivation for bytes32; using StorageSlot for bytes32; /** * @dev Sort an array of uint256 (in memory) following the provided comparator function. * * This function does the sorting "in place", meaning that it overrides the input. The object is returned for * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array. * * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may * consume more gas than is available in a block, leading to potential DoS. * * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way. */ function sort( uint256[] memory array, function(uint256, uint256) pure returns (bool) comp ) internal pure returns (uint256[] memory) { _quickSort(_begin(array), _end(array), comp); return array; } /** * @dev Variant of {sort} that sorts an array of uint256 in increasing order. */ function sort(uint256[] memory array) internal pure returns (uint256[] memory) { sort(array, Comparators.lt); return array; } /** * @dev Sort an array of address (in memory) following the provided comparator function. * * This function does the sorting "in place", meaning that it overrides the input. The object is returned for * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array. * * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may * consume more gas than is available in a block, leading to potential DoS. * * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way. */ function sort( address[] memory array, function(address, address) pure returns (bool) comp ) internal pure returns (address[] memory) { sort(_castToUint256Array(array), _castToUint256Comp(comp)); return array; } /** * @dev Variant of {sort} that sorts an array of address in increasing order. */ function sort(address[] memory array) internal pure returns (address[] memory) { sort(_castToUint256Array(array), Comparators.lt); return array; } /** * @dev Sort an array of bytes32 (in memory) following the provided comparator function. * * This function does the sorting "in place", meaning that it overrides the input. The object is returned for * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array. * * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may * consume more gas than is available in a block, leading to potential DoS. * * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way. */ function sort( bytes32[] memory array, function(bytes32, bytes32) pure returns (bool) comp ) internal pure returns (bytes32[] memory) { sort(_castToUint256Array(array), _castToUint256Comp(comp)); return array; } /** * @dev Variant of {sort} that sorts an array of bytes32 in increasing order. */ function sort(bytes32[] memory array) internal pure returns (bytes32[] memory) { sort(_castToUint256Array(array), Comparators.lt); return array; } /** * @dev Performs a quick sort of a segment of memory. The segment sorted starts at `begin` (inclusive), and stops * at end (exclusive). Sorting follows the `comp` comparator. * * Invariant: `begin <= end`. This is the case when initially called by {sort} and is preserved in subcalls. * * IMPORTANT: Memory locations between `begin` and `end` are not validated/zeroed. This function should * be used only if the limits are within a memory array. */ function _quickSort(uint256 begin, uint256 end, function(uint256, uint256) pure returns (bool) comp) private pure { unchecked { if (end - begin < 0x40) return; // Use first element as pivot uint256 pivot = _mload(begin); // Position where the pivot should be at the end of the loop uint256 pos = begin; for (uint256 it = begin + 0x20; it < end; it += 0x20) { if (comp(_mload(it), pivot)) { // If the value stored at the iterator's position comes before the pivot, we increment the // position of the pivot and move the value there. pos += 0x20; _swap(pos, it); } } _swap(begin, pos); // Swap pivot into place _quickSort(begin, pos, comp); // Sort the left side of the pivot _quickSort(pos + 0x20, end, comp); // Sort the right side of the pivot } } /** * @dev Pointer to the memory location of the first element of `array`. */ function _begin(uint256[] memory array) private pure returns (uint256 ptr) { assembly ("memory-safe") { ptr := add(array, 0x20) } } /** * @dev Pointer to the memory location of the first memory word (32bytes) after `array`. This is the memory word * that comes just after the last element of the array. */ function _end(uint256[] memory array) private pure returns (uint256 ptr) { unchecked { return _begin(array) + array.length * 0x20; } } /** * @dev Load memory word (as a uint256) at location `ptr`. */ function _mload(uint256 ptr) private pure returns (uint256 value) { assembly { value := mload(ptr) } } /** * @dev Swaps the elements memory location `ptr1` and `ptr2`. */ function _swap(uint256 ptr1, uint256 ptr2) private pure { assembly { let value1 := mload(ptr1) let value2 := mload(ptr2) mstore(ptr1, value2) mstore(ptr2, value1) } } /// @dev Helper: low level cast address memory array to uint256 memory array function _castToUint256Array(address[] memory input) private pure returns (uint256[] memory output) { assembly { output := input } } /// @dev Helper: low level cast bytes32 memory array to uint256 memory array function _castToUint256Array(bytes32[] memory input) private pure returns (uint256[] memory output) { assembly { output := input } } /// @dev Helper: low level cast address comp function to uint256 comp function function _castToUint256Comp( function(address, address) pure returns (bool) input ) private pure returns (function(uint256, uint256) pure returns (bool) output) { assembly { output := input } } /// @dev Helper: low level cast bytes32 comp function to uint256 comp function function _castToUint256Comp( function(bytes32, bytes32) pure returns (bool) input ) private pure returns (function(uint256, uint256) pure returns (bool) output) { assembly { output := input } } /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * NOTE: The `array` is expected to be sorted in ascending order, and to * contain no repeated elements. * * IMPORTANT: Deprecated. This implementation behaves as {lowerBound} but lacks * support for repeated elements in the array. The {lowerBound} function should * be used instead. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && unsafeAccess(array, low - 1).value == element) { return low - 1; } else { return low; } } /** * @dev Searches an `array` sorted in ascending order and returns the first * index that contains a value greater or equal than `element`. If no such index * exists (i.e. all values in the array are strictly less than `element`), the array * length is returned. Time complexity O(log n). * * See C++'s https://en.cppreference.com/w/cpp/algorithm/lower_bound[lower_bound]. */ function lowerBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value < element) { // this cannot overflow because mid < high unchecked { low = mid + 1; } } else { high = mid; } } return low; } /** * @dev Searches an `array` sorted in ascending order and returns the first * index that contains a value strictly greater than `element`. If no such index * exists (i.e. all values in the array are strictly less than `element`), the array * length is returned. Time complexity O(log n). * * See C++'s https://en.cppreference.com/w/cpp/algorithm/upper_bound[upper_bound]. */ function upperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { // this cannot overflow because mid < high unchecked { low = mid + 1; } } } return low; } /** * @dev Same as {lowerBound}, but with an array in memory. */ function lowerBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeMemoryAccess(array, mid) < element) { // this cannot overflow because mid < high unchecked { low = mid + 1; } } else { high = mid; } } return low; } /** * @dev Same as {upperBound}, but with an array in memory. */ function upperBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeMemoryAccess(array, mid) > element) { high = mid; } else { // this cannot overflow because mid < high unchecked { low = mid + 1; } } } return low; } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) { bytes32 slot; assembly ("memory-safe") { slot := arr.slot } return slot.deriveArray().offset(pos).getAddressSlot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) { bytes32 slot; assembly ("memory-safe") { slot := arr.slot } return slot.deriveArray().offset(pos).getBytes32Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) { bytes32 slot; assembly ("memory-safe") { slot := arr.slot } return slot.deriveArray().offset(pos).getUint256Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(bytes32[] memory arr, uint256 pos) internal pure returns (bytes32 res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Helper to set the length of an dynamic array. Directly writing to `.length` is forbidden. * * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. */ function unsafeSetLength(address[] storage array, uint256 len) internal { assembly ("memory-safe") { sstore(array.slot, len) } } /** * @dev Helper to set the length of an dynamic array. Directly writing to `.length` is forbidden. * * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. */ function unsafeSetLength(bytes32[] storage array, uint256 len) internal { assembly ("memory-safe") { sstore(array.slot, len) } } /** * @dev Helper to set the length of an dynamic array. Directly writing to `.length` is forbidden. * * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. */ function unsafeSetLength(uint256[] storage array, uint256 len) internal { assembly ("memory-safe") { sstore(array.slot, len) } } } // File: @openzeppelin/contracts/token/ERC1155/ERC1155.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.20; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 */ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors { using Arrays for uint256[]; using Arrays for address[]; mapping(uint256 id => mapping(address account => uint256)) private _balances; mapping(address account => mapping(address operator => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the ERC]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256 /* id */) public view virtual returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address account, uint256 id) public view virtual returns (uint256) { return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual returns (uint256[] memory) { if (accounts.length != ids.length) { revert ERC1155InvalidArrayLength(ids.length, accounts.length); } uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i)); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeTransferFrom(from, to, id, value, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeBatchTransferFrom(from, to, ids, values, data); } /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from` * (or `to`) is the zero address. * * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise. * * Requirements: * * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received} * or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value. * - `ids` and `values` must have the same length. * * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead. */ function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual { if (ids.length != values.length) { revert ERC1155InvalidArrayLength(ids.length, values.length); } address operator = _msgSender(); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids.unsafeMemoryAccess(i); uint256 value = values.unsafeMemoryAccess(i); if (from != address(0)) { uint256 fromBalance = _balances[id][from]; if (fromBalance < value) { revert ERC1155InsufficientBalance(from, fromBalance, value, id); } unchecked { // Overflow not possible: value <= fromBalance _balances[id][from] = fromBalance - value; } } if (to != address(0)) { _balances[id][to] += value; } } if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); emit TransferSingle(operator, from, to, id, value); } else { emit TransferBatch(operator, from, to, ids, values); } } /** * @dev Version of {_update} that performs the token acceptance check by calling * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it * contains code (eg. is a smart contract at the moment of execution). * * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any * update to the contract state after this function would break the check-effect-interaction pattern. Consider * overriding {_update} instead. */ function _updateWithAcceptanceCheck( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal virtual { _update(from, to, ids, values); if (to != address(0)) { address operator = _msgSender(); if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); ERC1155Utils.checkOnERC1155Received(operator, from, to, id, value, data); } else { ERC1155Utils.checkOnERC1155BatchReceived(operator, from, to, ids, values, data); } } } /** * @dev Transfers a `value` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. * - `ids` and `values` must have the same length. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the ERC]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the values in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `values` must have the same length. * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev Destroys a `value` amount of tokens of type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. */ function _burn(address from, uint256 id, uint256 value) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. * - `ids` and `values` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC1155InvalidOperator(address(0)); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Creates an array in memory with only one value for each of the elements provided. */ function _asSingletonArrays( uint256 element1, uint256 element2 ) private pure returns (uint256[] memory array1, uint256[] memory array2) { assembly ("memory-safe") { // Load the free memory pointer array1 := mload(0x40) // Set array length to 1 mstore(array1, 1) // Store the single element at the next word after the length (where content starts) mstore(add(array1, 0x20), element1) // Repeat for next array locating it right after the first array array2 := add(array1, 0x40) mstore(array2, 1) mstore(add(array2, 0x20), element2) // Update the free memory pointer by pointing after the second array mstore(0x40, add(array2, 0x40)) } } } // File: @openzeppelin/contracts/utils/math/SignedMath.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } } // File: @openzeppelin/contracts/interfaces/IERC2981.sol // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. * * NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the * royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); } // File: @openzeppelin/contracts/token/common/ERC2981.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) public view virtual returns (address receiver, uint256 amount) { RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId]; address royaltyReceiver = _royaltyInfo.receiver; uint96 royaltyFraction = _royaltyInfo.royaltyFraction; if (royaltyReceiver == address(0)) { royaltyReceiver = _defaultRoyaltyInfo.receiver; royaltyFraction = _defaultRoyaltyInfo.royaltyFraction; } uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator(); return (royaltyReceiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } } // File: @limitbreak/creator-token-contracts/contracts/programmable-royalties/BasicRoyalties.sol pragma solidity ^0.8.4; /** * @title BasicRoyaltiesBase * @author Limit Break, Inc. * @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties. */ abstract contract BasicRoyaltiesBase is ERC2981 { event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator); event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator); function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override { super._setDefaultRoyalty(receiver, feeNumerator); emit DefaultRoyaltySet(receiver, feeNumerator); } function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override { super._setTokenRoyalty(tokenId, receiver, feeNumerator); emit TokenRoyaltySet(tokenId, receiver, feeNumerator); } } /** * @title BasicRoyalties * @author Limit Break, Inc. * @notice Constructable BasicRoyalties Contract implementation. */ abstract contract BasicRoyalties is BasicRoyaltiesBase { constructor(address receiver, uint96 feeNumerator) { _setDefaultRoyalty(receiver, feeNumerator); } } /** * @title BasicRoyaltiesInitializable * @author Limit Break, Inc. * @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones. */ abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {} // File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) 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 generally not needed starting with Solidity 0.8, since 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 subtraction 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; } } } // File: contracts/ImmediateRoyaltySplitter.sol pragma solidity ^0.8.0; /** * @title ImmediateRoyaltySplitter * @dev Contract for instantly splitting received payments between multiple addresses */ abstract contract ImmediateRoyaltySplitter is ReentrancyGuard { using SafeMath for uint256; // Events event PaymentReceived(address from, uint256 amount); event PaymentSplit(address to, uint256 amount); event RoyaltySharesUpdated( address[] royaltyReceivers, uint256[] royaltyShares ); // Constants uint256 public constant TOTAL_ROYALTY_SHARES = 10000; // 100% = 10000 (0.01% precision) // State variables address[] public royaltyReceivers; uint256[] public royaltyShares; /** * @dev Internal function to update royaltyShares with validations */ function _updateRoyaltyShares( address[] memory _receivers, uint256[] memory _shares ) internal { require(_receivers.length == _shares.length, "Arrays length mismatch"); require(_receivers.length > 0, "No royaltyReceivers provided"); uint256 _totalShares; for (uint256 i = 0; i < _receivers.length; i++) { require(_receivers[i] != address(0), "Invalid receiver address"); require(_shares[i] > 0, "Share must be greater than 0"); _totalShares = _totalShares.add(_shares[i]); } require( _totalShares == TOTAL_ROYALTY_SHARES, "Total royaltyShares must be 10000" ); royaltyReceivers = _receivers; royaltyShares = _shares; emit RoyaltySharesUpdated(_receivers, _shares); } /** * @dev Private function to set the royalty shares only if they are not set yet */ function _initializeRoyaltyShares( address[] memory _receivers, uint256[] memory _shares ) internal { require(royaltyReceivers.length == 0, "Royalty shares already set"); _updateRoyaltyShares(_receivers, _shares); } /** * @dev Fallback function to receive and immediately split payments */ receive() external payable nonReentrant { require(msg.value > 0, "No payment received"); emit PaymentReceived(msg.sender, msg.value); uint256 remaining = msg.value; uint256 share; uint256 amount; // Process all royaltyReceivers except the last one for (uint256 i = 0; i < royaltyReceivers.length - 1; i++) { share = royaltyShares[i]; // Calculate payment amount using the share percentage amount = msg.value.mul(share).div(TOTAL_ROYALTY_SHARES); remaining = remaining.sub(amount); (bool success, ) = royaltyReceivers[i].call{value: amount}(""); require(success, "Transfer failed"); emit PaymentSplit(royaltyReceivers[i], amount); } // Send remaining amount to last receiver to handle rounding dust if (remaining > 0 && royaltyReceivers.length > 0) { (bool success, ) = royaltyReceivers[royaltyReceivers.length - 1] .call{value: remaining}(""); require(success, "Transfer failed"); emit PaymentSplit( royaltyReceivers[royaltyReceivers.length - 1], remaining ); } } /** * @dev Returns the current royaltyReceivers and their royaltyShares */ function getRoyaltyShares() external view returns (address[] memory, uint256[] memory) { return (royaltyReceivers, royaltyShares); } /** * @dev Allows a royalty receiver to update their wallet address * @param newAddress The new address to update to */ function updateReceiverAddress(address newAddress) external nonReentrant { require(newAddress != address(0), "New address is invalid"); bool updated = false; for (uint256 i = 0; i < royaltyReceivers.length; i++) { if (royaltyReceivers[i] == msg.sender) { royaltyReceivers[i] = newAddress; updated = true; break; } } require(updated, "Receiver address not found"); } } // File: access/OwnablePermissions.sol pragma solidity ^0.8.4; abstract contract OwnablePermissions is Context { function _requireCallerIsContractOwner() internal view virtual; } // File: interfaces/IEOARegistry.sol pragma solidity ^0.8.4; interface IEOARegistry is IERC165 { function isVerifiedEOA(address account) external view returns (bool); } // File: utils/TransferPolicy.sol pragma solidity ^0.8.4; enum AllowlistTypes { Operators, PermittedContractReceivers } enum ReceiverConstraints { None, NoCode, EOA } enum CallerConstraints { None, OperatorWhitelistEnableOTC, OperatorWhitelistDisableOTC } enum StakerConstraints { None, CallerIsTxOrigin, EOA } enum TransferSecurityLevels { Zero, One, Two, Three, Four, Five, Six } struct TransferSecurityPolicy { CallerConstraints callerConstraints; ReceiverConstraints receiverConstraints; } struct CollectionSecurityPolicy { TransferSecurityLevels transferSecurityLevel; uint120 operatorWhitelistId; uint120 permittedContractReceiversId; } // File: interfaces/ITransferSecurityRegistry.sol pragma solidity ^0.8.4; interface ITransferSecurityRegistry { event AddedToAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account); event CreatedAllowlist(AllowlistTypes indexed kind, uint256 indexed id, string indexed name); event ReassignedAllowlistOwnership(AllowlistTypes indexed kind, uint256 indexed id, address indexed newOwner); event RemovedFromAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account); event SetAllowlist(AllowlistTypes indexed kind, address indexed collection, uint120 indexed id); event SetTransferSecurityLevel(address indexed collection, TransferSecurityLevels level); function createOperatorWhitelist(string calldata name) external returns (uint120); function createPermittedContractReceiverAllowlist(string calldata name) external returns (uint120); function reassignOwnershipOfOperatorWhitelist(uint120 id, address newOwner) external; function reassignOwnershipOfPermittedContractReceiverAllowlist(uint120 id, address newOwner) external; function renounceOwnershipOfOperatorWhitelist(uint120 id) external; function renounceOwnershipOfPermittedContractReceiverAllowlist(uint120 id) external; function setTransferSecurityLevelOfCollection(address collection, TransferSecurityLevels level) external; function setOperatorWhitelistOfCollection(address collection, uint120 id) external; function setPermittedContractReceiverAllowlistOfCollection(address collection, uint120 id) external; function addOperatorToWhitelist(uint120 id, address operator) external; function addPermittedContractReceiverToAllowlist(uint120 id, address receiver) external; function removeOperatorFromWhitelist(uint120 id, address operator) external; function removePermittedContractReceiverFromAllowlist(uint120 id, address receiver) external; function getCollectionSecurityPolicy(address collection) external view returns (CollectionSecurityPolicy memory); function getWhitelistedOperators(uint120 id) external view returns (address[] memory); function getPermittedContractReceivers(uint120 id) external view returns (address[] memory); function isOperatorWhitelisted(uint120 id, address operator) external view returns (bool); function isContractReceiverPermitted(uint120 id, address receiver) external view returns (bool); } // File: interfaces/ITransferValidator.sol pragma solidity ^0.8.4; interface ITransferValidator { function applyCollectionTransferPolicy(address caller, address from, address to) external view; } // File: interfaces/ICreatorTokenTransferValidator.sol pragma solidity ^0.8.4; interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {} // File: interfaces/ICreatorToken.sol pragma solidity ^0.8.4; interface ICreatorToken { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (ICreatorTokenTransferValidator); function getSecurityPolicy() external view returns (CollectionSecurityPolicy memory); function getWhitelistedOperators() external view returns (address[] memory); function getPermittedContractReceivers() external view returns (address[] memory); function isOperatorWhitelisted(address operator) external view returns (bool); function isContractReceiverPermitted(address receiver) external view returns (bool); function isTransferAllowed(address caller, address from, address to) external view returns (bool); } // File: utils/TransferValidation.sol pragma solidity ^0.8.4; /** * @title TransferValidation * @author Limit Break, Inc. * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks. * Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows * developers to validate or customize transfers within the context of a mint, a burn, or a transfer. */ abstract contract TransferValidation is Context { error ShouldNotMintToBurnAddress(); /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} } // File: @openzeppelin/contracts/interfaces/IERC165.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; // File: contracts/CreatorTokenBase.sol pragma solidity ^0.8.4; /** * @title CreatorTokenBase * @author Limit Break, Inc. * @notice CreatorTokenBase is an abstract contract that provides basic functionality for managing token * transfer policies through an implementation of ICreatorTokenTransferValidator. This contract is intended to be used * as a base for creator-specific token contracts, enabling customizable transfer restrictions and security policies. * * <h4>Features:</h4> * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul> * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul> * <ul>ICreatorToken: Implements the interface for creator tokens, providing view functions for token security policies.</ul> * * <h4>Benefits:</h4> * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul> * <ul>Allows creators to enforce policies such as whitelisted operators and permitted contract receivers.</ul> * <ul>Can be easily integrated into other token contracts as a base contract.</ul> * * <h4>Intended Usage:</h4> * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and * security policies.</ul> * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the * creator token.</ul> */ abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken { error CreatorTokenBase__InvalidTransferValidatorContract(); error CreatorTokenBase__SetTransferValidatorFirst(); address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x0000721C310194CcfC01E523fc93C9cCcFa2A0Ac); TransferSecurityLevels public constant DEFAULT_TRANSFER_SECURITY_LEVEL = TransferSecurityLevels.One; uint120 public constant DEFAULT_OPERATOR_WHITELIST_ID = uint120(1); ICreatorTokenTransferValidator private transferValidator; /** * @notice Allows the contract owner to set the transfer validator to the official validator contract * and set the security policy to the recommended default settings. * @dev May be overridden to change the default behavior of an individual collection. */ function setToDefaultSecurityPolicy() public virtual { _requireCallerIsContractOwner(); setTransferValidator(DEFAULT_TRANSFER_VALIDATOR); ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setTransferSecurityLevelOfCollection(address(this), DEFAULT_TRANSFER_SECURITY_LEVEL); ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setOperatorWhitelistOfCollection(address(this), DEFAULT_OPERATOR_WHITELIST_ID); } /** * @notice Allows the contract owner to set the transfer validator to a custom validator contract * and set the security policy to their own custom settings. */ function setToCustomValidatorAndSecurityPolicy( address validator, TransferSecurityLevels level, uint120 operatorWhitelistId, uint120 permittedContractReceiversAllowlistId) public { _requireCallerIsContractOwner(); setTransferValidator(validator); ICreatorTokenTransferValidator(validator). setTransferSecurityLevelOfCollection(address(this), level); ICreatorTokenTransferValidator(validator). setOperatorWhitelistOfCollection(address(this), operatorWhitelistId); ICreatorTokenTransferValidator(validator). setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId); } /** * @notice Allows the contract owner to set the security policy to their own custom settings. * @dev Reverts if the transfer validator has not been set. */ function setToCustomSecurityPolicy( TransferSecurityLevels level, uint120 operatorWhitelistId, uint120 permittedContractReceiversAllowlistId) public { _requireCallerIsContractOwner(); ICreatorTokenTransferValidator validator = getTransferValidator(); if (address(validator) == address(0)) { revert CreatorTokenBase__SetTransferValidatorFirst(); } validator.setTransferSecurityLevelOfCollection(address(this), level); validator.setOperatorWhitelistOfCollection(address(this), operatorWhitelistId); validator.setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId); } /** * @notice Sets the transfer validator for the token contract. * * @dev Throws when provided validator contract is not the zero address and doesn't support * the ICreatorTokenTransferValidator interface. * @dev Throws when the caller is not the contract owner. * * @dev <h4>Postconditions:</h4> * 1. The transferValidator address is updated. * 2. The `TransferValidatorUpdated` event is emitted. * * @param transferValidator_ The address of the transfer validator contract. */ function setTransferValidator(address transferValidator_) public { _requireCallerIsContractOwner(); bool isValidTransferValidator = false; if(transferValidator_.code.length > 0) { try IERC165(transferValidator_).supportsInterface(type(ICreatorTokenTransferValidator).interfaceId) returns (bool supportsInterface) { isValidTransferValidator = supportsInterface; } catch {} } if(transferValidator_ != address(0) && !isValidTransferValidator) { revert CreatorTokenBase__InvalidTransferValidatorContract(); } emit TransferValidatorUpdated(address(transferValidator), transferValidator_); transferValidator = ICreatorTokenTransferValidator(transferValidator_); } /** * @notice Returns the transfer validator contract address for this token contract. */ function getTransferValidator() public view override returns (ICreatorTokenTransferValidator) { return transferValidator; } /** * @notice Returns the security policy for this token contract, which includes: * Transfer security level, operator whitelist id, permitted contract receiver allowlist id. */ function getSecurityPolicy() public view override returns (CollectionSecurityPolicy memory) { if (address(transferValidator) != address(0)) { return transferValidator.getCollectionSecurityPolicy(address(this)); } return CollectionSecurityPolicy({ transferSecurityLevel: TransferSecurityLevels.Zero, operatorWhitelistId: 0, permittedContractReceiversId: 0 }); } /** * @notice Returns the list of all whitelisted operators for this token contract. * @dev This can be an expensive call and should only be used in view-only functions. */ function getWhitelistedOperators() public view override returns (address[] memory) { if (address(transferValidator) != address(0)) { return transferValidator.getWhitelistedOperators( transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId); } return new address[](0); } /** * @notice Returns the list of permitted contract receivers for this token contract. * @dev This can be an expensive call and should only be used in view-only functions. */ function getPermittedContractReceivers() public view override returns (address[] memory) { if (address(transferValidator) != address(0)) { return transferValidator.getPermittedContractReceivers( transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId); } return new address[](0); } /** * @notice Checks if an operator is whitelisted for this token contract. * @param operator The address of the operator to check. */ function isOperatorWhitelisted(address operator) public view override returns (bool) { if (address(transferValidator) != address(0)) { return transferValidator.isOperatorWhitelisted( transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId, operator); } return false; } /** * @notice Checks if a contract receiver is permitted for this token contract. * @param receiver The address of the receiver to check. */ function isContractReceiverPermitted(address receiver) public view override returns (bool) { if (address(transferValidator) != address(0)) { return transferValidator.isContractReceiverPermitted( transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId, receiver); } return false; } /** * @notice Determines if a transfer is allowed based on the token contract's security policy. Use this function * to simulate whether or not a transfer made by the specified `caller` from the `from` address to the `to` * address would be allowed by this token's security policy. * * @notice This function only checks the security policy restrictions and does not check whether token ownership * or approvals are in place. * * @param caller The address of the simulated caller. * @param from The address of the sender. * @param to The address of the receiver. * @return True if the transfer is allowed, false otherwise. */ function isTransferAllowed(address caller, address from, address to) public view override returns (bool) { if (address(transferValidator) != address(0)) { try transferValidator.applyCollectionTransferPolicy(caller, from, to) { return true; } catch { return false; } } return true; } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. */ function _preValidateTransfer( address caller, address from, address to, uint256 /*tokenId*/, uint256 /*value*/) internal virtual override { if (address(transferValidator) != address(0)) { transferValidator.applyCollectionTransferPolicy(caller, from, to); } } } // File: contracts/RektumRelic.sol pragma solidity ^0.8.23; contract RektumRelic is ERC1155, Ownable, ReentrancyGuard, BasicRoyaltiesInitializable, ImmediateRoyaltySplitter, CreatorTokenBase { using Strings for uint256; // Token IDs: 1 = Rektum Relic uint256 public constant REKTUM_RELIC = 1; uint256 public constant REKTUM_RELIC_MAX_SUPPLY = 250; uint256 public rektumRelicMinted; string public name = "REKTUM RELIC"; string public symbol = "REKTUMRELIC"; // Mapping of addresses allowed to burn (in addition to owner) mapping(address => bool) public allowedBurners; string public baseUri; constructor( address _initialOwner, string memory _baseUri, uint96 _royaltyFeeNumerator ) Ownable(_initialOwner) ERC1155(_baseUri) CreatorTokenBase() { baseUri = _baseUri; _setDefaultRoyalty(address(this), _royaltyFeeNumerator); } function _requireCallerIsContractOwner() internal view override { require(msg.sender == owner(), "Caller is not the contract owner"); } function tokenURI(uint256 _tokenId) public view virtual returns (string memory) { return string(abi.encodePacked(baseUri, _tokenId.toString(), ".json")); } function uri(uint256 tokenId) public view override returns (string memory) { return string(abi.encodePacked(super.uri(tokenId), tokenId.toString(), ".json")); } // Owner can update base URI if needed function setURI(string memory newuri) external onlyOwner { _setURI(newuri); baseUri = newuri; } // Set royalty info function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } function setAllowedBurner(address burner, bool allowed) external onlyOwner { allowedBurners[burner] = allowed; } // Airdrop a single NFT of a given type to a wallet function airdropSingle(address to, uint256 tokenId) external onlyOwner nonReentrant { _checkSupply(tokenId, 1); _mint(to, tokenId, 1, ""); _incrementCounter(tokenId, 1); } // Airdrop to multiple wallets the same type (1 per wallet) function airdropBatch(address[] calldata recipients, uint256 tokenId) external onlyOwner nonReentrant { uint256 length = recipients.length; _checkSupply(tokenId, length); for (uint256 i = 0; i < length; i++) { _mint(recipients[i], tokenId, 1, ""); } _incrementCounter(tokenId, length); } function burn( address account, uint256 tokenId, uint256 amount ) external nonReentrant { require(msg.sender == owner() || allowedBurners[msg.sender], "Not allowed to burn"); _burn(account, tokenId, amount); } function _checkSupply(uint256 tokenId, uint256 amount) internal view { if (tokenId == REKTUM_RELIC) { require(rektumRelicMinted + amount <= REKTUM_RELIC_MAX_SUPPLY, "Exceeds Rusty supply"); } else { revert("Invalid tokenId"); } } function _incrementCounter(uint256 tokenId, uint256 amount) internal { if (tokenId == REKTUM_RELIC) { rektumRelicMinted += amount; } } // supportsInterface function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC1155, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /// @notice Initializes the receivers and their shares. /// @param _receivers The new array of receiver addresses. /// @param _shares The new array of corresponding shares. function initializeRoyaltyShares( address[] memory _receivers, uint256[] memory _shares ) external onlyOwner { _initializeRoyaltyShares(_receivers, _shares); } function rescueERC20(IERC20 token, address to, uint256 amount) external onlyOwner { token.transfer(to, amount); } function rescueNative() external onlyOwner nonReentrant { uint256 balance = address(this).balance; require(balance > 0, "No native token to withdraw"); (bool success, ) = payable(owner()).call{value: balance}(""); require(success, "Native withdraw failed"); } } // File: contracts/OogiesRelicUpgrade.sol pragma solidity ^0.8.23; contract OogiesRelicUpgrader is Ownable, ReentrancyGuard, PaymentSplitter { address public immutable oogieAddress = 0x214cAE51c3BAE88515aAEfd8e1867E64502B0342; address payable public immutable rektumRelicAddress = payable(0x675b1e00A73e9186d3C3613285F81cd26c823bb2); uint256 public price = 222 ether; mapping(uint256 => bool) public upgraded; uint256[] public upgradedMoogies; uint256 private teamLength; constructor( address _initialOwner, address[] memory _payees, uint256[] memory _shares ) Ownable(_initialOwner) PaymentSplitter(_payees, _shares) { teamLength = _payees.length; } /*/////////////////////////////////////////////////////////////// OWNER FUNCTIONS //////////////////////////////////////////////////////////////*/ function setPrice(uint256 _price) external onlyOwner { price = _price; } function releaseAll() external onlyOwner { for (uint256 i = 0; i < teamLength; i++) { release(payable(payee(i))); } } // Rescue function for tokens sent by mistake function rescueERC20(IERC20 token, address to, uint256 amount) external onlyOwner { token.transfer(to, amount); } /// @notice Allows the owner to mark a batch of token IDs as already upgraded /// @param tokenIds An array of token IDs that will be marked as upgraded function setAlreadyUpgraded(uint256[] calldata tokenIds) external onlyOwner { for (uint256 i = 0; i < tokenIds.length; i++) { // only update if it's not already upgraded if (!upgraded[tokenIds[i]]) { upgraded[tokenIds[i]] = true; } } } /*/////////////////////////////////////////////////////////////// PUBLIC VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ function areUpgraded(uint256[] calldata tokenIds) external view returns (bool[] memory) { bool[] memory results = new bool[](tokenIds.length); for (uint256 i = 0; i < tokenIds.length; i++) { results[i] = upgraded[tokenIds[i]]; } return results; } function getUpgraded() external view returns (uint256[] memory) { return upgradedMoogies; } /*/////////////////////////////////////////////////////////////// UPGRADE LOGIC //////////////////////////////////////////////////////////////*/ function upgrade(uint256 tokenId) external payable nonReentrant { IERC721 oogie = IERC721(oogieAddress); require(oogie.ownerOf(tokenId) == msg.sender, "Not the owner of the specified token"); require(!upgraded[tokenId], "Token already upgraded"); IERC1155 rektifier = IERC1155(rektumRelicAddress); require(rektifier.balanceOf(msg.sender, 1) > 0, "Not enough ERC1155 balance"); uint256 requiredPrice = price; require(msg.value == requiredPrice, "Incorrect payment amount"); // Burn the required rektifier RektumRelic(rektumRelicAddress).burn(msg.sender, 1, 1); // Mark the token as upgraded upgraded[tokenId] = true; // Push the tokenId into the upgraded list upgradedMoogies.push(tokenId); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_initialOwner","type":"address"},{"internalType":"address[]","name":"_payees","type":"address[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"areUpgraded","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUpgraded","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oogieAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rektumRelicAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"releaseAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"setAlreadyUpgraded","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","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"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"upgrade","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"upgraded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"upgradedMoogies","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c060405273214cae51c3bae88515aaefd8e1867e64502b034260805273675b1e00a73e9186d3c3613285f81cd26c823bb260a052680c08de6fcb28b8000060095534801561004c575f5ffd5b50604051611bd6380380611bd683398101604081905261006b916104e8565b8181846001600160a01b03811661009c57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6100a5816101cb565b506001805580518251146101165760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b6064820152608401610093565b5f8251116101665760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f207061796565730000000000006044820152606401610093565b5f5b82518110156101bb576101b3838281518110610186576101866105bb565b60200260200101518383815181106101a0576101a06105bb565b602002602001015161021a60201b60201c565b600101610168565b50509151600c55506105f4915050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0382166102855760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b6064820152608401610093565b5f81116102d45760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a207368617265732061726520300000006044820152606401610093565b6001600160a01b0382165f908152600460205260409020541561034d5760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b6064820152608401610093565b60068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b0384169081179091555f9081526004602052604090208190556002546103b49082906105cf565b600255604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b80516001600160a01b0381168114610413575f5ffd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561045457610454610418565b604052919050565b5f6001600160401b0382111561047457610474610418565b5060051b60200190565b5f82601f83011261048d575f5ffd5b81516104a061049b8261045c565b61042c565b8082825260208201915060208360051b8601019250858311156104c1575f5ffd5b602085015b838110156104de5780518352602092830192016104c6565b5095945050505050565b5f5f5f606084860312156104fa575f5ffd5b610503846103fd565b60208501519093506001600160401b0381111561051e575f5ffd5b8401601f8101861361052e575f5ffd5b805161053c61049b8261045c565b8082825260208201915060208360051b85010192508883111561055d575f5ffd5b6020840193505b8284101561058657610575846103fd565b825260209384019390910190610564565b6040880151909550925050506001600160401b038111156105a5575f5ffd5b6105b18682870161047e565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b808201808211156105ee57634e487b7160e01b5f52601160045260245ffd5b92915050565b60805160a0516115ac61062a5f395f81816101dc0152818161089d01526109d301525f818161022c015261075401526115ac5ff3fe60806040526004361061017e575f3560e01c806391b7f5ed116100cd578063bbee192d11610087578063d79779b211610062578063d79779b2146104ea578063e33b7de31461051e578063f2fde38b14610532578063f7ea244e14610551575f5ffd5b8063bbee192d14610478578063c45ac05014610497578063ce7c2ac2146104b6575f5ffd5b806391b7f5ed146103b35780639852595c146103d2578063a035b1fe14610406578063a3f8eace1461041b578063a4cd16891461043a578063b2118a8d14610459575f5ffd5b806345977d0311610138578063715018a611610113578063715018a614610343578063812e20dd146103575780638b83209b146103785780638da5cb5b14610397575f5ffd5b806345977d03146102fd57806348b75044146103105780635be7fde81461032f575f5ffd5b80630a3cd620146101cb5780631844125d1461021b578063191655871461024e5780631b468bd21461026f5780633a98ef391461029b578063406072a9146102b9575f5ffd5b366101c7577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b5f5ffd5b3480156101d6575f5ffd5b506101fe7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610226575f5ffd5b506101fe7f000000000000000000000000000000000000000000000000000000000000000081565b348015610259575f5ffd5b5061026d610268366004611253565b61058f565b005b34801561027a575f5ffd5b5061028e61028936600461126e565b61067a565b60405161021291906112df565b3480156102a6575f5ffd5b506002545b604051908152602001610212565b3480156102c4575f5ffd5b506102ab6102d3366004611323565b6001600160a01b039182165f90815260086020908152604080832093909416825291909152205490565b61026d61030b36600461135a565b610736565b34801561031b575f5ffd5b5061026d61032a366004611323565b610a8e565b34801561033a575f5ffd5b5061026d610b9a565b34801561034e575f5ffd5b5061026d610bc2565b348015610362575f5ffd5b5061036b610bd5565b6040516102129190611371565b348015610383575f5ffd5b506101fe61039236600461135a565b610c2b565b3480156103a2575f5ffd5b505f546001600160a01b03166101fe565b3480156103be575f5ffd5b5061026d6103cd36600461135a565b610c59565b3480156103dd575f5ffd5b506102ab6103ec366004611253565b6001600160a01b03165f9081526005602052604090205490565b348015610411575f5ffd5b506102ab60095481565b348015610426575f5ffd5b506102ab610435366004611253565b610c66565b348015610445575f5ffd5b506102ab61045436600461135a565b610cac565b348015610464575f5ffd5b5061026d6104733660046113a8565b610ccb565b348015610483575f5ffd5b5061026d61049236600461126e565b610d49565b3480156104a2575f5ffd5b506102ab6104b1366004611323565b610ddf565b3480156104c1575f5ffd5b506102ab6104d0366004611253565b6001600160a01b03165f9081526004602052604090205490565b3480156104f5575f5ffd5b506102ab610504366004611253565b6001600160a01b03165f9081526007602052604090205490565b348015610529575f5ffd5b506003546102ab565b34801561053d575f5ffd5b5061026d61054c366004611253565b610ea6565b34801561055c575f5ffd5b5061057f61056b36600461135a565b600a6020525f908152604090205460ff1681565b6040519015158152602001610212565b6001600160a01b0381165f908152600460205260409020546105cc5760405162461bcd60e51b81526004016105c3906113e6565b60405180910390fd5b5f6105d682610c66565b9050805f036105f75760405162461bcd60e51b81526004016105c39061142c565b8060035f828254610608919061148b565b90915550506001600160a01b0382165f9081526005602052604090208054820190556106348282610ee0565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b60605f8267ffffffffffffffff8111156106965761069661149e565b6040519080825280602002602001820160405280156106bf578160200160208202803683370190505b5090505f5b8381101561072c57600a5f8686848181106106e1576106e16114b2565b9050602002013581526020019081526020015f205f9054906101000a900460ff16828281518110610714576107146114b2565b911515602092830291909101909101526001016106c4565b5090505b92915050565b61073e610f73565b6040516331a9108f60e11b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000009033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156107a5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107c991906114c6565b6001600160a01b03161461082b5760405162461bcd60e51b8152602060048201526024808201527f4e6f7420746865206f776e6572206f662074686520737065636966696564207460448201526337b5b2b760e11b60648201526084016105c3565b5f828152600a602052604090205460ff16156108825760405162461bcd60e51b8152602060048201526016602482015275151bdad95b88185b1c9958591e481d5c19dc9859195960521b60448201526064016105c3565b604051627eeac760e11b8152336004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000905f906001600160a01b0383169062fdd58e90604401602060405180830381865afa1580156108ed573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091191906114e1565b1161095e5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820455243313135352062616c616e636500000000000060448201526064016105c3565b6009543481146109b05760405162461bcd60e51b815260206004820152601860248201527f496e636f7272656374207061796d656e7420616d6f756e74000000000000000060448201526064016105c3565b604051637a94c56560e11b815233600482015260016024820181905260448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5298aca906064015f604051808303815f87803b158015610a1c575f5ffd5b505af1158015610a2e573d5f5f3e3d5ffd5b5050505f858152600a60205260408120805460ff19166001908117909155600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90185905550610a8b9250610fcc915050565b50565b6001600160a01b0381165f90815260046020526040902054610ac25760405162461bcd60e51b81526004016105c3906113e6565b5f610acd8383610ddf565b9050805f03610aee5760405162461bcd60e51b81526004016105c39061142c565b6001600160a01b0383165f9081526007602052604081208054839290610b1590849061148b565b90915550506001600160a01b038084165f908152600860209081526040808320938616835292905220805482019055610b4f838383610fd2565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b610ba2611024565b5f5b600c54811015610a8b57610bba61026882610c2b565b600101610ba4565b610bca611024565b610bd35f611050565b565b6060600b805480602002602001604051908101604052809291908181526020018280548015610c2157602002820191905f5260205f20905b815481526020019060010190808311610c0d575b5050505050905090565b5f60068281548110610c3f57610c3f6114b2565b5f918252602090912001546001600160a01b031692915050565b610c61611024565b600955565b5f5f610c7160035490565b610c7b904761148b565b9050610ca58382610ca0866001600160a01b03165f9081526005602052604090205490565b61109f565b9392505050565b600b8181548110610cbb575f80fd5b5f91825260209091200154905081565b610cd3611024565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303815f875af1158015610d1f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d4391906114f8565b50505050565b610d51611024565b5f5b81811015610dda57600a5f848484818110610d7057610d706114b2565b602090810292909201358352508101919091526040015f205460ff16610dd2576001600a5f858585818110610da757610da76114b2565b9050602002013581526020019081526020015f205f6101000a81548160ff0219169083151502179055505b600101610d53565b505050565b6001600160a01b0382165f9081526007602052604081205481906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa158015610e3b573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5f91906114e1565b610e69919061148b565b6001600160a01b038086165f90815260086020908152604080832093881683529290522054909150610e9e908490839061109f565b949350505050565b610eae611024565b6001600160a01b038116610ed757604051631e4fbdf760e01b81525f60048201526024016105c3565b610a8b81611050565b80471015610f035760405163cd78605960e01b81523060048201526024016105c3565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610f4c576040519150601f19603f3d011682016040523d82523d5f602084013e610f51565b606091505b5050905080610dda57604051630a12f52160e11b815260040160405180910390fd5b600260015403610fc55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105c3565b6002600155565b60018055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610dda9084906110dc565b5f546001600160a01b03163314610bd35760405163118cdaa760e01b81523360048201526024016105c3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002546001600160a01b0384165f90815260046020526040812054909183916110c89086611517565b6110d2919061152e565b610e9e919061154d565b5f6110f06001600160a01b0384168361113d565b905080515f1415801561111457508080602001905181019061111291906114f8565b155b15610dda57604051635274afe760e01b81526001600160a01b03841660048201526024016105c3565b6060610ca583835f845f5f856001600160a01b031684866040516111619190611560565b5f6040518083038185875af1925050503d805f811461119b576040519150601f19603f3d011682016040523d82523d5f602084013e6111a0565b606091505b50915091506111b08683836111ba565b9695505050505050565b6060826111cf576111ca82611216565b610ca5565b81511580156111e657506001600160a01b0384163b155b1561120f57604051639996b31560e01b81526001600160a01b03851660048201526024016105c3565b5080610ca5565b8051156112265780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0381168114610a8b575f5ffd5b5f60208284031215611263575f5ffd5b8135610ca58161123f565b5f5f6020838503121561127f575f5ffd5b823567ffffffffffffffff811115611295575f5ffd5b8301601f810185136112a5575f5ffd5b803567ffffffffffffffff8111156112bb575f5ffd5b8560208260051b84010111156112cf575f5ffd5b6020919091019590945092505050565b602080825282518282018190525f918401906040840190835b8181101561131857835115158352602093840193909201916001016112f8565b509095945050505050565b5f5f60408385031215611334575f5ffd5b823561133f8161123f565b9150602083013561134f8161123f565b809150509250929050565b5f6020828403121561136a575f5ffd5b5035919050565b602080825282518282018190525f918401906040840190835b8181101561131857835183526020938401939092019160010161138a565b5f5f5f606084860312156113ba575f5ffd5b83356113c58161123f565b925060208401356113d58161123f565b929592945050506040919091013590565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561073057610730611477565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156114d6575f5ffd5b8151610ca58161123f565b5f602082840312156114f1575f5ffd5b5051919050565b5f60208284031215611508575f5ffd5b81518015158114610ca5575f5ffd5b808202811582820484141761073057610730611477565b5f8261154857634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561073057610730611477565b5f82518060208501845e5f92019182525091905056fea264697066735822122016e915917094c4ffea029ea37866d4a8eab9dc8dbc9c2306c9376b75168a0a9464736f6c634300081c00330000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e72000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000599afdfa9e2e663bde649da2b1922a282f18f6200000000000000000000000007b26cf06d223640c1fe05e8c8057fe96c0a1737b000000000000000000000000dbced55ef6c66192aa078587f70a6b2379e6fccc0000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e720000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000032
Deployed Bytecode
0x60806040526004361061017e575f3560e01c806391b7f5ed116100cd578063bbee192d11610087578063d79779b211610062578063d79779b2146104ea578063e33b7de31461051e578063f2fde38b14610532578063f7ea244e14610551575f5ffd5b8063bbee192d14610478578063c45ac05014610497578063ce7c2ac2146104b6575f5ffd5b806391b7f5ed146103b35780639852595c146103d2578063a035b1fe14610406578063a3f8eace1461041b578063a4cd16891461043a578063b2118a8d14610459575f5ffd5b806345977d0311610138578063715018a611610113578063715018a614610343578063812e20dd146103575780638b83209b146103785780638da5cb5b14610397575f5ffd5b806345977d03146102fd57806348b75044146103105780635be7fde81461032f575f5ffd5b80630a3cd620146101cb5780631844125d1461021b578063191655871461024e5780631b468bd21461026f5780633a98ef391461029b578063406072a9146102b9575f5ffd5b366101c7577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b5f5ffd5b3480156101d6575f5ffd5b506101fe7f000000000000000000000000675b1e00a73e9186d3c3613285f81cd26c823bb281565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610226575f5ffd5b506101fe7f000000000000000000000000214cae51c3bae88515aaefd8e1867e64502b034281565b348015610259575f5ffd5b5061026d610268366004611253565b61058f565b005b34801561027a575f5ffd5b5061028e61028936600461126e565b61067a565b60405161021291906112df565b3480156102a6575f5ffd5b506002545b604051908152602001610212565b3480156102c4575f5ffd5b506102ab6102d3366004611323565b6001600160a01b039182165f90815260086020908152604080832093909416825291909152205490565b61026d61030b36600461135a565b610736565b34801561031b575f5ffd5b5061026d61032a366004611323565b610a8e565b34801561033a575f5ffd5b5061026d610b9a565b34801561034e575f5ffd5b5061026d610bc2565b348015610362575f5ffd5b5061036b610bd5565b6040516102129190611371565b348015610383575f5ffd5b506101fe61039236600461135a565b610c2b565b3480156103a2575f5ffd5b505f546001600160a01b03166101fe565b3480156103be575f5ffd5b5061026d6103cd36600461135a565b610c59565b3480156103dd575f5ffd5b506102ab6103ec366004611253565b6001600160a01b03165f9081526005602052604090205490565b348015610411575f5ffd5b506102ab60095481565b348015610426575f5ffd5b506102ab610435366004611253565b610c66565b348015610445575f5ffd5b506102ab61045436600461135a565b610cac565b348015610464575f5ffd5b5061026d6104733660046113a8565b610ccb565b348015610483575f5ffd5b5061026d61049236600461126e565b610d49565b3480156104a2575f5ffd5b506102ab6104b1366004611323565b610ddf565b3480156104c1575f5ffd5b506102ab6104d0366004611253565b6001600160a01b03165f9081526004602052604090205490565b3480156104f5575f5ffd5b506102ab610504366004611253565b6001600160a01b03165f9081526007602052604090205490565b348015610529575f5ffd5b506003546102ab565b34801561053d575f5ffd5b5061026d61054c366004611253565b610ea6565b34801561055c575f5ffd5b5061057f61056b36600461135a565b600a6020525f908152604090205460ff1681565b6040519015158152602001610212565b6001600160a01b0381165f908152600460205260409020546105cc5760405162461bcd60e51b81526004016105c3906113e6565b60405180910390fd5b5f6105d682610c66565b9050805f036105f75760405162461bcd60e51b81526004016105c39061142c565b8060035f828254610608919061148b565b90915550506001600160a01b0382165f9081526005602052604090208054820190556106348282610ee0565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b60605f8267ffffffffffffffff8111156106965761069661149e565b6040519080825280602002602001820160405280156106bf578160200160208202803683370190505b5090505f5b8381101561072c57600a5f8686848181106106e1576106e16114b2565b9050602002013581526020019081526020015f205f9054906101000a900460ff16828281518110610714576107146114b2565b911515602092830291909101909101526001016106c4565b5090505b92915050565b61073e610f73565b6040516331a9108f60e11b8152600481018290527f000000000000000000000000214cae51c3bae88515aaefd8e1867e64502b03429033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156107a5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107c991906114c6565b6001600160a01b03161461082b5760405162461bcd60e51b8152602060048201526024808201527f4e6f7420746865206f776e6572206f662074686520737065636966696564207460448201526337b5b2b760e11b60648201526084016105c3565b5f828152600a602052604090205460ff16156108825760405162461bcd60e51b8152602060048201526016602482015275151bdad95b88185b1c9958591e481d5c19dc9859195960521b60448201526064016105c3565b604051627eeac760e11b8152336004820152600160248201527f000000000000000000000000675b1e00a73e9186d3c3613285f81cd26c823bb2905f906001600160a01b0383169062fdd58e90604401602060405180830381865afa1580156108ed573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091191906114e1565b1161095e5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820455243313135352062616c616e636500000000000060448201526064016105c3565b6009543481146109b05760405162461bcd60e51b815260206004820152601860248201527f496e636f7272656374207061796d656e7420616d6f756e74000000000000000060448201526064016105c3565b604051637a94c56560e11b815233600482015260016024820181905260448201527f000000000000000000000000675b1e00a73e9186d3c3613285f81cd26c823bb26001600160a01b03169063f5298aca906064015f604051808303815f87803b158015610a1c575f5ffd5b505af1158015610a2e573d5f5f3e3d5ffd5b5050505f858152600a60205260408120805460ff19166001908117909155600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90185905550610a8b9250610fcc915050565b50565b6001600160a01b0381165f90815260046020526040902054610ac25760405162461bcd60e51b81526004016105c3906113e6565b5f610acd8383610ddf565b9050805f03610aee5760405162461bcd60e51b81526004016105c39061142c565b6001600160a01b0383165f9081526007602052604081208054839290610b1590849061148b565b90915550506001600160a01b038084165f908152600860209081526040808320938616835292905220805482019055610b4f838383610fd2565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b610ba2611024565b5f5b600c54811015610a8b57610bba61026882610c2b565b600101610ba4565b610bca611024565b610bd35f611050565b565b6060600b805480602002602001604051908101604052809291908181526020018280548015610c2157602002820191905f5260205f20905b815481526020019060010190808311610c0d575b5050505050905090565b5f60068281548110610c3f57610c3f6114b2565b5f918252602090912001546001600160a01b031692915050565b610c61611024565b600955565b5f5f610c7160035490565b610c7b904761148b565b9050610ca58382610ca0866001600160a01b03165f9081526005602052604090205490565b61109f565b9392505050565b600b8181548110610cbb575f80fd5b5f91825260209091200154905081565b610cd3611024565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303815f875af1158015610d1f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d4391906114f8565b50505050565b610d51611024565b5f5b81811015610dda57600a5f848484818110610d7057610d706114b2565b602090810292909201358352508101919091526040015f205460ff16610dd2576001600a5f858585818110610da757610da76114b2565b9050602002013581526020019081526020015f205f6101000a81548160ff0219169083151502179055505b600101610d53565b505050565b6001600160a01b0382165f9081526007602052604081205481906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa158015610e3b573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5f91906114e1565b610e69919061148b565b6001600160a01b038086165f90815260086020908152604080832093881683529290522054909150610e9e908490839061109f565b949350505050565b610eae611024565b6001600160a01b038116610ed757604051631e4fbdf760e01b81525f60048201526024016105c3565b610a8b81611050565b80471015610f035760405163cd78605960e01b81523060048201526024016105c3565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610f4c576040519150601f19603f3d011682016040523d82523d5f602084013e610f51565b606091505b5050905080610dda57604051630a12f52160e11b815260040160405180910390fd5b600260015403610fc55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105c3565b6002600155565b60018055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610dda9084906110dc565b5f546001600160a01b03163314610bd35760405163118cdaa760e01b81523360048201526024016105c3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002546001600160a01b0384165f90815260046020526040812054909183916110c89086611517565b6110d2919061152e565b610e9e919061154d565b5f6110f06001600160a01b0384168361113d565b905080515f1415801561111457508080602001905181019061111291906114f8565b155b15610dda57604051635274afe760e01b81526001600160a01b03841660048201526024016105c3565b6060610ca583835f845f5f856001600160a01b031684866040516111619190611560565b5f6040518083038185875af1925050503d805f811461119b576040519150601f19603f3d011682016040523d82523d5f602084013e6111a0565b606091505b50915091506111b08683836111ba565b9695505050505050565b6060826111cf576111ca82611216565b610ca5565b81511580156111e657506001600160a01b0384163b155b1561120f57604051639996b31560e01b81526001600160a01b03851660048201526024016105c3565b5080610ca5565b8051156112265780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0381168114610a8b575f5ffd5b5f60208284031215611263575f5ffd5b8135610ca58161123f565b5f5f6020838503121561127f575f5ffd5b823567ffffffffffffffff811115611295575f5ffd5b8301601f810185136112a5575f5ffd5b803567ffffffffffffffff8111156112bb575f5ffd5b8560208260051b84010111156112cf575f5ffd5b6020919091019590945092505050565b602080825282518282018190525f918401906040840190835b8181101561131857835115158352602093840193909201916001016112f8565b509095945050505050565b5f5f60408385031215611334575f5ffd5b823561133f8161123f565b9150602083013561134f8161123f565b809150509250929050565b5f6020828403121561136a575f5ffd5b5035919050565b602080825282518282018190525f918401906040840190835b8181101561131857835183526020938401939092019160010161138a565b5f5f5f606084860312156113ba575f5ffd5b83356113c58161123f565b925060208401356113d58161123f565b929592945050506040919091013590565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561073057610730611477565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156114d6575f5ffd5b8151610ca58161123f565b5f602082840312156114f1575f5ffd5b5051919050565b5f60208284031215611508575f5ffd5b81518015158114610ca5575f5ffd5b808202811582820484141761073057610730611477565b5f8261154857634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561073057610730611477565b5f82518060208501845e5f92019182525091905056fea264697066735822122016e915917094c4ffea029ea37866d4a8eab9dc8dbc9c2306c9376b75168a0a9464736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e72000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000599afdfa9e2e663bde649da2b1922a282f18f6200000000000000000000000007b26cf06d223640c1fe05e8c8057fe96c0a1737b000000000000000000000000dbced55ef6c66192aa078587f70a6b2379e6fccc0000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e720000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000032
-----Decoded View---------------
Arg [0] : _initialOwner (address): 0x3303C4350259C2B8F3C560B2ec70aD3ed87A5E72
Arg [1] : _payees (address[]): 0x599AfdfA9e2e663BdE649dA2B1922a282f18F620,0x7b26cF06d223640c1fE05e8c8057fe96c0A1737B,0xdBcED55eF6C66192Aa078587F70A6b2379e6fCCC,0x3303C4350259C2B8F3C560B2ec70aD3ed87A5E72
Arg [2] : _shares (uint256[]): 15,20,15,50
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e72
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 000000000000000000000000599afdfa9e2e663bde649da2b1922a282f18f620
Arg [5] : 0000000000000000000000007b26cf06d223640c1fe05e8c8057fe96c0a1737b
Arg [6] : 000000000000000000000000dbced55ef6c66192aa078587f70a6b2379e6fccc
Arg [7] : 0000000000000000000000003303c4350259c2b8f3c560b2ec70ad3ed87a5e72
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [11] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000032
Deployed Bytecode Sourcemap
167880:3449:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29746:40;775:10;29746:40;;;-1:-1:-1;;;;;206:32:1;;;188:51;;29776:9:0;270:2:1;255:18;;248:34;161:18;29746:40:0;;;;;;;167880:3449;;;;;168050:105;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;473:32:1;;;455:51;;443:2;428:18;168050:105:0;;;;;;;;167961:82;;;;;;;;;;;;;;;32267:671;;;;;;;;;;-1:-1:-1;32267:671:0;;;;;:::i;:::-;;:::i;:::-;;169894:300;;;;;;;;;;-1:-1:-1;169894:300:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;29877:91::-;;;;;;;;;;-1:-1:-1;29948:12:0;;29877:91;;;2524:25:1;;;2512:2;2497:18;29877:91:0;2378:177:1;31006:135:0;;;;;;;;;;-1:-1:-1;31006:135:0;;;;;:::i;:::-;-1:-1:-1;;;;;31103:21:0;;;31076:7;31103:21;;;:14;:21;;;;;;;;:30;;;;;;;;;;;;;31006:135;170503:823;;;;;;:::i;:::-;;:::i;33206:792::-;;;;;;;;;;-1:-1:-1;33206:792:0;;;;;:::i;:::-;;:::i;168867:153::-;;;;;;;;;;;;;:::i;3254:103::-;;;;;;;;;;;;;:::i;170202:105::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;31232:100::-;;;;;;;;;;-1:-1:-1;31232:100:0;;;;;:::i;:::-;;:::i;2579:87::-;;;;;;;;;;-1:-1:-1;2625:7:0;2652:6;-1:-1:-1;;;;;2652:6:0;2579:87;;168773:86;;;;;;;;;;-1:-1:-1;168773:86:0;;;;;:::i;:::-;;:::i;30728:109::-;;;;;;;;;;-1:-1:-1;30728:109:0;;;;;:::i;:::-;-1:-1:-1;;;;;30811:18:0;30784:7;30811:18;;;:9;:18;;;;;;;30728:109;168164:32;;;;;;;;;;;;;;;;31422:225;;;;;;;;;;-1:-1:-1;31422:225:0;;;;;:::i;:::-;;:::i;168254:32::-;;;;;;;;;;-1:-1:-1;168254:32:0;;;;;:::i;:::-;;:::i;169079:127::-;;;;;;;;;;-1:-1:-1;169079:127:0;;;;;:::i;:::-;;:::i;169376:314::-;;;;;;;;;;-1:-1:-1;169376:314:0;;;;;:::i;:::-;;:::i;31807:260::-;;;;;;;;;;-1:-1:-1;31807:260:0;;;;;:::i;:::-;;:::i;30524:105::-;;;;;;;;;;-1:-1:-1;30524:105:0;;;;;:::i;:::-;-1:-1:-1;;;;;30605:16:0;30578:7;30605:16;;;:7;:16;;;;;;;30524:105;30314:119;;;;;;;;;;-1:-1:-1;30314:119:0;;;;;:::i;:::-;-1:-1:-1;;;;;30399:26:0;30372:7;30399:26;;;:19;:26;;;;;;;30314:119;30062:95;;;;;;;;;;-1:-1:-1;30135:14:0;;30062:95;;3512:220;;;;;;;;;;-1:-1:-1;3512:220:0;;;;;:::i;:::-;;:::i;168205:40::-;;;;;;;;;;-1:-1:-1;168205:40:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5072:14:1;;5065:22;5047:41;;5035:2;5020:18;168205:40:0;4907:187:1;32267:671:0;-1:-1:-1;;;;;32343:16:0;;32362:1;32343:16;;;:7;:16;;;;;;32335:71;;;;-1:-1:-1;;;32335:71:0;;;;;;;:::i;:::-;;;;;;;;;32419:15;32437:19;32448:7;32437:10;:19::i;:::-;32419:37;;32477:7;32488:1;32477:12;32469:68;;;;-1:-1:-1;;;32469:68:0;;;;;;;:::i;:::-;32750:7;32732:14;;:25;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;;;32793:18:0;;;;;;:9;:18;;;;;:29;;;;;;32846:35;32803:7;32815;32846:17;:35::i;:::-;32897:33;;;-1:-1:-1;;;;;206:32:1;;188:51;;270:2;255:18;;248:34;;;32897:33:0;;161:18:1;32897:33:0;;;;;;;32324:614;32267:671;:::o;169894:300::-;169967:13;169993:21;170028:8;170017:27;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;170017:27:0;-1:-1:-1;169993:51:0;-1:-1:-1;170060:9:0;170055:107;170075:19;;;170055:107;;;170129:8;:21;170138:8;;170147:1;170138:11;;;;;;;:::i;:::-;;;;;;;170129:21;;;;;;;;;;;;;;;;;;;;;170116:7;170124:1;170116:10;;;;;;;;:::i;:::-;:34;;;:10;;;;;;;;;;;:34;170096:3;;170055:107;;;-1:-1:-1;170179:7:0;-1:-1:-1;169894:300:0;;;;;:::o;170503:823::-;6435:21;:19;:21::i;:::-;170634:22:::1;::::0;-1:-1:-1;;;170634:22:0;;::::1;::::0;::::1;2524:25:1::0;;;170602:12:0::1;::::0;170660:10:::1;::::0;-1:-1:-1;;;;;170634:13:0;::::1;::::0;::::1;::::0;2497:18:1;;170634:22:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;170634:36:0::1;;170626:85;;;::::0;-1:-1:-1;;;170626:85:0;;7197:2:1;170626:85:0::1;::::0;::::1;7179:21:1::0;7236:2;7216:18;;;7209:30;7275:34;7255:18;;;7248:62;-1:-1:-1;;;7326:18:1;;;7319:34;7370:19;;170626:85:0::1;6995:400:1::0;170626:85:0::1;170731:17;::::0;;;:8:::1;:17;::::0;;;;;::::1;;170730:18;170722:53;;;::::0;-1:-1:-1;;;170722:53:0;;7602:2:1;170722:53:0::1;::::0;::::1;7584:21:1::0;7641:2;7621:18;;;7614:30;-1:-1:-1;;;7660:18:1;;;7653:52;7722:18;;170722:53:0::1;7400:346:1::0;170722:53:0::1;170856:34;::::0;-1:-1:-1;;;170856:34:0;;170876:10:::1;170856:34;::::0;::::1;188:51:1::0;170888:1:0::1;255:18:1::0;;;248:34;170818:18:0::1;::::0;170788::::1;::::0;-1:-1:-1;;;;;170856:19:0;::::1;::::0;::::1;::::0;161:18:1;;170856:34:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:38;170848:77;;;::::0;-1:-1:-1;;;170848:77:0;;8429:2:1;170848:77:0::1;::::0;::::1;8411:21:1::0;8468:2;8448:18;;;8441:30;8507:28;8487:18;;;8480:56;8553:18;;170848:77:0::1;8227:350:1::0;170848:77:0::1;170962:5;::::0;170986:9:::1;:26:::0;::::1;170978:63;;;::::0;-1:-1:-1;;;170978:63:0;;8784:2:1;170978:63:0::1;::::0;::::1;8766:21:1::0;8823:2;8803:18;;;8796:30;8862:26;8842:18;;;8835:54;8906:18;;170978:63:0::1;8582:348:1::0;170978:63:0::1;171094:54;::::0;-1:-1:-1;;;171094:54:0;;171131:10:::1;171094:54;::::0;::::1;9153:51:1::0;171143:1:0::1;9220:18:1::0;;;9213:34;;;9263:18;;;9256:34;171106:18:0::1;-1:-1:-1::0;;;;;171094:36:0::1;::::0;::::1;::::0;9126:18:1;;171094:54:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;171200:17:0::1;::::0;;;:8:::1;:17;::::0;;;;:24;;-1:-1:-1;;171200:24:0::1;171220:4;171200:24:::0;;::::1;::::0;;;171289:15:::1;:29:::0;;;;::::1;::::0;;;;;;::::1;::::0;;;-1:-1:-1;6479:20:0;;-1:-1:-1;6479:18:0;;-1:-1:-1;;6479:20:0:i;:::-;170503:823;:::o;33206:792::-;-1:-1:-1;;;;;33288:16:0;;33307:1;33288:16;;;:7;:16;;;;;;33280:71;;;;-1:-1:-1;;;33280:71:0;;;;;;;:::i;:::-;33364:15;33382:26;33393:5;33400:7;33382:10;:26::i;:::-;33364:44;;33429:7;33440:1;33429:12;33421:68;;;;-1:-1:-1;;;33421:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;33744:26:0;;;;;;:19;:26;;;;;:37;;33774:7;;33744:26;:37;;33774:7;;33744:37;:::i;:::-;;;;-1:-1:-1;;;;;;;33817:21:0;;;;;;;:14;:21;;;;;;;;:30;;;;;;;;;:41;;;;;;33882:47;33832:5;33839:7;33851;33882:22;:47::i;:::-;33945:45;;;-1:-1:-1;;;;;206:32:1;;;188:51;;270:2;255:18;;248:34;;;33945:45:0;;;;;161:18:1;33945:45:0;;;;;;;33269:729;33206:792;;:::o;168867:153::-;2465:13;:11;:13::i;:::-;168924:9:::1;168919:94;168943:10;;168939:1;:14;168919:94;;;168975:26;168991:8;168997:1;168991:5;:8::i;168975:26::-;168955:3;;168919:94;;3254:103:::0;2465:13;:11;:13::i;:::-;3319:30:::1;3346:1;3319:18;:30::i;:::-;3254:103::o:0;170202:105::-;170248:16;170284:15;170277:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;170202:105;:::o;31232:100::-;31283:7;31310;31318:5;31310:14;;;;;;;;:::i;:::-;;;;;;;;;;;-1:-1:-1;;;;;31310:14:0;;31232:100;-1:-1:-1;;31232:100:0:o;168773:86::-;2465:13;:11;:13::i;:::-;168837:5:::1;:14:::0;168773:86::o;31422:225::-;31480:7;31500:21;31548:15;30135:14;;;30062:95;31548:15;31524:39;;:21;:39;:::i;:::-;31500:63;;31581:58;31597:7;31606:13;31621:17;31630:7;-1:-1:-1;;;;;30811:18:0;30784:7;30811:18;;;:9;:18;;;;;;;30728:109;31621:17;31581:15;:58::i;:::-;31574:65;31422:225;-1:-1:-1;;;31422:225:0:o;168254:32::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;168254:32:0;:::o;169079:127::-;2465:13;:11;:13::i;:::-;169172:26:::1;::::0;-1:-1:-1;;;169172:26:0;;-1:-1:-1;;;;;206:32:1;;;169172:26:0::1;::::0;::::1;188:51:1::0;255:18;;;248:34;;;169172:14:0;::::1;::::0;::::1;::::0;161:18:1;;169172:26:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;169079:127:::0;;;:::o;169376:314::-;2465:13;:11;:13::i;:::-;169468:9:::1;169463:220;169483:19:::0;;::::1;169463:220;;;169586:8;:21;169595:8;;169604:1;169595:11;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;::::1;;169586:21:::0;;-1:-1:-1;169586:21:0;::::1;::::0;;;;;;-1:-1:-1;169586:21:0;;::::1;;169581:91;;169652:4;169628:8;:21;169637:8;;169646:1;169637:11;;;;;;;:::i;:::-;;;;;;;169628:21;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;169581:91;169504:3;;169463:220;;;;169376:314:::0;;:::o;31807:260::-;-1:-1:-1;;;;;30399:26:0;;31879:7;30399:26;;;:19;:26;;;;;;31879:7;;31923:30;;-1:-1:-1;;;31923:30:0;;31947:4;31923:30;;;455:51:1;-1:-1:-1;;;;;31923:15:0;;;;;428:18:1;;31923:30:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:53;;;;:::i;:::-;-1:-1:-1;;;;;31103:21:0;;;31076:7;31103:21;;;:14;:21;;;;;;;;:30;;;;;;;;;;31899:77;;-1:-1:-1;31994:65:0;;32010:7;;31899:77;;31581:15;:58::i;31994:65::-;31987:72;31807:260;-1:-1:-1;;;;31807:260:0:o;3512:220::-;2465:13;:11;:13::i;:::-;-1:-1:-1;;;;;3597:22:0;::::1;3593:93;;3643:31;::::0;-1:-1:-1;;;3643:31:0;;3671:1:::1;3643:31;::::0;::::1;455:51:1::0;428:18;;3643:31:0::1;293:219:1::0;3593:93:0::1;3696:28;3715:8;3696:18;:28::i;15752:340::-:0;15862:6;15838:21;:30;15834:111;;;15892:41;;-1:-1:-1;;;15892:41:0;;15927:4;15892:41;;;455:51:1;428:18;;15892:41:0;293:219:1;15834:111:0;15958:12;15976:9;-1:-1:-1;;;;;15976:14:0;15998:6;15976:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15957:52;;;16025:7;16020:65;;16056:17;;-1:-1:-1;;;16056:17:0;;;;;;;;;;;6515:293;5917:1;6649:7;;:19;6641:63;;;;-1:-1:-1;;;6641:63:0;;9995:2:1;6641:63:0;;;9977:21:1;10034:2;10014:18;;;10007:30;10073:33;10053:18;;;10046:61;10124:18;;6641:63:0;9793:355:1;6641:63:0;5917:1;6782:7;:18;6515:293::o;6816:213::-;5873:1;6999:22;;6816:213::o;21829:162::-;21939:43;;;-1:-1:-1;;;;;206:32:1;;21939:43:0;;;188:51:1;255:18;;;;248:34;;;21939:43:0;;;;;;;;;;161:18:1;;;;21939:43:0;;;;;;;;-1:-1:-1;;;;;21939:43:0;-1:-1:-1;;;21939:43:0;;;21912:71;;21932:5;;21912:19;:71::i;2744:166::-;2625:7;2652:6;-1:-1:-1;;;;;2652:6:0;775:10;2804:23;2800:103;;2851:40;;-1:-1:-1;;;2851:40:0;;775:10;2851:40;;;455:51:1;428:18;;2851:40:0;293:219:1;3892:191:0;3966:16;3985:6;;-1:-1:-1;;;;;4002:17:0;;;-1:-1:-1;;;;;;4002:17:0;;;;;;4035:40;;3985:6;;;;;;;4035:40;;3966:16;4035:40;3955:128;3892:191;:::o;34176:248::-;34386:12;;-1:-1:-1;;;;;34366:16:0;;34322:7;34366:16;;;:7;:16;;;;;;34322:7;;34401:15;;34350:32;;:13;:32;:::i;:::-;34349:49;;;;:::i;:::-;:67;;;;:::i;24640:638::-;25064:23;25090:33;-1:-1:-1;;;;;25090:27:0;;25118:4;25090:27;:33::i;:::-;25064:59;;25138:10;:17;25159:1;25138:22;;:57;;;;;25176:10;25165:30;;;;;;;;;;;;:::i;:::-;25164:31;25138:57;25134:137;;;25219:40;;-1:-1:-1;;;25219:40:0;;-1:-1:-1;;;;;473:32:1;;25219:40:0;;;455:51:1;428:18;;25219:40:0;293:219:1;16955:153:0;17030:12;17062:38;17084:6;17092:4;17098:1;17030:12;17688;17702:23;17729:6;-1:-1:-1;;;;;17729:11:0;17748:5;17755:4;17729:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17687:73;;;;17778:55;17805:6;17813:7;17822:10;17778:26;:55::i;:::-;17771:62;17443:398;-1:-1:-1;;;;;;17443:398:0:o;18919:597::-;19067:12;19097:7;19092:417;;19121:19;19129:10;19121:7;:19::i;:::-;19092:417;;;19349:17;;:22;:49;;;;-1:-1:-1;;;;;;19375:18:0;;;:23;19349:49;19345:121;;;19426:24;;-1:-1:-1;;;19426:24:0;;-1:-1:-1;;;;;473:32:1;;19426:24:0;;;455:51:1;428:18;;19426:24:0;293:219:1;19345:121:0;-1:-1:-1;19487:10:0;19480:17;;20069:528;20202:17;;:21;20198:392;;20434:10;20428:17;20491:15;20478:10;20474:2;20470:19;20463:44;20198:392;20561:17;;-1:-1:-1;;;20561:17:0;;;;;;;;;;;725:139:1;-1:-1:-1;;;;;808:31:1;;798:42;;788:70;;854:1;851;844:12;869:263;936:6;989:2;977:9;968:7;964:23;960:32;957:52;;;1005:1;1002;995:12;957:52;1044:9;1031:23;1063:39;1096:5;1063:39;:::i;1137:610::-;1223:6;1231;1284:2;1272:9;1263:7;1259:23;1255:32;1252:52;;;1300:1;1297;1290:12;1252:52;1340:9;1327:23;1373:18;1365:6;1362:30;1359:50;;;1405:1;1402;1395:12;1359:50;1428:22;;1481:4;1473:13;;1469:27;-1:-1:-1;1459:55:1;;1510:1;1507;1500:12;1459:55;1550:2;1537:16;1576:18;1568:6;1565:30;1562:50;;;1608:1;1605;1598:12;1562:50;1661:7;1656:2;1646:6;1643:1;1639:14;1635:2;1631:23;1627:32;1624:45;1621:65;;;1682:1;1679;1672:12;1621:65;1713:2;1705:11;;;;;1735:6;;-1:-1:-1;1137:610:1;-1:-1:-1;;;1137:610:1:o;1752:621::-;1936:2;1948:21;;;2018:13;;1921:18;;;2040:22;;;1888:4;;2119:15;;;2093:2;2078:18;;;1888:4;2162:185;2176:6;2173:1;2170:13;2162:185;;;2251:13;;2244:21;2237:29;2225:42;;2296:2;2322:15;;;;2287:12;;;;2198:1;2191:9;2162:185;;;-1:-1:-1;2364:3:1;;1752:621;-1:-1:-1;;;;;1752:621:1:o;2560:418::-;2642:6;2650;2703:2;2691:9;2682:7;2678:23;2674:32;2671:52;;;2719:1;2716;2709:12;2671:52;2758:9;2745:23;2777:39;2810:5;2777:39;:::i;:::-;2835:5;-1:-1:-1;2892:2:1;2877:18;;2864:32;2905:41;2864:32;2905:41;:::i;:::-;2965:7;2955:17;;;2560:418;;;;;:::o;2983:226::-;3042:6;3095:2;3083:9;3074:7;3070:23;3066:32;3063:52;;;3111:1;3108;3101:12;3063:52;-1:-1:-1;3156:23:1;;2983:226;-1:-1:-1;2983:226:1:o;3214:611::-;3404:2;3416:21;;;3486:13;;3389:18;;;3508:22;;;3356:4;;3587:15;;;3561:2;3546:18;;;3356:4;3630:169;3644:6;3641:1;3638:13;3630:169;;;3705:13;;3693:26;;3748:2;3774:15;;;;3739:12;;;;3666:1;3659:9;3630:169;;4090:538;4181:6;4189;4197;4250:2;4238:9;4229:7;4225:23;4221:32;4218:52;;;4266:1;4263;4256:12;4218:52;4305:9;4292:23;4324:39;4357:5;4324:39;:::i;:::-;4382:5;-1:-1:-1;4439:2:1;4424:18;;4411:32;4452:41;4411:32;4452:41;:::i;:::-;4090:538;;4512:7;;-1:-1:-1;;;4592:2:1;4577:18;;;;4564:32;;4090:538::o;5099:402::-;5301:2;5283:21;;;5340:2;5320:18;;;5313:30;5379:34;5374:2;5359:18;;5352:62;-1:-1:-1;;;5445:2:1;5430:18;;5423:36;5491:3;5476:19;;5099:402::o;5506:407::-;5708:2;5690:21;;;5747:2;5727:18;;;5720:30;5786:34;5781:2;5766:18;;5759:62;-1:-1:-1;;;5852:2:1;5837:18;;5830:41;5903:3;5888:19;;5506:407::o;5918:127::-;5979:10;5974:3;5970:20;5967:1;5960:31;6010:4;6007:1;6000:15;6034:4;6031:1;6024:15;6050:125;6115:9;;;6136:10;;;6133:36;;;6149:18;;:::i;6467:127::-;6528:10;6523:3;6519:20;6516:1;6509:31;6559:4;6556:1;6549:15;6583:4;6580:1;6573:15;6599:127;6660:10;6655:3;6651:20;6648:1;6641:31;6691:4;6688:1;6681:15;6715:4;6712:1;6705:15;6731:259;6801:6;6854:2;6842:9;6833:7;6829:23;6825:32;6822:52;;;6870:1;6867;6860:12;6822:52;6902:9;6896:16;6921:39;6954:5;6921:39;:::i;8038:184::-;8108:6;8161:2;8149:9;8140:7;8136:23;8132:32;8129:52;;;8177:1;8174;8167:12;8129:52;-1:-1:-1;8200:16:1;;8038:184;-1:-1:-1;8038:184:1:o;9301:277::-;9368:6;9421:2;9409:9;9400:7;9396:23;9392:32;9389:52;;;9437:1;9434;9427:12;9389:52;9469:9;9463:16;9522:5;9515:13;9508:21;9501:5;9498:32;9488:60;;9544:1;9541;9534:12;10153:168;10226:9;;;10257;;10274:15;;;10268:22;;10254:37;10244:71;;10295:18;;:::i;10326:217::-;10366:1;10392;10382:132;;10436:10;10431:3;10427:20;10424:1;10417:31;10471:4;10468:1;10461:15;10499:4;10496:1;10489:15;10382:132;-1:-1:-1;10528:9:1;;10326:217::o;10548:128::-;10615:9;;;10636:11;;;10633:37;;;10650:18;;:::i;10681:301::-;10810:3;10848:6;10842:13;10894:6;10887:4;10879:6;10875:17;10870:3;10864:37;10956:1;10920:16;;10945:13;;;-1:-1:-1;10920:16:1;10681:301;-1:-1:-1;10681:301:1:o
Swarm Source
ipfs://16e915917094c4ffea029ea37866d4a8eab9dc8dbc9c2306c9376b75168a0a94
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
APE | Ape (APE) | 100.00% | $1.02 | 222 | $225.5 |
[ 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.