Feature Tip: Add private address tag to any address under My Name Tag !
This is the continuous faucet/reward contract for QPay token.
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 44,891 transactions
(More than 25 Pending Txns)
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ERC20Faucet
Compiler Version
v0.4.18+commit.9cf6e910
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-06-24 */ /** *Submitted for verification at Etherscan.io on 2018-02-28 */ pragma solidity 0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20TokenInterface { function totalSupply() constant public returns (uint256 supply); function balanceOf(address _owner) constant public returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) constant public returns (uint256 remaining); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20Faucet { using SafeMath for uint256; uint256 public maxAllowanceInclusive; mapping (address => uint256) public claimedTokens; ERC20TokenInterface public erc20Contract; address private mOwner; bool private mIsPaused = false; bool private mReentrancyLock = false; event GetTokens(address requestor, uint256 amount); event ReclaimTokens(address owner, uint256 tokenAmount); event SetPause(address setter, bool newState, bool oldState); event SetMaxAllowance(address setter, uint256 newState, uint256 oldState); modifier notPaused() { require(!mIsPaused); _; } modifier onlyOwner() { require(msg.sender == mOwner); _; } modifier nonReentrant() { require(!mReentrancyLock); mReentrancyLock = true; _; mReentrancyLock = false; } function ERC20Faucet(ERC20TokenInterface _erc20ContractAddress, uint256 _maxAllowanceInclusive) public { mOwner = msg.sender; maxAllowanceInclusive = _maxAllowanceInclusive; erc20Contract = _erc20ContractAddress; } function getTokens(uint256 amount) notPaused nonReentrant public returns (bool) { require(claimedTokens[msg.sender].add(amount) <= maxAllowanceInclusive); require(erc20Contract.balanceOf(this) >= amount); claimedTokens[msg.sender] = claimedTokens[msg.sender].add(amount); if (!erc20Contract.transfer(msg.sender, amount)) { claimedTokens[msg.sender] = claimedTokens[msg.sender].sub(amount); return false; } GetTokens(msg.sender, amount); return true; } function setMaxAllowance(uint256 _maxAllowanceInclusive) onlyOwner nonReentrant public { SetMaxAllowance(msg.sender, _maxAllowanceInclusive, maxAllowanceInclusive); maxAllowanceInclusive = _maxAllowanceInclusive; } function reclaimTokens() onlyOwner nonReentrant public returns (bool) { uint256 tokenBalance = erc20Contract.balanceOf(this); if (!erc20Contract.transfer(msg.sender, tokenBalance)) { return false; } ReclaimTokens(msg.sender, tokenBalance); return true; } function setPause(bool isPaused) onlyOwner nonReentrant public { SetPause(msg.sender, isPaused, mIsPaused); mIsPaused = isPaused; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[],"name":"reclaimTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxAllowanceInclusive","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_maxAllowanceInclusive","type":"uint256"}],"name":"setMaxAllowance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"erc20Contract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"claimedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"isPaused","type":"bool"}],"name":"setPause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"getTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_erc20ContractAddress","type":"address"},{"name":"_maxAllowanceInclusive","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"requestor","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"GetTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"tokenAmount","type":"uint256"}],"name":"ReclaimTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"setter","type":"address"},{"indexed":false,"name":"newState","type":"bool"},{"indexed":false,"name":"oldState","type":"bool"}],"name":"SetPause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"setter","type":"address"},{"indexed":false,"name":"newState","type":"uint256"},{"indexed":false,"name":"oldState","type":"uint256"}],"name":"SetMaxAllowance","type":"event"}]
Contract Creation Code
60606040526003805460a060020a61ffff0219169055341561002057600080fd5b60405160408061082f833981016040528080519190602001805160038054600160a060020a03338116600160a060020a0319928316179092556000929092556002805495909116949091169390931790925550506107ac806100836000396000f3006060604052600436106100695763ffffffff60e060020a6000350416633c54caa5811461006e57806340c0f4201461009557806356d96a99146100ba578063a8f6c913146100d2578063a960c65f14610101578063bedb86fb14610120578063d3c9cc2614610138575b600080fd5b341561007957600080fd5b61008161014e565b604051901515815260200160405180910390f35b34156100a057600080fd5b6100a86102f8565b60405190815260200160405180910390f35b34156100c557600080fd5b6100d06004356102fe565b005b34156100dd57600080fd5b6100e56103b9565b604051600160a060020a03909116815260200160405180910390f35b341561010c57600080fd5b6100a8600160a060020a03600435166103c8565b341561012b57600080fd5b6100d060043515156103da565b341561014357600080fd5b6100816004356104de565b600354600090819033600160a060020a0390811691161461016e57600080fd5b60035460a860020a900460ff161561018557600080fd5b6003805460a860020a60ff02191660a860020a179055600254600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156101f457600080fd5b6102c65a03f1151561020557600080fd5b5050506040518051600254909250600160a060020a0316905063a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561027157600080fd5b6102c65a03f1151561028257600080fd5b50505060405180519050151561029b57600091506102e4565b7f355069f20974db323c9dcd100e8bf13fb2acc1884e5ec05b0a89c09e15ce810f3382604051600160a060020a03909216825260208201526040908101905180910390a1600191505b506003805460a860020a60ff021916905590565b60005481565b60035433600160a060020a0390811691161461031957600080fd5b60035460a860020a900460ff161561033057600080fd5b6003805460a860020a60ff02191660a860020a1790556000547fc697b3b7264f23c36d0e10dfb0d9e6a6d7c0b46869d6337f9ece76b60923ec7790339083906040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16000556003805460a860020a60ff0219169055565b600254600160a060020a031681565b60016020526000908152604090205481565b60035433600160a060020a039081169116146103f557600080fd5b60035460a860020a900460ff161561040c57600080fd5b6003805460a860020a60ff02191660a860020a17908190557fb70d0ff13d571b52e3005ea24087e63cd4f61ff45575a78db515f5a7558c8731903390839074010000000000000000000000000000000000000000900460ff16604051600160a060020a039093168352901515602083015215156040808301919091526060909101905180910390a16003805460a860020a60ff0219921515740100000000000000000000000000000000000000000274ff00000000000000000000000000000000000000001990911617919091169055565b60035460009074010000000000000000000000000000000000000000900460ff161561050957600080fd5b60035460a860020a900460ff161561052057600080fd5b6003805460a860020a60ff02191660a860020a17905560008054600160a060020a03331682526001602052604090912054610561908463ffffffff61075816565b111561056c57600080fd5b6002548290600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156105c757600080fd5b6102c65a03f115156105d857600080fd5b50505060405180519050101515156105ef57600080fd5b600160a060020a033316600090815260016020526040902054610618908363ffffffff61075816565b600160a060020a0333818116600090815260016020526040808220949094556002549092169263a9059cbb928691516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561068e57600080fd5b6102c65a03f1151561069f57600080fd5b5050506040518051905015156106fb57600160a060020a0333166000908152600160205260409020546106d8908363ffffffff61076e16565b600160a060020a0333166000908152600160205260408120919091559050610743565b7f4548b1aee8699526a653c333825df46ff8ec8117201598e9f02bb9f566c5754e3383604051600160a060020a03909216825260208201526040908101905180910390a15060015b6003805460a860020a60ff0219169055919050565b60008282018381101561076757fe5b9392505050565b60008282111561077a57fe5b509003905600a165627a7a72305820ecc9ac9ef2f0dfbb39904d077ba0c285219bf39d9ed337698a82e62d8e4f038700290000000000000000000000006911270d4bc1915744aedd785d41d44f47245bd000000000000000000000000000000000000000000000000d8d726b7177a80000
Deployed Bytecode
0x6060604052600436106100695763ffffffff60e060020a6000350416633c54caa5811461006e57806340c0f4201461009557806356d96a99146100ba578063a8f6c913146100d2578063a960c65f14610101578063bedb86fb14610120578063d3c9cc2614610138575b600080fd5b341561007957600080fd5b61008161014e565b604051901515815260200160405180910390f35b34156100a057600080fd5b6100a86102f8565b60405190815260200160405180910390f35b34156100c557600080fd5b6100d06004356102fe565b005b34156100dd57600080fd5b6100e56103b9565b604051600160a060020a03909116815260200160405180910390f35b341561010c57600080fd5b6100a8600160a060020a03600435166103c8565b341561012b57600080fd5b6100d060043515156103da565b341561014357600080fd5b6100816004356104de565b600354600090819033600160a060020a0390811691161461016e57600080fd5b60035460a860020a900460ff161561018557600080fd5b6003805460a860020a60ff02191660a860020a179055600254600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156101f457600080fd5b6102c65a03f1151561020557600080fd5b5050506040518051600254909250600160a060020a0316905063a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561027157600080fd5b6102c65a03f1151561028257600080fd5b50505060405180519050151561029b57600091506102e4565b7f355069f20974db323c9dcd100e8bf13fb2acc1884e5ec05b0a89c09e15ce810f3382604051600160a060020a03909216825260208201526040908101905180910390a1600191505b506003805460a860020a60ff021916905590565b60005481565b60035433600160a060020a0390811691161461031957600080fd5b60035460a860020a900460ff161561033057600080fd5b6003805460a860020a60ff02191660a860020a1790556000547fc697b3b7264f23c36d0e10dfb0d9e6a6d7c0b46869d6337f9ece76b60923ec7790339083906040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16000556003805460a860020a60ff0219169055565b600254600160a060020a031681565b60016020526000908152604090205481565b60035433600160a060020a039081169116146103f557600080fd5b60035460a860020a900460ff161561040c57600080fd5b6003805460a860020a60ff02191660a860020a17908190557fb70d0ff13d571b52e3005ea24087e63cd4f61ff45575a78db515f5a7558c8731903390839074010000000000000000000000000000000000000000900460ff16604051600160a060020a039093168352901515602083015215156040808301919091526060909101905180910390a16003805460a860020a60ff0219921515740100000000000000000000000000000000000000000274ff00000000000000000000000000000000000000001990911617919091169055565b60035460009074010000000000000000000000000000000000000000900460ff161561050957600080fd5b60035460a860020a900460ff161561052057600080fd5b6003805460a860020a60ff02191660a860020a17905560008054600160a060020a03331682526001602052604090912054610561908463ffffffff61075816565b111561056c57600080fd5b6002548290600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156105c757600080fd5b6102c65a03f115156105d857600080fd5b50505060405180519050101515156105ef57600080fd5b600160a060020a033316600090815260016020526040902054610618908363ffffffff61075816565b600160a060020a0333818116600090815260016020526040808220949094556002549092169263a9059cbb928691516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561068e57600080fd5b6102c65a03f1151561069f57600080fd5b5050506040518051905015156106fb57600160a060020a0333166000908152600160205260409020546106d8908363ffffffff61076e16565b600160a060020a0333166000908152600160205260408120919091559050610743565b7f4548b1aee8699526a653c333825df46ff8ec8117201598e9f02bb9f566c5754e3383604051600160a060020a03909216825260208201526040908101905180910390a15060015b6003805460a860020a60ff0219169055919050565b60008282018381101561076757fe5b9392505050565b60008282111561077a57fe5b509003905600a165627a7a72305820ecc9ac9ef2f0dfbb39904d077ba0c285219bf39d9ed337698a82e62d8e4f03870029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006911270d4bc1915744aedd785d41d44f47245bd000000000000000000000000000000000000000000000000d8d726b7177a80000
-----Decoded View---------------
Arg [0] : _erc20ContractAddress (address): 0x6911270D4BC1915744AEdd785d41D44f47245BD0
Arg [1] : _maxAllowanceInclusive (uint256): 250000000000000000000
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000006911270d4bc1915744aedd785d41d44f47245bd0
Arg [1] : 00000000000000000000000000000000000000000000000d8d726b7177a80000
Deployed Bytecode Sourcemap
1989:2507:0:-;;;;;;;;;-1:-1:-1;;;1989:2507:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4008:319;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2052:36;;;;;;;;;;;;;;;;;;;;;;;;;;;3759:237;;;;;;;;;;;;;;;;2151:40;;;;;;;;;;;;;;;-1:-1:-1;;;;;2151:40:0;;;;;;;;;;;;;;2095:49;;;;;;;;;;-1:-1:-1;;;;;2095:49:0;;;;;4339:154;;;;;;;;;;;;;;;;3180:567;;;;;;;;;;;;;;4008:319;2724:6;;4072:4;;;;2710:10;-1:-1:-1;;;;;2710:20:0;;;2724:6;;2710:20;2702:29;;;;;;2807:15;;-1:-1:-1;;;2807:15:0;;;;2806:16;2798:25;;;;;;2834:15;:22;;-1:-1:-1;;;;;;2834:22:0;-1:-1:-1;;;2834:22:0;;;4112:13;;-1:-1:-1;;;;;4112:13:0;:23;4136:4;2834:22;4112:29;;;;;;;-1:-1:-1;;;4112:29:0;;;;;;-1:-1:-1;;;;;4112:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4157:13;;4112:29;;-1:-1:-1;;;;;;4157:13:0;;-1:-1:-1;4157:22:0;4180:10;4112:29;4157:13;:48;;;;;;;-1:-1:-1;;;4157:48:0;;;;;;-1:-1:-1;;;;;4157:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4156:49;4152:94;;;4229:5;4222:12;;;;4152:94;4258:39;4272:10;4284:12;4258:39;;-1:-1:-1;;;;;4258:39:0;;;;;;;;;;;;;;;;;;;;4315:4;4308:11;;2867:1;-1:-1:-1;2879:15:0;:23;;-1:-1:-1;;;;;;2879:23:0;;;4008:319;:::o;2052:36::-;;;;:::o;3759:237::-;2724:6;;2710:10;-1:-1:-1;;;;;2710:20:0;;;2724:6;;2710:20;2702:29;;;;;;2807:15;;-1:-1:-1;;;2807:15:0;;;;2806:16;2798:25;;;;;;2834:15;:22;;-1:-1:-1;;;;;;2834:22:0;-1:-1:-1;;;2834:22:0;;;;3909:21;3857:74;;3873:10;;3885:22;;3857:74;;;;-1:-1:-1;;;;;3857:74:0;-1:-1:-1;;;;;3857:74:0;;;;;;;;;;;;;;;;;;;;;;;;;;;3942:21;:46;2879:15;:23;;-1:-1:-1;;;;;;2879:23:0;;;3759:237::o;2151:40::-;;;-1:-1:-1;;;;;2151:40:0;;:::o;2095:49::-;;;;;;;;;;;;;:::o;4339:154::-;2724:6;;2710:10;-1:-1:-1;;;;;2710:20:0;;;2724:6;;2710:20;2702:29;;;;;;2807:15;;-1:-1:-1;;;2807:15:0;;;;2806:16;2798:25;;;;;;2834:15;:22;;-1:-1:-1;;;;;;2834:22:0;-1:-1:-1;;;2834:22:0;;;;;4413:41;;4422:10;;4434:8;;4444:9;;;2834:22;4444:9;4413:41;;-1:-1:-1;;;;;4413:41:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4465:9;:20;;-1:-1:-1;;;;;;4465:20:0;;;;;-1:-1:-1;;4465:20:0;;;;2879:23;;;;;;4339:154::o;3180:567::-;2632:9;;3254:4;;2632:9;;;;;2631:10;2623:19;;;;;;2807:15;;-1:-1:-1;;;2807:15:0;;;;2806:16;2798:25;;;;;;2834:15;:22;;-1:-1:-1;;;;;;2834:22:0;-1:-1:-1;;;2834:22:0;;;;3320:21;;-1:-1:-1;;;;;3293:10:0;3279:25;;;2852:4;3279:25;;;;;;;:37;;3309:6;3279:37;:29;:37;:::i;:::-;:62;;3271:71;;;;;;3361:13;;3394:6;;-1:-1:-1;;;;;3361:13:0;:23;3385:4;3361:13;:29;;;;;;;-1:-1:-1;;;3361:29:0;;;;;;-1:-1:-1;;;;;3361:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:39;;3353:48;;;;;;;;-1:-1:-1;;;;;3464:10:0;3450:25;;;;;:13;:25;;;;;;:37;;3480:6;3450:37;:29;:37;:::i;:::-;-1:-1:-1;;;;;3436:10:0;3422:25;;;;;;;:13;:25;;;;;;:65;;;;3505:13;;;;;;:22;;3540:6;;3505:42;;;;;;-1:-1:-1;;;3505:42:0;;;;;;-1:-1:-1;;;;;3505:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3504:43;3500:168;;;-1:-1:-1;;;;;3606:10:0;3592:25;;;;;:13;:25;;;;;;:37;;3622:6;3592:37;:29;:37;:::i;:::-;-1:-1:-1;;;;;3578:10:0;3564:25;;;;;:13;:25;;;;;:65;;;;:25;-1:-1:-1;3644:12:0;;3500:168;3688:29;3698:10;3710:6;3688:29;;-1:-1:-1;;;;;3688:29:0;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3735:4:0;2867:1;2879:15;:23;;-1:-1:-1;;;;;;2879:23:0;;;3180:567;;-1:-1:-1;3180:567:0:o;1120:133::-;1178:7;1206:5;;;1225:6;;;;1218:14;;;;1246:1;1120:133;-1:-1:-1;;;1120:133:0:o;940:113::-;998:7;1021:6;;;;1014:14;;;;-1:-1:-1;1042:5:0;;;940:113::o
Swarm Source
bzzr://ecc9ac9ef2f0dfbb39904d077ba0c285219bf39d9ed337698a82e62d8e4f0387
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.