Skip to content

Commit b39861f

Browse files
committed
maxBalance config
1 parent 8d532f0 commit b39861f

File tree

1 file changed

+5
-2
lines changed
  • protocol-units/settlement/mcr/contracts/src/token/faucet

1 file changed

+5
-2
lines changed

protocol-units/settlement/mcr/contracts/src/token/faucet/MOVEFaucet.sol

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ contract MOVEFaucet {
1212
IERC20 public move;
1313
uint256 public rateLimit = 1 days;
1414
uint256 public amount = 10;
15+
uint256 public maxBalance = 1;
1516
address public owner;
1617
mapping(address => uint256) public lastFaucetClaim;
1718

@@ -22,17 +23,19 @@ contract MOVEFaucet {
2223

2324
function faucet() external payable {
2425
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");
2627
require(block.timestamp - lastFaucetClaim[msg.sender] >= rateLimit, "MOVEFaucet: rate limit exceeded");
2728
lastFaucetClaim[msg.sender] = block.timestamp;
2829
require(move.transfer(msg.sender, amount * 10 ** move.decimals()), "MOVEFaucet: transfer failed");
2930
}
3031

31-
function setConfig(uint256 _rateLimit, uint256 _amount, address _owner) external {
32+
function setConfig(uint256 _rateLimit, uint256 _amount, uint256 _maxBalance, address _owner) external {
3233
require(msg.sender == owner, "MOVEFaucet: only owner can set config");
3334
rateLimit = _rateLimit;
3435
amount = _amount;
36+
maxBalance = _maxBalance;
3537
owner = _owner;
38+
3639
}
3740

3841
function withdraw() external {

0 commit comments

Comments
 (0)