Contract Address Details
0x313a161dA054724d743dc367D5ACA1DCd1eCa9aB
Faucet
Last Balance Update: Block #7692360
Created by 0x272cā503838
at
0xcb88ā7b0580
Balance
67,566,448.244217056778931588 GEN
Fetching tokens...
- Contract name:
- Faucet
- Optimization enabled
- true
- Compiler version
- v0.8.6+commit.11564f7e
- Optimization runs
- 200
- EVM Version
- default
Contract source code
/*** Submitted for verification at blockscout.com on 2021-07-29 09:11:42.100453Z*/// "SPDX-License-Identifier: UNLICENSED"
pragma solidity >= 0.8.0;
contract owned {
address payable owner;
constructor() {
owner = payable(msg.sender);
}
modifier onlyOwner {
require(msg.sender == owner, "Only the contract owner can call this function");
_;
}
}
contract mortal is owned {
function destroy() public onlyOwner {
selfdestruct(owner);
}
}
contract Faucet is mortal {
mapping (address => uint) last_withdraw_blocks;
uint constant drip_amount = 10000.0 ether;
event Withdrawal(address indexed to, uint amount);
event Deposit(address indexed from, uint amount);
// withdraw to custom address
function withdraw_to(address payable toAddress) external {
do_withdraw(toAddress);
}
// withdraw to sender
function withdraw() external {
do_withdraw(payable(msg.sender));
}
function do_withdraw(address payable toAddress) internal {
require(address(this).balance >= drip_amount, "This faucet is empty. Please check back later.");
require(block.number - last_withdraw_blocks[toAddress] > 10 , "You can withdraw only once per 10 blocks");
toAddress.transfer(drip_amount);
last_withdraw_blocks[toAddress] = block.number;
emit Withdrawal(toAddress, drip_amount);
}
// accept any incoming amount
receive() external payable {
emit Deposit(msg.sender, msg.value);
}
}
Contract ABI
[{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawal","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"destroy","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw_to","inputs":[{"type":"address","name":"toAddress","internalType":"address payable"}]},{"type":"receive","stateMutability":"payable"}]
Contract Byte Code
0x6080604052600436106100385760003560e01c80633ccfd60b14610079578063807674ee1461009057806383197ef0146100b057600080fd5b366100745760405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2005b600080fd5b34801561008557600080fd5b5061008e6100c5565b005b34801561009c57600080fd5b5061008e6100ab3660046102f3565b6100d0565b3480156100bc57600080fd5b5061008e6100dc565b6100ce33610160565b565b6100d981610160565b50565b6000546001600160a01b031633146101525760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c792074686520636f6e7472616374206f776e65722063616e2063616c6c60448201526d103a3434b990333ab731ba34b7b760911b60648201526084015b60405180910390fd5b6000546001600160a01b0316ff5b69021e19e0c9bab24000004710156101d15760405162461bcd60e51b815260206004820152602e60248201527f546869732066617563657420697320656d7074792e20506c656173652063686560448201526d31b5903130b1b5903630ba32b91760911b6064820152608401610149565b6001600160a01b038116600090815260016020526040902054600a906101f79043610323565b116102555760405162461bcd60e51b815260206004820152602860248201527f596f752063616e207769746864726177206f6e6c79206f6e63652070657220316044820152673020626c6f636b7360c01b6064820152608401610149565b6040516001600160a01b0382169060009069021e19e0c9bab24000009082818181858883f19350505050158015610290573d6000803e3d6000fd5b506001600160a01b03811660008181526001602052604090819020439055517f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65906102e89069021e19e0c9bab2400000815260200190565b60405180910390a250565b60006020828403121561030557600080fd5b81356001600160a01b038116811461031c57600080fd5b9392505050565b60008282101561034357634e487b7160e01b600052601160045260246000fd5b50039056fea2646970667358221220e91c826a590faaeae4f6c7377c10585a66446cfa83f46c25f755287a72714c5a64736f6c63430008060033