Skip to content

Commit 2f3c2dd

Browse files
committed
feat(configure): changing configuring from allowance to limit
1 parent 78556a9 commit 2f3c2dd

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

script/configureToken.s.sol

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,39 @@ contract All is Script {
1212
address tokenAddress = vm.envAddress("TOKEN_ADDRESS");
1313
address system = vm.envAddress("SYSTEM_ADDRESS");
1414
address admin = vm.envAddress("ADMIN_ADDRESS");
15-
uint256 allowance = vm.envUint("MAX_MINT_ALLOWANCE");
16-
address devKey = vm.addr(deployerPrivateKey);
15+
uint256 allowance = vm.envUint("LIMIT_CAP");
16+
address devKey = vm.addr(deployerPrivateKey);
1717
if (allowance == 0) {
1818
allowance = 50000000000000000000000000; // Default value if not provided
1919
}
2020

2121
vm.startBroadcast(deployerPrivateKey);
22-
console.log("Configuring with Token:");//, tokenAddress, "System:", system, "Admin:", admin, "Allowance:", allowance);
23-
22+
console.log("Configuring with Token:"); //, tokenAddress, "System:", system, "Admin:", admin, "Allowance:", allowance);
2423

2524
// Assuming Token and SmartController are already deployed and their ABIs are known
2625
Token token = Token(tokenAddress);
2726

2827
token.addAdminAccount(admin);
2928
console.log("Admin account added successfully.");
3029

31-
token.setLimitCap( allowance);
30+
token.addSystemAccount(system);
31+
console.log("System account added successfully.");
32+
33+
token.setLimitCap(allowance);
34+
35+
if (devKey != admin) {
36+
token.addAdminAccount(devKey);
37+
console.log("Developer account added successfully.");
38+
}
39+
40+
token.setLimits(system, allowance, allowance);
41+
console.log("Rate Limit set successfully.");
42+
43+
if (devKey != admin) {
44+
token.removeAdminAccount(devKey);
45+
console.log("Developer account removed successfully.");
46+
}
3247

33-
token.addAdminAccount(devKey);
34-
token.setLimits(system, allowance, 0);
35-
console.log("mint allowance set successfully.");
36-
token.removeAdminAccount(devKey);
3748
vm.stopBroadcast();
3849
}
3950
}

script/configureToken.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ allowance=$5
2222
export TOKEN_ADDRESS=$tokenAddress
2323
export SYSTEM_ADDRESS=$system
2424
export ADMIN_ADDRESS=$admin
25-
export MAX_MINT_ALLOWANCE=$allowance
25+
export LIMIT_CAP=$allowance
2626

2727

2828
# Call the Forge script

script/deployAll.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454

5555
# Deploying all tokens
5656
echo "Deploying all tokens..."
57-
forge script script/deploy.s.sol:AllControllerEthereum --rpc-url $RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --verify $VERIFIER_URL -vvvv --legacy
57+
forge script script/deploy.s.sol:All --rpc-url $RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --verify $VERIFIER_URL -vvvv
5858

5959

6060
echo "Deployment process completed."

0 commit comments

Comments
 (0)