Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 7 from a total of 7 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Token Price ... | 20206372 | 76 days ago | IN | 0 ETH | 0.00038557 | ||||
Set Token Price ... | 20206355 | 76 days ago | IN | 0 ETH | 0.00038917 | ||||
Set Token Price ... | 20077339 | 94 days ago | IN | 0 ETH | 0.00065562 | ||||
Set Token Price ... | 20068816 | 95 days ago | IN | 0 ETH | 0.00134554 | ||||
Set Token Price ... | 20061326 | 96 days ago | IN | 0 ETH | 0.00087544 | ||||
Set Token Price ... | 20061305 | 96 days ago | IN | 0 ETH | 0.00059852 | ||||
0x60803461 | 20045939 | 98 days ago | IN | 0 ETH | 0.01468298 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PreSaleInstitution
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 { Ownable, Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol"; import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /// @title PreSaleInstitution contract /// @notice Implements the institution presale of token /// @dev The PreSaleInstitution contract allows you to purchase token with ETH and any other tokens contract PreSaleInstitution is Ownable2Step, ReentrancyGuard { using SafeERC20 for IERC20; using Address for address payable; /// @member priceFeed The Chainlink price feed address /// @member normalizationFactorForToken The normalization factor to achieve return value of 18 decimals ,while calculating token purchases and always with different token decimals /// @member tolerance The pricefeed live price should be updated in tolerance time to get better price struct PriceFeedData { AggregatorV3Interface priceFeed; uint8 normalizationFactor; uint256 tolerance; } /// @member price The price of token from price feed /// @member normalizationFactorForToken The normalization factor to achieve return value of 18 decimals, while calculating token purchases and always with different token decimals struct TokenInfo { uint256 latestPrice; uint8 normalizationFactor; } /// @dev The ETH identifier IERC20 public constant ETH = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); /// @notice BuyEnable or not bool public buyEnable = true; /// @notice The address of signerWallet address public signerWallet; /// @notice The address of fundsWallet address public fundsWallet; /// @notice Sum of tokens purchased in presale uint256 public totalPurchases; /// @notice Gives claim info of user mapping(address => uint256) public claims; /// @notice Gives us onchain price oracle address of the token mapping(IERC20 => PriceFeedData) public tokenData; /// @notice Gives info about address's permission mapping(address => bool) public blacklistAddress; /// @notice mapping gives us access info of the token mapping(IERC20 => bool) public allowedTokens; /// @dev Emitted when token is purchased with ETH event PurchasedWithETH( address indexed by, string code, uint256 amountPurchasedEth, address indexed recipient, uint256 indexed price, uint256 tokenPurchased ); /// @dev Emitted when token is purchased with Token event PurchasedWithToken( address indexed by, string code, IERC20 indexed token, uint256 amountPurchased, address indexed recipient, uint256 price, uint256 tokenPrice, uint256 tokenPurchased ); /// @dev Emitted when address of signer is updated event SignerUpdated(address oldSigner, address newSigner); /// @dev Emitted when address of funds wallet is updated event FundsWalletUpdated(address oldAddress, address newAddress); /// @dev Emitted when blacklist access of address is updated event BlacklistUpdated(address which, bool accessNow); /// @dev Emitted when buying access changes event BuyEnableUpdated(bool oldAccess, bool newAccess); /// @dev Emitted when address of Chainlink price feed contract is added for the token event TokenDataAdded(IERC20 indexed token, AggregatorV3Interface priceFeed); /// @dev Emitted when token access is updated event TokensAccessUpdated(IERC20 indexed token, bool indexed access); /// @notice Thrown when address is blacklisted error Blacklisted(); /// @notice Thrown when updating an address with zero address error ZeroAddress(); /// @notice Thrown when buy is disabled error BuyNotEnable(); /// @notice Thrown when sign is invalid error InvalidSignature(); /// @notice Thrown when price returned from price feed is zero error PriceNotFound(); /// @notice Thrown when both price feed and reference price are non zero error CodeSyncIssue(); /// @notice Thrown when ETH price suddenly drops while purchasing token error UnexpectedPriceDifference(); /// @notice Thrown when value to transfer is zero error ZeroValue(); /// @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 value to transfer is zero error ValueZero(); /// @notice Thrown when sign deadline is expired error DeadlineExpired(); /// @notice Thrown when updating with an array of no values error ZeroLengthArray(); /// @notice Thrown when Token is restricted in given round error TokenDisallowed(); /// @notice Thrown if the price is not updated error PriceNotUpdated(); /// @notice Thrown if the roundId of price is not updated error RoundIdNotUpdated(); /// @notice Restricts blacklisted addresses modifier notBlacklisted(address which) { if (blacklistAddress[which]) { revert Blacklisted(); } _; } /// @notice Restricts when updating wallet/contract address to zero address modifier checkZeroAddress(address which) { if (which == address(0)) { revert ZeroAddress(); } _; } /// @notice Ensures that buy is enabled when buying modifier canBuy() { if (!buyEnable) { revert BuyNotEnable(); } _; } /// @dev Constructor /// @param signerAddress The address of signer wallet /// @param fundsWalletAddress The address of funds wallet /// @param owner The address of owner wallet constructor(address fundsWalletAddress, address signerAddress, address owner) Ownable(owner) { if (fundsWalletAddress == address(0) || signerAddress == address(0)) { revert ZeroAddress(); } fundsWallet = fundsWalletAddress; signerWallet = signerAddress; } /// @notice The Chainlink inherited function, give us tokens live price function getLatestPrice(IERC20 token) public view returns (TokenInfo memory) { PriceFeedData memory data = tokenData[token]; TokenInfo memory tokenInfo; if (address(data.priceFeed) == address(0)) { return tokenInfo; } ( uint80 roundId, /*uint80 roundID*/ int price /*uint256 startedAt*/ /*uint80 answeredInRound*/, , uint256 updatedAt, ) = /*uint256 timeStamp*/ data.priceFeed.latestRoundData(); if (roundId == 0) { revert RoundIdNotUpdated(); } if (updatedAt == 0 || block.timestamp - updatedAt > data.tolerance) { revert PriceNotUpdated(); } return TokenInfo({ latestPrice: uint256(price), normalizationFactor: data.normalizationFactor }); } /// @notice Changes access of buying /// @param enabled The decision about buying function enableBuy(bool enabled) external onlyOwner { if (buyEnable == enabled) { revert IdenticalValue(); } emit BuyEnableUpdated({ oldAccess: buyEnable, newAccess: enabled }); buyEnable = enabled; } /// @notice Changes signer wallet address /// @param newSigner The address of the new signer wallet function changeSigner(address newSigner) external checkZeroAddress(newSigner) onlyOwner { address oldSigner = signerWallet; if (oldSigner == newSigner) { revert IdenticalValue(); } emit SignerUpdated({ oldSigner: oldSigner, newSigner: newSigner }); signerWallet = newSigner; } /// @notice Changes funds wallet to a new address /// @param newFundsWallet The address of the new funds wallet function changeFundsWallet(address newFundsWallet) external checkZeroAddress(newFundsWallet) onlyOwner { address oldWallet = fundsWallet; if (oldWallet == newFundsWallet) { revert IdenticalValue(); } emit FundsWalletUpdated({ oldAddress: oldWallet, newAddress: newFundsWallet }); fundsWallet = newFundsWallet; } /// @notice Changes the access of any address in contract interaction /// @param which The address for which access is updated /// @param access The access decision of `which` address function updateBlackListedUser(address which, bool access) external checkZeroAddress(which) onlyOwner { bool oldAccess = blacklistAddress[which]; if (oldAccess == access) { revert IdenticalValue(); } emit BlacklistUpdated({ which: which, accessNow: access }); blacklistAddress[which] = access; } /// @notice Purchases presale token with ETH /// @param code The code is used to verify signature of the user /// @param recipient The recipient is the address which will claim presale tokens /// @param price The price is usdt price of presale token /// @param deadline The deadline is validity of the signature /// @param minAmountToken The minAmountToken user agrees to purchase /// @param v The `v` signature parameter /// @param r The `r` signature parameter /// @param s The `s` signature parameter function purchaseWithETH( string memory code, address recipient, uint256 price, uint256 deadline, uint256 minAmountToken, uint8 v, bytes32 r, bytes32 s ) external payable notBlacklisted(recipient) canBuy nonReentrant { _validatePurchase(deadline, ETH, msg.value); _verifyCode(code, recipient, price, deadline, v, r, s); TokenInfo memory tokenInfo = getLatestPrice(ETH); if (tokenInfo.latestPrice == 0) { revert PriceNotFound(); } uint256 toReturn = ((msg.value * tokenInfo.latestPrice) * (10 ** tokenInfo.normalizationFactor)) / price; _updateTokenPurchases(toReturn); if (toReturn < minAmountToken) { revert UnexpectedPriceDifference(); } claims[recipient] += toReturn; payable(fundsWallet).sendValue(msg.value); emit PurchasedWithETH({ by: msg.sender, code: code, amountPurchasedEth: msg.value, recipient: recipient, price: price, tokenPurchased: toReturn }); } /// @notice Purchases presale token with any token /// @param token The purchase token /// @param purchaseAmount The purchase amount /// @param code The code is used to verify signature of the user /// @param referenceNormalizationFactor The normalization factor to achieve return value of required token decimals /// @param referenceTokenPrice The current price of token in 10 decimals /// @param recipient The recipient is the address which will claim presale tokens /// @param price The price is usdt price of presale token /// @param deadline The deadline is validity of the signature /// @param v The `v` signature parameter /// @param r The `r` signature parameter /// @param s The `s` signature parameter function purchaseWithToken( IERC20 token, uint256 purchaseAmount, string memory code, uint8 referenceNormalizationFactor, uint256 referenceTokenPrice, uint256 minAmountToken, address recipient, uint256 price, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external notBlacklisted(recipient) canBuy nonReentrant { _validatePurchase(deadline, token, purchaseAmount); _verifyCodeWithPrice( token, code, recipient, price, deadline, referenceNormalizationFactor, referenceTokenPrice, v, r, s ); (uint256 latestPrice, uint8 normalizationFactor) = _validatePrice( token, referenceTokenPrice, referenceNormalizationFactor ); // we don't expect such value such that this multiplication overflows and reverts. uint256 toReturn = (purchaseAmount * latestPrice * (10 ** normalizationFactor)) / price; if (toReturn < minAmountToken) { revert UnexpectedPriceDifference(); } _updateTokenPurchases(toReturn); claims[recipient] += toReturn; token.safeTransferFrom(msg.sender, fundsWallet, purchaseAmount); emit PurchasedWithToken({ by: msg.sender, code: code, token: token, amountPurchased: purchaseAmount, recipient: recipient, price: price, tokenPrice: latestPrice, tokenPurchased: toReturn }); } /// @notice Sets Chainlink price feed contracts of the tokens /// @param tokens The addresses of the tokens /// @param priceFeedData Contains the price feed of the tokens and the normalization factor function setTokenPriceFeed(IERC20[] calldata tokens, PriceFeedData[] calldata priceFeedData) external onlyOwner { if (tokens.length == 0) { revert ZeroLengthArray(); } if (tokens.length != priceFeedData.length) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < tokens.length; ++i) { PriceFeedData calldata data = priceFeedData[i]; IERC20 token = tokens[i]; PriceFeedData memory currentPriceFeedData = tokenData[token]; if (address(token) == address(0) || address(data.priceFeed) == address(0)) { revert ZeroAddress(); } if ( currentPriceFeedData.priceFeed == data.priceFeed && currentPriceFeedData.normalizationFactor == data.normalizationFactor && currentPriceFeedData.tolerance == data.tolerance ) { revert IdenticalValue(); } emit TokenDataAdded({ token: token, priceFeed: data.priceFeed }); tokenData[token] = data; } } /// @notice Updates the access of tokens in a given round /// @param tokens addresses of the tokens /// @param accesses The access for the tokens function updateAllowedTokens(IERC20[] calldata tokens, bool[] memory accesses) external onlyOwner { if (tokens.length == 0) { revert ZeroLengthArray(); } if (tokens.length != accesses.length) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < tokens.length; ++i) { IERC20 token = tokens[i]; if (address(token) == address(0)) { revert ZeroAddress(); } allowedTokens[token] = accesses[i]; emit TokensAccessUpdated({ token: token, access: accesses[i] }); } } /// @dev The helper function which verifies signature, signed by signerWallet, reverts if invalidSignature function _verifyCode( string memory code, address recipient, uint256 price, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) private view { bytes32 encodedMessageHash = keccak256(abi.encodePacked(code, recipient, price, deadline)); _verifyMessage(encodedMessageHash, v, r, s); } /// @dev The helper function which verifies signature, signed by signerWallet, reverts if invalidSignature function _verifyCodeWithPrice( IERC20 token, string memory code, address recipient, uint256 price, uint256 deadline, uint8 normalizationFactor, uint256 referenceTokenPrice, uint8 v, bytes32 r, bytes32 s ) private view { bytes32 encodedMessageHash = keccak256( abi.encodePacked(token, code, recipient, price, normalizationFactor, referenceTokenPrice, deadline) ); _verifyMessage(encodedMessageHash, v, r, s); } /// @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 value, if zero then reverts function _checkValue(uint256 value) private pure { if (value == 0) { revert ValueZero(); } } /// @dev Checks and returns price and normalization factor of the token function _validatePrice( IERC20 token, uint256 referenceTokenPrice, uint8 referenceNormalizationFactor ) private view returns (uint256, uint8) { TokenInfo memory tokenInfo = getLatestPrice(token); if (tokenInfo.latestPrice != 0 && (referenceTokenPrice != 0 || referenceNormalizationFactor != 0)) { revert CodeSyncIssue(); } // If price feed isn't available,we fallback to the reference price if (tokenInfo.latestPrice == 0) { if (referenceTokenPrice == 0 || referenceNormalizationFactor == 0) { revert ZeroValue(); } tokenInfo.latestPrice = referenceTokenPrice; tokenInfo.normalizationFactor = referenceNormalizationFactor; } return (tokenInfo.latestPrice, tokenInfo.normalizationFactor); } /// @dev Checks deadline, token access and purchase amount function _validatePurchase(uint256 deadline, IERC20 token, uint256 purchaseAmount) private view { if (block.timestamp > deadline) { revert DeadlineExpired(); } if (!allowedTokens[token]) { revert TokenDisallowed(); } _checkValue(purchaseAmount); } /// @dev Updates total purchases function _updateTokenPurchases(uint256 newPurchase) private { totalPurchases += newPurchase; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // solhint-disable-next-line interface-starts-with-i interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); function getRoundData( uint80 _roundId ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol) pragma solidity ^0.8.20; import {Ownable} from "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is specified at deployment time in the constructor for `Ownable`. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); if (pendingOwner() != sender) { revert OwnableUnauthorizedAccount(sender); } _transferOwnership(sender); } }
// 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/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)); } }
{ "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":"fundsWalletAddress","type":"address"},{"internalType":"address","name":"signerAddress","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"Blacklisted","type":"error"},{"inputs":[],"name":"BuyNotEnable","type":"error"},{"inputs":[],"name":"CodeSyncIssue","type":"error"},{"inputs":[],"name":"DeadlineExpired","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":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PriceNotFound","type":"error"},{"inputs":[],"name":"PriceNotUpdated","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"RoundIdNotUpdated","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"TokenDisallowed","type":"error"},{"inputs":[],"name":"UnexpectedPriceDifference","type":"error"},{"inputs":[],"name":"ValueZero","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroLengthArray","type":"error"},{"inputs":[],"name":"ZeroValue","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"which","type":"address"},{"indexed":false,"internalType":"bool","name":"accessNow","type":"bool"}],"name":"BlacklistUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"oldAccess","type":"bool"},{"indexed":false,"internalType":"bool","name":"newAccess","type":"bool"}],"name":"BuyEnableUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"FundsWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"string","name":"code","type":"string"},{"indexed":false,"internalType":"uint256","name":"amountPurchasedEth","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenPurchased","type":"uint256"}],"name":"PurchasedWithETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"string","name":"code","type":"string"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountPurchased","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenPurchased","type":"uint256"}],"name":"PurchasedWithToken","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"}],"name":"TokenDataAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"bool","name":"access","type":"bool"}],"name":"TokensAccessUpdated","type":"event"},{"inputs":[],"name":"ETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"allowedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"blacklistAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newFundsWallet","type":"address"}],"name":"changeFundsWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"changeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claims","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"enableBuy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fundsWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"getLatestPrice","outputs":[{"components":[{"internalType":"uint256","name":"latestPrice","type":"uint256"},{"internalType":"uint8","name":"normalizationFactor","type":"uint8"}],"internalType":"struct PreSaleInstitution.TokenInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"minAmountToken","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"purchaseWithETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"purchaseAmount","type":"uint256"},{"internalType":"string","name":"code","type":"string"},{"internalType":"uint8","name":"referenceNormalizationFactor","type":"uint8"},{"internalType":"uint256","name":"referenceTokenPrice","type":"uint256"},{"internalType":"uint256","name":"minAmountToken","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"purchaseWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"components":[{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"normalizationFactor","type":"uint8"},{"internalType":"uint256","name":"tolerance","type":"uint256"}],"internalType":"struct PreSaleInstitution.PriceFeedData[]","name":"priceFeedData","type":"tuple[]"}],"name":"setTokenPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"tokenData","outputs":[{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"normalizationFactor","type":"uint8"},{"internalType":"uint256","name":"tolerance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPurchases","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"bool[]","name":"accesses","type":"bool[]"}],"name":"updateAllowedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"which","type":"address"},{"internalType":"bool","name":"access","type":"bool"}],"name":"updateBlackListedUser","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60803461014157601f61232f38819003918201601f19168301916001600160401b0383118484101761014657808492606094604052833981010312610141578061004a60409261015c565b906100576020820161015c565b6001600160a01b03939091849161006e910161015c565b169283156101285760018060a01b031980600154166001556000549480828716176000558260405196167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600160025581600354941691821590811561011d575b5061010e576001945060045416176004556101008360a81b039060081b1690828060a81b03191617176003556040516121be90816101718239f35b63d92e233d60e01b8552600485fd5b9050831615386100d3565b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036101415756fe6080604052600436101561001257600080fd5b60003560e01c806316345f18146118c55780632194f3a21461187357806327e45c2c146117f457806338046ffb1461153e5780633d389faf146114fd57806341e7e341146114485780635962a9411461140c57806364f0d35e146113b7578063715018a61461131257806379ba5097146112355780637d6f0d5f146111555780637fb8e39714610b8a5780638322fff214610b3d5780638da5cb5b14610aeb578063aad2b723146109ea578063b555ddad1461081e578063c6788bdd146107b9578063cbbb28991461043a578063e09590d1146102f1578063e30c39781461029f578063e744092e14610235578063f2fde38b146101885763f3290d751461011957600080fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61016561191b565b166000526008602052602060ff604060002054166040519015158152f35b600080fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576101bf61191b565b6101c7611ed8565b73ffffffffffffffffffffffffffffffffffffffff80911690817fffffffffffffffffffffffff00000000000000000000000000000000000000006001541617600155600054167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700600080a3005b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61028161191b565b166000526009602052602060ff604060002054166040519015158152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835761032861191b565b602435801515918282036101835773ffffffffffffffffffffffffffffffffffffffff1680156104105761035a611ed8565b8060005260086020528260ff604060002054161515146103e6577f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac60406103e4948151908482526020820152a1600052600860205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b005b60046040517f2620eb3a000000000000000000000000000000000000000000000000000000008152fd5b60046040517fd92e233d000000000000000000000000000000000000000000000000000000008152fd5b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835767ffffffffffffffff6004358181116101835761048a903690600401611a38565b9091806024351161018357366023602435011215610183576024356004013511610183573660246060813560040135028135010111610183576104cb611ed8565b801561078f576024356004013581036107655760005b8181106104ea57005b602435600401358110156107365773ffffffffffffffffffffffffffffffffffffffff61052061051b838587611e1c565b611e2c565b1690816000526007602052604060002060405161053c8161193e565b81549173ffffffffffffffffffffffffffffffffffffffff83168252600160ff9182602085019560a01c1685520154916040810192835285158015610707575b6104105773ffffffffffffffffffffffffffffffffffffffff90511673ffffffffffffffffffffffffffffffffffffffff6105bf60246060880281350101611e2c565b161492836106e3575b5050816106cd575b506103e657816001927f05a55041f547bc02746ecf7b080f4a090ea42e2a9e0b0c0b151f939cd74d8182602061060e60246060870281350101611e2c565b73ffffffffffffffffffffffffffffffffffffffff60405191168152a26000526007602052604060002073ffffffffffffffffffffffffffffffffffffffff61065f60246060850281350101611e2c565b168154907fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000006106ad6044606088026024350101611e61565b60a01b1692161717815582606460608402602435010135910155016104e1565b90505160646060830260243501013514856105d0565b819293505116906106fd6044606086026024350101611e61565b16149086806105c8565b5073ffffffffffffffffffffffffffffffffffffffff61072f60246060880281350101611e2c565b161561057c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b60046040517f0f59b9ff000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61080561191b565b1660005260066020526020604060002054604051908152f35b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835767ffffffffffffffff6004358181116101835761086e903690600401611a38565b916024359281841161018357366023850112156101835783600401359182116109bb578160051b93602094604051936108aa6020830186611976565b8452602460208501918301019136831161018357602401905b8282106109a3575050506108d5611ed8565b801561078f57815181036107655760005b8181106108ef57005b73ffffffffffffffffffffffffffffffffffffffff61091261051b838588611e1c565b169081156104105760019161096a61092a8387611e4d565b511515826000526009895260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6109748286611e4d565b511515907f1ced45b0ee0758da73555ab722db924ae9a51fb90c102e56149772515ef9db4a600080a3016108e6565b813580151581036101835781529086019086016108c3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357610a2161191b565b73ffffffffffffffffffffffffffffffffffffffff90818116801561041057610a48611ed8565b600354928360081c169081146103e6576040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fffffffffffffffffffffff0000000000000000000000000000000000000000ff9274ffffffffffffffffffffffffffffffffffffffff009290917f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb91a160081b16911617600355600080f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610183576101807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357610bc261191b565b60443567ffffffffffffffff811161018357610be29036906004016119f1565b60ff60643516606435036101835773ffffffffffffffffffffffffffffffffffffffff60c4351660c435036101835760ff610124351661012435036101835773ffffffffffffffffffffffffffffffffffffffff60c43516600052600860205260ff6040600020541661112b5760ff600354161561110157610c62611e6f565b6101043542116110d75773ffffffffffffffffffffffffffffffffffffffff8216600052600960205260ff60406000205416156110ad576024351561108357610d6760405160208101610d5060a9837fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808960601b1685528751610ced816034850160208c01611db6565b82019060c43560601b16603482015260e43560488201527fff0000000000000000000000000000000000000000000000000000000000000060643560f81b1660688201526084356069820152610104356089820152036089810185520183611976565b610164359161014435916101243591519020611ef9565b610d7082611caa565b805115158061106a575b61104057805115610fe5575b610db960ff6020835193015116610db4610da284602435611d1d565b610dae60e43593611d5f565b90611d1d565b611d70565b60a4358110610fbb57610dce81600554611da9565b60055573ffffffffffffffffffffffffffffffffffffffff60c4351660005260066020526040600020610e02828254611da9565b905573ffffffffffffffffffffffffffffffffffffffff6004541660405160208101917f23b872dd000000000000000000000000000000000000000000000000000000008352336024830152604482015260243560648201526064815260a0810181811067ffffffffffffffff8211176109bb5760405251610ec29160009182918273ffffffffffffffffffffffffffffffffffffffff8a165af1610ea5611ea8565b9073ffffffffffffffffffffffffffffffffffffffff8716612112565b8051908115159182610f97575b5050610f5057610eea6040519360a0855260a0850190611dd9565b91602435602085015260e4356040850152606084015260808301527f663b1bca0789228820b108bd992cafd0bb458b356b4ceb5661d1dfd9a10df53973ffffffffffffffffffffffffffffffffffffffff8060c435169416928033930390a46001600255005b60248473ffffffffffffffffffffffffffffffffffffffff604051917f5274afe7000000000000000000000000000000000000000000000000000000008352166004820152fd5b81925090602091810103126101835760200151801590811503610183578580610ecf565b60046040517fbde82093000000000000000000000000000000000000000000000000000000008152fd5b608435158015611033575b61100957608435815260ff606435166020820152610d86565b60046040517f7c946ed7000000000000000000000000000000000000000000000000000000008152fd5b5060ff6064351615610ff0565b60046040517ff443cb16000000000000000000000000000000000000000000000000000000008152fd5b50608435151580610d7a575060ff606435161515610d7a565b60046040517f589f3068000000000000000000000000000000000000000000000000000000008152fd5b60046040517f49a8defd000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1ab7da6b000000000000000000000000000000000000000000000000000000008152fd5b60046040517f46b57c6f000000000000000000000000000000000000000000000000000000008152fd5b60046040517f09550c77000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835761118c61191b565b73ffffffffffffffffffffffffffffffffffffffff90818116918215610410576111b4611ed8565b6004549081168381146103e6576040805173ffffffffffffffffffffffffffffffffffffffff92831681529390911660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927fe22b566ac7db56412e2e041c88a7fd3151151ad6c6647e954f9bdc054bcb780e9190a11617600455005b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835760015473ffffffffffffffffffffffffffffffffffffffff33818316036112e2577fffffffffffffffffffffffff00000000000000000000000000000000000000008092166001556000549133908316176000553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357611349611ed8565b600073ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffff0000000000000000000000000000000000000000806001541660015582549081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60035460081c16604051908152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576020600554604051908152f35b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576004358015158091036101835761148c611ed8565b6003549060ff821615158181146103e6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00917fe557486689c0bf71dde8cb27e7e87ed23badcf92ea724f4a0368676720d416f6604060ff938151908152836020820152a116911617600355600080f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602060ff600354166040519015158152f35b6101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835760043567ffffffffffffffff8111610183576115899036906004016119f1565b73ffffffffffffffffffffffffffffffffffffffff60243581811691828203610183576044359360a43560643560ff8216820361018357856000526020946008865260ff6040600020541661112b5760ff6003541615611101576115eb611e6f565b8142116110d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6000526009865260ff60406000205416156110ad5734156110835761169a9261168a607460405180948a8201967fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008c6116668c8b815193849201611db6565b84019260601b168c8301528d60348301526054820152036054810185520183611976565b60e4359260c43592519020611ef9565b6116a2611a80565b8051156117ca5785610db482610dae60ff886116c26116cb975134611d1d565b93015116611d5f565b916116d883600554611da9565b6005556084358310610fbb57846000526006845260406000206116fc848254611da9565b90556004541634471061179a5760008080809334905af161171b611ea8565b5015611770577f875894c2b51a110087a5f958870138dd8534664b2982b188f35c25082ad2d05b9161175860405192606084526060840190611dd9565b93349083015260408201528033930390a46001600255005b60046040517f1425ea42000000000000000000000000000000000000000000000000000000008152fd5b60246040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152fd5b60046040517f358e2ce7000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357606073ffffffffffffffffffffffffffffffffffffffff8061184361191b565b166000526007602052604060002060ff6001825492015491604051938116845260a01c1660208301526040820152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357604061190661190161191b565b611caa565b60ff6020835192805184520151166020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361018357565b6060810190811067ffffffffffffffff8211176109bb57604052565b6040810190811067ffffffffffffffff8211176109bb57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109bb57604052565b67ffffffffffffffff81116109bb57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561018357803590611a08826119b7565b92611a166040519485611976565b8284526020838301011161018357816000926020809301838601378301015290565b9181601f840112156101835782359167ffffffffffffffff8311610183576020808501948460051b01011161018357565b519069ffffffffffffffffffff8216820361018357565b6040805190611a8e8261195a565b6000918281528260208092015273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83526007815281832092825193611ac68561193e565b805491600173ffffffffffffffffffffffffffffffffffffffff92838516885260ff8689019560a01c168552015491858701928352855196611b078861195a565b82885282868901525116958615611ca0575060a06004968651978880927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa918215611c94578182978394611c2e575b5069ffffffffffffffffffff1615611c05578215928315611bbf575b505050611b965760ff905116915192611b8e8461195a565b835282015290565b600483517f1f4bcb2b000000000000000000000000000000000000000000000000000000008152fd5b90919250420391428311611bd857505110388080611b76565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b600486517fa5959c59000000000000000000000000000000000000000000000000000000008152fd5b975050915060a0863d60a011611c8c575b81611c4c60a09383611976565b81010312611c8957611c5d86611a69565b9169ffffffffffffffffffff8588015193611c7f608060608b01519a01611a69565b5093979390611b5a565b80fd5b3d9150611c3f565b508451903d90823e3d90fd5b9550505050505090565b60408051611cb78161195a565b6000928382528360208093015273ffffffffffffffffffffffffffffffffffffffff80911684526007825282842090835194611cf28661193e565b6001835493838516885260ff8689019560a01c168552015491858701928352855196611b078861195a565b81810292918115918404141715611d3057565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff16604d8111611d3057600a0a90565b8115611d7a570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b91908201809211611d3057565b60005b838110611dc95750506000910152565b8181015183820152602001611db9565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093611e1581518092818752878088019101611db6565b0116010190565b91908110156107365760051b0190565b3573ffffffffffffffffffffffffffffffffffffffff811681036101835790565b80518210156107365760209160051b010190565b3560ff811681036101835790565b6002805414611e7e5760028055565b60046040517f3ee5aeb5000000000000000000000000000000000000000000000000000000008152fd5b3d15611ed3573d90611eb9826119b7565b91611ec76040519384611976565b82523d6000602084013e565b606090565b73ffffffffffffffffffffffffffffffffffffffff6000541633036112e257565b92611f5390611f5c929373ffffffffffffffffffffffffffffffffffffffff948560035460081c16967f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c600020611f8e565b9092919261202b565b1603611f6457565b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841161201f57926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa1561201357805173ffffffffffffffffffffffffffffffffffffffff81161561200a57918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b60048110156120e3578061203d575050565b6001810361206f5760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b600281036120a857602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b6003146120b25750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90612127575080511561177057805190602001fd5b8151158061217f575b612138575090565b60249073ffffffffffffffffffffffffffffffffffffffff604051917f9996b315000000000000000000000000000000000000000000000000000000008352166004820152fd5b50803b1561213056fea26469706673582212206b4417be0029d5e2b60b3832197384947c11dd3d0dce7c6032c217bffb896eec64736f6c63430008190033000000000000000000000000923e18eb8dc9c92f2e746f80b7d6a64a9cdebfbf0000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb000000000000000000000000f414b6cf553c65adb145b78f2e87694aa3c9c1d1
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806316345f18146118c55780632194f3a21461187357806327e45c2c146117f457806338046ffb1461153e5780633d389faf146114fd57806341e7e341146114485780635962a9411461140c57806364f0d35e146113b7578063715018a61461131257806379ba5097146112355780637d6f0d5f146111555780637fb8e39714610b8a5780638322fff214610b3d5780638da5cb5b14610aeb578063aad2b723146109ea578063b555ddad1461081e578063c6788bdd146107b9578063cbbb28991461043a578063e09590d1146102f1578063e30c39781461029f578063e744092e14610235578063f2fde38b146101885763f3290d751461011957600080fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61016561191b565b166000526008602052602060ff604060002054166040519015158152f35b600080fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576101bf61191b565b6101c7611ed8565b73ffffffffffffffffffffffffffffffffffffffff80911690817fffffffffffffffffffffffff00000000000000000000000000000000000000006001541617600155600054167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700600080a3005b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61028161191b565b166000526009602052602060ff604060002054166040519015158152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835761032861191b565b602435801515918282036101835773ffffffffffffffffffffffffffffffffffffffff1680156104105761035a611ed8565b8060005260086020528260ff604060002054161515146103e6577f6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac60406103e4948151908482526020820152a1600052600860205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b005b60046040517f2620eb3a000000000000000000000000000000000000000000000000000000008152fd5b60046040517fd92e233d000000000000000000000000000000000000000000000000000000008152fd5b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835767ffffffffffffffff6004358181116101835761048a903690600401611a38565b9091806024351161018357366023602435011215610183576024356004013511610183573660246060813560040135028135010111610183576104cb611ed8565b801561078f576024356004013581036107655760005b8181106104ea57005b602435600401358110156107365773ffffffffffffffffffffffffffffffffffffffff61052061051b838587611e1c565b611e2c565b1690816000526007602052604060002060405161053c8161193e565b81549173ffffffffffffffffffffffffffffffffffffffff83168252600160ff9182602085019560a01c1685520154916040810192835285158015610707575b6104105773ffffffffffffffffffffffffffffffffffffffff90511673ffffffffffffffffffffffffffffffffffffffff6105bf60246060880281350101611e2c565b161492836106e3575b5050816106cd575b506103e657816001927f05a55041f547bc02746ecf7b080f4a090ea42e2a9e0b0c0b151f939cd74d8182602061060e60246060870281350101611e2c565b73ffffffffffffffffffffffffffffffffffffffff60405191168152a26000526007602052604060002073ffffffffffffffffffffffffffffffffffffffff61065f60246060850281350101611e2c565b168154907fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000006106ad6044606088026024350101611e61565b60a01b1692161717815582606460608402602435010135910155016104e1565b90505160646060830260243501013514856105d0565b819293505116906106fd6044606086026024350101611e61565b16149086806105c8565b5073ffffffffffffffffffffffffffffffffffffffff61072f60246060880281350101611e2c565b161561057c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b60046040517f0f59b9ff000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835773ffffffffffffffffffffffffffffffffffffffff61080561191b565b1660005260066020526020604060002054604051908152f35b346101835760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835767ffffffffffffffff6004358181116101835761086e903690600401611a38565b916024359281841161018357366023850112156101835783600401359182116109bb578160051b93602094604051936108aa6020830186611976565b8452602460208501918301019136831161018357602401905b8282106109a3575050506108d5611ed8565b801561078f57815181036107655760005b8181106108ef57005b73ffffffffffffffffffffffffffffffffffffffff61091261051b838588611e1c565b169081156104105760019161096a61092a8387611e4d565b511515826000526009895260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b6109748286611e4d565b511515907f1ced45b0ee0758da73555ab722db924ae9a51fb90c102e56149772515ef9db4a600080a3016108e6565b813580151581036101835781529086019086016108c3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357610a2161191b565b73ffffffffffffffffffffffffffffffffffffffff90818116801561041057610a48611ed8565b600354928360081c169081146103e6576040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fffffffffffffffffffffff0000000000000000000000000000000000000000ff9274ffffffffffffffffffffffffffffffffffffffff009290917f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb91a160081b16911617600355600080f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610183576101807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357610bc261191b565b60443567ffffffffffffffff811161018357610be29036906004016119f1565b60ff60643516606435036101835773ffffffffffffffffffffffffffffffffffffffff60c4351660c435036101835760ff610124351661012435036101835773ffffffffffffffffffffffffffffffffffffffff60c43516600052600860205260ff6040600020541661112b5760ff600354161561110157610c62611e6f565b6101043542116110d75773ffffffffffffffffffffffffffffffffffffffff8216600052600960205260ff60406000205416156110ad576024351561108357610d6760405160208101610d5060a9837fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808960601b1685528751610ced816034850160208c01611db6565b82019060c43560601b16603482015260e43560488201527fff0000000000000000000000000000000000000000000000000000000000000060643560f81b1660688201526084356069820152610104356089820152036089810185520183611976565b610164359161014435916101243591519020611ef9565b610d7082611caa565b805115158061106a575b61104057805115610fe5575b610db960ff6020835193015116610db4610da284602435611d1d565b610dae60e43593611d5f565b90611d1d565b611d70565b60a4358110610fbb57610dce81600554611da9565b60055573ffffffffffffffffffffffffffffffffffffffff60c4351660005260066020526040600020610e02828254611da9565b905573ffffffffffffffffffffffffffffffffffffffff6004541660405160208101917f23b872dd000000000000000000000000000000000000000000000000000000008352336024830152604482015260243560648201526064815260a0810181811067ffffffffffffffff8211176109bb5760405251610ec29160009182918273ffffffffffffffffffffffffffffffffffffffff8a165af1610ea5611ea8565b9073ffffffffffffffffffffffffffffffffffffffff8716612112565b8051908115159182610f97575b5050610f5057610eea6040519360a0855260a0850190611dd9565b91602435602085015260e4356040850152606084015260808301527f663b1bca0789228820b108bd992cafd0bb458b356b4ceb5661d1dfd9a10df53973ffffffffffffffffffffffffffffffffffffffff8060c435169416928033930390a46001600255005b60248473ffffffffffffffffffffffffffffffffffffffff604051917f5274afe7000000000000000000000000000000000000000000000000000000008352166004820152fd5b81925090602091810103126101835760200151801590811503610183578580610ecf565b60046040517fbde82093000000000000000000000000000000000000000000000000000000008152fd5b608435158015611033575b61100957608435815260ff606435166020820152610d86565b60046040517f7c946ed7000000000000000000000000000000000000000000000000000000008152fd5b5060ff6064351615610ff0565b60046040517ff443cb16000000000000000000000000000000000000000000000000000000008152fd5b50608435151580610d7a575060ff606435161515610d7a565b60046040517f589f3068000000000000000000000000000000000000000000000000000000008152fd5b60046040517f49a8defd000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1ab7da6b000000000000000000000000000000000000000000000000000000008152fd5b60046040517f46b57c6f000000000000000000000000000000000000000000000000000000008152fd5b60046040517f09550c77000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835761118c61191b565b73ffffffffffffffffffffffffffffffffffffffff90818116918215610410576111b4611ed8565b6004549081168381146103e6576040805173ffffffffffffffffffffffffffffffffffffffff92831681529390911660208401527fffffffffffffffffffffffff0000000000000000000000000000000000000000927fe22b566ac7db56412e2e041c88a7fd3151151ad6c6647e954f9bdc054bcb780e9190a11617600455005b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835760015473ffffffffffffffffffffffffffffffffffffffff33818316036112e2577fffffffffffffffffffffffff00000000000000000000000000000000000000008092166001556000549133908316176000553391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357611349611ed8565b600073ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffff0000000000000000000000000000000000000000806001541660015582549081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60035460081c16604051908152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576020600554604051908152f35b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610183576004358015158091036101835761148c611ed8565b6003549060ff821615158181146103e6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00917fe557486689c0bf71dde8cb27e7e87ed23badcf92ea724f4a0368676720d416f6604060ff938151908152836020820152a116911617600355600080f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602060ff600354166040519015158152f35b6101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101835760043567ffffffffffffffff8111610183576115899036906004016119f1565b73ffffffffffffffffffffffffffffffffffffffff60243581811691828203610183576044359360a43560643560ff8216820361018357856000526020946008865260ff6040600020541661112b5760ff6003541615611101576115eb611e6f565b8142116110d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6000526009865260ff60406000205416156110ad5734156110835761169a9261168a607460405180948a8201967fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008c6116668c8b815193849201611db6565b84019260601b168c8301528d60348301526054820152036054810185520183611976565b60e4359260c43592519020611ef9565b6116a2611a80565b8051156117ca5785610db482610dae60ff886116c26116cb975134611d1d565b93015116611d5f565b916116d883600554611da9565b6005556084358310610fbb57846000526006845260406000206116fc848254611da9565b90556004541634471061179a5760008080809334905af161171b611ea8565b5015611770577f875894c2b51a110087a5f958870138dd8534664b2982b188f35c25082ad2d05b9161175860405192606084526060840190611dd9565b93349083015260408201528033930390a46001600255005b60046040517f1425ea42000000000000000000000000000000000000000000000000000000008152fd5b60246040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152fd5b60046040517f358e2ce7000000000000000000000000000000000000000000000000000000008152fd5b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357606073ffffffffffffffffffffffffffffffffffffffff8061184361191b565b166000526007602052604060002060ff6001825492015491604051938116845260a01c1660208301526040820152f35b346101835760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b346101835760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018357604061190661190161191b565b611caa565b60ff6020835192805184520151166020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361018357565b6060810190811067ffffffffffffffff8211176109bb57604052565b6040810190811067ffffffffffffffff8211176109bb57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109bb57604052565b67ffffffffffffffff81116109bb57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561018357803590611a08826119b7565b92611a166040519485611976565b8284526020838301011161018357816000926020809301838601378301015290565b9181601f840112156101835782359167ffffffffffffffff8311610183576020808501948460051b01011161018357565b519069ffffffffffffffffffff8216820361018357565b6040805190611a8e8261195a565b6000918281528260208092015273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83526007815281832092825193611ac68561193e565b805491600173ffffffffffffffffffffffffffffffffffffffff92838516885260ff8689019560a01c168552015491858701928352855196611b078861195a565b82885282868901525116958615611ca0575060a06004968651978880927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa918215611c94578182978394611c2e575b5069ffffffffffffffffffff1615611c05578215928315611bbf575b505050611b965760ff905116915192611b8e8461195a565b835282015290565b600483517f1f4bcb2b000000000000000000000000000000000000000000000000000000008152fd5b90919250420391428311611bd857505110388080611b76565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b600486517fa5959c59000000000000000000000000000000000000000000000000000000008152fd5b975050915060a0863d60a011611c8c575b81611c4c60a09383611976565b81010312611c8957611c5d86611a69565b9169ffffffffffffffffffff8588015193611c7f608060608b01519a01611a69565b5093979390611b5a565b80fd5b3d9150611c3f565b508451903d90823e3d90fd5b9550505050505090565b60408051611cb78161195a565b6000928382528360208093015273ffffffffffffffffffffffffffffffffffffffff80911684526007825282842090835194611cf28661193e565b6001835493838516885260ff8689019560a01c168552015491858701928352855196611b078861195a565b81810292918115918404141715611d3057565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff16604d8111611d3057600a0a90565b8115611d7a570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b91908201809211611d3057565b60005b838110611dc95750506000910152565b8181015183820152602001611db9565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093611e1581518092818752878088019101611db6565b0116010190565b91908110156107365760051b0190565b3573ffffffffffffffffffffffffffffffffffffffff811681036101835790565b80518210156107365760209160051b010190565b3560ff811681036101835790565b6002805414611e7e5760028055565b60046040517f3ee5aeb5000000000000000000000000000000000000000000000000000000008152fd5b3d15611ed3573d90611eb9826119b7565b91611ec76040519384611976565b82523d6000602084013e565b606090565b73ffffffffffffffffffffffffffffffffffffffff6000541633036112e257565b92611f5390611f5c929373ffffffffffffffffffffffffffffffffffffffff948560035460081c16967f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c600020611f8e565b9092919261202b565b1603611f6457565b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841161201f57926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa1561201357805173ffffffffffffffffffffffffffffffffffffffff81161561200a57918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b60048110156120e3578061203d575050565b6001810361206f5760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b600281036120a857602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b6003146120b25750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90612127575080511561177057805190602001fd5b8151158061217f575b612138575090565b60249073ffffffffffffffffffffffffffffffffffffffff604051917f9996b315000000000000000000000000000000000000000000000000000000008352166004820152fd5b50803b1561213056fea26469706673582212206b4417be0029d5e2b60b3832197384947c11dd3d0dce7c6032c217bffb896eec64736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000923e18eb8dc9c92f2e746f80b7d6a64a9cdebfbf0000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb000000000000000000000000f414b6cf553c65adb145b78f2e87694aa3c9c1d1
-----Decoded View---------------
Arg [0] : fundsWalletAddress (address): 0x923E18eb8dc9C92f2e746f80b7D6a64a9cDebfbf
Arg [1] : signerAddress (address): 0x3088149945e0dFdf78f10650A36cd0C1fb8816eB
Arg [2] : owner (address): 0xf414B6cf553C65ADb145b78F2e87694AA3C9c1D1
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000923e18eb8dc9c92f2e746f80b7d6a64a9cdebfbf
Arg [1] : 0000000000000000000000003088149945e0dfdf78f10650a36cd0c1fb8816eb
Arg [2] : 000000000000000000000000f414b6cf553c65adb145b78f2e87694aa3c9c1d1
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.