Skip to content

Commit a4a8d31

Browse files
committed
add env variable
1 parent b68e9e4 commit a4a8d31

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

script/DeployOrderContract.s.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ contract DeployOrderContract is Script {
2222
agentController, pyUSD, address(token) // Replace with actual pyUSD token address
2323
);
2424
if (block.chainid == 31337) {
25-
26-
token.mint(vm.envAddress("PUBLIC_KEY"), 1000000 ether);
27-
25+
address[] memory test_accounts = vm.envAddress("PUBLIC_KEYS",',');
26+
for (uint256 i = 0; i < test_accounts.length; i++) {
27+
token.mint(test_accounts[i], 1000000 ether);
28+
29+
}
2830
}
2931
token.transferOwnership(address(orderContract));
3032

script/HelperConfig.s.sol

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contract HelperConfig is Script {
1818
function getSepoliaEthConfig() public view returns (NetworkConfig memory) {
1919
return NetworkConfig({
2020
pyUSD: 0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9,
21-
agentController: 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc, // replace with actual address
21+
agentController: vm.envAddress("AGENT_ADDRESS"), // replace with actual address
2222
deployerKey: vm.envUint("PRIVATE_KEY")
2323
});
2424
}
@@ -29,12 +29,15 @@ contract HelperConfig is Script {
2929
}
3030
vm.startBroadcast();
3131
ERC20Mock pyUSD = new ERC20Mock();
32-
pyUSD.mint(vm.envAddress("PUBLIC_KEY"), 100 ether);
33-
32+
address[] memory test_accounts = vm.envAddress("PUBLIC_KEYS",',');
33+
for (uint256 i = 0; i < test_accounts.length; i++) {
34+
pyUSD.mint(test_accounts[i], 100 ether);
35+
36+
}
3437
vm.stopBroadcast();
3538
return NetworkConfig({
3639
pyUSD: address(pyUSD),
37-
agentController: address(5),
40+
agentController: vm.envAddress("AGENT_ADDRESS"),
3841
deployerKey: vm.envUint("DEFAULT_ANVIL_KEY")
3942
});
4043

start_windows.cmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@echo off
2+
for /f "usebackq tokens=1,2 delims==" %%A in (".env") do (
3+
if not "%%A"=="" (
4+
if not "%%A"=="#" (
5+
set %%A=%%B
6+
)
7+
)
8+
)
9+
echo OK .env variables loaded into current session.

0 commit comments

Comments
 (0)