Holesky Testnet

Contract

0x1828eaA3cdE0B2373bc869A19cf5b4804C21752C

Overview

ETH Balance

0 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Request Tokens24951822024-10-08 23:48:0054 days ago1728431280IN
0x1828eaA3...04C21752C
0 ETH0.0003542611.4105092
Request Tokens24951642024-10-08 23:44:2454 days ago1728431064IN
0x1828eaA3...04C21752C
0 ETH0.000429313.8275956
Request Tokens24950192024-10-08 23:12:3654 days ago1728429156IN
0x1828eaA3...04C21752C
0 ETH0.0003325410.7110464
Request Tokens24949092024-10-08 22:49:0054 days ago1728427740IN
0x1828eaA3...04C21752C
0 ETH0.0003572511.5069448
Request Tokens24948122024-10-08 22:27:4854 days ago1728426468IN
0x1828eaA3...04C21752C
0 ETH0.0003818912.3004016
Request Tokens24947932024-10-08 22:23:1254 days ago1728426192IN
0x1828eaA3...04C21752C
0 ETH0.0003252510.4763052
Request Tokens24947832024-10-08 22:20:3654 days ago1728426036IN
0x1828eaA3...04C21752C
0 ETH0.0003218710.3672962
Request Tokens24947502024-10-08 22:13:3654 days ago1728425616IN
0x1828eaA3...04C21752C
0 ETH0.0003595211.580092
Request Tokens24947502024-10-08 22:13:3654 days ago1728425616IN
0x1828eaA3...04C21752C
0 ETH0.0004165113.4157304
Request Tokens24896272024-10-08 3:27:1255 days ago1728358032IN
0x1828eaA3...04C21752C
0 ETH0.0003107510.00926399
Request Tokens24895152024-10-08 3:02:4855 days ago1728356568IN
0x1828eaA3...04C21752C
0 ETH0.0003957512.7469244
Request Tokens24894252024-10-08 2:43:0055 days ago1728355380IN
0x1828eaA3...04C21752C
0 ETH0.0003202710.31581996
Request Tokens24894202024-10-08 2:42:0055 days ago1728355320IN
0x1828eaA3...04C21752C
0 ETH0.0003335910.7449368
Request Tokens24891672024-10-08 1:44:4855 days ago1728351888IN
0x1828eaA3...04C21752C
0 ETH0.0003497711.2660732
Request Tokens24891602024-10-08 1:42:4855 days ago1728351768IN
0x1828eaA3...04C21752C
0 ETH0.0003689411.883396
Request Tokens24891542024-10-08 1:41:3655 days ago1728351696IN
0x1828eaA3...04C21752C
0 ETH0.0003560411.4679432
Request Tokens24891472024-10-08 1:40:1255 days ago1728351612IN
0x1828eaA3...04C21752C
0 ETH0.0004263913.733942
Request Tokens24890252024-10-08 1:12:2455 days ago1728349944IN
0x1828eaA3...04C21752C
0 ETH0.0003328410.7207232
Request Tokens24890252024-10-08 1:12:2455 days ago1728349944IN
0x1828eaA3...04C21752C
0 ETH0.000433613.9659292
Request Tokens24889872024-10-08 1:04:2455 days ago1728349464IN
0x1828eaA3...04C21752C
0 ETH0.0003498211.2675648
Request Tokens24889542024-10-08 0:56:4855 days ago1728349008IN
0x1828eaA3...04C21752C
0 ETH0.000425213.6955432
Request Tokens24888742024-10-08 0:39:2455 days ago1728347964IN
0x1828eaA3...04C21752C
0 ETH0.0003713911.962206
Request Tokens24887592024-10-08 0:15:0055 days ago1728346500IN
0x1828eaA3...04C21752C
0 ETH0.000362411.6729156
Request Tokens24695452024-10-05 2:28:1258 days ago1728095292IN
0x1828eaA3...04C21752C
0 ETH0.0003362310.8300036
Request Tokens24695202024-10-05 2:23:0058 days ago1728094980IN
0x1828eaA3...04C21752C
0 ETH0.0003524311.3517532
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xb9B2F900...21366a2a4
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Faucet

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : Faucet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";


