ETH Price: $2,764.98 (+2.39%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Withdraw Eth197404882024-04-26 15:42:11284 days ago1714146131IN
0xDb7955F6...d749634A3
0 ETH0.0004862312.33464076
Trigger Pause Sa...197402952024-04-26 15:03:23284 days ago1714143803IN
0xDb7955F6...d749634A3
0 ETH0.0008192917.29959805
Purchase197402772024-04-26 14:59:47284 days ago1714143587IN
0xDb7955F6...d749634A3
1 ETH0.0005986110.5
Purchase197402762024-04-26 14:59:35284 days ago1714143575IN
0xDb7955F6...d749634A3
0.99 ETH0.0005986110.5
Purchase197402752024-04-26 14:59:23284 days ago1714143563IN
0xDb7955F6...d749634A3
0.08 ETH0.000539379.46081599
Purchase197402742024-04-26 14:59:11284 days ago1714143551IN
0xDb7955F6...d749634A3
0.05 ETH0.000560079.82394863
Purchase197402732024-04-26 14:58:59284 days ago1714143539IN
0xDb7955F6...d749634A3
0.05 ETH0.0005786810.15034826
Purchase197402722024-04-26 14:58:47284 days ago1714143527IN
0xDb7955F6...d749634A3
0.05 ETH0.00053499.38248768
Purchase197402712024-04-26 14:58:35284 days ago1714143515IN
0xDb7955F6...d749634A3
0.4 ETH0.00052689.24046734
Purchase197402712024-04-26 14:58:35284 days ago1714143515IN
0xDb7955F6...d749634A3
1 ETH0.0005986110.5
Purchase197402692024-04-26 14:58:11284 days ago1714143491IN
0xDb7955F6...d749634A3
1 ETH0.000551529.67402164
Purchase197402672024-04-26 14:57:47284 days ago1714143467IN
0xDb7955F6...d749634A3
0.1 ETH0.000540159.47457751
Purchase197402672024-04-26 14:57:47284 days ago1714143467IN
0xDb7955F6...d749634A3
0.1 ETH0.000540269.47641697
Purchase197402662024-04-26 14:57:35284 days ago1714143455IN
0xDb7955F6...d749634A3
0.05 ETH0.000490618.60558514
Purchase197402632024-04-26 14:56:59284 days ago1714143419IN
0xDb7955F6...d749634A3
0.05 ETH0.000395499.90942805
Purchase197402592024-04-26 14:56:11284 days ago1714143371IN
0xDb7955F6...d749634A3
0.05 ETH0.000394799.89192005
Purchase197402562024-04-26 14:55:35284 days ago1714143335IN
0xDb7955F6...d749634A3
0.42 ETH0.0005874410.30398782
Purchase197402552024-04-26 14:55:23284 days ago1714143323IN
0xDb7955F6...d749634A3
0.06 ETH0.0006211210.89482163
Purchase197402552024-04-26 14:55:23284 days ago1714143323IN
0xDb7955F6...d749634A3
0.17 ETH0.0006211210.89482163
Purchase197402542024-04-26 14:55:11284 days ago1714143311IN
0xDb7955F6...d749634A3
0.16 ETH0.0005936510.41291697
Purchase197402532024-04-26 14:54:59284 days ago1714143299IN
0xDb7955F6...d749634A3
0.05 ETH0.0007149912.54141431
Purchase197402522024-04-26 14:54:47284 days ago1714143287IN
0xDb7955F6...d749634A3
0.11 ETH0.000545169.5624702
Purchase197402522024-04-26 14:54:47284 days ago1714143287IN
0xDb7955F6...d749634A3
0.5 ETH0.000540859.4869072
Purchase197402522024-04-26 14:54:47284 days ago1714143287IN
0xDb7955F6...d749634A3
0.085 ETH0.000545169.5624702
Purchase197402522024-04-26 14:54:47284 days ago1714143287IN
0xDb7955F6...d749634A3
0.1 ETH0.000398229.9777892
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
197404882024-04-26 15:42:11284 days ago1714146131
0xDb7955F6...d749634A3
636.48958538 ETH
197327082024-04-25 13:34:11285 days ago1714052051
0xDb7955F6...d749634A3
0.05 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SomoTokenSaleV2

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 7 : SomoTokenSaleV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
/**
 * @title SomoTokenSaleV2
 * @notice This contract is used for somo pre-launch sale. It doesn't send tokens to the buyer directly, and doesn not guarantee 
 * the buyer will receive the tokens. If the buyer is not allocated the tokens, the buyer will be refunded.
 * @dev Contract will store the amount of eth sent by users.
 */
contract SomoTokenSaleV2 is AccessControl, Pausable {

    /**
     * @notice Admin role to manage the sale
     */
    bytes32 public constant SALE_MANAGER = keccak256("SALE_MANAGER");

    /**
     * @notice Funds receiver address
    */
    address public immutable TREASURY;

    /**
     * @notice Total amount of eth that is sold in the sale
     */
    uint256 public totalSold;

    /**
     * @dev Maximum amount of eth pool allocated to whitelsit sale.
     */
    uint256 public minAmount;
    uint256 public maxAmount;

    /// @notice Mapping to store the user's allocation
    mapping(address => uint256) public userAllocation;

    /// @notice Errors to handle the exceptions
    error InvalidAmount();
    error WithdrawFailed();

    /// @notice Events
    event EthAllocated(address indexed user, uint256 allocated, uint256 time);

    constructor(address owner, uint256 min, uint256 max) {
      minAmount = min;
      maxAmount = max;
      TREASURY = owner;

      _grantRole(DEFAULT_ADMIN_ROLE, owner);
      _grantRole(SALE_MANAGER, msg.sender);
    
      // Pause the sale by default
      _pause();
    }

    /**
     * @notice Function totake part in sale
     * @dev User can take part in sale by sending eth through this function call. msg.value should be between minAmount and maxAmount.
     */
    function purchase() external payable whenNotPaused {
      // Validate the amount of eth sent by the user
      if (
        msg.value < minAmount ||
        userAllocation[msg.sender] + msg.value > maxAmount
      ) {
        revert InvalidAmount();
      }

      _allocateEth(msg.sender, msg.value);
    }

    /**
     * @notice Function to withdraw eth from the contract
     * @dev Only sale manager can call this function. Withdraws all balance from the contract to owner.
     */
    function withdrawEth() external onlyRole(SALE_MANAGER) {
        uint256 amount = address(this).balance;
        (bool sent,) = TREASURY.call{value: amount}("");
        if (!sent) {
            revert WithdrawFailed(); 
        }
    }

    /**
     * @notice Function to pause or unpause the sale
     * @dev Public interface for Pausable functionality
     * @param isPaused Boolean to pause or unpause the sale
     */
    function triggerPauseSale(bool isPaused) external onlyRole(SALE_MANAGER) {
        if (isPaused) {
            _pause();
            return;
        }
        _unpause();
    }

    /**
     * @notice Function to update the limit per user
     * @dev Only sale manager can call this function
     * @param min Minimum amount of eth that can be sent by the user
     * @param max Maximum amount of eth that can be sent by the user
     */
    function updateSaleConfig(uint256 min, uint256 max) external onlyRole(SALE_MANAGER) {
        minAmount = min;
        maxAmount = max;
    }

    /**
     * @notice Internal function to allocate eth to the user
     * @param to User address we are allocating the eth to
     * @param amount Amount of eth against which the user will receive tokens
     */
    function _allocateEth(address to, uint256 amount) internal {
        userAllocation[to] += amount;
        totalSold += amount;

        emit EthAllocated(to, amount, block.timestamp);
    }
}

File 2 of 7 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 7 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 4 of 7 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 5 of 7 : Context.sol
// 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;
    }
}

