Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Claims
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.25; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import { IPreSale } from "./IPreSale.sol"; import "./Common.sol"; /// @title Claims contract /// @notice Implements the claiming of the leader's commissions contract Claims is AccessControl, ReentrancyGuard { using SafeERC20 for IERC20; using Address for address payable; /// @member token The token address /// @member amount The token amount struct ClaimInfo { IERC20 token; uint256 amount; } /// @notice Returns the identifier of the COMMISSIONS_MANAGER role bytes32 public constant COMMISSIONS_MANAGER = keccak256("COMMISSIONS_MANAGER"); /// @notice Returns the identifier of the ADMIN_ROLE role bytes32 public constant ADMIN_ROLE = keccak256("ADMIN"); /// @notice Returns the address of presale contract IPreSale public presale; /// @notice The address of signer wallet address public signerWallet; /// @notice Stores the amount of token in a round of the user mapping(address => mapping(uint32 => mapping(IERC20 => uint256))) public pendingClaims; /// @notice Stores the enabled/disabled status of a round mapping(uint32 => bool) public isEnabled; /// @dev Emitted when claim amount is set for the addresses event ClaimSet(address indexed to, uint32 indexed round, ClaimInfo claimInfo); /// @dev Emitted when claim amount is claimed event FundsClaimed(address indexed by, uint32 indexed round, IERC20 token, uint256 amount); /// @dev Emitted when claim access changes for the round event RoundEnableUpdated(bool oldAccess, bool newAccess); /// @dev Emitted when token presale contract is updated event PresaleUpdated(address prevAddress, address newAddress); /// @dev Emitted when address of signer is updated event SignerUpdated(address oldSigner, address newSigner); /// @notice Thrown when claiming before round ends error RoundNotEnded(); /// @notice Thrown when round is not Enabled error RoundNotEnabled(); /// @notice Thrown when commissions manager wants to set claim while claim enable error WaitForRoundDisable(); /// @dev Constructor /// @param signerAddress The signer wallet constructor(address signerAddress) { if (signerAddress == address(0)) { revert ZeroAddress(); } signerWallet = signerAddress; _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE); _setRoleAdmin(COMMISSIONS_MANAGER, ADMIN_ROLE); _grantRole(ADMIN_ROLE, msg.sender); } /// @notice Updates token amounts to addresses in a given round /// @param to The array of claimants /// @param round The round number /// @param claims The tokens and amount to claim function setClaim( address[] calldata to, uint32 round, ClaimInfo[][] calldata claims ) external onlyRole(COMMISSIONS_MANAGER) { if (isEnabled[round]) { revert WaitForRoundDisable(); } uint256 toLength = to.length; if (toLength == 0) { revert InvalidData(); } if (toLength != claims.length) { revert ArrayLengthMismatch(); } for (uint256 i; i < toLength; ++i) { address user = to[i]; if (user == address(0)) { revert ZeroAddress(); } mapping(IERC20 => uint256) storage claimInfo = pendingClaims[to[i]][round]; ClaimInfo[] calldata toClaim = claims[i]; for (uint256 j; j < toClaim.length; j++) { ClaimInfo calldata amount = toClaim[j]; claimInfo[amount.token] = amount.amount; emit ClaimSet({ to: user, round: round, claimInfo: amount }); } } } /// @notice Changes presale contract address /// @param newPresale The address of the new PreSale contract function updatePreSaleAddress(IPreSale newPresale) external onlyRole(ADMIN_ROLE) { if (address(newPresale) == address(0)) { revert ZeroAddress(); } if (presale == newPresale) { revert IdenticalValue(); } emit PresaleUpdated({ prevAddress: address(presale), newAddress: address(newPresale) }); presale = newPresale; } /// @notice Changes the claim access of the contract /// @param round The round number of which access is changed /// @param status The access status of the round function enableClaims(uint32 round, bool status) external onlyRole(COMMISSIONS_MANAGER) { bool oldAccess = isEnabled[round]; if (oldAccess == status) { revert IdenticalValue(); } emit RoundEnableUpdated({ oldAccess: oldAccess, newAccess: status }); isEnabled[round] = status; } /// @notice Gives max allowance of tokens to presale contract /// @param tokens List of tokens to approve function approveAllowance(IERC20[] calldata tokens) external onlyRole(ADMIN_ROLE) { uint256 tokensLength = tokens.length; for (uint256 i; i < tokensLength; ++i) { tokens[i].forceApprove(address(presale), type(uint256).max); } } /// @notice Claims the amount in a given round /// @param round The round in which you want to claim /// @param tokens The addresses of the token to be claimed function claim(uint32 round, IERC20[] calldata tokens) external nonReentrant { _checkRoundAndTime(round); mapping(IERC20 => uint256) storage claimInfo = pendingClaims[msg.sender][round]; uint256 tokensLength = tokens.length; for (uint256 i; i < tokensLength; ++i) { IERC20 token = tokens[i]; uint256 amount = claimInfo[token]; if (amount == 0) { continue; } delete claimInfo[token]; _processTokenTransfer(token, amount); emit FundsClaimed({ by: msg.sender, round: round, token: token, amount: amount }); } } /// @notice Purchases presale token with claim amounts /// @param round The round in which user will purchase /// @param deadline The signature deadline /// @param normalizationFactors The values to handle decimals /// @param tokenPrices The current prices of the tokens in 10 decimals /// @param tokens The addresses of the tokens /// @param amounts The purchase amounts /// @param minAmountsToken The minimum amounts of tokens recipient will get /// @param v The `v` signature parameter /// @param r The `r` signature parameter /// @param s The `s` signature parameter function purchaseWithClaim( uint32 round, uint256 deadline, uint8[] calldata normalizationFactors, uint256[] calldata tokenPrices, IERC20[] calldata tokens, uint256[] calldata amounts, uint256[] calldata minAmountsToken, uint8 v, bytes32 r, bytes32 s ) external nonReentrant { _checkRoundAndTime(round); if (normalizationFactors.length == 0) { revert ZeroLengthArray(); } uint256 tokensLength = tokens.length; if ( normalizationFactors.length != tokenPrices.length || tokenPrices.length != tokensLength || tokensLength != amounts.length || amounts.length != minAmountsToken.length ) { revert ArrayLengthMismatch(); } _verifyPurchaseWithClaim( msg.sender, round, deadline, tokenPrices, normalizationFactors, tokens, amounts, v, r, s ); mapping(IERC20 => uint256) storage claimInfo = pendingClaims[msg.sender][round]; for (uint256 i; i < tokensLength; ++i) { IERC20 token = tokens[i]; uint256 amountToPurchase = amounts[i]; uint8 normalizationFactor = normalizationFactors[i]; uint256 minAmountToken = minAmountsToken[i]; uint256 amount = claimInfo[token]; if (amount == 0) { continue; } if (amountToPurchase > amount) { continue; } delete claimInfo[token]; uint256 remainingAmount = amount - amountToPurchase; IPreSale sale = presale; if (token == ETH) { sale.purchaseWithClaim{ value: amountToPurchase }( ETH, 0, normalizationFactor, amountToPurchase, minAmountToken, msg.sender, round ); } else { uint256 allowance = token.allowance(address(this), address(sale)); if (allowance < amountToPurchase) { token.forceApprove(address(sale), type(uint256).max); } sale.purchaseWithClaim( token, tokenPrices[i], normalizationFactor, amountToPurchase, minAmountToken, msg.sender, round ); } if (remainingAmount > 0) { _processTokenTransfer(token, remainingAmount); emit FundsClaimed({ by: msg.sender, round: round, token: token, amount: remainingAmount }); } } } /// @notice Changes signer wallet address /// @param newSigner The address of the new signer wallet function changeSigner(address newSigner) external onlyRole(ADMIN_ROLE) { address oldSigner = signerWallet; if (newSigner == address(0)) { revert ZeroAddress(); } if (oldSigner == newSigner) { revert IdenticalValue(); } emit SignerUpdated({ oldSigner: oldSigner, newSigner: newSigner }); signerWallet = newSigner; } /// @dev Verifies round and time function _checkRoundAndTime(uint32 round) private view { if (!isEnabled[round]) { revert RoundNotEnabled(); } (, uint256 endTime, ) = presale.rounds(round); if (block.timestamp < endTime) { revert RoundNotEnded(); } } /// @dev Verifies the address that signed a hashed message (`hash`) with /// `signature` function _verifyMessage(bytes32 encodedMessageHash, uint8 v, bytes32 r, bytes32 s) private view { if (signerWallet != ECDSA.recover(MessageHashUtils.toEthSignedMessageHash(encodedMessageHash), v, r, s)) { revert InvalidSignature(); } } /// @dev Checks token and transfer amount to user of that token function _processTokenTransfer(IERC20 token, uint256 amount) private { if (token == ETH) { payable(msg.sender).sendValue(amount); } else { token.safeTransfer(msg.sender, amount); } } /// @dev The tokenPrices,tokens are provided externally and therefore have to be verified by the trusted presale contract function _verifyPurchaseWithClaim( address by, uint32 round, uint256 deadline, uint256[] calldata tokenPrices, uint8[] calldata normalizationFactors, IERC20[] calldata tokens, uint256[] calldata amounts, uint8 v, bytes32 r, bytes32 s ) private view { bytes32 encodedMessageHash = keccak256( abi.encodePacked(by, round, tokenPrices, normalizationFactors, deadline, tokens, amounts) ); _verifyMessage(encodedMessageHash, v, r, s); } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../utils/Address.sol"; /** * @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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol) pragma solidity ^0.8.20; import {Strings} from "../Strings.sol"; /** * @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) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @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)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.25; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @dev The address of the Ethereum IERC20 constant ETH = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); /// @notice Thrown when updating an address with zero address error ZeroAddress(); /// @notice Thrown when updating with an array of no values error ZeroLengthArray(); /// @notice Thrown when updating with the same value as previously stored error IdenticalValue(); /// @notice Thrown when two array lengths does not match error ArrayLengthMismatch(); /// @notice Thrown when sign is invalid error InvalidSignature(); /// @notice Thrown when input array length is zero error InvalidData();
// SPDX-License-Identifier: MIT pragma solidity 0.8.25; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IRounds } from "./IRounds.sol"; interface IPreSale is IRounds { /// @notice Purchases token with claim amount /// @param token The purchase token /// @param tokenPrice The current price of token in 10 decimals /// @param referenceNormalizationFactor The value to handle decimals /// @param amount The purchase amount /// @param minAmountToken The minimum amount of token recipient will get /// @param recipient The address of the recipient /// @param round The round in which user will purchase function purchaseWithClaim( IERC20 token, uint256 tokenPrice, uint8 referenceNormalizationFactor, uint256 amount, uint256 minAmountToken, address recipient, uint32 round ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.25; interface IRounds { /// @notice Returns the round details of the round function rounds(uint32 round) external view returns (uint256 startTime, uint256 endTime, uint256 price); }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 1000000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"signerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IdenticalValue","type":"error"},{"inputs":[],"name":"InvalidData","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"RoundNotEnabled","type":"error"},{"inputs":[],"name":"RoundNotEnded","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"WaitForRoundDisable","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroLengthArray","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint32","name":"round","type":"uint32"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct Claims.ClaimInfo","name":"claimInfo","type":"tuple"}],"name":"ClaimSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"uint32","name":"round","type":"uint32"},{"indexed":false,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"prevAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"PresaleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"oldAccess","type":"bool"},{"indexed":false,"internalType":"bool","name":"newAccess","type":"bool"}],"name":"RoundEnableUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldSigner","type":"address"},{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSIONS_MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"approveAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"changeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"round","type":"uint32"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"round","type":"uint32"},{"internalType":"bool","name":"status","type":"bool"}],"name":"enableClaims","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"isEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"contract IERC20","name":"","type":"address"}],"name":"pendingClaims","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presale","outputs":[{"internalType":"contract IPreSale","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"round","type":"uint32"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8[]","name":"normalizationFactors","type":"uint8[]"},{"internalType":"uint256[]","name":"tokenPrices","type":"uint256[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"minAmountsToken","type":"uint256[]"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"purchaseWithClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint32","name":"round","type":"uint32"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Claims.ClaimInfo[][]","name":"claims","type":"tuple[][]"}],"name":"setClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPreSale","name":"newPresale","type":"address"}],"name":"updatePreSaleAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60803461013757601f61223a38819003918201601f19168301916001600160401b0383118484101761013c5780849260209460405283398101031261013757516001600160a01b038116908190036101375760018055801561012557600380546001600160a01b03191691909117905560008051602061221a833981519152600081815260208190527f5cbfc8ee58ca47855df7bcf648dd304ddb6b932f9b87878bdf6318d7ec7ee5b88054908390557fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff90839081838580a47f28d695c7dfc0dc20c36b38cc22e861d8a3c0da73ef3975e85a4bf12193642a5c908183526001604084200192848454945580a461011533610152565b5060405161202790816101f38239f35b60405163d92e233d60e01b8152600490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b031660008181527f5cbfc8ee58ca47855df7bcf648dd304ddb6b932f9b87878bdf6318d7ec7ee5b7602052604081205490919060008051602061221a8339815191529060ff166101ed57808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b50509056fe60a080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816301ffc9a71461145e57508063054a68ad146113c4578063248a9ca3146113775780632f2ff15d1461131a57806336568abe14611290578063461c48cd146111b35780635f91d4061461115957806364f0d35e146111075780637188cb351461102757806375b238fc14610fce57806391d1485414610f55578063a217fddf14610f1b578063a24e178814610e7f578063aad2b72314610d75578063c4f805fe14610a8d578063cabb454914610a34578063ce73f87d14610310578063d547741f146102b3578063fdea8e0b146102615763ff93be0314610106573861000f565b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761013d611573565b60243567ffffffffffffffff811161025c5761015d9036906004016115a7565b91610166611a6c565b61016f81611aa7565b336000526020600460205263ffffffff604060002092169182600052602052604060002060005b8581106101a35760018055005b80846101ba6101b56001948a8a6115d8565b6115e8565b73ffffffffffffffffffffffffffffffffffffffff811660005284865260406000208054908115610253577f4978506686bd9ae370ab4cd6b1b3093dad6682e7840df229a6534e9dc4ba522391600061024992556102188185611bfb565b6040519182913395836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b0390a35b01610196565b5050505061024d565b600080fd5b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761001b6004356102f061153d565b9080600052600060205261030b60016040600020015461177c565b61184c565b3461025c576101407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610348611573565b67ffffffffffffffff9060443582811161025c5761036a9036906004016115a7565b9260643581811161025c576103839036906004016115a7565b906080529260843582811161025c576103a09036906004016115a7565b92909460a43582811161025c576103bb9036906004016115a7565b94909260c4351161025c576103d53660c4356004016115a7565b91909560ff60e4351660e4350361025c576103ee611a6c565b6103f786611aa7565b8915610a0a57838a14801590610a00575b80156109f6575b80156109ec575b6109c2576040513360601b60208201527fffffffff000000000000000000000000000000000000000000000000000000008760e01b1660348201526104616038820186608051611bc7565b899060005b8d81106109a0575060209150602435815201818b60005b8681106109695750506104946104c092858a611bc7565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261164c565b6020815191012073ffffffffffffffffffffffffffffffffffffffff60035416907f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c5273ffffffffffffffffffffffffffffffffffffffff610541610538610124356101043560e435603c600020611e03565b90929192611e94565b160361093f57336000526004602052604060002063ffffffff871660005260205260406000209960005b8381106105785760018055005b808a6105a282858f82896105958f996101b5908e61059b966115d8565b986115d8565b35936115d8565b3560ff8116810361025c578e936105ba848a8f6115d8565b359473ffffffffffffffffffffffffffffffffffffffff8216600052602052604060002091825492831561093157838511610931576000905582848103116109025773ffffffffffffffffffffffffffffffffffffffff600254169073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff84161460001461078457813b1561025c5760e460ff918f60009463ffffffff89926040519c8d9788967f27824e5300000000000000000000000000000000000000000000000000000000885273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60048901528a602489015216604487015284606487015260848601523360a48601521660c48401525af1908115610778576001958d92610769575b505b8383036106f1575b505050505b0161056b565b7f4978506686bd9ae370ab4cd6b1b3093dad6682e7840df229a6534e9dc4ba52239161075d63ffffffff9261072887870382611bfb565b604051938493169633960390836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b0390a38d808a816106e6565b61077290611609565b386106dc565b6040513d6000823e3d90fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff831660248201526020818060448101038173ffffffffffffffffffffffffffffffffffffffff88165afa80156107785786916000916108cd575b50106108be575b610813868d6080516115d8565b3596823b1561025c5760ff978f60009463ffffffff869260e4956040519d8e9889977f27824e5300000000000000000000000000000000000000000000000000000000895273ffffffffffffffffffffffffffffffffffffffff8d1660048a015260248901521660448701528b606487015260848601523360a48601521660c48401525af1908115610778576001958d926108af575b506106de565b6108b890611609565b386108a9565b6108c882846118ed565b610806565b9150506020813d6020116108fa575b816108e96020938361164c565b8101031261025c57859051386107ff565b3d91506108dc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5050505050600191506106eb565b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b91509160208060019273ffffffffffffffffffffffffffffffffffffffff61099087611586565b168152019301910190839161047d565b9082359060ff821680920361025c579081526020928301920190600101610466565b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b5082811415610416565b508082141561040f565b5081841415610408565b60046040517f0f59b9ff000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760206040517f28d695c7dfc0dc20c36b38cc22e861d8a3c0da73ef3975e85a4bf12193642a5c8152f35b3461025c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043567ffffffffffffffff811161025c57610adc9036906004016115a7565b610ae4611560565b60443567ffffffffffffffff811161025c57610b049036906004016115a7565b9093610b0e61168d565b63ffffffff8316600052600560205260ff60406000205416610d4b578315610d21578184036109c25760005b848110610b4357005b73ffffffffffffffffffffffffffffffffffffffff610b666101b58388866115d8565b168015610cf75773ffffffffffffffffffffffffffffffffffffffff610b906101b58489876115d8565b166000526004602052604060002063ffffffff8616600052602052604060002084831015610cc8578260051b880135917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18936030183121561025c5767ffffffffffffffff838a01351161025c578289013560061b36036020848b01011361025c5760005b838a01358110610c2b5750505050600101610b3a565b8060019160061b858c010160406020820191013573ffffffffffffffffffffffffffffffffffffffff610c5d836115e8565b16600052856020528060406000205573ffffffffffffffffffffffffffffffffffffffff610c8d60405193611586565b1682526020820152837fe58012850783f5239c792b9394f0264e9c95cf3882980249ae8efc411a921dee604063ffffffff8d1693a301610c15565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60046040517fd92e233d000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b60046040517f2f516035000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610dac61151a565b610db4611720565b60035473ffffffffffffffffffffffffffffffffffffffff80831692919081168315610cf757838114610e55576040805173ffffffffffffffffffffffffffffffffffffffff92831681529390911660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb9190a11617600355005b60046040517f2620eb3a000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043567ffffffffffffffff811161025c57610ece9036906004016115a7565b610ed6611720565b60005b818110610ee257005b80610f15610ef66101b560019486886115d8565b73ffffffffffffffffffffffffffffffffffffffff60025416906118ed565b01610ed9565b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602060405160008152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610f8c61153d565b600435600052600060205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760206040517fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec428152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043573ffffffffffffffffffffffffffffffffffffffff80821680920361025c57611080611720565b8115610cf75760025490811690828214610e55576040805173ffffffffffffffffffffffffffffffffffffffff938416815292841660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927f42e6b4d0f422db8acba71d0435d0dd4e46fadb4a2d99683b66eded85126fb2859190a11617600255005b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5763ffffffff611195611573565b166000526005602052602060ff604060002054166040519015158152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576111ea611573565b6024359081151580920361025c5763ffffffff9061120661168d565b1680600052600560205260ff604060002054161515828114610e555760407f747f56458041cea2ada41de00c95f1a8dc602dfa334765aafe548611948502d2918151908152846020820152a1600052600560205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169116179055600080f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576112c761153d565b3373ffffffffffffffffffffffffffffffffffffffff8216036112f05761001b9060043561184c565b60046040517f6697b232000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761001b60043561135761153d565b9080600052600060205261137260016040600020015461177c565b6117a2565b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043560005260006020526020600160406000200154604051908152f35b3461025c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576113fb61151a565b611403611560565b6044359173ffffffffffffffffffffffffffffffffffffffff9081841680940361025c5716600052600460205263ffffffff604060002091166000526020526040600020906000526020526020604060002054604051908152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361025c57817f7965db0b00000000000000000000000000000000000000000000000000000000602093149081156114f0575b5015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836114e9565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b6024359063ffffffff8216820361025c57565b6004359063ffffffff8216820361025c57565b359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b9181601f8401121561025c5782359167ffffffffffffffff831161025c576020808501948460051b01011161025c57565b9190811015610cc85760051b0190565b3573ffffffffffffffffffffffffffffffffffffffff8116810361025c5790565b67ffffffffffffffff811161161d57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761161d57604052565b3360009081527f344c38c63afa63cc0790d03fd9f5e1b1e0cb81e2f69d7bd71f512be2ba8de6de60205260409020547f28d695c7dfc0dc20c36b38cc22e861d8a3c0da73ef3975e85a4bf12193642a5c9060ff16156116e95750565b604490604051907fe2517d3f0000000000000000000000000000000000000000000000000000000082523360048301526024820152fd5b3360009081527f5cbfc8ee58ca47855df7bcf648dd304ddb6b932f9b87878bdf6318d7ec7ee5b760205260409020547fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec429060ff16156116e95750565b80600052600060205260406000203360005260205260ff60406000205416156116e95750565b906000918083528260205273ffffffffffffffffffffffffffffffffffffffff6040842092169182845260205260ff604084205416156000146118475780835282602052604083208284526020526040832060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b906000918083528260205273ffffffffffffffffffffffffffffffffffffffff6040842092169182845260205260ff604084205416600014611847578083528260205260408320828452602052604083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b9190916040519060208201937f095ea7b3000000000000000000000000000000000000000000000000000000009485815273ffffffffffffffffffffffffffffffffffffffff8092168060248601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff604486015260448552608085019267ffffffffffffffff938681108582111761161d576040528416600080809488519082855af19061199a611cf4565b82611a3a575b5081611a2f575b50156119b7575b50505050509050565b604051966020880152602487015280604487015260448652608086019186831090831117611a0257506119f793946119f29160405282611d6a565b611d6a565b8038808080806119ae565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b90503b1515386119a7565b80519192508115918215611a52575b505090386119a0565b611a659250602080918301019101611d52565b3880611a49565b600260015414611a7d576002600155565b60046040517f3ee5aeb5000000000000000000000000000000000000000000000000000000008152fd5b63ffffffff16600090808252600560205260ff60408320541615611b9d57606073ffffffffffffffffffffffffffffffffffffffff60025416916024604051809481937f79a6d51f00000000000000000000000000000000000000000000000000000000835260048301525afa918215611b91578092611b56575b50504210611b2c57565b60046040517fc43172d2000000000000000000000000000000000000000000000000000000008152fd5b9091506060823d606011611b89575b81611b726060938361164c565b81010312611b865750602001513880611b22565b80fd5b3d9150611b65565b604051903d90823e3d90fd5b60046040517fde699550000000000000000000000000000000000000000000000000000000008152fd5b91907f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811161025c5760051b809282370190565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee03611ca75750804710611c7757600080808093335af1611c45611cf4565b5015611c4d57565b60046040517f1425ea42000000000000000000000000000000000000000000000000000000008152fd5b60246040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152fd5b6040517fa9059cbb000000000000000000000000000000000000000000000000000000006020820152336024820152604480820193909352918252611cf291906119f260648361164c565b565b3d15611d4d573d9067ffffffffffffffff821161161d5760405191611d4160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461164c565b82523d6000602084013e565b606090565b9081602091031261025c5751801515810361025c5790565b60008073ffffffffffffffffffffffffffffffffffffffff611da193169360208151910182865af1611d9a611cf4565b9083611f7b565b8051908115159182611de8575b5050611db75750565b602490604051907f5274afe70000000000000000000000000000000000000000000000000000000082526004820152fd5b611dfb9250602080918301019101611d52565b153880611dae565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611e8857926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa15611b9157805173ffffffffffffffffffffffffffffffffffffffff811615611e7f57918190565b50809160019190565b50505060009160039190565b6004811015611f4c5780611ea6575050565b60018103611ed85760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b60028103611f1157602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b600314611f1b5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90611f905750805115611c4d57805190602001fd5b81511580611fe8575b611fa1575090565b60249073ffffffffffffffffffffffffffffffffffffffff604051917f9996b315000000000000000000000000000000000000000000000000000000008352166004820152fd5b50803b15611f9956fea2646970667358221220c8eae7426f4ec9055b4a0f8321d7c6ce0f56e9650a62a0af4ca9750746c72add64736f6c63430008190033df8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec420000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb
Deployed Bytecode
0x60a080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816301ffc9a71461145e57508063054a68ad146113c4578063248a9ca3146113775780632f2ff15d1461131a57806336568abe14611290578063461c48cd146111b35780635f91d4061461115957806364f0d35e146111075780637188cb351461102757806375b238fc14610fce57806391d1485414610f55578063a217fddf14610f1b578063a24e178814610e7f578063aad2b72314610d75578063c4f805fe14610a8d578063cabb454914610a34578063ce73f87d14610310578063d547741f146102b3578063fdea8e0b146102615763ff93be0314610106573861000f565b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761013d611573565b60243567ffffffffffffffff811161025c5761015d9036906004016115a7565b91610166611a6c565b61016f81611aa7565b336000526020600460205263ffffffff604060002092169182600052602052604060002060005b8581106101a35760018055005b80846101ba6101b56001948a8a6115d8565b6115e8565b73ffffffffffffffffffffffffffffffffffffffff811660005284865260406000208054908115610253577f4978506686bd9ae370ab4cd6b1b3093dad6682e7840df229a6534e9dc4ba522391600061024992556102188185611bfb565b6040519182913395836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b0390a35b01610196565b5050505061024d565b600080fd5b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761001b6004356102f061153d565b9080600052600060205261030b60016040600020015461177c565b61184c565b3461025c576101407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610348611573565b67ffffffffffffffff9060443582811161025c5761036a9036906004016115a7565b9260643581811161025c576103839036906004016115a7565b906080529260843582811161025c576103a09036906004016115a7565b92909460a43582811161025c576103bb9036906004016115a7565b94909260c4351161025c576103d53660c4356004016115a7565b91909560ff60e4351660e4350361025c576103ee611a6c565b6103f786611aa7565b8915610a0a57838a14801590610a00575b80156109f6575b80156109ec575b6109c2576040513360601b60208201527fffffffff000000000000000000000000000000000000000000000000000000008760e01b1660348201526104616038820186608051611bc7565b899060005b8d81106109a0575060209150602435815201818b60005b8681106109695750506104946104c092858a611bc7565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810183528261164c565b6020815191012073ffffffffffffffffffffffffffffffffffffffff60035416907f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c5273ffffffffffffffffffffffffffffffffffffffff610541610538610124356101043560e435603c600020611e03565b90929192611e94565b160361093f57336000526004602052604060002063ffffffff871660005260205260406000209960005b8381106105785760018055005b808a6105a282858f82896105958f996101b5908e61059b966115d8565b986115d8565b35936115d8565b3560ff8116810361025c578e936105ba848a8f6115d8565b359473ffffffffffffffffffffffffffffffffffffffff8216600052602052604060002091825492831561093157838511610931576000905582848103116109025773ffffffffffffffffffffffffffffffffffffffff600254169073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff84161460001461078457813b1561025c5760e460ff918f60009463ffffffff89926040519c8d9788967f27824e5300000000000000000000000000000000000000000000000000000000885273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60048901528a602489015216604487015284606487015260848601523360a48601521660c48401525af1908115610778576001958d92610769575b505b8383036106f1575b505050505b0161056b565b7f4978506686bd9ae370ab4cd6b1b3093dad6682e7840df229a6534e9dc4ba52239161075d63ffffffff9261072887870382611bfb565b604051938493169633960390836020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b0390a38d808a816106e6565b61077290611609565b386106dc565b6040513d6000823e3d90fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff831660248201526020818060448101038173ffffffffffffffffffffffffffffffffffffffff88165afa80156107785786916000916108cd575b50106108be575b610813868d6080516115d8565b3596823b1561025c5760ff978f60009463ffffffff869260e4956040519d8e9889977f27824e5300000000000000000000000000000000000000000000000000000000895273ffffffffffffffffffffffffffffffffffffffff8d1660048a015260248901521660448701528b606487015260848601523360a48601521660c48401525af1908115610778576001958d926108af575b506106de565b6108b890611609565b386108a9565b6108c882846118ed565b610806565b9150506020813d6020116108fa575b816108e96020938361164c565b8101031261025c57859051386107ff565b3d91506108dc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5050505050600191506106eb565b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b91509160208060019273ffffffffffffffffffffffffffffffffffffffff61099087611586565b168152019301910190839161047d565b9082359060ff821680920361025c579081526020928301920190600101610466565b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b5082811415610416565b508082141561040f565b5081841415610408565b60046040517f0f59b9ff000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760206040517f28d695c7dfc0dc20c36b38cc22e861d8a3c0da73ef3975e85a4bf12193642a5c8152f35b3461025c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043567ffffffffffffffff811161025c57610adc9036906004016115a7565b610ae4611560565b60443567ffffffffffffffff811161025c57610b049036906004016115a7565b9093610b0e61168d565b63ffffffff8316600052600560205260ff60406000205416610d4b578315610d21578184036109c25760005b848110610b4357005b73ffffffffffffffffffffffffffffffffffffffff610b666101b58388866115d8565b168015610cf75773ffffffffffffffffffffffffffffffffffffffff610b906101b58489876115d8565b166000526004602052604060002063ffffffff8616600052602052604060002084831015610cc8578260051b880135917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18936030183121561025c5767ffffffffffffffff838a01351161025c578289013560061b36036020848b01011361025c5760005b838a01358110610c2b5750505050600101610b3a565b8060019160061b858c010160406020820191013573ffffffffffffffffffffffffffffffffffffffff610c5d836115e8565b16600052856020528060406000205573ffffffffffffffffffffffffffffffffffffffff610c8d60405193611586565b1682526020820152837fe58012850783f5239c792b9394f0264e9c95cf3882980249ae8efc411a921dee604063ffffffff8d1693a301610c15565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60046040517fd92e233d000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5cb045db000000000000000000000000000000000000000000000000000000008152fd5b60046040517f2f516035000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610dac61151a565b610db4611720565b60035473ffffffffffffffffffffffffffffffffffffffff80831692919081168315610cf757838114610e55576040805173ffffffffffffffffffffffffffffffffffffffff92831681529390911660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb9190a11617600355005b60046040517f2620eb3a000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043567ffffffffffffffff811161025c57610ece9036906004016115a7565b610ed6611720565b60005b818110610ee257005b80610f15610ef66101b560019486886115d8565b73ffffffffffffffffffffffffffffffffffffffff60025416906118ed565b01610ed9565b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602060405160008152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57610f8c61153d565b600435600052600060205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760206040517fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec428152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043573ffffffffffffffffffffffffffffffffffffffff80821680920361025c57611080611720565b8115610cf75760025490811690828214610e55576040805173ffffffffffffffffffffffffffffffffffffffff938416815292841660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927f42e6b4d0f422db8acba71d0435d0dd4e46fadb4a2d99683b66eded85126fb2859190a11617600255005b3461025c5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5763ffffffff611195611573565b166000526005602052602060ff604060002054166040519015158152f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576111ea611573565b6024359081151580920361025c5763ffffffff9061120661168d565b1680600052600560205260ff604060002054161515828114610e555760407f747f56458041cea2ada41de00c95f1a8dc602dfa334765aafe548611948502d2918151908152846020820152a1600052600560205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169116179055600080f35b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576112c761153d565b3373ffffffffffffffffffffffffffffffffffffffff8216036112f05761001b9060043561184c565b60046040517f6697b232000000000000000000000000000000000000000000000000000000008152fd5b3461025c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5761001b60043561135761153d565b9080600052600060205261137260016040600020015461177c565b6117a2565b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c5760043560005260006020526020600160406000200154604051908152f35b3461025c5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c576113fb61151a565b611403611560565b6044359173ffffffffffffffffffffffffffffffffffffffff9081841680940361025c5716600052600460205263ffffffff604060002091166000526020526040600020906000526020526020604060002054604051908152f35b3461025c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261025c57600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361025c57817f7965db0b00000000000000000000000000000000000000000000000000000000602093149081156114f0575b5015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836114e9565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b6024359063ffffffff8216820361025c57565b6004359063ffffffff8216820361025c57565b359073ffffffffffffffffffffffffffffffffffffffff8216820361025c57565b9181601f8401121561025c5782359167ffffffffffffffff831161025c576020808501948460051b01011161025c57565b9190811015610cc85760051b0190565b3573ffffffffffffffffffffffffffffffffffffffff8116810361025c5790565b67ffffffffffffffff811161161d57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761161d57604052565b3360009081527f344c38c63afa63cc0790d03fd9f5e1b1e0cb81e2f69d7bd71f512be2ba8de6de60205260409020547f28d695c7dfc0dc20c36b38cc22e861d8a3c0da73ef3975e85a4bf12193642a5c9060ff16156116e95750565b604490604051907fe2517d3f0000000000000000000000000000000000000000000000000000000082523360048301526024820152fd5b3360009081527f5cbfc8ee58ca47855df7bcf648dd304ddb6b932f9b87878bdf6318d7ec7ee5b760205260409020547fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec429060ff16156116e95750565b80600052600060205260406000203360005260205260ff60406000205416156116e95750565b906000918083528260205273ffffffffffffffffffffffffffffffffffffffff6040842092169182845260205260ff604084205416156000146118475780835282602052604083208284526020526040832060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b906000918083528260205273ffffffffffffffffffffffffffffffffffffffff6040842092169182845260205260ff604084205416600014611847578083528260205260408320828452602052604083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b9190916040519060208201937f095ea7b3000000000000000000000000000000000000000000000000000000009485815273ffffffffffffffffffffffffffffffffffffffff8092168060248601527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff604486015260448552608085019267ffffffffffffffff938681108582111761161d576040528416600080809488519082855af19061199a611cf4565b82611a3a575b5081611a2f575b50156119b7575b50505050509050565b604051966020880152602487015280604487015260448652608086019186831090831117611a0257506119f793946119f29160405282611d6a565b611d6a565b8038808080806119ae565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b90503b1515386119a7565b80519192508115918215611a52575b505090386119a0565b611a659250602080918301019101611d52565b3880611a49565b600260015414611a7d576002600155565b60046040517f3ee5aeb5000000000000000000000000000000000000000000000000000000008152fd5b63ffffffff16600090808252600560205260ff60408320541615611b9d57606073ffffffffffffffffffffffffffffffffffffffff60025416916024604051809481937f79a6d51f00000000000000000000000000000000000000000000000000000000835260048301525afa918215611b91578092611b56575b50504210611b2c57565b60046040517fc43172d2000000000000000000000000000000000000000000000000000000008152fd5b9091506060823d606011611b89575b81611b726060938361164c565b81010312611b865750602001513880611b22565b80fd5b3d9150611b65565b604051903d90823e3d90fd5b60046040517fde699550000000000000000000000000000000000000000000000000000000008152fd5b91907f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811161025c5760051b809282370190565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee03611ca75750804710611c7757600080808093335af1611c45611cf4565b5015611c4d57565b60046040517f1425ea42000000000000000000000000000000000000000000000000000000008152fd5b60246040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152fd5b6040517fa9059cbb000000000000000000000000000000000000000000000000000000006020820152336024820152604480820193909352918252611cf291906119f260648361164c565b565b3d15611d4d573d9067ffffffffffffffff821161161d5760405191611d4160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461164c565b82523d6000602084013e565b606090565b9081602091031261025c5751801515810361025c5790565b60008073ffffffffffffffffffffffffffffffffffffffff611da193169360208151910182865af1611d9a611cf4565b9083611f7b565b8051908115159182611de8575b5050611db75750565b602490604051907f5274afe70000000000000000000000000000000000000000000000000000000082526004820152fd5b611dfb9250602080918301019101611d52565b153880611dae565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611e8857926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa15611b9157805173ffffffffffffffffffffffffffffffffffffffff811615611e7f57918190565b50809160019190565b50505060009160039190565b6004811015611f4c5780611ea6575050565b60018103611ed85760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b60028103611f1157602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b600314611f1b5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90611f905750805115611c4d57805190602001fd5b81511580611fe8575b611fa1575090565b60249073ffffffffffffffffffffffffffffffffffffffff604051917f9996b315000000000000000000000000000000000000000000000000000000008352166004820152fd5b50803b15611f9956fea2646970667358221220c8eae7426f4ec9055b4a0f8321d7c6ce0f56e9650a62a0af4ca9750746c72add64736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb
-----Decoded View---------------
Arg [0] : signerAddress (address): 0x3088149945e0dFdf78f10650A36cd0C1fb8816eB
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 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.