Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 97,471 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Request Tokens | 2495182 | 54 days ago | IN | 0 ETH | 0.00035426 | ||||
Request Tokens | 2495164 | 54 days ago | IN | 0 ETH | 0.0004293 | ||||
Request Tokens | 2495019 | 54 days ago | IN | 0 ETH | 0.00033254 | ||||
Request Tokens | 2494909 | 54 days ago | IN | 0 ETH | 0.00035725 | ||||
Request Tokens | 2494812 | 54 days ago | IN | 0 ETH | 0.00038189 | ||||
Request Tokens | 2494793 | 54 days ago | IN | 0 ETH | 0.00032525 | ||||
Request Tokens | 2494783 | 54 days ago | IN | 0 ETH | 0.00032187 | ||||
Request Tokens | 2494750 | 54 days ago | IN | 0 ETH | 0.00035952 | ||||
Request Tokens | 2494750 | 54 days ago | IN | 0 ETH | 0.00041651 | ||||
Request Tokens | 2489627 | 55 days ago | IN | 0 ETH | 0.00031075 | ||||
Request Tokens | 2489515 | 55 days ago | IN | 0 ETH | 0.00039575 | ||||
Request Tokens | 2489425 | 55 days ago | IN | 0 ETH | 0.00032027 | ||||
Request Tokens | 2489420 | 55 days ago | IN | 0 ETH | 0.00033359 | ||||
Request Tokens | 2489167 | 55 days ago | IN | 0 ETH | 0.00034977 | ||||
Request Tokens | 2489160 | 55 days ago | IN | 0 ETH | 0.00036894 | ||||
Request Tokens | 2489154 | 55 days ago | IN | 0 ETH | 0.00035604 | ||||
Request Tokens | 2489147 | 55 days ago | IN | 0 ETH | 0.00042639 | ||||
Request Tokens | 2489025 | 55 days ago | IN | 0 ETH | 0.00033284 | ||||
Request Tokens | 2489025 | 55 days ago | IN | 0 ETH | 0.0004336 | ||||
Request Tokens | 2488987 | 55 days ago | IN | 0 ETH | 0.00034982 | ||||
Request Tokens | 2488954 | 55 days ago | IN | 0 ETH | 0.0004252 | ||||
Request Tokens | 2488874 | 55 days ago | IN | 0 ETH | 0.00037139 | ||||
Request Tokens | 2488759 | 55 days ago | IN | 0 ETH | 0.0003624 | ||||
Request Tokens | 2469545 | 58 days ago | IN | 0 ETH | 0.00033623 | ||||
Request Tokens | 2469520 | 58 days ago | IN | 0 ETH | 0.00035243 |
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)
// 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))); } }
// 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); }
// 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); } }
// 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; } }
{ "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": {} }
[{"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
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.