Skip to content

Commit c04f2af

Browse files
authored
Update ERC20.sol
1 parent 32bbef9 commit c04f2af

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/07_exercise-advanced-contracts/ERC20.sol

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,38 @@ error InvalidSignature();
1818
error InvalidRelayer();
1919

2020
contract AIAgentShare is ERC20, Ownable, EIP712, ERC20Permit {
21+
// Minimum share amount per participant 100 tokens
2122
uint256 public constant MIN_AMOUNT_MINUS_ONE = 99 * 10 ** 18;
23+
24+
// Maximum share amount per participant 50000 tokens
2225
uint256 public constant MAX_AMOUNT_PLUS_ONE = 50001 * 10 ** 18;
26+
27+
// Total user participants
2328
uint256 public constant TOTAL_PARTICIPANTS = 260;
24-
uint256 public constant BITS_PER_UINT = 256; // 256 bits
29+
30+
// 256 bits per 1 uint256 state variable
31+
uint256 public constant BITS_PER_UINT = 256;
32+
33+
// Relayer fee 5% commission
2534
uint256 public constant RELAYER_FEE = 5 * 10 ** 18;
35+
36+
// Set type hash for buy approval
2637
bytes32 public constant STRUCT_TYPE_HASH = keccak256("BuyApproval(uint256 amount, int256 deadline)");
2738

28-
uint256 public immutable BUY_PERIOD_ENDS = block.timestamp + 10 days; // 10 days buying period
39+
// Set 10 days buys period
40+
uint256 public immutable BUY_PERIOD_ENDS = block.timestamp + 10 days;
41+
42+
// Store tree root
2943
bytes32 public immutable root;
3044

45+
// Store user relayer
3146
address public relayer;
3247

33-
uint256 public shareHoldersPool = 5_000_000 * 10 ** 18; // 5 million tokens for share holders
34-
uint256 public price = 0.1 ether; // 0.1 ether price per 1 token
48+
// Add 5 million tokens to the pool for my buyers participants
49+
uint256 public shareHoldersPool = 5_000_000 * 10 ** 18;
50+
51+
// Set price per 1 token == 0.10 ether
52+
uint256 public price = 0.1 ether;
3553

3654
/**
3755
*

0 commit comments

Comments
 (0)