contract Faucet is Ownable {
    IERC20 public token;

    uint256 public withdrawalAmount = 10 * (10**18);
    uint256 public lockTime = 1 minutes;
    uint256 public maxUsageCount = 3;

    event Withdrawal(address indexed to, uint256 indexed amount);

    mapping(address => uint256) private nextAccessTime;

    mapping(address => uint256) private usageCount;

    constructor(address tokenAddress) Ownable() payable {
        token = IERC20(tokenAddress);
    }

    function requestTokens() public {
        require(
            token.balanceOf(address(this)) >= withdrawalAmount,
            "Insufficient balance in faucet for withdrawal request"
        );
        require(
            block.timestamp >= nextAccessTime[msg.sender],
            "Insufficient time elapsed since last withdrawal - try again later."
        );
        require(
            usageCount[msg.sender] < maxUsageCount,
            "Address has already used the faucet maximum 3 times"
        );

        token.transfer(msg.sender, withdrawalAmount);

        nextAccessTime[msg.sender] = block.timestamp + lockTime;
        usageCount[msg.sender]++;
    }

    function getBalance() external view returns (uint256) {
        return token.balanceOf(address(this));
    }

    function setWithdrawalAmount(uint256 amount) public onlyOwner {
        withdrawalAmount = amount * (10**18);
    }

    function setLockTime(uint256 amount) public onlyOwner {
        lockTime = amount * 1 minutes;
    }

    function setMaxUsageCount(uint256 count) public onlyOwner {
        maxUsageCount = count;
    }

    function withdraw() external onlyOwner {
        emit Withdrawal(msg.sender, token.balanceOf(address(this)));
        token.transfer(msg.sender, token.balanceOf(address(this)));
    }
}

File 2 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
}

File 3 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }
}

File 4 of 4 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
    }
}

Settings
{
  "remappings": [
    "@eigenlayer/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/",
    "@eigenlayer-scripts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/script/",
    "@eigenlayer-middleware/=lib/eigenlayer-middleware/",
    "@openzeppelin/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/",
    "@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/",
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "eigenlayer-contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/",
    "eigenlayer-middleware/=lib/eigenlayer-middleware/",
    "openzeppelin-contracts-upgradeable/=lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/eigenlayer-middleware/lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false,
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"stateMutability":"payable","type":"constructor"},{"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":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxUsageCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"setMaxUsageCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setWithdrawalAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c578063ae04d45d11610066578063ae04d45d14610166578063e6e268f414610179578063f2fde38b14610182578063fc0c546a1461019557600080fd5b8063715018a6146101305780638da5cb5b146101385780639969e1941461015d57600080fd5b80630d668087146100d457806312065fe0146100f0578063168ee33a146100f8578063359cf2b71461010d5780633ccfd60b146101155780636014409c1461011d575b600080fd5b6100dd60035481565b6040519081526020015b60405180910390f35b6100dd6101a8565b61010b6101063660046107be565b61021a565b005b61010b61023a565b61010b6104dd565b61010b61012b3660046107be565b610664565b61010b610671565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100e7565b6100dd60045481565b61010b6101743660046107be565b610685565b6100dd60025481565b61010b6101903660046107d7565b61069e565b600154610145906001600160a01b031681565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156101f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102159190610807565b905090565b610222610714565b61023481670de0b6b3a7640000610836565b60025550565b6002546001546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a99190610807565b101561031a5760405162461bcd60e51b815260206004820152603560248201527f496e73756666696369656e742062616c616e636520696e2066617563657420666044820152741bdc881dda5d1a191c985dd85b081c995c5d595cdd605a1b60648201526084015b60405180910390fd5b336000908152600560205260409020544210156103aa5760405162461bcd60e51b815260206004820152604260248201527f496e73756666696369656e742074696d6520656c61707365642073696e63652060448201527f6c617374207769746864726177616c202d2074727920616761696e206c617465606482015261391760f11b608482015260a401610311565b60045433600090815260066020526040902054106104265760405162461bcd60e51b815260206004820152603360248201527f416464726573732068617320616c726561647920757365642074686520666175604482015272636574206d6178696d756d20332074696d657360681b6064820152608401610311565b60015460025460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561047b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049f9190610855565b506003546104ad9042610877565b33600090815260056020908152604080832093909355600690529081208054916104d68361088f565b9190505550565b6104e5610714565b6001546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801561052d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105519190610807565b60405133907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b6590600090a36001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156105ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f29190610807565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561063d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106619190610855565b50565b61066c610714565b600455565b610679610714565b610683600061076e565b565b61068d610714565b61069881603c610836565b60035550565b6106a6610714565b6001600160a01b03811661070b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610311565b6106618161076e565b6000546001600160a01b031633146106835760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610311565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156107d057600080fd5b5035919050565b6000602082840312156107e957600080fd5b81356001600160a01b038116811461080057600080fd5b9392505050565b60006020828403121561081957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561085057610850610820565b500290565b60006020828403121561086757600080fd5b8151801515811461080057600080fd5b6000821982111561088a5761088a610820565b500190565b60006000198214156108a3576108a3610820565b506001019056fea2646970667358221220157df66e39c5779fb1c9f6b560338a036f13eb03881a2dafaba6dcea80e6a09d64736f6c634300080c0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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