-
-
Save dendisuhubdy/be37dfb3b64a94317db132bcef41721d to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT | |
// Copyright (c) 2020 petejkim | |
pragma solidity 0.6.12; | |
import { Ownable } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/access/Ownable.sol"; | |
import { IERC20 } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/IERC20.sol"; | |
import { SafeERC20 } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/SafeERC20.sol"; | |
contract USDCFaucet is Ownable { | |
using SafeERC20 for IERC20; | |
mapping (address => uint256) public lastClaimedAt; | |
uint256 public amount = 100000000; | |
uint256 public waitPeriod = 3600; | |
address public tokenAddress = 0x2f3A40A3db8a7e3D09B0adfEfbCe4f6F81927557; | |
function configure(uint256 newAmount, uint256 newWaitPeriod, address newTokenAddress) external onlyOwner { | |
amount = newAmount; | |
waitPeriod = newWaitPeriod; | |
tokenAddress = newTokenAddress; | |
} | |
function canClaim(address account) external view returns (bool) { | |
return lastClaimedAt[account] + waitPeriod < now; | |
} | |
function claim() external { | |
require(lastClaimedAt[msg.sender] + waitPeriod < now, "You cannot claim again so soon!"); | |
lastClaimedAt[msg.sender] = now; | |
IERC20(tokenAddress).safeTransfer(msg.sender, amount); | |
} | |
function drain() external onlyOwner { | |
IERC20 token = IERC20(tokenAddress); | |
token.safeTransfer(msg.sender, token.balanceOf(address(this))); | |
} | |
function destroy() external onlyOwner { | |
selfdestruct(msg.sender); | |
} | |
} |
0xeA1577de7b43C6a67c4b667eDdFE8Df5BA08009F
0xd25479a918de02Cdce1e31dB8746bA1126e49e7E
0x13b61cE98EeaE62fe37d99008B0d1985F13691cD
0x4050e700DD94E7295B887c9B0e08ac7c31622B63
0x89dB3a1bfBeB08aa77741C7aA8a235926D217Ff9
0x07C2c59775E5Bf9CCEAF385b9bEbcCEa96c9Ad49
0x64F36FEC01b022f1aE4F28a409da2B9F9e8db796
0x68B7Bc99e3Bc1750973C58070C68A0C75FEeFEA3
0x82130ad2266d6B71318659Abcbab3C34c13E249e
0xbE721ddE19047BdBaf4dE1583619F8f8c6103495
0xFf7d298ba0750D60c4eBa5B3E264ed8Aba50E1e5
0x0aC656Dd4D8576098c9Ad312F2D6b21e4Ee1b566
0x379Ab8f47B0b39a2993D0f2B33F883935aD57ce9
0x97DbD073A4e0F090Bc04Dd0fD7054995bF462f7a
0x70858bf42DdB02356C907d038C27861D1fC9a409
0x93fa552Bed1016d6030724987dD7C6A7EC583083
0x914d0386a34b1Da6040642215fB06876010c6e4E
0x3E28FeD775a71f6C9B627B05e175D9c0581FaFbc
0xc0D820b40F420b64cebf95dd00dd9aD77Cdc2194
0xd24788e3567437D86b984cd8472c9Faf7BE096Ca
0x456D201892F61213E2be127C32863e7AF1b64158
0xDc85B86cD5565e8324A844402423a3882f6B4614
0xa466Eeb34dcF451461301B1348055eC2817ba162
0x94cdEC488bfac461a9FC65216C1b1c6e2589e4Bc
0x1E1FCeb2c10429f9d8e21Ef314B515c1507E51B6
0x2299dB74883FE9AaBE7A009Fe4d362D0BA00DE01
0x046825BFD2ab4562E0308e48526B779Fd897d539
0xF34B73f56a7F8EF5d3EADC6ebf75F80Fd2926D92
0x16e8F6Cc161A3d6a80aee4323D5E724bD6743555
0xcb67af32ba5916b6fabecbb52203e1303604a8d0