Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deployer script for factory and implementation #614

Merged
merged 2 commits into from
May 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
format
  • Loading branch information
pscott committed May 28, 2024
commit 31d0b52b31aa324d8a8f331eeb4655016a6525b3
25 changes: 8 additions & 17 deletions ethereum/script/Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.8.19;

import { Script } from "forge-std/Script.sol";
import {Script} from "forge-std/Script.sol";
import {L1AvatarExecutionStrategy} from "../src/execution-strategies/L1AvatarExecutionStrategy.sol";
import {L1AvatarExecutionStrategyFactory} from "../src/execution-strategies/L1AvatarExecutionStrategyFactory.sol";
import { stdJson } from "forge-std/StdJson.sol";
import {stdJson} from "forge-std/StdJson.sol";

contract Deployer is Script {
string internal deployments;
Expand All @@ -12,12 +12,10 @@ contract Deployer is Script {
error ImplementationInitializationFailed();

function run() public {

vm.startBroadcast();
L1AvatarExecutionStrategy implementation = new L1AvatarExecutionStrategy();
address owner = vm.addr(vm.envUint("PRIVATE_KEY"));


// If the master space is not initialized, initialize it
address target = address(1);
address starknetCore = address(2);
Expand All @@ -26,21 +24,14 @@ contract Deployer is Script {
if (implementation.owner() == address(0x0)) {
uint256[] memory starknetSpaces = new uint256[](1);
starknetSpaces[0] = 4;
implementation.setUp(
owner,
target,
starknetCore,
executionRelayer,
starknetSpaces,
quorum
);
implementation.setUp(owner, target, starknetCore, executionRelayer, starknetSpaces, quorum);
}

if (implementation.owner() != owner
|| implementation.target() != address(0x1)
|| implementation.starknetCore() != address(2)
|| implementation.executionRelayer() != 3
|| implementation.quorum() != 5) {
if (
implementation.owner() != owner || implementation.target() != address(0x1)
|| implementation.starknetCore() != address(2) || implementation.executionRelayer() != 3
|| implementation.quorum() != 5
) {
// Initialization failed (e.g. got frontran)
revert ImplementationInitializationFailed();
}
Expand Down
Loading