Overview
ETH Balance
16.9020930399997784 ETH
Eth Value
$52,828.60 (@ $3,125.57/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 327 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw Tokens | 21195634 | 9 hrs ago | IN | 0 ETH | 0.00160323 | ||||
Buy Tokens | 21195623 | 9 hrs ago | IN | 0.07212612 ETH | 0.0020736 | ||||
Withdraw Tokens | 21195574 | 9 hrs ago | IN | 0 ETH | 0.00118331 | ||||
Buy Tokens | 21195570 | 9 hrs ago | IN | 0.07212612 ETH | 0.00166106 | ||||
Withdraw Tokens | 21195561 | 9 hrs ago | IN | 0 ETH | 0.0015695 | ||||
Buy Tokens | 21194962 | 11 hrs ago | IN | 0.03295 ETH | 0.00159313 | ||||
Withdraw Tokens | 21186103 | 41 hrs ago | IN | 0 ETH | 0.00207 | ||||
Withdraw Tokens | 21182698 | 2 days ago | IN | 0 ETH | 0.00187517 | ||||
Buy Tokens | 21182696 | 2 days ago | IN | 1.571 ETH | 0.00228643 | ||||
Buy Tokens | 21181867 | 2 days ago | IN | 1.8 ETH | 0.00266346 | ||||
Buy Tokens | 21181867 | 2 days ago | IN | 4.99999999 ETH | 0.00271753 | ||||
Buy Tokens | 21181848 | 2 days ago | IN | 2.2 ETH | 0.00268377 | ||||
Buy Tokens | 21181845 | 2 days ago | IN | 0.95 ETH | 0.00289447 | ||||
Buy Tokens | 21181841 | 2 days ago | IN | 1.34999999 ETH | 0.00286929 | ||||
Withdraw Tokens | 21163014 | 4 days ago | IN | 0 ETH | 0.00061614 | ||||
Buy Tokens | 21163008 | 4 days ago | IN | 0.000319 ETH | 0.00099624 | ||||
Withdraw Tokens | 21160889 | 5 days ago | IN | 0 ETH | 0.00100415 | ||||
Withdraw Tokens | 21151888 | 6 days ago | IN | 0 ETH | 0.00054199 | ||||
Buy Tokens | 21151882 | 6 days ago | IN | 0.04 ETH | 0.00067816 | ||||
Withdraw Tokens | 21149179 | 6 days ago | IN | 0 ETH | 0.00051591 | ||||
Buy Tokens | 21149174 | 6 days ago | IN | 3.281 ETH | 0.00079963 | ||||
Buy Tokens | 21124941 | 10 days ago | IN | 0.00499999 ETH | 0.00055274 | ||||
Withdraw Tokens | 21085279 | 15 days ago | IN | 0 ETH | 0.00057433 | ||||
Withdraw Tokens | 21045094 | 21 days ago | IN | 0 ETH | 0.00041402 | ||||
Buy Tokens | 21036050 | 22 days ago | IN | 0.01 ETH | 0.00116792 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20628085 | 79 days ago | 291.19835542 ETH |
Loading...
Loading
Contract Name:
TokenSale
Compiler Version
v0.8.20+commit.a1b79de6
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.20; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-contracts/contracts/access/Ownable2Step.sol"; import {AggregatorV3Interface} from "@chainlink/contracts/src/interfaces/feeds/AggregatorV3Interface.sol"; contract TokenSale is Ownable2Step, ReentrancyGuard { using SafeERC20 for IERC20; uint256 public tokenPriceInDollar; uint256 public totalTokensForSale; uint256 constant ETH_AMOUNT_MULTIPLIER = 10**10; uint256 immutable CHAINLINK_STALE_DATA_PERIOD = 1 hours; bool public saleActive; bool public tokensLocked; mapping(address => uint256) public userBalances; IERC20 public immutable psyToken; AggregatorV3Interface public dataFeed; event TokensBought(address buyer, uint256 amount); event TokensWithdrawn(address withdrawer, uint256 amount); event SalePaused(); event SaleResumed(); event TokenUnlocked(); constructor(address _psyToken, address _chainlinkPriceFeed, uint256 _tokenPrice) Ownable(msg.sender) { require(_psyToken != address(0), "TokenSale: Cannot Be Zero Address"); require(_chainlinkPriceFeed != address(0), "TokenSale: Cannot Be Zero Address"); //Mainnet USD/ETH price feed address dataFeed = AggregatorV3Interface(_chainlinkPriceFeed); psyToken = IERC20(_psyToken); tokenPriceInDollar = _tokenPrice; saleActive = true; tokensLocked = true; } /** * @notice Allows users to buy a specified amount of PsyTokens. * @param _amountOfPsyTokens The amount of PsyTokens to buy. */ function buyTokens(uint256 _amountOfPsyTokens) external payable nonReentrant { require(saleActive, "TokenSale: Sale Paused"); require(_amountOfPsyTokens > 0, "TokenSale: Amount Must Be Bigger Than 0"); require(_hasSufficientSupplyForPurchase(_amountOfPsyTokens), "TokenSale: Not enough supply"); uint256 ethPricePerToken = calculateEthAmountPerPsyToken(); uint256 ethAmount = _amountOfPsyTokens * ethPricePerToken / 1e18; require(msg.value == ethAmount, "TokenSale: Incorrect Amount Sent In"); require(ethAmount > 0, "TokenSale: Insufficient Funds"); userBalances[msg.sender] += _amountOfPsyTokens; totalTokensForSale -= _amountOfPsyTokens; if (totalTokensForSale == 0) { saleActive = false; } emit TokensBought(msg.sender, _amountOfPsyTokens); } /** * @notice Allows a user to withdraw their PSY tokens. * @dev The user must have a positive balance of tokens and the sale status must be set to WITHDRAWABLE. */ function withdrawTokens() external nonReentrant { require(!tokensLocked, "TokenSale: Tokens Locked"); require(userBalances[msg.sender] > 0, "TokenSale: Insufficient funds"); uint256 amount = userBalances[msg.sender]; userBalances[msg.sender] = 0; psyToken.safeTransfer(msg.sender, amount); emit TokensWithdrawn(msg.sender, amount); } /** * @notice Pauses the token sale. * @dev Only the contract owner can call this function. * @dev The sale status must be set to OPEN in order to pause it. */ function pauseSale() external onlyOwner { require(saleActive, "TokenSale: Token Already Paused"); saleActive = false; emit SalePaused(); } /** * @notice Resumes the token sale. * @dev Only the contract owner can call this function. * @dev The sale status must be set to PAUSED and the totalTokensForSale must be greater than 0 in order to resume the sale. */ function resumeSale() external onlyOwner { require(!saleActive, "TokenSale: Token Not Paused"); require(totalTokensForSale > 0, "TokenSale: Supply Finished"); saleActive = true; emit SalePaused(); } /** * @notice Unlocks the token for withdrawal. * @dev Only the contract owner can call this function. */ function unlockToken() external onlyOwner { require(tokensLocked, "TokenSale: Tokens Already Unlocked"); tokensLocked = false; emit TokenUnlocked(); } /** * @notice Deposits a specified amount of PsyTokens into the contract for sale. * @param _amountToDeposit The amount of PsyTokens to deposit for sale. * @dev The sale status must be set to PAUSED in order to unlock the token. */ function depositPsyTokensForSale(uint256 _amountToDeposit) external onlyOwner { totalTokensForSale += _amountToDeposit; psyToken.safeTransferFrom(msg.sender, address(this), _amountToDeposit); } /** * @notice Sets the token price in USDC. * @dev Only the contract owner can call this function. * @param _newPrice The new token price in USDC. * @dev The new price must be different from the current token price. */ function setTokenPrice(uint256 _newPrice) external onlyOwner { require(_newPrice != tokenPriceInDollar, "TokenSale: New Token Price Same As Current"); tokenPriceInDollar = _newPrice; } /** * @notice Updates the Chainlink price feed address used for calculating the amount of Ether required to purchase one PsyToken. * @param _newPriceFeed The new address of the Chainlink price feed. * @notice This function updates the dataFeed variable with the new Chainlink price feed address. */ function updateChainlinkPriceFeed(address _newPriceFeed) external onlyOwner { require(_newPriceFeed != address(0), "TokenSale: Cannot Be Address 0"); dataFeed = AggregatorV3Interface(_newPriceFeed); } /** * @notice Calculates the amount of Ether required to purchase one PsyToken. * @dev The token price in USD must be greater than 0. * @return The amount of Ether required to purchase one PsyToken, multiplied by ETH_AMOUNT_MULTIPLIER. */ function calculateEthAmountPerPsyToken() public returns (uint256) { require(tokenPriceInDollar != 0, "TokenSale: Token Is Free"); uint256 dollarPricePerEth = _getDollarAmountPerEth(); uint256 ethAmount = tokenPriceInDollar / dollarPricePerEth + 1; return ethAmount * ETH_AMOUNT_MULTIPLIER; } /** * @notice Withdraws the contract's balance and sends it to the specified receiver address. * @param _receiver: The address to which the contract's balance will be sent. * @dev Only the contract owner can call this function. * @dev If the transfer fails, an error message is thrown. * @notice This function should be used with caution as it transfers the entire balance of the contract. */ function withdrawFunds(address _receiver) external onlyOwner { require(_receiver != address(0), "TokenSale: Receiver Cannot Be Zero Address"); (bool sent,) = _receiver.call{value: address(this).balance}(""); require(sent, "Failed to send Ether"); } /** * @notice Checks if the contract has sufficient supply for a purchase. * @param _amount The amount of tokens to be purchased. * @return A boolean indicating whether the contract has sufficient supply for the purchase. */ function _hasSufficientSupplyForPurchase(uint256 _amount) internal view returns (bool) { return (totalTokensForSale >= _amount); } /** * @notice Retrieves the latest dollar amount per Ether from the Chainlink price feed. * @dev This function calls the latestRoundData() function of the dataFeed contract to get the latest round data. * @return The dollar amount per Ether as an unsigned integer. */ function _getDollarAmountPerEth() internal returns (uint256) { (uint80 roundID, int256 amount, , uint256 updatedAt, uint80 answeredInRound) = dataFeed.latestRoundData(); require(answeredInRound >= roundID, "TokenSale: Stale price"); require(updatedAt >= block.timestamp - CHAINLINK_STALE_DATA_PERIOD, "TokenSale: Incomplete Round"); require(amount > 0, "TokenSale: Invalid price"); return uint256(amount); } }
// 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/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) (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 pragma solidity >=0.6.2 <0.9.0; 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) (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) (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.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.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; } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "@chainlink/contracts/=lib/foundry-chainlink-toolkit/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "foundry-chainlink-toolkit/=lib/foundry-chainlink-toolkit/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_psyToken","type":"address"},{"internalType":"address","name":"_chainlinkPriceFeed","type":"address"},{"internalType":"uint256","name":"_tokenPrice","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"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":[],"name":"SalePaused","type":"event"},{"anonymous":false,"inputs":[],"name":"SaleResumed","type":"event"},{"anonymous":false,"inputs":[],"name":"TokenUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOfPsyTokens","type":"uint256"}],"name":"buyTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"calculateEthAmountPerPsyToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dataFeed","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountToDeposit","type":"uint256"}],"name":"depositPsyTokensForSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"psyToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resumeSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setTokenPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenPriceInDollar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokensForSale","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":[],"name":"unlockToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newPriceFeed","type":"address"}],"name":"updateChainlinkPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c0604052610e106080523480156200001757600080fd5b5060405162001bfb38038062001bfb8339810160408190526200003a91620001d9565b33806200006257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200006d816200014e565b5060016002556001600160a01b038316620000c45760405162461bcd60e51b8152602060048201526021602482015260008051602062001bdb8339815191526044820152607360f81b606482015260840162000059565b6001600160a01b038216620001155760405162461bcd60e51b8152602060048201526021602482015260008051602062001bdb8339815191526044820152607360f81b606482015260840162000059565b600780546001600160a01b0319166001600160a01b03938416179055911660a0526003556005805461ffff19166101011790556200021a565b600180546001600160a01b031916905562000169816200016c565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620001d457600080fd5b919050565b600080600060608486031215620001ef57600080fd5b620001fa84620001bc565b92506200020a60208501620001bc565b9150604084015190509250925092565b60805160a05161198d6200024e6000396000818161030a015281816105840152611021015260006113ce015261198d6000f3fe6080604052600436106101755760003560e01c8063715018a6116100cb5780638d8f2adb1161007f578063a1feba4211610059578063a1feba42146103e9578063e30c397814610408578063f2fde38b1461043357600080fd5b80638d8f2adb1461037c5780638da5cb5b146103915780639e42ff90146103bc57600080fd5b80637b031b29116100b05780637b031b29146102f85780638144658d14610351578063896dcb5f1461036757600080fd5b8063715018a6146102ce57806379ba5097146102e357600080fd5b80635074527b1161012d57806368428a1b1161010757806368428a1b1461026457806368742da61461028e5780636a61e5fc146102ae57600080fd5b80635074527b1461021957806355367ba91461023957806360219c7b1461024e57600080fd5b80632a3fbce41161015e5780632a3fbce4146101d157806333e364cb146101f15780633610724e1461020657600080fd5b806318a24b5b1461017a57806326224c6414610191575b600080fd5b34801561018657600080fd5b5061018f610453565b005b34801561019d57600080fd5b506101be6101ac3660046117ca565b60066020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101dd57600080fd5b5061018f6101ec366004611800565b61054a565b3480156101fd57600080fd5b5061018f6105af565b61018f610214366004611800565b6106e6565b34801561022557600080fd5b5061018f6102343660046117ca565b610a37565b34801561024557600080fd5b5061018f610b03565b34801561025a57600080fd5b506101be60045481565b34801561027057600080fd5b5060055461027e9060ff1681565b60405190151581526020016101c8565b34801561029a57600080fd5b5061018f6102a93660046117ca565b610bca565b3480156102ba57600080fd5b5061018f6102c9366004611800565b610d43565b3480156102da57600080fd5b5061018f610de1565b3480156102ef57600080fd5b5061018f610df5565b34801561030457600080fd5b5061032c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561035d57600080fd5b506101be60035481565b34801561037357600080fd5b506101be610e69565b34801561038857600080fd5b5061018f610f16565b34801561039d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661032c565b3480156103c857600080fd5b5060075461032c9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103f557600080fd5b5060055461027e90610100900460ff1681565b34801561041457600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661032c565b34801561043f57600080fd5b5061018f61044e3660046117ca565b6110a1565b61045b611151565b600554610100900460ff166104f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f546f6b656e53616c653a20546f6b656e7320416c726561647920556e6c6f636b60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040517f207acd5776f957a43a89bc1a22dc017c11da78363d4df57a450b110e31ec8f2290600090a1565b610552611151565b80600460008282546105649190611848565b909155506105ac905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163330846111a4565b50565b6105b7611151565b60055460ff1615610624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f546f6b656e53616c653a20546f6b656e204e6f7420506175736564000000000060448201526064016104ee565b600060045411610690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f546f6b656e53616c653a20537570706c792046696e697368656400000000000060448201526064016104ee565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517f8a98cbd0cab14e33b8a5e5710b9b59bceec8af9a5b4b3bb32fb275cf04ea048d90600090a1565b6106ee611233565b60055460ff1661075a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e53616c653a2053616c65205061757365640000000000000000000060448201526064016104ee565b600081116107ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e53616c653a20416d6f756e74204d7573742042652042696767657260448201527f205468616e20300000000000000000000000000000000000000000000000000060648201526084016104ee565b6107f681600454101590565b61085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f546f6b656e53616c653a204e6f7420656e6f75676820737570706c790000000060448201526064016104ee565b6000610866610e69565b90506000670de0b6b3a764000061087d838561185b565b6108879190611872565b9050803414610918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f546f6b656e53616c653a20496e636f727265637420416d6f756e742053656e7460448201527f20496e000000000000000000000000000000000000000000000000000000000060648201526084016104ee565b60008111610982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546f6b656e53616c653a20496e73756666696369656e742046756e647300000060448201526064016104ee565b33600090815260066020526040812080548592906109a1908490611848565b9250508190555082600460008282546109ba91906118ad565b90915550506004546000036109f257600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60408051338152602081018590527f745f661b8143944fb883f50694ebed3a871e43c451d9d4bf4648a9d551d7e47a910160405180910390a150506105ac6001600255565b610a3f611151565b73ffffffffffffffffffffffffffffffffffffffff8116610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f546f6b656e53616c653a2043616e6e6f7420426520416464726573732030000060448201526064016104ee565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b0b611151565b60055460ff16610b77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f546f6b656e53616c653a20546f6b656e20416c7265616479205061757365640060448201526064016104ee565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f8a98cbd0cab14e33b8a5e5710b9b59bceec8af9a5b4b3bb32fb275cf04ea048d90600090a1565b610bd2611151565b73ffffffffffffffffffffffffffffffffffffffff8116610c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f546f6b656e53616c653a2052656365697665722043616e6e6f74204265205a6560448201527f726f20416464726573730000000000000000000000000000000000000000000060648201526084016104ee565b60008173ffffffffffffffffffffffffffffffffffffffff164760405160006040518083038185875af1925050503d8060008114610ccf576040519150601f19603f3d011682016040523d82523d6000602084013e610cd4565b606091505b5050905080610d3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4661696c656420746f2073656e6420457468657200000000000000000000000060448201526064016104ee565b5050565b610d4b611151565b6003548103610ddc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f546f6b656e53616c653a204e657720546f6b656e2050726963652053616d652060448201527f41732043757272656e740000000000000000000000000000000000000000000060648201526084016104ee565b600355565b610de9611151565b610df36000611274565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610e60576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016104ee565b6105ac81611274565b6000600354600003610ed7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20546f6b656e2049732046726565000000000000000060448201526064016104ee565b6000610ee16112a5565b9050600081600354610ef39190611872565b610efe906001611848565b9050610f0f6402540be4008261185b565b9250505090565b610f1e611233565b600554610100900460ff1615610f90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20546f6b656e73204c6f636b6564000000000000000060448201526064016104ee565b33600090815260066020526040902054611006576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546f6b656e53616c653a20496e73756666696369656e742066756e647300000060448201526064016104ee565b33600081815260066020526040812080549190559061105d907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690836114cf565b60408051338152602081018390527f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b910160405180910390a150610df36001600255565b6110a9611151565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561110c60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610df3576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016104ee565b60405173ffffffffffffffffffffffffffffffffffffffff848116602483015283811660448301526064820183905261122d9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611512565b50505050565b600280540361126e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028055565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105ac816115a8565b6000806000806000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561131a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133e91906118df565b9450945050935093508369ffffffffffffffffffff168169ffffffffffffffffffff1610156113c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e53616c653a205374616c652070726963650000000000000000000060448201526064016104ee565b6113f37f0000000000000000000000000000000000000000000000000000000000000000426118ad565b82101561145c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f546f6b656e53616c653a20496e636f6d706c65746520526f756e64000000000060448201526064016104ee565b600083136114c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20496e76616c6964207072696365000000000000000060448201526064016104ee565b50909392505050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261150d91859182169063a9059cbb906064016111e6565b505050565b600061153473ffffffffffffffffffffffffffffffffffffffff84168361161d565b90508051600014158015611559575080806020019051810190611557919061192f565b155b1561150d576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016104ee565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606061162b83836000611634565b90505b92915050565b606081471015611672576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016104ee565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161169b9190611951565b60006040518083038185875af1925050503d80600081146116d8576040519150601f19603f3d011682016040523d82523d6000602084013e6116dd565b606091505b50915091506116ed8683836116f9565b925050505b9392505050565b60608261170e5761170982611788565b6116f2565b8151158015611732575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611781576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016104ee565b50806116f2565b8051156117985780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156117dc57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146116f257600080fd5b60006020828403121561181257600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561162e5761162e611819565b808202811582820484141761162e5761162e611819565b6000826118a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561162e5761162e611819565b805169ffffffffffffffffffff811681146118da57600080fd5b919050565b600080600080600060a086880312156118f757600080fd5b611900866118c0565b9450602086015193506040860151925060608601519150611923608087016118c0565b90509295509295909350565b60006020828403121561194157600080fd5b815180151581146116f257600080fd5b6000825160005b818110156119725760208186018101518583015201611958565b50600092019182525091905056fea164736f6c6343000814000a546f6b656e53616c653a2043616e6e6f74204265205a65726f204164647265730000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000000000000000000000000000016345785d8a0000
Deployed Bytecode
0x6080604052600436106101755760003560e01c8063715018a6116100cb5780638d8f2adb1161007f578063a1feba4211610059578063a1feba42146103e9578063e30c397814610408578063f2fde38b1461043357600080fd5b80638d8f2adb1461037c5780638da5cb5b146103915780639e42ff90146103bc57600080fd5b80637b031b29116100b05780637b031b29146102f85780638144658d14610351578063896dcb5f1461036757600080fd5b8063715018a6146102ce57806379ba5097146102e357600080fd5b80635074527b1161012d57806368428a1b1161010757806368428a1b1461026457806368742da61461028e5780636a61e5fc146102ae57600080fd5b80635074527b1461021957806355367ba91461023957806360219c7b1461024e57600080fd5b80632a3fbce41161015e5780632a3fbce4146101d157806333e364cb146101f15780633610724e1461020657600080fd5b806318a24b5b1461017a57806326224c6414610191575b600080fd5b34801561018657600080fd5b5061018f610453565b005b34801561019d57600080fd5b506101be6101ac3660046117ca565b60066020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101dd57600080fd5b5061018f6101ec366004611800565b61054a565b3480156101fd57600080fd5b5061018f6105af565b61018f610214366004611800565b6106e6565b34801561022557600080fd5b5061018f6102343660046117ca565b610a37565b34801561024557600080fd5b5061018f610b03565b34801561025a57600080fd5b506101be60045481565b34801561027057600080fd5b5060055461027e9060ff1681565b60405190151581526020016101c8565b34801561029a57600080fd5b5061018f6102a93660046117ca565b610bca565b3480156102ba57600080fd5b5061018f6102c9366004611800565b610d43565b3480156102da57600080fd5b5061018f610de1565b3480156102ef57600080fd5b5061018f610df5565b34801561030457600080fd5b5061032c7f0000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a81565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561035d57600080fd5b506101be60035481565b34801561037357600080fd5b506101be610e69565b34801561038857600080fd5b5061018f610f16565b34801561039d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661032c565b3480156103c857600080fd5b5060075461032c9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103f557600080fd5b5060055461027e90610100900460ff1681565b34801561041457600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661032c565b34801561043f57600080fd5b5061018f61044e3660046117ca565b6110a1565b61045b611151565b600554610100900460ff166104f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f546f6b656e53616c653a20546f6b656e7320416c726561647920556e6c6f636b60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040517f207acd5776f957a43a89bc1a22dc017c11da78363d4df57a450b110e31ec8f2290600090a1565b610552611151565b80600460008282546105649190611848565b909155506105ac905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a163330846111a4565b50565b6105b7611151565b60055460ff1615610624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f546f6b656e53616c653a20546f6b656e204e6f7420506175736564000000000060448201526064016104ee565b600060045411610690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f546f6b656e53616c653a20537570706c792046696e697368656400000000000060448201526064016104ee565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517f8a98cbd0cab14e33b8a5e5710b9b59bceec8af9a5b4b3bb32fb275cf04ea048d90600090a1565b6106ee611233565b60055460ff1661075a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e53616c653a2053616c65205061757365640000000000000000000060448201526064016104ee565b600081116107ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e53616c653a20416d6f756e74204d7573742042652042696767657260448201527f205468616e20300000000000000000000000000000000000000000000000000060648201526084016104ee565b6107f681600454101590565b61085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f546f6b656e53616c653a204e6f7420656e6f75676820737570706c790000000060448201526064016104ee565b6000610866610e69565b90506000670de0b6b3a764000061087d838561185b565b6108879190611872565b9050803414610918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f546f6b656e53616c653a20496e636f727265637420416d6f756e742053656e7460448201527f20496e000000000000000000000000000000000000000000000000000000000060648201526084016104ee565b60008111610982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546f6b656e53616c653a20496e73756666696369656e742046756e647300000060448201526064016104ee565b33600090815260066020526040812080548592906109a1908490611848565b9250508190555082600460008282546109ba91906118ad565b90915550506004546000036109f257600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60408051338152602081018590527f745f661b8143944fb883f50694ebed3a871e43c451d9d4bf4648a9d551d7e47a910160405180910390a150506105ac6001600255565b610a3f611151565b73ffffffffffffffffffffffffffffffffffffffff8116610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f546f6b656e53616c653a2043616e6e6f7420426520416464726573732030000060448201526064016104ee565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b0b611151565b60055460ff16610b77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f546f6b656e53616c653a20546f6b656e20416c7265616479205061757365640060448201526064016104ee565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f8a98cbd0cab14e33b8a5e5710b9b59bceec8af9a5b4b3bb32fb275cf04ea048d90600090a1565b610bd2611151565b73ffffffffffffffffffffffffffffffffffffffff8116610c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f546f6b656e53616c653a2052656365697665722043616e6e6f74204265205a6560448201527f726f20416464726573730000000000000000000000000000000000000000000060648201526084016104ee565b60008173ffffffffffffffffffffffffffffffffffffffff164760405160006040518083038185875af1925050503d8060008114610ccf576040519150601f19603f3d011682016040523d82523d6000602084013e610cd4565b606091505b5050905080610d3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4661696c656420746f2073656e6420457468657200000000000000000000000060448201526064016104ee565b5050565b610d4b611151565b6003548103610ddc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f546f6b656e53616c653a204e657720546f6b656e2050726963652053616d652060448201527f41732043757272656e740000000000000000000000000000000000000000000060648201526084016104ee565b600355565b610de9611151565b610df36000611274565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610e60576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016104ee565b6105ac81611274565b6000600354600003610ed7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20546f6b656e2049732046726565000000000000000060448201526064016104ee565b6000610ee16112a5565b9050600081600354610ef39190611872565b610efe906001611848565b9050610f0f6402540be4008261185b565b9250505090565b610f1e611233565b600554610100900460ff1615610f90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20546f6b656e73204c6f636b6564000000000000000060448201526064016104ee565b33600090815260066020526040902054611006576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546f6b656e53616c653a20496e73756666696369656e742066756e647300000060448201526064016104ee565b33600081815260066020526040812080549190559061105d907f0000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a73ffffffffffffffffffffffffffffffffffffffff1690836114cf565b60408051338152602081018390527f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b910160405180910390a150610df36001600255565b6110a9611151565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561110c60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314610df3576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016104ee565b60405173ffffffffffffffffffffffffffffffffffffffff848116602483015283811660448301526064820183905261122d9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611512565b50505050565b600280540361126e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028055565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105ac816115a8565b6000806000806000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561131a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133e91906118df565b9450945050935093508369ffffffffffffffffffff168169ffffffffffffffffffff1610156113c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e53616c653a205374616c652070726963650000000000000000000060448201526064016104ee565b6113f37f0000000000000000000000000000000000000000000000000000000000000e10426118ad565b82101561145c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f546f6b656e53616c653a20496e636f6d706c65746520526f756e64000000000060448201526064016104ee565b600083136114c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f546f6b656e53616c653a20496e76616c6964207072696365000000000000000060448201526064016104ee565b50909392505050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261150d91859182169063a9059cbb906064016111e6565b505050565b600061153473ffffffffffffffffffffffffffffffffffffffff84168361161d565b90508051600014158015611559575080806020019051810190611557919061192f565b155b1561150d576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016104ee565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606061162b83836000611634565b90505b92915050565b606081471015611672576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016104ee565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161169b9190611951565b60006040518083038185875af1925050503d80600081146116d8576040519150601f19603f3d011682016040523d82523d6000602084013e6116dd565b606091505b50915091506116ed8683836116f9565b925050505b9392505050565b60608261170e5761170982611788565b6116f2565b8151158015611732575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611781576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016104ee565b50806116f2565b8051156117985780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156117dc57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146116f257600080fd5b60006020828403121561181257600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561162e5761162e611819565b808202811582820484141761162e5761162e611819565b6000826118a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561162e5761162e611819565b805169ffffffffffffffffffff811681146118da57600080fd5b919050565b600080600080600060a086880312156118f757600080fd5b611900866118c0565b9450602086015193506040860151925060608601519150611923608087016118c0565b90509295509295909350565b60006020828403121561194157600080fd5b815180151581146116f257600080fd5b6000825160005b818110156119725760208186018101518583015201611958565b50600092019182525091905056fea164736f6c6343000814000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000000000000000000000000000016345785d8a0000
-----Decoded View---------------
Arg [0] : _psyToken (address): 0x2196B84EaCe74867b73fb003AfF93C11FcE1D47A
Arg [1] : _chainlinkPriceFeed (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [2] : _tokenPrice (uint256): 100000000000000000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000002196b84eace74867b73fb003aff93c11fce1d47a
Arg [1] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [2] : 000000000000000000000000000000000000000000000000016345785d8a0000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,127.65 | 16.9021 | $52,863.78 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.