File 6 of 7 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 7 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@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/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"allocated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"EthAllocated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALE_MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isPaused","type":"bool"}],"name":"triggerPauseSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"updateSaleConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051610bd8380380610bd883398101604081905261002f916101b2565b6001805460ff19169055600382905560048190556001600160a01b03831660805261005b600084610097565b506100867f3acf1bc7984281b30349b9bfa997b4b0f2f358952540ae4429a353ceb699e8dc33610097565b5061008f610143565b5050506101f5565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610139576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100f13390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161013d565b5060005b92915050565b61014b61018c565b6001805460ff1916811790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b60015460ff16156101b05760405163d93c066560e01b815260040160405180910390fd5b565b6000806000606084860312156101c757600080fd5b83516001600160a01b03811681146101de57600080fd5b602085015160409095015190969495509392505050565b6080516109c1610217600039600081816101e201526104d801526109c16000f3fe6080604052600436106101095760003560e01c806364edfbf011610095578063a0ef91df11610064578063a0ef91df146102de578063a217fddf146102f3578063a3f6df0114610308578063c816f72a1461032a578063d547741f1461034a57600080fd5b806364edfbf01461028a5780639106d7ba1461029257806391d14854146102a85780639b2cb5d8146102c857600080fd5b80632d2c5565116100dc5780632d2c5565146101d05780632f2ff15d1461021c57806336568abe1461023c5780635c975abb1461025c5780635f48f3931461027457600080fd5b806301ffc9a71461010e57806314dca73b146101435780631a0cb3a714610165578063248a9ca3146101a0575b600080fd5b34801561011a57600080fd5b5061012e610129366004610859565b61036a565b60405190151581526020015b60405180910390f35b34801561014f57600080fd5b5061016361015e36600461088a565b6103a1565b005b34801561017157600080fd5b506101926101803660046108c8565b60056020526000908152604090205481565b60405190815260200161013a565b3480156101ac57600080fd5b506101926101bb3660046108e3565b60009081526020819052604090206001015490565b3480156101dc57600080fd5b506102047f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161013a565b34801561022857600080fd5b506101636102373660046108fc565b6103c5565b34801561024857600080fd5b506101636102573660046108fc565b6103f0565b34801561026857600080fd5b5060015460ff1661012e565b34801561028057600080fd5b5061019260045481565b610163610428565b34801561029e57600080fd5b5061019260025481565b3480156102b457600080fd5b5061012e6102c33660046108fc565b610485565b3480156102d457600080fd5b5061019260035481565b3480156102ea57600080fd5b506101636104ae565b3480156102ff57600080fd5b50610192600081565b34801561031457600080fd5b5061019260008051602061096c83398151915281565b34801561033657600080fd5b50610163610345366004610928565b61055a565b34801561035657600080fd5b506101636103653660046108fc565b61058c565b60006001600160e01b03198216637965db0b60e01b148061039b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061096c8339815191526103b9816105b1565b50600391909155600455565b6000828152602081905260409020600101546103e0816105b1565b6103ea83836105be565b50505050565b6001600160a01b03811633146104195760405163334bd91960e11b815260040160405180910390fd5b6104238282610650565b505050565b6104306106bb565b60035434108061045b57506004543360009081526005602052604090205461045990349061094a565b115b156104795760405163162908e360e11b815260040160405180910390fd5b61048333346106df565b565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061096c8339815191526104c6816105b1565b60405147906000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083908381818185875af1925050503d8060008114610533576040519150601f19603f3d011682016040523d82523d6000602084013e610538565b606091505b505090508061042357604051631d42c86760e21b815260040160405180910390fd5b60008051602061096c833981519152610572816105b1565b81156105845761058061076c565b5050565b6105806107c0565b6000828152602081905260409020600101546105a7816105b1565b6103ea8383610650565b6105bb81336107f9565b50565b60006105ca8383610485565b610648576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556106003390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161039b565b50600061039b565b600061065c8383610485565b15610648576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161039b565b60015460ff16156104835760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b0382166000908152600560205260408120805483929061070790849061094a565b925050819055508060026000828254610720919061094a565b9091555050604080518281524260208201526001600160a01b038416917fcefe277453a38f017bce6f15ab4fa682ffba348fd7a12609596ef91b77b142b9910160405180910390a25050565b6107746106bb565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b6040516001600160a01b03909116815260200160405180910390a1565b6107c8610836565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336107a3565b6108038282610485565b6105805760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440160405180910390fd5b60015460ff1661048357604051638dfc202b60e01b815260040160405180910390fd5b60006020828403121561086b57600080fd5b81356001600160e01b03198116811461088357600080fd5b9392505050565b6000806040838503121561089d57600080fd5b50508035926020909101359150565b80356001600160a01b03811681146108c357600080fd5b919050565b6000602082840312156108da57600080fd5b610883826108ac565b6000602082840312156108f557600080fd5b5035919050565b6000806040838503121561090f57600080fd5b8235915061091f602084016108ac565b90509250929050565b60006020828403121561093a57600080fd5b8135801515811461088357600080fd5b8082018082111561039b57634e487b7160e01b600052601160045260246000fdfe3acf1bc7984281b30349b9bfa997b4b0f2f358952540ae4429a353ceb699e8dca2646970667358221220c455ac97cc66a5785e0a5999cad809ccf3a7ccc64ac3b637af929dfe4c456c6164736f6c6343000814003300000000000000000000000063ab08d6ac1f4e79a6248d3b6eca748afa756ff300000000000000000000000000000000000000000000000000b1a2bc2ec500000000000000000000000000000000000000000000000000000de0b6b3a7640000

