Skip to content

Commit e469e38

Browse files
authored
ERC20 fixes (#1639)
1 parent ae8a0aa commit e469e38

File tree

4 files changed

+32
-116
lines changed

4 files changed

+32
-116
lines changed

claim_contracts/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ deploy-token: ## 🚀 Deploy the token contract
3030
--broadcast \
3131
--verbosity 3
3232

33+
deploy-token-prod: ## 🚀 Deploy the token contract
34+
cd script && \
35+
forge script DeployAlignedToken.s.sol \
36+
--sig "run(string)" \
37+
$(PROD_CONFIG) \
38+
--keystore $(KEYSTORE_PATH) \
39+
--rpc-url $(PROD_RPC_URL) \
40+
--broadcast \
41+
--verbosity 3
42+
3343

3444
update_token_proxy:
3545
@NEW_TOKEN_PROXY=$$(jq -r '.tokenProxy' "script-out/deployed_token_addresses.json") && \

claim_contracts/README.md

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"salt": "0xb254f45e54b7faa70154efcd4fc206f1ca27235419244dd07d64afdc4cc10b1e",
3+
"deployer": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
4+
"foundation": "",
5+
"tokenDistributor": "",
6+
"tokenProxy": "0x0000000000000000000000000000000000000000"
7+
}

claim_contracts/src/AlignedToken.sol

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {ERC20BurnableUpgradeable} from "@openzeppelin/contracts-upgradeable/toke
88
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
99

1010
/// @title Aligned Token
11+
/// @custom:security-contact If you find a security bug, please contact us at [email protected]
1112
/// @notice This contract is the implementation of the Aligned Token
1213
/// @dev This contract is upgradeable and should be used only through the proxy contract
1314
contract AlignedToken is
@@ -23,11 +24,16 @@ contract AlignedToken is
2324
/// @notice Symbol of the token.
2425
string public constant SYMBOL = "ALIGN";
2526

26-
/// @notice Supply of the token for the foundation.
27-
uint256 public constant FOUNDATION_SUPPLY = 7_400_000_000e18; // 7.4 billion
27+
/// @notice Supply of tokens for the foundation.
28+
uint256 public constant INITIAL_FOUNDATION_SUPPLY = 7_400_000_000e18; // 7.4 billion
2829

29-
/// @notice Supply of the token for the token distributor.
30-
uint256 public constant TOKEN_DISTRIBUTOR_SUPPLY = 2_600_000_000e18; // 2.6 billion
30+
/// @notice Supply of tokens for the token distributor.
31+
uint256 public constant INITIAL_TOKEN_DISTRIBUTOR_SUPPLY = 2_600_000_000e18; // 2.6 billion
32+
33+
/// @notice Event emitted when tokens are minted.
34+
/// @param to address to which the tokens are minted.
35+
/// @param amount amount of tokens minted.
36+
event TokensMinted(address indexed to, uint256 indexed amount);
3137

3238
/// @custom:oz-upgrades-unsafe-allow constructor
3339
constructor() {
@@ -51,13 +57,16 @@ contract AlignedToken is
5157
__ERC20Permit_init(NAME);
5258
__ERC20Burnable_init();
5359
__Ownable_init(_foundation);
54-
_mint(_foundation, FOUNDATION_SUPPLY);
55-
_mint(_tokenDistributor, TOKEN_DISTRIBUTOR_SUPPLY);
60+
_mint(_foundation, INITIAL_FOUNDATION_SUPPLY);
61+
_mint(_tokenDistributor, INITIAL_TOKEN_DISTRIBUTOR_SUPPLY);
5662
}
5763

5864
/// @notice Mints `amount` of tokens.
65+
/// @param to address to which the tokens will be minted.
66+
/// @param amount amount of tokens to mint.
5967
function mint(address to, uint256 amount) external onlyOwner {
6068
_mint(to, amount);
69+
emit TokensMinted(to, amount);
6170
}
6271

6372
/// @notice Prevents the owner from renouncing ownership.

0 commit comments

Comments
 (0)