Skip to content

Commit

Permalink
Remove vm.setEnv from script
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Nov 1, 2024
1 parent 9251160 commit 561d8ec
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
19 changes: 16 additions & 3 deletions packages/contracts/test/script/ChangeOwnersScript.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ contract ChangeOwnersScriptTest is StructHelper {
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
);
vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0");
vm.setEnv("INITIAL_OWNER", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8");
vm.setEnv(
"INITIAL_OWNER",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
);
vm.setEnv("NEW_OWNER", "0xa1bec2dd161d6bbcc91ec32aa44d9333e2a864c0");
}

Expand All @@ -27,11 +30,21 @@ contract ChangeOwnersScriptTest is StructHelper {

Deploy deploy = new Deploy();
deploy.run();
vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e");
vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508");
vm.setEnv(
"EMAIL_AUTH_IMPL",
"0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0"
);
vm.setEnv(
"RECOVERY_CONTROLLER",
"0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487"
);
deploy.deployECDSAOwnedDKIMRegistry(
vm.addr(vm.envUint("PRIVATE_KEY")),
vm.envAddress("INITIAL_OWNER"),
vm.envAddress("DKIM_SIGNER")
);
// vm.setEnv("SOURCE_DKIM", vm.toString(vm.envAddress("ECDSA_DKIM")));
vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3");
ChangeOwners changeOwners = new ChangeOwners();
changeOwners.run();
address verifier = vm.envAddress("VERIFIER");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ contract ChangeSignerInECDSAOwnedDKIMRegistryScriptTest is StructHelper {
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
);
vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0");
vm.setEnv("INITIAL_OWNER", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8");
vm.setEnv(
"INITIAL_OWNER",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
);
vm.setEnv("NEW_SIGNER", "0xa1bec2dd161d6bbcc91ec32aa44d9333e2a864c0");
}

Expand All @@ -27,10 +30,21 @@ contract ChangeSignerInECDSAOwnedDKIMRegistryScriptTest is StructHelper {

Deploy deploy = new Deploy();
deploy.run();
vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e");
vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508");
vm.setEnv(
"EMAIL_AUTH_IMPL",
"0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0"
);
vm.setEnv(
"RECOVERY_CONTROLLER",
"0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487"
);
deploy.deployECDSAOwnedDKIMRegistry(
vm.addr(vm.envUint("PRIVATE_KEY")),
vm.envAddress("DKIM_SIGNER")
);
vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3");
ChangeSigner changeSigner = new ChangeSigner();
changeSigner.run();
address ecdsaDkimAddr = vm.envAddress("ECDSA_DKIM");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,36 @@ contract DeployRecoveryControllerScriptTest is StructHelper {
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
);
vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0");
vm.setEnv("INITIAL_OWNER", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8");
vm.setEnv(
"INITIAL_OWNER",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
);
}

function test_run() public {
skipIfZkSync();

Deploy deploy = new Deploy();
deploy.run();
vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e");
vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508");
vm.setEnv(
"EMAIL_AUTH_IMPL",
"0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0"
);
vm.setEnv(
"RECOVERY_CONTROLLER",
"0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487"
);
vm.setEnv(
"SIMPLE_WALLET",
"0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52"
);
deploy.deployECDSAOwnedDKIMRegistry(
vm.addr(vm.envUint("PRIVATE_KEY")),
vm.envAddress("DKIM_SIGNER")
);
vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3");
require(
vm.envAddress("ECDSA_DKIM") != address(0),
"ECDSA_DKIM is not set"
Expand Down
20 changes: 19 additions & 1 deletion packages/contracts/test/script/RenounceOwnersScript.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,35 @@ contract RenounceOwnersScriptTest is StructHelper {
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
);
vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0");
vm.setEnv("INITIAL_OWNER", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8");
vm.setEnv(
"INITIAL_OWNER",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
);
}

function test_run() public {
skipIfZkSync();
Deploy deploy = new Deploy();
deploy.run();
vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e");
vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508");
vm.setEnv(
"EMAIL_AUTH_IMPL",
"0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0"
);
vm.setEnv(
"RECOVERY_CONTROLLER",
"0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487"
);
vm.setEnv(
"SIMPLE_WALLET",
"0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52"
);
deploy.deployECDSAOwnedDKIMRegistry(
vm.addr(vm.envUint("PRIVATE_KEY")),
vm.envAddress("DKIM_SIGNER")
);
vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3");
RenounceOwners renounceOwners = new RenounceOwners();
renounceOwners.run();
address verifier = vm.envAddress("VERIFIER");
Expand Down

0 comments on commit 561d8ec

Please sign in to comment.