Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 171 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Drip | 7225106 | 2 days ago | IN | 0 ETH | 0.00017039 | ||||
Drip | 7221595 | 2 days ago | IN | 0 ETH | 0.0008196 | ||||
Drip | 7217311 | 3 days ago | IN | 0 ETH | 0.00102865 | ||||
Drip | 7201311 | 5 days ago | IN | 0 ETH | 0.00082428 | ||||
Drip | 7189666 | 7 days ago | IN | 0 ETH | 0.00052402 | ||||
Drip | 7151438 | 13 days ago | IN | 0 ETH | 0.00086482 | ||||
Drip | 7151436 | 13 days ago | IN | 0 ETH | 0.00065666 | ||||
Drip | 7151429 | 13 days ago | IN | 0 ETH | 0.00034678 | ||||
Drip | 7151423 | 13 days ago | IN | 0 ETH | 0.00096458 | ||||
Set Amount | 7151412 | 13 days ago | IN | 0 ETH | 0.00028636 | ||||
Drip | 7031363 | 31 days ago | IN | 0 ETH | 0.00050988 | ||||
Drip | 7031347 | 31 days ago | IN | 0 ETH | 0.00023678 | ||||
Drip | 7031321 | 31 days ago | IN | 0 ETH | 0.00047591 | ||||
Drip | 7031310 | 31 days ago | IN | 0 ETH | 0.00147945 | ||||
Drip | 7028877 | 31 days ago | IN | 0 ETH | 0.00161424 | ||||
Drip | 7028869 | 31 days ago | IN | 0 ETH | 0.00176145 | ||||
Drip | 6986283 | 38 days ago | IN | 0 ETH | 0.00022221 | ||||
Drip | 6977392 | 39 days ago | IN | 0 ETH | 0.00038214 | ||||
Drip | 6977391 | 39 days ago | IN | 0 ETH | 0.00036413 | ||||
Drip | 6971422 | 40 days ago | IN | 0 ETH | 0.00012721 | ||||
Drip | 6971102 | 40 days ago | IN | 0 ETH | 0.00061235 | ||||
Drip | 6929813 | 46 days ago | IN | 0 ETH | 0.00017166 | ||||
Drip | 6929811 | 46 days ago | IN | 0 ETH | 0.00017926 | ||||
Drip | 6924562 | 47 days ago | IN | 0 ETH | 0.00007938 | ||||
Drip | 6924559 | 47 days ago | IN | 0 ETH | 0.00007479 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Faucet
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract Faucet is Ownable { constructor() Ownable(msg.sender) {} mapping (address => uint256) public amount; mapping (address => mapping (address => uint)) public lastDrip; function setAmount(address token, uint256 amount_) external onlyOwner { amount[token] = amount_; } function drip(address token) external { require(block.timestamp - lastDrip[msg.sender][address(token)] >= 1 days, "ERR_DRIP_THROTTLE"); require(IERC20(token).balanceOf(address(this)) >= amount[token], "ERR_NEEDS_REFILL"); lastDrip[msg.sender][address(token)] = block.timestamp; IERC20(token).transfer(msg.sender, amount[token]); } function drain(address token) external onlyOwner { IERC20(token).transfer(msg.sender, IERC20(token).balanceOf(address(this))); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","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"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"drain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"drip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"lastDrip","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":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610602806100a56000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063d2fafb191161005b578063d2fafb19146100f8578063eab23a401461010b578063ece5313214610136578063f2fde38b1461014957600080fd5b806367a5cd061461008d578063715018a6146100a25780638da5cb5b146100aa578063b9f0bf66146100ca575b600080fd5b6100a061009b3660046104eb565b61015c565b005b6100a0610331565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100ea6100d83660046104eb565b60016020526000908152604090205481565b6040519081526020016100c1565b6100a061010636600461050d565b610345565b6100ea610119366004610537565b600260209081526000928352604080842090915290825290205481565b6100a06101443660046104eb565b610369565b6100a06101573660046104eb565b610414565b3360009081526002602090815260408083206001600160a01b0385168452909152902054620151809061018f904261056a565b10156101d65760405162461bcd60e51b81526020600482015260116024820152704552525f445249505f5448524f54544c4560781b60448201526064015b60405180910390fd5b6001600160a01b038116600081815260016020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa15801561022c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102509190610591565b10156102915760405162461bcd60e51b815260206004820152601060248201526f11549497d391515114d7d4915192531360821b60448201526064016101cd565b3360008181526002602090815260408083206001600160a01b03861680855290835281842042905560019092529182902054915163a9059cbb60e01b8152600481019390935260248301919091529063a9059cbb906044015b6020604051808303816000875af1158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906105aa565b5050565b610339610452565b610343600061047f565b565b61034d610452565b6001600160a01b03909116600090815260016020526040902055565b610371610452565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156103bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e39190610591565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016102ea565b61041c610452565b6001600160a01b03811661044657604051631e4fbdf760e01b8152600060048201526024016101cd565b61044f8161047f565b50565b6000546001600160a01b031633146103435760405163118cdaa760e01b81523360048201526024016101cd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146104e657600080fd5b919050565b6000602082840312156104fd57600080fd5b610506826104cf565b9392505050565b6000806040838503121561052057600080fd5b610529836104cf565b946020939093013593505050565b6000806040838503121561054a57600080fd5b610553836104cf565b9150610561602084016104cf565b90509250929050565b8181038181111561058b57634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156105a357600080fd5b5051919050565b6000602082840312156105bc57600080fd5b8151801515811461050657600080fdfea2646970667358221220c66b496b3ee4b046653fc1cc8034706683013da30b7b4c75a9380c25ff2e409164736f6c63430008150033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063d2fafb191161005b578063d2fafb19146100f8578063eab23a401461010b578063ece5313214610136578063f2fde38b1461014957600080fd5b806367a5cd061461008d578063715018a6146100a25780638da5cb5b146100aa578063b9f0bf66146100ca575b600080fd5b6100a061009b3660046104eb565b61015c565b005b6100a0610331565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100ea6100d83660046104eb565b60016020526000908152604090205481565b6040519081526020016100c1565b6100a061010636600461050d565b610345565b6100ea610119366004610537565b600260209081526000928352604080842090915290825290205481565b6100a06101443660046104eb565b610369565b6100a06101573660046104eb565b610414565b3360009081526002602090815260408083206001600160a01b0385168452909152902054620151809061018f904261056a565b10156101d65760405162461bcd60e51b81526020600482015260116024820152704552525f445249505f5448524f54544c4560781b60448201526064015b60405180910390fd5b6001600160a01b038116600081815260016020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa15801561022c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102509190610591565b10156102915760405162461bcd60e51b815260206004820152601060248201526f11549497d391515114d7d4915192531360821b60448201526064016101cd565b3360008181526002602090815260408083206001600160a01b03861680855290835281842042905560019092529182902054915163a9059cbb60e01b8152600481019390935260248301919091529063a9059cbb906044015b6020604051808303816000875af1158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906105aa565b5050565b610339610452565b610343600061047f565b565b61034d610452565b6001600160a01b03909116600090815260016020526040902055565b610371610452565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156103bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e39190610591565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016102ea565b61041c610452565b6001600160a01b03811661044657604051631e4fbdf760e01b8152600060048201526024016101cd565b61044f8161047f565b50565b6000546001600160a01b031633146103435760405163118cdaa760e01b81523360048201526024016101cd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146104e657600080fd5b919050565b6000602082840312156104fd57600080fd5b610506826104cf565b9392505050565b6000806040838503121561052057600080fd5b610529836104cf565b946020939093013593505050565b6000806040838503121561054a57600080fd5b610553836104cf565b9150610561602084016104cf565b90509250929050565b8181038181111561058b57634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156105a357600080fd5b5051919050565b6000602082840312156105bc57600080fd5b8151801515811461050657600080fdfea2646970667358221220c66b496b3ee4b046653fc1cc8034706683013da30b7b4c75a9380c25ff2e409164736f6c63430008150033
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.