@@ -15,6 +15,12 @@ import "../interfaces/IRevokableTokenLock.sol";
15
15
contract ArenaToken is ERC20 , ERC20Burnable , Ownable , ERC20Permit , ERC20Votes {
16
16
using BitMaps for BitMaps.BitMap;
17
17
18
+ /// mint cooldown period
19
+ uint256 public constant MIN_MINT_INTERVAL = 365 days ;
20
+ /// maximum tokens allowed per mint
21
+ /// 10_000 = 100%
22
+ uint256 public constant MINT_CAP = 200 ; // 2%
23
+
18
24
bytes32 public merkleRoot;
19
25
/// Proportion of airdropped tokens that are immediately claimable
20
26
/// 10_000 = 100%
@@ -27,6 +33,8 @@ contract ArenaToken is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
27
33
28
34
/// vesting duration
29
35
uint256 public vestDuration;
36
+ /// timestamp till next mint is allowed
37
+ uint256 public nextMint;
30
38
31
39
event MerkleRootChanged (bytes32 merkleRoot );
32
40
event Claim (address indexed claimant , uint256 amount );
@@ -52,6 +60,7 @@ contract ArenaToken is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
52
60
require (_claimPeriodEnds > block .timestamp , "cannot have a backward time " );
53
61
_mint (msg .sender , _freeSupply);
54
62
_mint (address (this ), _airdropSupply);
63
+ nextMint = block .timestamp + MIN_MINT_INTERVAL;
55
64
claimableProportion = _claimableProportion;
56
65
claimPeriodEnds = _claimPeriodEnds;
57
66
vestDuration = _vestDuration;
@@ -147,6 +156,13 @@ contract ArenaToken is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
147
156
* @param amount The quantity of tokens to mint.
148
157
*/
149
158
function mint (address dest , uint256 amount ) external onlyOwner {
159
+ require (
160
+ amount <= (totalSupply () * MINT_CAP) / 10_000 ,
161
+ "ArenaToken: Mint exceeds maximum amount "
162
+ );
163
+ require (block .timestamp >= nextMint, "ArenaToken: Cannot mint yet " );
164
+
165
+ nextMint = block .timestamp + MIN_MINT_INTERVAL;
150
166
_mint (dest, amount);
151
167
}
152
168
0 commit comments