@@ -12,6 +12,7 @@ contract MOVEFaucet {
12
12
IERC20 public move;
13
13
uint256 public rateLimit = 1 days ;
14
14
uint256 public amount = 10 ;
15
+ uint256 public maxBalance = 1 ;
15
16
address public owner;
16
17
mapping (address => uint256 ) public lastFaucetClaim;
17
18
@@ -22,17 +23,19 @@ contract MOVEFaucet {
22
23
23
24
function faucet () external payable {
24
25
require (msg .value == 10 ** 17 , "MOVEFaucet: eth invalid amount " );
25
- require (move.balanceOf (msg .sender ) < 10 ** move.decimals (), "MOVEFaucet: balance must be less than 1 MOVE " );
26
+ require (move.balanceOf (msg .sender ) < maxBalance * 10 ** move.decimals (), "MOVEFaucet: balance must be less than determine amount of MOVE " );
26
27
require (block .timestamp - lastFaucetClaim[msg .sender ] >= rateLimit, "MOVEFaucet: rate limit exceeded " );
27
28
lastFaucetClaim[msg .sender ] = block .timestamp ;
28
29
require (move.transfer (msg .sender , amount * 10 ** move.decimals ()), "MOVEFaucet: transfer failed " );
29
30
}
30
31
31
- function setConfig (uint256 _rateLimit , uint256 _amount , address _owner ) external {
32
+ function setConfig (uint256 _rateLimit , uint256 _amount , uint256 _maxBalance , address _owner ) external {
32
33
require (msg .sender == owner, "MOVEFaucet: only owner can set config " );
33
34
rateLimit = _rateLimit;
34
35
amount = _amount;
36
+ maxBalance = _maxBalance;
35
37
owner = _owner;
38
+
36
39
}
37
40
38
41
function withdraw () external {
0 commit comments