Deployed Bytecode

0x6080604052600436106101095760003560e01c806364edfbf011610095578063a0ef91df11610064578063a0ef91df146102de578063a217fddf146102f3578063a3f6df0114610308578063c816f72a1461032a578063d547741f1461034a57600080fd5b806364edfbf01461028a5780639106d7ba1461029257806391d14854146102a85780639b2cb5d8146102c857600080fd5b80632d2c5565116100dc5780632d2c5565146101d05780632f2ff15d1461021c57806336568abe1461023c5780635c975abb1461025c5780635f48f3931461027457600080fd5b806301ffc9a71461010e57806314dca73b146101435780631a0cb3a714610165578063248a9ca3146101a0575b600080fd5b34801561011a57600080fd5b5061012e610129366004610859565b61036a565b60405190151581526020015b60405180910390f35b34801561014f57600080fd5b5061016361015e36600461088a565b6103a1565b005b34801561017157600080fd5b506101926101803660046108c8565b60056020526000908152604090205481565b60405190815260200161013a565b3480156101ac57600080fd5b506101926101bb3660046108e3565b60009081526020819052604090206001015490565b3480156101dc57600080fd5b506102047f00000000000000000000000063ab08d6ac1f4e79a6248d3b6eca748afa756ff381565b6040516001600160a01b03909116815260200161013a565b34801561022857600080fd5b506101636102373660046108fc565b6103c5565b34801561024857600080fd5b506101636102573660046108fc565b6103f0565b34801561026857600080fd5b5060015460ff1661012e565b34801561028057600080fd5b5061019260045481565b610163610428565b34801561029e57600080fd5b5061019260025481565b3480156102b457600080fd5b5061012e6102c33660046108fc565b610485565b3480156102d457600080fd5b5061019260035481565b3480156102ea57600080fd5b506101636104ae565b3480156102ff57600080fd5b50610192600081565b34801561031457600080fd5b5061019260008051602061096c83398151915281565b34801561033657600080fd5b50610163610345366004610928565b61055a565b34801561035657600080fd5b506101636103653660046108fc565b61058c565b60006001600160e01b03198216637965db0b60e01b148061039b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061096c8339815191526103b9816105b1565b50600391909155600455565b6000828152602081905260409020600101546103e0816105b1565b6103ea83836105be565b50505050565b6001600160a01b03811633146104195760405163334bd91960e11b815260040160405180910390fd5b6104238282610650565b505050565b6104306106bb565b60035434108061045b57506004543360009081526005602052604090205461045990349061094a565b115b156104795760405163162908e360e11b815260040160405180910390fd5b61048333346106df565b565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061096c8339815191526104c6816105b1565b60405147906000906001600160a01b037f00000000000000000000000063ab08d6ac1f4e79a6248d3b6eca748afa756ff3169083908381818185875af1925050503d8060008114610533576040519150601f19603f3d011682016040523d82523d6000602084013e610538565b606091505b505090508061042357604051631d42c86760e21b815260040160405180910390fd5b60008051602061096c833981519152610572816105b1565b81156105845761058061076c565b5050565b6105806107c0565b6000828152602081905260409020600101546105a7816105b1565b6103ea8383610650565b6105bb81336107f9565b50565b60006105ca8383610485565b610648576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556106003390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161039b565b50600061039b565b600061065c8383610485565b15610648576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161039b565b60015460ff16156104835760405163d93c066560e01b815260040160405180910390fd5b6001600160a01b0382166000908152600560205260408120805483929061070790849061094a565b925050819055508060026000828254610720919061094a565b9091555050604080518281524260208201526001600160a01b038416917fcefe277453a38f017bce6f15ab4fa682ffba348fd7a12609596ef91b77b142b9910160405180910390a25050565b6107746106bb565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b6040516001600160a01b03909116815260200160405180910390a1565b6107c8610836565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336107a3565b6108038282610485565b6105805760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440160405180910390fd5b60015460ff1661048357604051638dfc202b60e01b815260040160405180910390fd5b60006020828403121561086b57600080fd5b81356001600160e01b03198116811461088357600080fd5b9392505050565b6000806040838503121561089d57600080fd5b50508035926020909101359150565b80356001600160a01b03811681146108c357600080fd5b919050565b6000602082840312156108da57600080fd5b610883826108ac565b6000602082840312156108f557600080fd5b5035919050565b6000806040838503121561090f57600080fd5b8235915061091f602084016108ac565b90509250929050565b60006020828403121561093a57600080fd5b8135801515811461088357600080fd5b8082018082111561039b57634e487b7160e01b600052601160045260246000fdfe3acf1bc7984281b30349b9bfa997b4b0f2f358952540ae4429a353ceb699e8dca2646970667358221220c455ac97cc66a5785e0a5999cad809ccf3a7ccc64ac3b637af929dfe4c456c6164736f6c63430008140033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000063ab08d6ac1f4e79a6248d3b6eca748afa756ff300000000000000000000000000000000000000000000000000b1a2bc2ec500000000000000000000000000000000000000000000000000000de0b6b3a7640000

-----Decoded View---------------
Arg [0] : owner (address): 0x63Ab08D6ac1F4E79a6248D3B6EcA748AFa756ff3
Arg [1] : min (uint256): 50000000000000000
Arg [2] : max (uint256): 1000000000000000000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000063ab08d6ac1f4e79a6248d3b6eca748afa756ff3
Arg [1] : 00000000000000000000000000000000000000000000000000b1a2bc2ec50000
Arg [2] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.