Skip to content

Commit

Permalink
Fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Sep 13, 2024
1 parent 6ed6e87 commit 5342f0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/script/DeployRecoveryController.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract Deploy is Script {
}

vm.startBroadcast(deployerPrivateKey);
address initialOwner = msg.sender;
address initialOwner = vm.addr(deployerPrivateKey);

// Deploy ECDSAOwned DKIM registry
dkim = ECDSAOwnedDKIMRegistry(vm.envOr("ECDSA_DKIM", address(0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract Deploy is Script {
}

vm.startBroadcast(deployerPrivateKey);
address initialOwner = msg.sender;
address initialOwner = vm.addr(deployerPrivateKey);

// Deploy ECDSAOwned DKIM registry
dkim = ECDSAOwnedDKIMRegistry(vm.envOr("ECDSA_DKIM", address(0)));
Expand Down
29 changes: 4 additions & 25 deletions packages/contracts/script/DeploySimpleWallet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,18 @@ pragma solidity ^0.8.13;

import "forge-std/Script.sol";

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "../test/helpers/SimpleWallet.sol";
import "../src/utils/Verifier.sol";
import "../src/utils/ECDSAOwnedDKIMRegistry.sol";
import "../src/EmailAuth.sol";

contract Deploy is Script {
using ECDSA for *;

function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
if (deployerPrivateKey == 0) {
console.log("PRIVATE_KEY env var not set");
return;
}
address dkim = vm.envAddress("DKIM");
if (dkim == address(0)) {
console.log("DKIM env var not set");
return;
}
address verifier = vm.envAddress("VERIFIER");
if (verifier == address(0)) {
console.log("VERIFIER env var not set");
return;
}
address emailAuthImpl = vm.envAddress("EMAIL_AUTH_IMPL");
if (emailAuthImpl == address(0)) {
console.log("EMAIL_AUTH_IMPL env var not set");
return;
}
address initOwner = vm.addr(deployerPrivateKey);
address controller = vm.envAddress("CONTROLLER");
address simpleWalletImpl = vm.envAddress("SIMPLE_WALLET_IMPL");
if (simpleWalletImpl == address(0)) {
console.log("SIMPLE_WALLET_IMPL env var not set");
Expand All @@ -43,10 +24,8 @@ contract Deploy is Script {
vm.startBroadcast(deployerPrivateKey);
bytes memory data = abi.encodeWithSelector(
SimpleWallet(payable(simpleWalletImpl)).initialize.selector,
vm.addr(deployerPrivateKey),
verifier,
dkim,
emailAuthImpl
initOwner,
controller
);
ERC1967Proxy proxy = new ERC1967Proxy(address(simpleWalletImpl), data);
console.log("SimpleWallet deployed at: %s", address(proxy));
Expand Down

0 comments on commit 5342f0a

Please sign in to comment.