Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StraightSale
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-28 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } /** * @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); } } /** * @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); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @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); } /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } } /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS, s); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } } /** * @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; } } /** * @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); } } } /** * @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)); } } /** * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing. * * The library provides methods for generating a hash of a message that conforms to the * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712] * specifications. */ library MessageHashUtils { /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing a bytes32 `messageHash` with * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with * keccak256, although any bytes32 value can be safely used because the final digest will * be re-hashed. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20) } } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing an arbitrary `message` with * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) { return keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message)); } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x00` (data with intended validator). * * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended * `validator` address. Then hashing the result. * * See {ECDSA-recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked(hex"19_00", validator, data)); } /** * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`). * * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with * `\x19\x01` and hashing the result. It corresponds to the hash signed by the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712. * * See {ECDSA-recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, hex"19_01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) digest := keccak256(ptr, 0x42) } } } /** * @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 ERC1967 implementation slot: * ```solidity * contract ERC1967 { * 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; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 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) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { 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) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { 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) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } // | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | // | length | 0x BB | type ShortString is bytes32; /** * @dev This library provides functions to convert short memory strings * into a `ShortString` type that can be used as an immutable variable. * * Strings of arbitrary length can be optimized using this library if * they are short enough (up to 31 bytes) by packing them with their * length (1 byte) in a single EVM word (32 bytes). Additionally, a * fallback mechanism can be used for every other case. * * Usage example: * * ```solidity * contract Named { * using ShortStrings for *; * * ShortString private immutable _name; * string private _nameFallback; * * constructor(string memory contractName) { * _name = contractName.toShortStringWithFallback(_nameFallback); * } * * function name() external view returns (string memory) { * return _name.toStringWithFallback(_nameFallback); * } * } * ``` */ library ShortStrings { // Used as an identifier for strings longer than 31 bytes. bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; error StringTooLong(string str); error InvalidShortString(); /** * @dev Encode a string of at most 31 chars into a `ShortString`. * * This will trigger a `StringTooLong` error is the input string is too long. */ function toShortString(string memory str) internal pure returns (ShortString) { bytes memory bstr = bytes(str); if (bstr.length > 31) { revert StringTooLong(str); } return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); } /** * @dev Decode a `ShortString` back to a "normal" string. */ function toString(ShortString sstr) internal pure returns (string memory) { uint256 len = byteLength(sstr); // using `new string(len)` would work locally but is not memory safe. string memory str = new string(32); /// @solidity memory-safe-assembly assembly { mstore(str, len) mstore(add(str, 0x20), sstr) } return str; } /** * @dev Return the length of a `ShortString`. */ function byteLength(ShortString sstr) internal pure returns (uint256) { uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; if (result > 31) { revert InvalidShortString(); } return result; } /** * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. */ function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { if (bytes(value).length < 32) { return toShortString(value); } else { StorageSlot.getStringSlot(store).value = value; return ShortString.wrap(FALLBACK_SENTINEL); } } /** * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. */ function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { return toString(value); } else { return store; } } /** * @dev Return the length of a string that was encoded to `ShortString` or written to storage using * {setWithFallback}. * * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. */ function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { return byteLength(value); } else { return bytes(store).length; } } } interface IERC5267 { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); } /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * @custom:oz-upgrades-unsafe-allow state-variable-immutable */ abstract contract EIP712 is IERC5267 { using ShortStrings for *; bytes32 private constant TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _cachedDomainSeparator; uint256 private immutable _cachedChainId; address private immutable _cachedThis; bytes32 private immutable _hashedName; bytes32 private immutable _hashedVersion; ShortString private immutable _name; ShortString private immutable _version; string private _nameFallback; string private _versionFallback; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { _name = name.toShortStringWithFallback(_nameFallback); _version = version.toShortStringWithFallback(_versionFallback); _hashedName = keccak256(bytes(name)); _hashedVersion = keccak256(bytes(version)); _cachedChainId = block.chainid; _cachedDomainSeparator = _buildDomainSeparator(); _cachedThis = address(this); } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _cachedThis && block.chainid == _cachedChainId) { return _cachedDomainSeparator; } else { return _buildDomainSeparator(); } } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {IERC-5267}. */ function eip712Domain() public view virtual returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { return ( hex"0f", // 01111 _EIP712Name(), _EIP712Version(), block.chainid, address(this), bytes32(0), new uint256[](0) ); } /** * @dev The name parameter for the EIP712 domain. * * NOTE: By default this function reads _name which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). */ // solhint-disable-next-line func-name-mixedcase function _EIP712Name() internal view returns (string memory) { return _name.toStringWithFallback(_nameFallback); } /** * @dev The version parameter for the EIP712 domain. * * NOTE: By default this function reads _version which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). */ // solhint-disable-next-line func-name-mixedcase function _EIP712Version() internal view returns (string memory) { return _version.toStringWithFallback(_versionFallback); } } /** * @dev Provides tracking nonces for addresses. Nonces will only increment. */ abstract contract Nonces { /** * @dev The nonce used for an `account` is not the expected current nonce. */ error InvalidAccountNonce(address account, uint256 currentNonce); mapping(address account => uint256) private _nonces; /** * @dev Returns the next unused nonce for an address. */ function nonces(address owner) public view virtual returns (uint256) { return _nonces[owner]; } /** * @dev Consumes a nonce. * * Returns the current value and increments nonce. */ function _useNonce(address owner) internal virtual returns (uint256) { // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be // decremented or reset. This guarantees that the nonce never overflows. unchecked { // It is important to do x++ and not ++x here. return _nonces[owner]++; } } /** * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`. */ function _useCheckedNonce(address owner, uint256 nonce) internal virtual { uint256 current = _useNonce(owner); if (nonce != current) { revert InvalidAccountNonce(owner, current); } } } /** * @dev Implementation 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. */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { bytes32 private constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Permit deadline has expired. */ error ERC2612ExpiredSignature(uint256 deadline); /** * @dev Mismatched signature. */ error ERC2612InvalidSigner(address signer, address owner); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @inheritdoc IERC20Permit */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { if (block.timestamp > deadline) { revert ERC2612ExpiredSignature(deadline); } bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); if (signer != owner) { revert ERC2612InvalidSigner(signer, owner); } _approve(owner, spender, value); } /** * @inheritdoc IERC20Permit */ function nonces(address owner) public view virtual override(IERC20Permit, Nonces) returns (uint256) { return super.nonces(owner); } /** * @inheritdoc IERC20Permit */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view virtual returns (bytes32) { return _domainSeparatorV4(); } } /** * @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(); } } } /** * @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; } } contract Upgradeable is Ownable { address public implementation; constructor() Ownable(msg.sender) {} function replaceImplementation(address impl_) public onlyOwner { implementation = impl_; } } error PleaseSendETH(); error Unauthorized(); error CountMismatch(); error BelowZero(); error InsufficientTokens(); error EthTransferFailed(); error InvalidPrice(); error PurchaseTooMuch(); contract StraightSale is Upgradeable { event PurchaseToken(address indexed who, uint256 ethAmount, uint256 tokenAmount); event WalletCapUpdated(uint256 ethAmount); /* START State Variables */ bool private _initialized; IERC20 public immutable fungToken; uint256 public ethPricePerFung; address public beneficiary; uint256 public totalCommitments; bool private _whitelistEnabled; // depreciated mapping(address user => uint256 allocationWhitelist) public whitelist; uint256 public perWalletCap; mapping(address user => uint256 amountCommitted) public commitments; uint256 public whitelistCap; /* END State Variables */ constructor(IERC20 _fungToken) { fungToken = _fungToken; } function checkWhitelistEnabled() public view returns (bool) { if (totalCommitments < whitelistCap) { return true; } else { return false; } } // takes into account whitelist allocation, max cap during public sale, and available inventory function maxPurchasePossible(address user) external view returns (uint256) { uint256 maxAllowed = maxPurchaseAllowed(user); uint256 tokenAmountAllowed = maxAllowed * 1e18 / ethPricePerFung; if (fungToken.balanceOf(address(this)) < tokenAmountAllowed) { maxAllowed = maxAllowed * fungToken.balanceOf(address(this)) / tokenAmountAllowed; } return maxAllowed; } // takes into account whitelist allocation and max cap during public sale function maxPurchaseAllowed(address user) public view returns (uint256 maxAllowed) { // can always purchase at least up to whitelisted amount from available inventory uint256 whitelistAllo = whitelist[user]; if (checkWhitelistEnabled()) { maxAllowed = whitelistAllo; } else { uint256 walletCap = perWalletCap; uint256 committed = commitments[user]; if (committed < walletCap) { walletCap = walletCap - committed; } else { walletCap = 0; } if (whitelistAllo >= walletCap) { maxAllowed = whitelistAllo; } else { maxAllowed = walletCap; } } } function purchaseToken() external payable { if (msg.value == 0) { revert PleaseSendETH(); } if (maxPurchaseAllowed(msg.sender) < msg.value) { revert PurchaseTooMuch(); } if (whitelist[msg.sender] > msg.value) { whitelist[msg.sender] = whitelist[msg.sender] - msg.value; } else { whitelist[msg.sender] = 0; } commitments[msg.sender] = commitments[msg.sender] + msg.value; totalCommitments = totalCommitments + msg.value; uint256 tokenAmount = msg.value * 1e18 / ethPricePerFung; if (fungToken.balanceOf(address(this)) < tokenAmount) { revert InsufficientTokens(); } fungToken.transfer(msg.sender, tokenAmount); _sendETH(beneficiary, msg.value); emit PurchaseToken(msg.sender, msg.value, tokenAmount); } function initialize(address _beneficiary, uint256 _ethPricePerFung, uint256 _whitelistCap) external onlyOwner { if (_initialized == true) { revert Unauthorized(); } _updateSettings(_beneficiary, _ethPricePerFung, _whitelistCap); _initialized = true; } function _updateSettings(address _beneficiary, uint256 _ethPricePerFung, uint256 _whitelistCap) public onlyOwner { if (_ethPricePerFung == 0) { revert InvalidPrice(); } if (_beneficiary == address(0)) { beneficiary = address(this); } else { beneficiary = _beneficiary; } ethPricePerFung = _ethPricePerFung; whitelistCap = _whitelistCap; } function setPerWalletCap(uint256 _value) external onlyOwner { perWalletCap = _value; emit WalletCapUpdated(_value); } function increaseWhitelist(address[] memory users, uint256[] memory addedAmounts) external onlyOwner { if (users.length != addedAmounts.length) { revert CountMismatch(); } for(uint i; i < users.length;) { whitelist[users[i]] = whitelist[users[i]] + addedAmounts[i]; unchecked { i++; } } } function decreaseWhitelist(address[] memory users, uint256[] memory subtractedAmounts) external onlyOwner { if (users.length != subtractedAmounts.length) { revert CountMismatch(); } for(uint i; i < users.length;) { uint256 whitelistRemaining = whitelist[users[i]]; if (whitelistRemaining < subtractedAmounts[i]) { revert BelowZero(); } unchecked { whitelist[users[i]] = whitelistRemaining - subtractedAmounts[i]; i++; } } } function rescue(IERC20 _token) external onlyOwner { SafeERC20.safeTransfer(_token, msg.sender, _token.balanceOf(address(this))); } function rescueETH() external onlyOwner { _sendETH(msg.sender, address(this).balance); } function _sendETH(address _to, uint256 _amount) private { if (_to == address(this)) return; (bool success, ) = _to.call{ value: _amount }(""); if (success == false) { revert EthTransferFailed(); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_fungToken","type":"address"}],"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":"BelowZero","type":"error"},{"inputs":[],"name":"CountMismatch","type":"error"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientTokens","type":"error"},{"inputs":[],"name":"InvalidPrice","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":[],"name":"PleaseSendETH","type":"error"},{"inputs":[],"name":"PurchaseTooMuch","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"PurchaseToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"WalletCapUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_ethPricePerFung","type":"uint256"},{"internalType":"uint256","name":"_whitelistCap","type":"uint256"}],"name":"_updateSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkWhitelistEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"commitments","outputs":[{"internalType":"uint256","name":"amountCommitted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"subtractedAmounts","type":"uint256[]"}],"name":"decreaseWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethPricePerFung","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fungToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"addedAmounts","type":"uint256[]"}],"name":"increaseWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_ethPricePerFung","type":"uint256"},{"internalType":"uint256","name":"_whitelistCap","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"maxPurchaseAllowed","outputs":[{"internalType":"uint256","name":"maxAllowed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"maxPurchasePossible","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"perWalletCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchaseToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"impl_","type":"address"}],"name":"replaceImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"rescue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setPerWalletCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalCommitments","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":"address","name":"user","type":"address"}],"name":"whitelist","outputs":[{"internalType":"uint256","name":"allocationWhitelist","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561000f575f80fd5b506040516113e63803806113e683398101604081905261002e916100bd565b338061005357604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61005c8161006e565b506001600160a01b03166080526100ea565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cd575f80fd5b81516001600160a01b03811681146100e3575f80fd5b9392505050565b6080516112c861011e5f395f8181610417015281816105f201528181610678015281816109a20152610a4601526112c85ff3fe608060405260043610610147575f3560e01c80637b62ab6c116100b3578063bd1aed881161006d578063bd1aed8814610369578063d69efdc514610388578063e8fcf723146103a7578063f2fde38b146103d2578063f634d519146103f1578063fa5e361f14610406575f80fd5b80637b62ab6c146102b8578063839006f2146102dc5780638da5cb5b146102fb5780639b19251a14610317578063a95c4d6214610342578063bcf2b70d1461034a575f80fd5b8063565838561161010457806356583856146102135780635c60da1b14610232578063715018a61461025157806378bb86d31461026557806378f5c8cb1461027a5780637a1ac61e14610299575f80fd5b806315b093f81461014b57806320800a001461017357806331816ab41461018957806338af3eed146101a8578063472ecbb5146101df5780634b4cb6a7146101f4575b5f80fd5b348015610156575f80fd5b5061016060025481565b6040519081526020015b60405180910390f35b34801561017e575f80fd5b50610187610439565b005b348015610194575f80fd5b506101876101a3366004610fa4565b61044d565b3480156101b3575f80fd5b506003546101c7906001600160a01b031681565b6040516001600160a01b03909116815260200161016a565b3480156101ea575f80fd5b5061016060075481565b3480156101ff575f80fd5b5061018761020e3660046110a3565b610490565b34801561021e575f80fd5b5061016061022d36600461115f565b6105a1565b34801561023d575f80fd5b506001546101c7906001600160a01b031681565b34801561025c575f80fd5b50610187610707565b348015610270575f80fd5b5061016060045481565b348015610285575f80fd5b5061016061029436600461115f565b610718565b3480156102a4575f80fd5b506101876102b336600461117a565b610799565b3480156102c3575f80fd5b506102cc6107f2565b604051901515815260200161016a565b3480156102e7575f80fd5b506101876102f636600461115f565b61080a565b348015610306575f80fd5b505f546001600160a01b03166101c7565b348015610322575f80fd5b5061016061033136600461115f565b60066020525f908152604090205481565b610187610888565b348015610355575f80fd5b506101876103643660046110a3565b610b0d565b348015610374575f80fd5b5061018761038336600461117a565b610be3565b348015610393575f80fd5b506101876103a236600461115f565b610c57565b3480156103b2575f80fd5b506101606103c136600461115f565b60086020525f908152604090205481565b3480156103dd575f80fd5b506101876103ec36600461115f565b610c81565b3480156103fc575f80fd5b5061016060095481565b348015610411575f80fd5b506101c77f000000000000000000000000000000000000000000000000000000000000000081565b610441610cc0565b61044b3347610cec565b565b610455610cc0565b60078190556040518181527f4784309e6b1f1431c711eac5e572f9ba2d542ecb5428efc0e927b794f4e8e2c19060200160405180910390a150565b610498610cc0565b80518251146104ba57604051637507aab160e11b815260040160405180910390fd5b5f5b825181101561059c575f60065f8584815181106104db576104db6111ac565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f20549050828281518110610517576105176111ac565b602002602001015181101561053f57604051635a4ec36560e01b815260040160405180910390fd5b828281518110610551576105516111ac565b6020026020010151810360065f868581518110610570576105706111ac565b6020908102919091018101516001600160a01b031682528101919091526040015f2055506001016104bc565b505050565b5f806105ac83610718565b90505f60025482670de0b6b3a76400006105c691906111d4565b6105d091906111eb565b6040516370a0823160e01b815230600482015290915081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610637573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065b919061120a565b1015610700576040516370a0823160e01b815230600482015281907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156106c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e9919061120a565b6106f390846111d4565b6106fd91906111eb565b91505b5092915050565b61070f610cc0565b61044b5f610d75565b6001600160a01b0381165f908152600660205260408120546107386107f2565b1561074557809150610793565b6007546001600160a01b0384165f9081526008602052604090205481811015610779576107728183611221565b915061077d565b5f91505b81831061078c57829350610790565b8193505b50505b50919050565b6107a1610cc0565b60018054600160a01b900460ff16151590036107cf576040516282b42960e81b815260040160405180910390fd5b6107da838383610be3565b50506001805460ff60a01b1916600160a01b17905550565b5f60095460045410156108055750600190565b505f90565b610812610cc0565b6040516370a0823160e01b815230600482015261088590829033906001600160a01b038316906370a0823190602401602060405180830381865afa15801561085c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610880919061120a565b610dc4565b50565b345f036108a857604051639477cc2960e01b815260040160405180910390fd5b346108b233610718565b10156108d157604051631f0f623360e11b815260040160405180910390fd5b335f9081526006602052604090205434101561091557335f90815260066020526040902054610901903490611221565b335f90815260066020526040902055610925565b335f908152600660205260408120555b335f9081526008602052604090205461093f903490611234565b335f9081526008602052604090205560045461095c903490611234565b6004556002545f9061097634670de0b6b3a76400006111d4565b61098091906111eb565b6040516370a0823160e01b815230600482015290915081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156109e7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0b919061120a565b1015610a2a576040516378dbf0af60e11b815260040160405180910390fd5b60405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610a94573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab89190611247565b50600354610acf906001600160a01b031634610cec565b604080513481526020810183905233917ffefbb345f3254c99ae71865219647ef38b6363c25a654348007cb8aac567402d910160405180910390a250565b610b15610cc0565b8051825114610b3757604051637507aab160e11b815260040160405180910390fd5b5f5b825181101561059c57818181518110610b5457610b546111ac565b602002602001015160065f858481518110610b7157610b716111ac565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054610ba39190611234565b60065f858481518110610bb857610bb86111ac565b6020908102919091018101516001600160a01b031682528101919091526040015f2055600101610b39565b610beb610cc0565b815f03610c0a5760405162bfc92160e01b815260040160405180910390fd5b6001600160a01b038316610c2f57600380546001600160a01b03191630179055610c4b565b600380546001600160a01b0319166001600160a01b0385161790555b60029190915560095550565b610c5f610cc0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610c89610cc0565b6001600160a01b038116610cb757604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61088581610d75565b5f546001600160a01b0316331461044b5760405163118cdaa760e01b8152336004820152602401610cae565b306001600160a01b03831603610d00575050565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610d49576040519150601f19603f3d011682016040523d82523d5f602084013e610d4e565b606091505b50909150508015155f0361059c57604051630db2c7f160e31b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092019092526020810180516001600160e01b031663a9059cbb60e01b17905261059c918591905f90610e2190841683610e6e565b905080515f14158015610e45575080806020019051810190610e439190611247565b155b1561059c57604051635274afe760e01b81526001600160a01b0384166004820152602401610cae565b6060610e7b83835f610e84565b90505b92915050565b606081471015610ea95760405163cd78605960e01b8152306004820152602401610cae565b5f80856001600160a01b03168486604051610ec49190611266565b5f6040518083038185875af1925050503d805f8114610efe576040519150601f19603f3d011682016040523d82523d5f602084013e610f03565b606091505b5091509150610f13868383610f1f565b925050505b9392505050565b606082610f3457610f2f82610f7b565b610f18565b8151158015610f4b57506001600160a01b0384163b155b15610f7457604051639996b31560e01b81526001600160a01b0385166004820152602401610cae565b5080610f18565b805115610f8b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f60208284031215610fb4575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff857610ff8610fbb565b604052919050565b5f67ffffffffffffffff82111561101957611019610fbb565b5060051b60200190565b6001600160a01b0381168114610885575f80fd5b5f82601f830112611046575f80fd5b8135602061105b61105683611000565b610fcf565b8083825260208201915060208460051b87010193508684111561107c575f80fd5b602086015b848110156110985780358352918301918301611081565b509695505050505050565b5f80604083850312156110b4575f80fd5b823567ffffffffffffffff808211156110cb575f80fd5b818501915085601f8301126110de575f80fd5b813560206110ee61105683611000565b82815260059290921b8401810191818101908984111561110c575f80fd5b948201945b8386101561113357853561112481611023565b82529482019490820190611111565b96505086013592505080821115611148575f80fd5b5061115585828601611037565b9150509250929050565b5f6020828403121561116f575f80fd5b8135610f1881611023565b5f805f6060848603121561118c575f80fd5b833561119781611023565b95602085013595506040909401359392505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610e7e57610e7e6111c0565b5f8261120557634e487b7160e01b5f52601260045260245ffd5b500490565b5f6020828403121561121a575f80fd5b5051919050565b81810381811115610e7e57610e7e6111c0565b80820180821115610e7e57610e7e6111c0565b5f60208284031215611257575f80fd5b81518015158114610f18575f80fd5b5f82515f5b81811015611285576020818601810151858301520161126b565b505f92019182525091905056fea26469706673582212200bbfe9c0e84efa5dbf70dd279bc045acb8178bcffaea1cdc16dce9027ec180ee64736f6c634300081700330000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a
Deployed Bytecode
0x608060405260043610610147575f3560e01c80637b62ab6c116100b3578063bd1aed881161006d578063bd1aed8814610369578063d69efdc514610388578063e8fcf723146103a7578063f2fde38b146103d2578063f634d519146103f1578063fa5e361f14610406575f80fd5b80637b62ab6c146102b8578063839006f2146102dc5780638da5cb5b146102fb5780639b19251a14610317578063a95c4d6214610342578063bcf2b70d1461034a575f80fd5b8063565838561161010457806356583856146102135780635c60da1b14610232578063715018a61461025157806378bb86d31461026557806378f5c8cb1461027a5780637a1ac61e14610299575f80fd5b806315b093f81461014b57806320800a001461017357806331816ab41461018957806338af3eed146101a8578063472ecbb5146101df5780634b4cb6a7146101f4575b5f80fd5b348015610156575f80fd5b5061016060025481565b6040519081526020015b60405180910390f35b34801561017e575f80fd5b50610187610439565b005b348015610194575f80fd5b506101876101a3366004610fa4565b61044d565b3480156101b3575f80fd5b506003546101c7906001600160a01b031681565b6040516001600160a01b03909116815260200161016a565b3480156101ea575f80fd5b5061016060075481565b3480156101ff575f80fd5b5061018761020e3660046110a3565b610490565b34801561021e575f80fd5b5061016061022d36600461115f565b6105a1565b34801561023d575f80fd5b506001546101c7906001600160a01b031681565b34801561025c575f80fd5b50610187610707565b348015610270575f80fd5b5061016060045481565b348015610285575f80fd5b5061016061029436600461115f565b610718565b3480156102a4575f80fd5b506101876102b336600461117a565b610799565b3480156102c3575f80fd5b506102cc6107f2565b604051901515815260200161016a565b3480156102e7575f80fd5b506101876102f636600461115f565b61080a565b348015610306575f80fd5b505f546001600160a01b03166101c7565b348015610322575f80fd5b5061016061033136600461115f565b60066020525f908152604090205481565b610187610888565b348015610355575f80fd5b506101876103643660046110a3565b610b0d565b348015610374575f80fd5b5061018761038336600461117a565b610be3565b348015610393575f80fd5b506101876103a236600461115f565b610c57565b3480156103b2575f80fd5b506101606103c136600461115f565b60086020525f908152604090205481565b3480156103dd575f80fd5b506101876103ec36600461115f565b610c81565b3480156103fc575f80fd5b5061016060095481565b348015610411575f80fd5b506101c77f0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a81565b610441610cc0565b61044b3347610cec565b565b610455610cc0565b60078190556040518181527f4784309e6b1f1431c711eac5e572f9ba2d542ecb5428efc0e927b794f4e8e2c19060200160405180910390a150565b610498610cc0565b80518251146104ba57604051637507aab160e11b815260040160405180910390fd5b5f5b825181101561059c575f60065f8584815181106104db576104db6111ac565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f20549050828281518110610517576105176111ac565b602002602001015181101561053f57604051635a4ec36560e01b815260040160405180910390fd5b828281518110610551576105516111ac565b6020026020010151810360065f868581518110610570576105706111ac565b6020908102919091018101516001600160a01b031682528101919091526040015f2055506001016104bc565b505050565b5f806105ac83610718565b90505f60025482670de0b6b3a76400006105c691906111d4565b6105d091906111eb565b6040516370a0823160e01b815230600482015290915081906001600160a01b037f0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a16906370a0823190602401602060405180830381865afa158015610637573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065b919061120a565b1015610700576040516370a0823160e01b815230600482015281907f0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a6001600160a01b0316906370a0823190602401602060405180830381865afa1580156106c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e9919061120a565b6106f390846111d4565b6106fd91906111eb565b91505b5092915050565b61070f610cc0565b61044b5f610d75565b6001600160a01b0381165f908152600660205260408120546107386107f2565b1561074557809150610793565b6007546001600160a01b0384165f9081526008602052604090205481811015610779576107728183611221565b915061077d565b5f91505b81831061078c57829350610790565b8193505b50505b50919050565b6107a1610cc0565b60018054600160a01b900460ff16151590036107cf576040516282b42960e81b815260040160405180910390fd5b6107da838383610be3565b50506001805460ff60a01b1916600160a01b17905550565b5f60095460045410156108055750600190565b505f90565b610812610cc0565b6040516370a0823160e01b815230600482015261088590829033906001600160a01b038316906370a0823190602401602060405180830381865afa15801561085c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610880919061120a565b610dc4565b50565b345f036108a857604051639477cc2960e01b815260040160405180910390fd5b346108b233610718565b10156108d157604051631f0f623360e11b815260040160405180910390fd5b335f9081526006602052604090205434101561091557335f90815260066020526040902054610901903490611221565b335f90815260066020526040902055610925565b335f908152600660205260408120555b335f9081526008602052604090205461093f903490611234565b335f9081526008602052604090205560045461095c903490611234565b6004556002545f9061097634670de0b6b3a76400006111d4565b61098091906111eb565b6040516370a0823160e01b815230600482015290915081906001600160a01b037f0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a16906370a0823190602401602060405180830381865afa1580156109e7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0b919061120a565b1015610a2a576040516378dbf0af60e11b815260040160405180910390fd5b60405163a9059cbb60e01b8152336004820152602481018290527f0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a6001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610a94573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab89190611247565b50600354610acf906001600160a01b031634610cec565b604080513481526020810183905233917ffefbb345f3254c99ae71865219647ef38b6363c25a654348007cb8aac567402d910160405180910390a250565b610b15610cc0565b8051825114610b3757604051637507aab160e11b815260040160405180910390fd5b5f5b825181101561059c57818181518110610b5457610b546111ac565b602002602001015160065f858481518110610b7157610b716111ac565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054610ba39190611234565b60065f858481518110610bb857610bb86111ac565b6020908102919091018101516001600160a01b031682528101919091526040015f2055600101610b39565b610beb610cc0565b815f03610c0a5760405162bfc92160e01b815260040160405180910390fd5b6001600160a01b038316610c2f57600380546001600160a01b03191630179055610c4b565b600380546001600160a01b0319166001600160a01b0385161790555b60029190915560095550565b610c5f610cc0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610c89610cc0565b6001600160a01b038116610cb757604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61088581610d75565b5f546001600160a01b0316331461044b5760405163118cdaa760e01b8152336004820152602401610cae565b306001600160a01b03831603610d00575050565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610d49576040519150601f19603f3d011682016040523d82523d5f602084013e610d4e565b606091505b50909150508015155f0361059c57604051630db2c7f160e31b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092019092526020810180516001600160e01b031663a9059cbb60e01b17905261059c918591905f90610e2190841683610e6e565b905080515f14158015610e45575080806020019051810190610e439190611247565b155b1561059c57604051635274afe760e01b81526001600160a01b0384166004820152602401610cae565b6060610e7b83835f610e84565b90505b92915050565b606081471015610ea95760405163cd78605960e01b8152306004820152602401610cae565b5f80856001600160a01b03168486604051610ec49190611266565b5f6040518083038185875af1925050503d805f8114610efe576040519150601f19603f3d011682016040523d82523d5f602084013e610f03565b606091505b5091509150610f13868383610f1f565b925050505b9392505050565b606082610f3457610f2f82610f7b565b610f18565b8151158015610f4b57506001600160a01b0384163b155b15610f7457604051639996b31560e01b81526001600160a01b0385166004820152602401610cae565b5080610f18565b805115610f8b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f60208284031215610fb4575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff857610ff8610fbb565b604052919050565b5f67ffffffffffffffff82111561101957611019610fbb565b5060051b60200190565b6001600160a01b0381168114610885575f80fd5b5f82601f830112611046575f80fd5b8135602061105b61105683611000565b610fcf565b8083825260208201915060208460051b87010193508684111561107c575f80fd5b602086015b848110156110985780358352918301918301611081565b509695505050505050565b5f80604083850312156110b4575f80fd5b823567ffffffffffffffff808211156110cb575f80fd5b818501915085601f8301126110de575f80fd5b813560206110ee61105683611000565b82815260059290921b8401810191818101908984111561110c575f80fd5b948201945b8386101561113357853561112481611023565b82529482019490820190611111565b96505086013592505080821115611148575f80fd5b5061115585828601611037565b9150509250929050565b5f6020828403121561116f575f80fd5b8135610f1881611023565b5f805f6060848603121561118c575f80fd5b833561119781611023565b95602085013595506040909401359392505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610e7e57610e7e6111c0565b5f8261120557634e487b7160e01b5f52601260045260245ffd5b500490565b5f6020828403121561121a575f80fd5b5051919050565b81810381811115610e7e57610e7e6111c0565b80820180821115610e7e57610e7e6111c0565b5f60208284031215611257575f80fd5b81518015158114610f18575f80fd5b5f82515f5b81811015611285576020818601810151858301520161126b565b505f92019182525091905056fea26469706673582212200bbfe9c0e84efa5dbf70dd279bc045acb8178bcffaea1cdc16dce9027ec180ee64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a
-----Decoded View---------------
Arg [0] : _fungToken (address): 0x0e4e7F2AecF408AFF4f82f067677050239bdC58A
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e4e7f2aecf408aff4f82f067677050239bdc58a
Deployed Bytecode Sourcemap
90855:5785:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;91149:30;;;;;;;;;;;;;;;;;;;160:25:1;;;148:2;133:18;91149:30:0;;;;;;;;96262:102;;;;;;;;;;;;;:::i;:::-;;94989:140;;;;;;;;;;-1:-1:-1;94989:140:0;;;;;:::i;:::-;;:::i;91188:26::-;;;;;;;;;;-1:-1:-1;91188:26:0;;;;-1:-1:-1;;;;;91188:26:0;;;;;;-1:-1:-1;;;;;545:32:1;;;527:51;;515:2;500:18;91188:26:0;381:203:1;91393:27:0;;;;;;;;;;;;;;;;95511:593;;;;;;;;;;-1:-1:-1;95511:593:0;;;;;:::i;:::-;;:::i;91965:425::-;;;;;;;;;;-1:-1:-1;91965:425:0;;;;;:::i;:::-;;:::i;90463:29::-;;;;;;;;;;-1:-1:-1;90463:29:0;;;;-1:-1:-1;;;;;90463:29:0;;;3107:103;;;;;;;;;;;;;:::i;91223:31::-;;;;;;;;;;;;;;;;92477:790;;;;;;;;;;-1:-1:-1;92477:790:0;;;;;:::i;:::-;;:::i;94209:309::-;;;;;;;;;;-1:-1:-1;94209:309:0;;;;;:::i;:::-;;:::i;91656:200::-;;;;;;;;;;;;;:::i;:::-;;;4023:14:1;;4016:22;3998:41;;3986:2;3971:18;91656:200:0;3858:187:1;96112:144:0;;;;;;;;;;-1:-1:-1;96112:144:0;;;;;:::i;:::-;;:::i;2432:87::-;;;;;;;;;;-1:-1:-1;2478:7:0;2505:6;-1:-1:-1;;;;;2505:6:0;2432:87;;91315:69;;;;;;;;;;-1:-1:-1;91315:69:0;;;;;:::i;:::-;;;;;;;;;;;;;;93283:918;;;:::i;95137:368::-;;;;;;;;;;-1:-1:-1;95137:368:0;;;;;:::i;:::-;;:::i;94526:455::-;;;;;;;;;;-1:-1:-1;94526:455:0;;;;;:::i;:::-;;:::i;90545:104::-;;;;;;;;;;-1:-1:-1;90545:104:0;;;;;:::i;:::-;;:::i;91429:67::-;;;;;;;;;;-1:-1:-1;91429:67:0;;;;;:::i;:::-;;;;;;;;;;;;;;3365:220;;;;;;;;;;-1:-1:-1;3365:220:0;;;;;:::i;:::-;;:::i;91505:27::-;;;;;;;;;;;;;;;;91107:33;;;;;;;;;;;;;;;96262:102;2318:13;:11;:13::i;:::-;96313:43:::1;96322:10;96334:21;96313:8;:43::i;:::-;96262:102::o:0;94989:140::-;2318:13;:11;:13::i;:::-;95060:12:::1;:21:::0;;;95097:24:::1;::::0;160:25:1;;;95097:24:0::1;::::0;148:2:1;133:18;95097:24:0::1;;;;;;;94989:140:::0;:::o;95511:593::-;2318:13;:11;:13::i;:::-;95648:17:::1;:24;95632:5;:12;:40;95628:95;;95696:15;;-1:-1:-1::0;;;95696:15:0::1;;;;;;;;;;;95628:95;95737:6;95733:364;95749:5;:12;95745:1;:16;95733:364;;;95779:26;95808:9;:19;95818:5;95824:1;95818:8;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;95808:19:0::1;-1:-1:-1::0;;;;;95808:19:0::1;;;;;;;;;;;;;95779:48;;95867:17;95885:1;95867:20;;;;;;;;:::i;:::-;;;;;;;95846:18;:41;95842:100;;;95915:11;;-1:-1:-1::0;;;95915:11:0::1;;;;;;;;;;;95842:100;96028:17;96046:1;96028:20;;;;;;;;:::i;:::-;;;;;;;96007:18;:41;95985:9;:19;95995:5;96001:1;95995:8;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;;;-1:-1:-1;;;;;95985:19:0::1;::::0;;;::::1;::::0;;;;;;-1:-1:-1;95985:19:0;:63;-1:-1:-1;96067:3:0::1;;95733:364;;;;95511:593:::0;;:::o;91965:425::-;92031:7;92051:18;92072:24;92091:4;92072:18;:24::i;:::-;92051:45;;92109:26;92158:15;;92138:10;92151:4;92138:17;;;;:::i;:::-;:35;;;;:::i;:::-;92188:34;;-1:-1:-1;;;92188:34:0;;92216:4;92188:34;;;527:51:1;92109:64:0;;-1:-1:-1;92109:64:0;;-1:-1:-1;;;;;92188:9:0;:19;;;;500:18:1;;92188:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:55;92184:169;;;92286:34;;-1:-1:-1;;;92286:34:0;;92314:4;92286:34;;;527:51:1;92323:18:0;;92286:9;-1:-1:-1;;;;;92286:19:0;;;;500:18:1;;92286:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;92273:47;;:10;:47;:::i;:::-;:68;;;;:::i;:::-;92260:81;;92184:169;-1:-1:-1;92372:10:0;91965:425;-1:-1:-1;;91965:425:0:o;3107:103::-;2318:13;:11;:13::i;:::-;3172:30:::1;3199:1;3172:18;:30::i;92477:790::-:0;-1:-1:-1;;;;;92696:15:0;;92540:18;92696:15;;;:9;:15;;;;;;92728:23;:21;:23::i;:::-;92724:536;;;92781:13;92768:26;;92724:536;;;92847:12;;-1:-1:-1;;;;;92894:17:0;;92827;92894;;;:11;:17;;;;;;92932:21;;;92928:149;;;92986:21;92998:9;92986;:21;:::i;:::-;92974:33;;92928:149;;;93060:1;93048:13;;92928:149;93114:9;93097:13;:26;93093:156;;93157:13;93144:26;;93093:156;;;93224:9;93211:22;;93093:156;92812:448;;92724:536;92560:707;92477:790;;;:::o;94209:309::-;2318:13;:11;:13::i;:::-;94334:12:::1;::::0;;-1:-1:-1;;;94334:12:0;::::1;;;:20;;::::0;;94330:74:::1;;94378:14;;-1:-1:-1::0;;;94378:14:0::1;;;;;;;;;;;94330:74;94416:62;94432:12;94446:16;94464:13;94416:15;:62::i;:::-;-1:-1:-1::0;;94506:4:0::1;94491:19:::0;;-1:-1:-1;;;;94491:19:0::1;-1:-1:-1::0;;;94491:19:0::1;::::0;;-1:-1:-1;94209:309:0:o;91656:200::-;91710:4;91750:12;;91731:16;;:31;91727:120;;;-1:-1:-1;91786:4:0;;91656:200::o;91727:120::-;-1:-1:-1;91830:5:0;;91656:200::o;96112:144::-;2318:13;:11;:13::i;:::-;96216:31:::1;::::0;-1:-1:-1;;;96216:31:0;;96241:4:::1;96216:31;::::0;::::1;527:51:1::0;96173:75:0::1;::::0;96196:6;;96204:10:::1;::::0;-1:-1:-1;;;;;96216:16:0;::::1;::::0;::::1;::::0;500:18:1;;96216:31:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;96173:22;:75::i;:::-;96112:144:::0;:::o;93283:918::-;93340:9;93353:1;93340:14;93336:69;;93378:15;;-1:-1:-1;;;93378:15:0;;;;;;;;;;;93336:69;93454:9;93421:30;93440:10;93421:18;:30::i;:::-;:42;93417:99;;;93487:17;;-1:-1:-1;;;93487:17:0;;;;;;;;;;;93417:99;93542:10;93532:21;;;;:9;:21;;;;;;93556:9;-1:-1:-1;93528:181:0;;;93616:10;93606:21;;;;:9;:21;;;;;;:33;;93630:9;;93606:33;:::i;:::-;93592:10;93582:21;;;;:9;:21;;;;;:57;93528:181;;;93682:10;93696:1;93672:21;;;:9;:21;;;;;:25;93528:181;93757:10;93745:23;;;;:11;:23;;;;;;:35;;93771:9;;93745:35;:::i;:::-;93731:10;93719:23;;;;:11;:23;;;;;:61;93810:16;;:28;;93829:9;;93810:28;:::i;:::-;93791:16;:47;93892:15;;93851:19;;93873:16;:9;93885:4;93873:16;:::i;:::-;:34;;;;:::i;:::-;93922;;-1:-1:-1;;;93922:34:0;;93950:4;93922:34;;;527:51:1;93851:56:0;;-1:-1:-1;93851:56:0;;-1:-1:-1;;;;;93922:9:0;:19;;;;500:18:1;;93922:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:48;93918:108;;;93994:20;;-1:-1:-1;;;93994:20:0;;;;;;;;;;;93918:108;94038:43;;-1:-1:-1;;;94038:43:0;;94057:10;94038:43;;;5823:51:1;5890:18;;;5883:34;;;94038:9:0;-1:-1:-1;;;;;94038:18:0;;;;5796::1;;94038:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;94103:11:0;;94094:32;;-1:-1:-1;;;;;94103:11:0;94116:9;94094:8;:32::i;:::-;94144:49;;;94170:9;6384:25:1;;6440:2;6425:18;;6418:34;;;94158:10:0;;94144:49;;6357:18:1;94144:49:0;;;;;;;93325:876;93283:918::o;95137:368::-;2318:13;:11;:13::i;:::-;95269:12:::1;:19;95253:5;:12;:35;95249:90;;95312:15;;-1:-1:-1::0;;;95312:15:0::1;;;;;;;;;;;95249:90;95353:6;95349:149;95365:5;:12;95361:1;:16;95349:149;;;95439:12;95452:1;95439:15;;;;;;;;:::i;:::-;;;;;;;95417:9;:19;95427:5;95433:1;95427:8;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;95417:19:0::1;-1:-1:-1::0;;;;;95417:19:0::1;;;;;;;;;;;;;:37;;;;:::i;:::-;95395:9;:19;95405:5;95411:1;95405:8;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;;;-1:-1:-1;;;;;95395:19:0::1;::::0;;;::::1;::::0;;;;;;-1:-1:-1;95395:19:0;:59;95481:3:::1;;95349:149;;94526:455:::0;2318:13;:11;:13::i;:::-;94654:16:::1;94674:1;94654:21:::0;94650:75:::1;;94699:14;;-1:-1:-1::0;;;94699:14:0::1;;;;;;;;;;;94650:75;-1:-1:-1::0;;;;;94749:26:0;::::1;94745:145;;94792:11;:27:::0;;-1:-1:-1;;;;;;94792:27:0::1;94814:4;94792:27;::::0;;94745:145:::1;;;94852:11;:26:::0;;-1:-1:-1;;;;;;94852:26:0::1;-1:-1:-1::0;;;;;94852:26:0;::::1;;::::0;;94745:145:::1;94900:15;:34:::0;;;;94945:12:::1;:28:::0;-1:-1:-1;94526:455:0:o;90545:104::-;2318:13;:11;:13::i;:::-;90619:14:::1;:22:::0;;-1:-1:-1;;;;;;90619:22:0::1;-1:-1:-1::0;;;;;90619:22:0;;;::::1;::::0;;;::::1;::::0;;90545:104::o;3365:220::-;2318:13;:11;:13::i;:::-;-1:-1:-1;;;;;3450:22:0;::::1;3446:93;;3496:31;::::0;-1:-1:-1;;;3496:31:0;;3524:1:::1;3496:31;::::0;::::1;527:51:1::0;500:18;;3496:31:0::1;;;;;;;;3446:93;3549:28;3568:8;3549:18;:28::i;2597:166::-:0;2478:7;2505:6;-1:-1:-1;;;;;2505:6:0;680:10;2657:23;2653:103;;2704:40;;-1:-1:-1;;;2704:40:0;;680:10;2704:40;;;527:51:1;500:18;;2704:40:0;381:203:1;96370:267:0;96456:4;-1:-1:-1;;;;;96441:20:0;;;96437:46;;96370:267;;:::o;96437:46::-;96496:12;96514:3;-1:-1:-1;;;;;96514:8:0;96531:7;96514:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;96495:49:0;;-1:-1:-1;;96559:16:0;;;96570:5;96559:16;96555:75;;96599:19;;-1:-1:-1;;;96599:19:0;;;;;;;;;;;3745:191;3819:16;3838:6;;-1:-1:-1;;;;;3855:17:0;;;-1:-1:-1;;;;;;3855:17:0;;;;;;3888:40;;3838:6;;;;;;;3888:40;;3819:16;3888:40;3808:128;3745:191;:::o;85872:162::-;85982:43;;;-1:-1:-1;;;;;5841:32:1;;;85982:43:0;;;5823:51:1;5890:18;;;;5883:34;;;85982:43:0;;;;;;;;;;5796:18:1;;;;85982:43:0;;;;;;;;-1:-1:-1;;;;;85982:43:0;-1:-1:-1;;;85982:43:0;;;85955:71;;85975:5;;85982:43;-1:-1:-1;;89133:33:0;;85997:14;;85982:43;89133:27;:33::i;:::-;89107:59;;89181:10;:17;89202:1;89181:22;;:57;;;;;89219:10;89208:30;;;;;;;;;;;;:::i;:::-;89207:31;89181:57;89177:137;;;89262:40;;-1:-1:-1;;;89262:40:0;;-1:-1:-1;;;;;545:32:1;;89262:40:0;;;527:51:1;500:18;;89262:40:0;381:203:1;81187:153:0;81262:12;81294:38;81316:6;81324:4;81330:1;81294:21;:38::i;:::-;81287:45;;81187:153;;;;;:::o;81675:398::-;81774:12;81827:5;81803:21;:29;81799:110;;;81856:41;;-1:-1:-1;;;81856:41:0;;81891:4;81856:41;;;527:51:1;500:18;;81856:41:0;381:203:1;81799:110:0;81920:12;81934:23;81961:6;-1:-1:-1;;;;;81961:11:0;81980:5;81987:4;81961:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81919:73;;;;82010:55;82037:6;82045:7;82054:10;82010:26;:55::i;:::-;82003:62;;;;81675:398;;;;;;:::o;83151:597::-;83299:12;83329:7;83324:417;;83353:19;83361:10;83353:7;:19::i;:::-;83324:417;;;83581:17;;:22;:49;;;;-1:-1:-1;;;;;;83607:18:0;;;:23;83581:49;83577:121;;;83658:24;;-1:-1:-1;;;83658:24:0;;-1:-1:-1;;;;;545:32:1;;83658:24:0;;;527:51:1;500:18;;83658:24:0;381:203:1;83577:121:0;-1:-1:-1;83719:10:0;83712:17;;84301:528;84434:17;;:21;84430:392;;84666:10;84660:17;84723:15;84710:10;84706:2;84702:19;84695:44;84430:392;84793:17;;-1:-1:-1;;;84793:17:0;;;;;;;;;;;196:180:1;255:6;308:2;296:9;287:7;283:23;279:32;276:52;;;324:1;321;314:12;276:52;-1:-1:-1;347:23:1;;196:180;-1:-1:-1;196:180:1:o;589:127::-;650:10;645:3;641:20;638:1;631:31;681:4;678:1;671:15;705:4;702:1;695:15;721:275;792:2;786:9;857:2;838:13;;-1:-1:-1;;834:27:1;822:40;;892:18;877:34;;913:22;;;874:62;871:88;;;939:18;;:::i;:::-;975:2;968:22;721:275;;-1:-1:-1;721:275:1:o;1001:183::-;1061:4;1094:18;1086:6;1083:30;1080:56;;;1116:18;;:::i;:::-;-1:-1:-1;1161:1:1;1157:14;1173:4;1153:25;;1001:183::o;1189:131::-;-1:-1:-1;;;;;1264:31:1;;1254:42;;1244:70;;1310:1;1307;1300:12;1325:668;1379:5;1432:3;1425:4;1417:6;1413:17;1409:27;1399:55;;1450:1;1447;1440:12;1399:55;1486:6;1473:20;1512:4;1536:60;1552:43;1592:2;1552:43;:::i;:::-;1536:60;:::i;:::-;1618:3;1642:2;1637:3;1630:15;1670:4;1665:3;1661:14;1654:21;;1727:4;1721:2;1718:1;1714:10;1706:6;1702:23;1698:34;1684:48;;1755:3;1747:6;1744:15;1741:35;;;1772:1;1769;1762:12;1741:35;1808:4;1800:6;1796:17;1822:142;1838:6;1833:3;1830:15;1822:142;;;1904:17;;1892:30;;1942:12;;;;1855;;1822:142;;;-1:-1:-1;1982:5:1;1325:668;-1:-1:-1;;;;;;1325:668:1:o;1998:1215::-;2116:6;2124;2177:2;2165:9;2156:7;2152:23;2148:32;2145:52;;;2193:1;2190;2183:12;2145:52;2233:9;2220:23;2262:18;2303:2;2295:6;2292:14;2289:34;;;2319:1;2316;2309:12;2289:34;2357:6;2346:9;2342:22;2332:32;;2402:7;2395:4;2391:2;2387:13;2383:27;2373:55;;2424:1;2421;2414:12;2373:55;2460:2;2447:16;2482:4;2506:60;2522:43;2562:2;2522:43;:::i;2506:60::-;2600:15;;;2682:1;2678:10;;;;2670:19;;2666:28;;;2631:12;;;;2706:19;;;2703:39;;;2738:1;2735;2728:12;2703:39;2762:11;;;;2782:217;2798:6;2793:3;2790:15;2782:217;;;2878:3;2865:17;2895:31;2920:5;2895:31;:::i;:::-;2939:18;;2815:12;;;;2977;;;;2782:217;;;3018:5;-1:-1:-1;;3061:18:1;;3048:32;;-1:-1:-1;;3092:16:1;;;3089:36;;;3121:1;3118;3111:12;3089:36;;3144:63;3199:7;3188:8;3177:9;3173:24;3144:63;:::i;:::-;3134:73;;;1998:1215;;;;;:::o;3218:247::-;3277:6;3330:2;3318:9;3309:7;3305:23;3301:32;3298:52;;;3346:1;3343;3336:12;3298:52;3385:9;3372:23;3404:31;3429:5;3404:31;:::i;3470:383::-;3547:6;3555;3563;3616:2;3604:9;3595:7;3591:23;3587:32;3584:52;;;3632:1;3629;3622:12;3584:52;3671:9;3658:23;3690:31;3715:5;3690:31;:::i;:::-;3740:5;3792:2;3777:18;;3764:32;;-1:-1:-1;3843:2:1;3828:18;;;3815:32;;3470:383;-1:-1:-1;;;3470:383:1:o;4538:127::-;4599:10;4594:3;4590:20;4587:1;4580:31;4630:4;4627:1;4620:15;4654:4;4651:1;4644:15;4670:127;4731:10;4726:3;4722:20;4719:1;4712:31;4762:4;4759:1;4752:15;4786:4;4783:1;4776:15;4802:168;4875:9;;;4906;;4923:15;;;4917:22;;4903:37;4893:71;;4944:18;;:::i;4975:217::-;5015:1;5041;5031:132;;5085:10;5080:3;5076:20;5073:1;5066:31;5120:4;5117:1;5110:15;5148:4;5145:1;5138:15;5031:132;-1:-1:-1;5177:9:1;;4975:217::o;5197:184::-;5267:6;5320:2;5308:9;5299:7;5295:23;5291:32;5288:52;;;5336:1;5333;5326:12;5288:52;-1:-1:-1;5359:16:1;;5197:184;-1:-1:-1;5197:184:1:o;5386:128::-;5453:9;;;5474:11;;;5471:37;;;5488:18;;:::i;5519:125::-;5584:9;;;5605:10;;;5602:36;;;5618:18;;:::i;5928:277::-;5995:6;6048:2;6036:9;6027:7;6023:23;6019:32;6016:52;;;6064:1;6061;6054:12;6016:52;6096:9;6090:16;6149:5;6142:13;6135:21;6128:5;6125:32;6115:60;;6171:1;6168;6161:12;6673:412;6802:3;6840:6;6834:13;6865:1;6875:129;6889:6;6886:1;6883:13;6875:129;;;6987:4;6971:14;;;6967:25;;6961:32;6948:11;;;6941:53;6904:12;6875:129;;;-1:-1:-1;7059:1:1;7023:16;;7048:13;;;-1:-1:-1;7023:16:1;6673:412;-1:-1:-1;6673:412:1:o
Swarm Source
ipfs://0bbfe9c0e84efa5dbf70dd279bc045acb8178bcffaea1cdc16dce9027ec180ee
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.