-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add devnet manifest for deploying solve inbox / outbox contracts. issue: #2355
- Loading branch information
1 parent
9d4f7ae
commit 3100781
Showing
11 changed files
with
507 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# DevnetSolve is a simple devnet with solve contracts deployed | ||
network = "devnet" | ||
anvil_chains = ["mock_l1", "mock_l2"] | ||
deploy_solve = true | ||
|
||
prometheus = true | ||
|
||
[node.validator01] | ||
|
||
[node.fullnode01] | ||
mode="archive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package solve | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/omni-network/omni/lib/contracts/solveinbox" | ||
"github.com/omni-network/omni/lib/contracts/solveoutbox" | ||
"github.com/omni-network/omni/lib/errors" | ||
"github.com/omni-network/omni/lib/ethclient/ethbackend" | ||
"github.com/omni-network/omni/lib/log" | ||
"github.com/omni-network/omni/lib/netconf" | ||
) | ||
|
||
// DeployContracts deploys solve inbox / outbox contracts. | ||
func DeployContracts(ctx context.Context, network netconf.Network, backends ethbackend.Backends) error { | ||
if network.ID != netconf.Devnet { | ||
log.Warn(ctx, "Skipping solve deploy", nil) | ||
return nil | ||
} | ||
|
||
log.Info(ctx, "Deploying solve contracts") | ||
|
||
for _, chain := range network.EVMChains() { | ||
backend, err := backends.Backend(chain.ID) | ||
if err != nil { | ||
return errors.Wrap(err, "get backend", "chain", chain.Name) | ||
} | ||
|
||
addr, _, err := solveinbox.DeployIfNeeded(ctx, network.ID, backend) | ||
if err != nil { | ||
return errors.Wrap(err, "deploy solve inbox") | ||
} | ||
|
||
log.Info(ctx, "SolveInbox deployed", "addr", addr.Hex(), "chain", chain.Name) | ||
|
||
addr, _, err = solveoutbox.DeployIfNeeded(ctx, network.ID, backend) | ||
if err != nil { | ||
return errors.Wrap(err, "deploy solve outbox") | ||
} | ||
|
||
log.Info(ctx, "SolveOutbox deployed", "addr", addr.Hex(), "chain", chain.Name) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.