Source Code
Latest 25 from a total of 89 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Refund For | 41048126 | 178 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 40723614 | 181 days ago | IN | 0 S | 0.0032572 | ||||
| Refund For | 38566296 | 195 days ago | IN | 0 S | 0.0032572 | ||||
| Refund For | 38447514 | 196 days ago | IN | 0 S | 0.00411756 | ||||
| Refund For | 38312918 | 197 days ago | IN | 0 S | 0.0032566 | ||||
| Refund For | 38023911 | 199 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 37760988 | 200 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 37694325 | 201 days ago | IN | 0 S | 0.00377443 | ||||
| Refund For | 37691721 | 201 days ago | IN | 0 S | 0.00344289 | ||||
| Refund For | 37500659 | 202 days ago | IN | 0 S | 0.0032566 | ||||
| Refund For | 37495728 | 202 days ago | IN | 0 S | 0.00377514 | ||||
| Refund For | 37492337 | 202 days ago | IN | 0 S | 0.0032566 | ||||
| Refund For | 37492229 | 202 days ago | IN | 0 S | 0.0032572 | ||||
| Refund For | 37434727 | 203 days ago | IN | 0 S | 0.00358292 | ||||
| Refund For | 37257864 | 204 days ago | IN | 0 S | 0.00366328 | ||||
| Refund For | 37257784 | 204 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 37225605 | 205 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 37196010 | 205 days ago | IN | 0 S | 0.0032572 | ||||
| Refund For | 37194618 | 205 days ago | IN | 0 S | 0.00377583 | ||||
| Refund For | 37188328 | 205 days ago | IN | 0 S | 0.00411834 | ||||
| Refund For | 37188136 | 205 days ago | IN | 0 S | 0.0037758 | ||||
| Refund For | 37173049 | 205 days ago | IN | 0 S | 0.00377511 | ||||
| Refund For | 37163663 | 205 days ago | IN | 0 S | 0.00463313 | ||||
| Refund For | 37162937 | 205 days ago | IN | 0 S | 0.00377651 | ||||
| Refund For | 37145418 | 205 days ago | IN | 0 S | 0.00377583 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 41048126 | 178 days ago | 250 S | ||||
| 40723614 | 181 days ago | 560 S | ||||
| 38566296 | 195 days ago | 500 S | ||||
| 38447514 | 196 days ago | 24 S | ||||
| 38312918 | 197 days ago | 25 S | ||||
| 38023911 | 199 days ago | 4,000 S | ||||
| 37760988 | 200 days ago | 100 S | ||||
| 37694325 | 201 days ago | 100,000 S | ||||
| 37691721 | 201 days ago | 143.1 S | ||||
| 37500659 | 202 days ago | 750 S | ||||
| 37495728 | 202 days ago | 6 S | ||||
| 37492337 | 202 days ago | 50 S | ||||
| 37492229 | 202 days ago | 200 S | ||||
| 37434727 | 203 days ago | 20,001 S | ||||
| 37257864 | 204 days ago | 650 S | ||||
| 37257784 | 204 days ago | 490 S | ||||
| 37225605 | 205 days ago | 5,000 S | ||||
| 37196010 | 205 days ago | 1,000 S | ||||
| 37194618 | 205 days ago | 1,000 S | ||||
| 37188328 | 205 days ago | 50,000 S | ||||
| 37188136 | 205 days ago | 10,000 S | ||||
| 37173049 | 205 days ago | 1,593 S | ||||
| 37163663 | 205 days ago | 2,000 S | ||||
| 37162937 | 205 days ago | 50 S | ||||
| 37145418 | 205 days ago | 2,000 S |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Sale
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract Sale is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address payable;
/*---------- CONSTANTS --------------------------------------------*/
uint256 constant public PRICE = 0.5 ether;
uint256 constant public DIVISOR = 1 ether;
uint256 constant public MIN_CAP = 5_000_000 ether;
uint256 constant public MAX_CAP = 10_000_000 ether;
/*---------- STATE VARIABLES --------------------------------------*/
address public token;
uint256 public totalAmount;
uint256 public totalClaim;
uint256 public totalRefund;
mapping(address => uint256) public account_Amount;
mapping(address => uint256) public account_Claim;
mapping(address => uint256) public account_Refund;
mapping(address => bool) public account_Whitelist;
enum State {
Closed,
Whitelist,
Open,
Claim,
Refund
}
State public state;
/*---------- ERRORS ------------------------------------------------*/
error Sale__InvalidAccount();
error Sale__NotWhitelisted();
error Sale__NotOpen();
error Sale__InvalidPayment();
error Sale__InvalidClaim();
error Sale__InvalidRefund();
error Sale__TokenNotSet();
error Sale__NotClaim();
error Sale__NotRefund();
error Sale__Concluded();
error Sale__CantWithdrawInRefund();
error Sale__MinCapNotReached();
error Sale__MaxCapReached();
/*---------- EVENTS ------------------------------------------------*/
event Sale__Purchase(address indexed account, uint256 amount);
event Sale__Claim(address indexed account, uint256 amount);
event Sale__Refund(address indexed account, uint256 amount);
event Sale__Withdrawn(address indexed account, uint256 amount);
event Sale__Whitelist(address indexed account, bool flag);
event Sale__TokenSet(address indexed token);
event Sale__StateUpdated(State indexed state);
/*---------- FUNCTIONS --------------------------------------------*/
constructor() {}
function purchaseFor(address account) external payable nonReentrant {
if (account == address(0)) revert Sale__InvalidAccount();
if (state == State.Whitelist) {
if (!account_Whitelist[account]) revert Sale__NotWhitelisted();
} else if (state != State.Open) revert Sale__NotOpen();
uint256 amount = msg.value;
if (amount <= 0) revert Sale__InvalidPayment();
uint256 total = totalAmount + amount;
if (total > MAX_CAP) revert Sale__MaxCapReached();
account_Amount[account] += amount;
totalAmount = total;
emit Sale__Purchase(account, amount);
}
function claimFor(address account) external nonReentrant {
if (account == address(0)) revert Sale__InvalidAccount();
if (state != State.Claim) revert Sale__NotClaim();
if (account_Amount[account] == 0) revert Sale__InvalidClaim();
uint256 claim = account_Amount[account] * DIVISOR / PRICE - account_Claim[account];
if (claim <= 0) revert Sale__InvalidClaim();
account_Claim[account] += claim;
totalClaim += claim;
IERC20(token).safeTransfer(account, claim);
emit Sale__Claim(account, claim);
}
function refundFor(address account) external nonReentrant {
if (account == address(0)) revert Sale__InvalidAccount();
if (state != State.Refund) revert Sale__NotRefund();
if (account_Amount[account] == 0) revert Sale__InvalidRefund();
uint256 refund = account_Amount[account] - account_Refund[account];
if (refund <= 0) revert Sale__InvalidRefund();
account_Refund[account] += refund;
totalRefund += refund;
payable(account).sendValue(refund);
emit Sale__Refund(account, refund);
}
/*---------- RESTRICTED FUNCTIONS ---------------------------------*/
function whitelist(address[] calldata accounts, bool flag) external onlyOwner {
for (uint256 i = 0; i < accounts.length; i++) {
account_Whitelist[accounts[i]] = flag;
emit Sale__Whitelist(accounts[i], flag);
}
}
function setToken(address _token) external onlyOwner {
token = _token;
emit Sale__TokenSet(token);
}
function updateState() external onlyOwner {
if (state == State.Closed) {
state = State.Whitelist;
emit Sale__StateUpdated(State.Whitelist);
} else if (state == State.Whitelist) {
state = State.Open;
emit Sale__StateUpdated(State.Open);
} else if (state == State.Open) {
if (totalAmount < MIN_CAP) {
state = State.Refund;
emit Sale__StateUpdated(State.Refund);
} else {
if (token == address(0)) revert Sale__TokenNotSet();
state = State.Claim;
uint256 tokenPurchased = getTotalTokenPurchased();
IERC20(token).safeTransferFrom(msg.sender, address(this), tokenPurchased);
emit Sale__StateUpdated(State.Claim);
}
} else {
revert Sale__Concluded();
}
}
function withdraw(address account) external onlyOwner {
if (state == State.Refund) revert Sale__CantWithdrawInRefund();
if (totalAmount < MIN_CAP) revert Sale__MinCapNotReached();
uint256 amount = address(this).balance;
payable(account).sendValue(amount);
emit Sale__Withdrawn(account, amount);
}
/*---------- VIEW FUNCTIONS ---------------------------------------*/
function getTotalTokenPurchased() public view returns (uint256) {
return totalAmount * DIVISOR / PRICE;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../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.
*
* By default, the owner account will be the one that deploys the contract. 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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @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 {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_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 v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @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 v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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 amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` 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 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @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.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @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.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @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, it is bubbled up by this
* function (like regular Solidity function calls).
*
* 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.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @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`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Sale__CantWithdrawInRefund","type":"error"},{"inputs":[],"name":"Sale__Concluded","type":"error"},{"inputs":[],"name":"Sale__InvalidAccount","type":"error"},{"inputs":[],"name":"Sale__InvalidClaim","type":"error"},{"inputs":[],"name":"Sale__InvalidPayment","type":"error"},{"inputs":[],"name":"Sale__InvalidRefund","type":"error"},{"inputs":[],"name":"Sale__MaxCapReached","type":"error"},{"inputs":[],"name":"Sale__MinCapNotReached","type":"error"},{"inputs":[],"name":"Sale__NotClaim","type":"error"},{"inputs":[],"name":"Sale__NotOpen","type":"error"},{"inputs":[],"name":"Sale__NotRefund","type":"error"},{"inputs":[],"name":"Sale__NotWhitelisted","type":"error"},{"inputs":[],"name":"Sale__TokenNotSet","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sale__Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sale__Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sale__Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum Sale.State","name":"state","type":"uint8"}],"name":"Sale__StateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"Sale__TokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"Sale__Whitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sale__Withdrawn","type":"event"},{"inputs":[],"name":"DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"account_Amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"account_Claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"account_Refund","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"account_Whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"claimFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTotalTokenPurchased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"purchaseFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"refundFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum Sale.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRefund","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":"updateState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"whitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611525806100826000396000f3fe60806040526004361061014b5760003560e01c80636d4a877b116100b6578063d669e1d41161006f578063d669e1d4146103b0578063ddeae033146103cf578063f2fde38b146103ef578063f6e4641f1461040f578063fa81ca3914610422578063fc0c546a1461044f57600080fd5b80636d4a877b146102f2578063715018a614610307578063801db9cc1461031c5780638d859f3e1461033b5780638da5cb5b14610357578063c19d93fb1461038957600080fd5b80631f0c27dc116101085780631f0c27dc146102135780633410fe6e1461024057806351cff8d91461025c578063547d18641461027c57806357aba4ab146102925780635ed4ab71146102b257600080fd5b806301541fe31461015057806301b38af514610179578063144fa6d71461019b5780631a39d8ef146101bb5780631d8557d7146101d15780631dcfe767146101e6575b600080fd5b34801561015c57600080fd5b5061016660055481565b6040519081526020015b60405180910390f35b34801561018557600080fd5b506101996101943660046112c1565b61046f565b005b3480156101a757600080fd5b506101996101b6366004611347565b610559565b3480156101c757600080fd5b5061016660035481565b3480156101dd57600080fd5b506101996105ab565b3480156101f257600080fd5b50610166610201366004611347565b60066020526000908152604090205481565b34801561021f57600080fd5b5061016661022e366004611347565b60076020526000908152604090205481565b34801561024c57600080fd5b50610166670de0b6b3a764000081565b34801561026857600080fd5b50610199610277366004611347565b61072c565b34801561028857600080fd5b5061016660045481565b34801561029e57600080fd5b506101996102ad366004611347565b6107f4565b3480156102be57600080fd5b506102e26102cd366004611347565b60096020526000908152604090205460ff1681565b6040519015158152602001610170565b3480156102fe57600080fd5b5061016661098d565b34801561031357600080fd5b506101996109bd565b34801561032857600080fd5b506101666a0422ca8b0a00a42500000081565b34801561034757600080fd5b506101666706f05b59d3b2000081565b34801561036357600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610170565b34801561039557600080fd5b50600a546103a39060ff1681565b604051610170919061138d565b3480156103bc57600080fd5b506101666a084595161401484a00000081565b3480156103db57600080fd5b506101996103ea366004611347565b6109cf565b3480156103fb57600080fd5b5061019961040a366004611347565b610b7d565b61019961041d366004611347565b610bf8565b34801561042e57600080fd5b5061016661043d366004611347565b60086020526000908152604090205481565b34801561045b57600080fd5b50600254610371906001600160a01b031681565b610477610d92565b60005b82811015610553578160096000868685818110610499576104996113b5565b90506020020160208101906104ae9190611347565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558383828181106104e8576104e86113b5565b90506020020160208101906104fd9190611347565b6001600160a01b03167f98a357a47ab5e585934aeecf369231edb185246249e0be1fc91bc1bdb401328183604051610539911515815260200190565b60405180910390a28061054b816113e1565b91505061047a565b50505050565b610561610d92565b600280546001600160a01b0319166001600160a01b0383169081179091556040517fb0f0aefdfb8011e760e92e4a2311508ca71529ff29875caf75f3989817fc787e90600090a250565b6105b3610d92565b6000600a5460ff1660048111156105cc576105cc611377565b0361060d57600a805460ff191660019081179091555b6040517f14d6f1d6492cce900750c0ae2ba8217e6e0af9c2f40b966e7505589e9398e3d890600090a2565b6001600a5460ff16600481111561062657610626611377565b0361064057600a805460ff191660029081179091556105e2565b6002600a5460ff16600481111561065957610659611377565b03610711576a0422ca8b0a00a425000000600354101561068857600a805460ff191660049081179091556105e2565b6002546001600160a01b03166106b15760405163bb7f1ca360e01b815260040160405180910390fd5b600a805460ff1916600317905560006106c861098d565b6002549091506106e3906001600160a01b0316333084610dec565b60036040517f14d6f1d6492cce900750c0ae2ba8217e6e0af9c2f40b966e7505589e9398e3d890600090a250565b604051631145350160e11b815260040160405180910390fd5b565b610734610d92565b6004600a5460ff16600481111561074d5761074d611377565b0361076b57604051632b0c039760e11b815260040160405180910390fd5b6a0422ca8b0a00a425000000600354101561079957604051631c22bb0960e31b815260040160405180910390fd5b476107ad6001600160a01b03831682610e57565b816001600160a01b03167f3012ab15f7d84c3888167259359fd74fde4044cf9fb4e502448bded99e31c03d826040516107e891815260200190565b60405180910390a25050565b6107fc610f75565b6001600160a01b0381166108235760405163752c773560e11b815260040160405180910390fd5b6004600a5460ff16600481111561083c5761083c611377565b1461085a57604051632b0fad7760e11b815260040160405180910390fd5b6001600160a01b038116600090815260066020526040812054900361089257604051635905309760e11b815260040160405180910390fd5b6001600160a01b03811660009081526008602090815260408083205460069092528220546108c091906113fa565b9050600081116108e357604051635905309760e11b815260040160405180910390fd5b6001600160a01b0382166000908152600860205260408120805483929061090b908490611413565b9250508190555080600560008282546109249190611413565b9091555061093d90506001600160a01b03831682610e57565b816001600160a01b03167fb36129ee357322fc4e68e25c7adaf4d6269080873f274ef4f43056965bb525048260405161097891815260200190565b60405180910390a25061098a60018055565b50565b60006706f05b59d3b20000670de0b6b3a76400006003546109ae9190611426565b6109b8919061143d565b905090565b6109c5610d92565b61072a6000610fce565b6109d7610f75565b6001600160a01b0381166109fe5760405163752c773560e11b815260040160405180910390fd5b6003600a5460ff166004811115610a1757610a17611377565b14610a355760405163190a360960e01b815260040160405180910390fd5b6001600160a01b0381166000908152600660205260408120549003610a6d5760405163d3c9c6d560e01b815260040160405180910390fd5b6001600160a01b03811660009081526007602090815260408083205460069092528220546706f05b59d3b2000090610aae90670de0b6b3a764000090611426565b610ab8919061143d565b610ac291906113fa565b905060008111610ae55760405163d3c9c6d560e01b815260040160405180910390fd5b6001600160a01b03821660009081526007602052604081208054839290610b0d908490611413565b925050819055508060046000828254610b269190611413565b9091555050600254610b42906001600160a01b0316838361101e565b816001600160a01b03167f1a013bfc44212ac61aa9407da038fdd6f097e9717d6642e8b82cc5ba90d665d98260405161097891815260200190565b610b85610d92565b6001600160a01b038116610bef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61098a81610fce565b610c00610f75565b6001600160a01b038116610c275760405163752c773560e11b815260040160405180910390fd5b6001600a5460ff166004811115610c4057610c40611377565b03610c83576001600160a01b03811660009081526009602052604090205460ff16610c7e5760405163358b177560e01b815260040160405180910390fd5b610cba565b6002600a5460ff166004811115610c9c57610c9c611377565b14610cba57604051633a83b78760e01b815260040160405180910390fd5b3480610cd957604051634c24cadd60e11b815260040160405180910390fd5b600081600354610ce99190611413565b90506a084595161401484a000000811115610d17576040516332afa95160e01b815260040160405180910390fd5b6001600160a01b03831660009081526006602052604081208054849290610d3f908490611413565b909155505060038190556040518281526001600160a01b038416907f75fea33366ced718b602e8c066321a2273b985a76ab9c20157138a012f9e5f189060200160405180910390a2505061098a60018055565b6000546001600160a01b0316331461072a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be6565b6040516001600160a01b03808516602483015283166044820152606481018290526105539085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261104e565b80471015610ea75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610be6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ef4576040519150601f19603f3d011682016040523d82523d6000602084013e610ef9565b606091505b5050905080610f705760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610be6565b505050565b600260015403610fc75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be6565b6002600155565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038316602482015260448101829052610f7090849063a9059cbb60e01b90606401610e20565b60006110a3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111239092919063ffffffff16565b90508051600014806110c45750808060200190518101906110c4919061145f565b610f705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610be6565b6060611132848460008561113a565b949350505050565b60608247101561119b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610be6565b600080866001600160a01b031685876040516111b791906114a0565b60006040518083038185875af1925050503d80600081146111f4576040519150601f19603f3d011682016040523d82523d6000602084013e6111f9565b606091505b509150915061120a87838387611215565b979650505050505050565b6060831561128457825160000361127d576001600160a01b0385163b61127d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610be6565b5081611132565b61113283838151156112995781518083602001fd5b8060405162461bcd60e51b8152600401610be691906114bc565b801515811461098a57600080fd5b6000806000604084860312156112d657600080fd5b833567ffffffffffffffff808211156112ee57600080fd5b818601915086601f83011261130257600080fd5b81358181111561131157600080fd5b8760208260051b850101111561132657600080fd5b6020928301955093505084013561133c816112b3565b809150509250925092565b60006020828403121561135957600080fd5b81356001600160a01b038116811461137057600080fd5b9392505050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106113af57634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016113f3576113f36113cb565b5060010190565b8181038181111561140d5761140d6113cb565b92915050565b8082018082111561140d5761140d6113cb565b808202811582820484141761140d5761140d6113cb565b60008261145a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561147157600080fd5b8151611370816112b3565b60005b8381101561149757818101518382015260200161147f565b50506000910152565b600082516114b281846020870161147c565b9190910192915050565b60208152600082518060208401526114db81604085016020870161147c565b601f01601f1916919091016040019291505056fea26469706673582212200c0d54e65f8dc944ae32f1466e6b5029909dc6120673f3bb82a0b4e31e7cd3a064736f6c63430008130033
Deployed Bytecode
0x60806040526004361061014b5760003560e01c80636d4a877b116100b6578063d669e1d41161006f578063d669e1d4146103b0578063ddeae033146103cf578063f2fde38b146103ef578063f6e4641f1461040f578063fa81ca3914610422578063fc0c546a1461044f57600080fd5b80636d4a877b146102f2578063715018a614610307578063801db9cc1461031c5780638d859f3e1461033b5780638da5cb5b14610357578063c19d93fb1461038957600080fd5b80631f0c27dc116101085780631f0c27dc146102135780633410fe6e1461024057806351cff8d91461025c578063547d18641461027c57806357aba4ab146102925780635ed4ab71146102b257600080fd5b806301541fe31461015057806301b38af514610179578063144fa6d71461019b5780631a39d8ef146101bb5780631d8557d7146101d15780631dcfe767146101e6575b600080fd5b34801561015c57600080fd5b5061016660055481565b6040519081526020015b60405180910390f35b34801561018557600080fd5b506101996101943660046112c1565b61046f565b005b3480156101a757600080fd5b506101996101b6366004611347565b610559565b3480156101c757600080fd5b5061016660035481565b3480156101dd57600080fd5b506101996105ab565b3480156101f257600080fd5b50610166610201366004611347565b60066020526000908152604090205481565b34801561021f57600080fd5b5061016661022e366004611347565b60076020526000908152604090205481565b34801561024c57600080fd5b50610166670de0b6b3a764000081565b34801561026857600080fd5b50610199610277366004611347565b61072c565b34801561028857600080fd5b5061016660045481565b34801561029e57600080fd5b506101996102ad366004611347565b6107f4565b3480156102be57600080fd5b506102e26102cd366004611347565b60096020526000908152604090205460ff1681565b6040519015158152602001610170565b3480156102fe57600080fd5b5061016661098d565b34801561031357600080fd5b506101996109bd565b34801561032857600080fd5b506101666a0422ca8b0a00a42500000081565b34801561034757600080fd5b506101666706f05b59d3b2000081565b34801561036357600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610170565b34801561039557600080fd5b50600a546103a39060ff1681565b604051610170919061138d565b3480156103bc57600080fd5b506101666a084595161401484a00000081565b3480156103db57600080fd5b506101996103ea366004611347565b6109cf565b3480156103fb57600080fd5b5061019961040a366004611347565b610b7d565b61019961041d366004611347565b610bf8565b34801561042e57600080fd5b5061016661043d366004611347565b60086020526000908152604090205481565b34801561045b57600080fd5b50600254610371906001600160a01b031681565b610477610d92565b60005b82811015610553578160096000868685818110610499576104996113b5565b90506020020160208101906104ae9190611347565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558383828181106104e8576104e86113b5565b90506020020160208101906104fd9190611347565b6001600160a01b03167f98a357a47ab5e585934aeecf369231edb185246249e0be1fc91bc1bdb401328183604051610539911515815260200190565b60405180910390a28061054b816113e1565b91505061047a565b50505050565b610561610d92565b600280546001600160a01b0319166001600160a01b0383169081179091556040517fb0f0aefdfb8011e760e92e4a2311508ca71529ff29875caf75f3989817fc787e90600090a250565b6105b3610d92565b6000600a5460ff1660048111156105cc576105cc611377565b0361060d57600a805460ff191660019081179091555b6040517f14d6f1d6492cce900750c0ae2ba8217e6e0af9c2f40b966e7505589e9398e3d890600090a2565b6001600a5460ff16600481111561062657610626611377565b0361064057600a805460ff191660029081179091556105e2565b6002600a5460ff16600481111561065957610659611377565b03610711576a0422ca8b0a00a425000000600354101561068857600a805460ff191660049081179091556105e2565b6002546001600160a01b03166106b15760405163bb7f1ca360e01b815260040160405180910390fd5b600a805460ff1916600317905560006106c861098d565b6002549091506106e3906001600160a01b0316333084610dec565b60036040517f14d6f1d6492cce900750c0ae2ba8217e6e0af9c2f40b966e7505589e9398e3d890600090a250565b604051631145350160e11b815260040160405180910390fd5b565b610734610d92565b6004600a5460ff16600481111561074d5761074d611377565b0361076b57604051632b0c039760e11b815260040160405180910390fd5b6a0422ca8b0a00a425000000600354101561079957604051631c22bb0960e31b815260040160405180910390fd5b476107ad6001600160a01b03831682610e57565b816001600160a01b03167f3012ab15f7d84c3888167259359fd74fde4044cf9fb4e502448bded99e31c03d826040516107e891815260200190565b60405180910390a25050565b6107fc610f75565b6001600160a01b0381166108235760405163752c773560e11b815260040160405180910390fd5b6004600a5460ff16600481111561083c5761083c611377565b1461085a57604051632b0fad7760e11b815260040160405180910390fd5b6001600160a01b038116600090815260066020526040812054900361089257604051635905309760e11b815260040160405180910390fd5b6001600160a01b03811660009081526008602090815260408083205460069092528220546108c091906113fa565b9050600081116108e357604051635905309760e11b815260040160405180910390fd5b6001600160a01b0382166000908152600860205260408120805483929061090b908490611413565b9250508190555080600560008282546109249190611413565b9091555061093d90506001600160a01b03831682610e57565b816001600160a01b03167fb36129ee357322fc4e68e25c7adaf4d6269080873f274ef4f43056965bb525048260405161097891815260200190565b60405180910390a25061098a60018055565b50565b60006706f05b59d3b20000670de0b6b3a76400006003546109ae9190611426565b6109b8919061143d565b905090565b6109c5610d92565b61072a6000610fce565b6109d7610f75565b6001600160a01b0381166109fe5760405163752c773560e11b815260040160405180910390fd5b6003600a5460ff166004811115610a1757610a17611377565b14610a355760405163190a360960e01b815260040160405180910390fd5b6001600160a01b0381166000908152600660205260408120549003610a6d5760405163d3c9c6d560e01b815260040160405180910390fd5b6001600160a01b03811660009081526007602090815260408083205460069092528220546706f05b59d3b2000090610aae90670de0b6b3a764000090611426565b610ab8919061143d565b610ac291906113fa565b905060008111610ae55760405163d3c9c6d560e01b815260040160405180910390fd5b6001600160a01b03821660009081526007602052604081208054839290610b0d908490611413565b925050819055508060046000828254610b269190611413565b9091555050600254610b42906001600160a01b0316838361101e565b816001600160a01b03167f1a013bfc44212ac61aa9407da038fdd6f097e9717d6642e8b82cc5ba90d665d98260405161097891815260200190565b610b85610d92565b6001600160a01b038116610bef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61098a81610fce565b610c00610f75565b6001600160a01b038116610c275760405163752c773560e11b815260040160405180910390fd5b6001600a5460ff166004811115610c4057610c40611377565b03610c83576001600160a01b03811660009081526009602052604090205460ff16610c7e5760405163358b177560e01b815260040160405180910390fd5b610cba565b6002600a5460ff166004811115610c9c57610c9c611377565b14610cba57604051633a83b78760e01b815260040160405180910390fd5b3480610cd957604051634c24cadd60e11b815260040160405180910390fd5b600081600354610ce99190611413565b90506a084595161401484a000000811115610d17576040516332afa95160e01b815260040160405180910390fd5b6001600160a01b03831660009081526006602052604081208054849290610d3f908490611413565b909155505060038190556040518281526001600160a01b038416907f75fea33366ced718b602e8c066321a2273b985a76ab9c20157138a012f9e5f189060200160405180910390a2505061098a60018055565b6000546001600160a01b0316331461072a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be6565b6040516001600160a01b03808516602483015283166044820152606481018290526105539085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261104e565b80471015610ea75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610be6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ef4576040519150601f19603f3d011682016040523d82523d6000602084013e610ef9565b606091505b5050905080610f705760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610be6565b505050565b600260015403610fc75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be6565b6002600155565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038316602482015260448101829052610f7090849063a9059cbb60e01b90606401610e20565b60006110a3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111239092919063ffffffff16565b90508051600014806110c45750808060200190518101906110c4919061145f565b610f705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610be6565b6060611132848460008561113a565b949350505050565b60608247101561119b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610be6565b600080866001600160a01b031685876040516111b791906114a0565b60006040518083038185875af1925050503d80600081146111f4576040519150601f19603f3d011682016040523d82523d6000602084013e6111f9565b606091505b509150915061120a87838387611215565b979650505050505050565b6060831561128457825160000361127d576001600160a01b0385163b61127d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610be6565b5081611132565b61113283838151156112995781518083602001fd5b8060405162461bcd60e51b8152600401610be691906114bc565b801515811461098a57600080fd5b6000806000604084860312156112d657600080fd5b833567ffffffffffffffff808211156112ee57600080fd5b818601915086601f83011261130257600080fd5b81358181111561131157600080fd5b8760208260051b850101111561132657600080fd5b6020928301955093505084013561133c816112b3565b809150509250925092565b60006020828403121561135957600080fd5b81356001600160a01b038116811461137057600080fd5b9392505050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106113af57634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016113f3576113f36113cb565b5060010190565b8181038181111561140d5761140d6113cb565b92915050565b8082018082111561140d5761140d6113cb565b808202811582820484141761140d5761140d6113cb565b60008261145a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561147157600080fd5b8151611370816112b3565b60005b8381101561149757818101518382015260200161147f565b50506000910152565b600082516114b281846020870161147c565b9190910192915050565b60208152600082518060208401526114db81604085016020870161147c565b601f01601f1916919091016040019291505056fea26469706673582212200c0d54e65f8dc944ae32f1466e6b5029909dc6120673f3bb82a0b4e31e7cd3a064736f6c63430008130033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$18.58
Net Worth in S
Token Allocations
S
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| SONIC | 100.00% | $0.067554 | 275 | $18.58 |
Loading...
Loading
Loading...
Loading
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.