Skip to content

Commit

Permalink
Add contract build step
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Oct 8, 2024
1 parent 95987fb commit d9fd617
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testnet/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math"
"math/big"
"os"
"os/exec"
"path/filepath"
"time"

Expand Down Expand Up @@ -303,6 +304,16 @@ func Main(cliCtx *cli.Context) error {
return fmt.Errorf("failed to create L2 genesis: %w", err)
}

log.Info("Building Optimism contracts")
cmd := exec.Command("forge", "build")
cmd.Dir = "./lib/optimism/packages/contracts-bedrock"
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
if err != nil {
return fmt.Errorf("failed to build contracts: %w", err)
}

foundryArtifacts := foundry.OpenArtifactsDir("./lib/optimism/packages/contracts-bedrock/forge-artifacts")
sourceMap := foundry.NewSourceMapFS(os.DirFS("./lib/optimism/packages/contracts-bedrock"))
l2Host := createL2(log.Root(), foundryArtifacts, sourceMap, &config, l2Genesis.Timestamp)
Expand Down

0 comments on commit d9fd617

Please sign in to comment.