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 emulator support to deployment script #104

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,54 @@ execute** - the value of `allowsBridging()` is irrelevant and assets can move be
For an in-depth look at the high-level architecture of the bridge, see [FLIP
#237](https://github.com/onflow/flips/blob/main/application/20231222-evm-vm-bridge.md)

## Local Development

The contracts in this repo are not yet included in the Flow emulator. For local development against the bridge, follow
the steps below to stand up a local Flow emulator instance and deploy the bridge contracts:

### Prerequisites

- Install Flow CLI on your machine. For instructions, see the [Flow CLI documentation](https://developers.flow.com/tools/flow-cli/install).
- Download and install Go. For instructions, see the [Go documentation](https://go.dev/doc/install).

Ensure both are installed with:

```sh
flow-c1 version
```

and go with:

```sh
go version
```

### Start your local emulator

Start the Flow emulator with the following command:

```sh
flow-c1 emulator
```

### Run the deployment script

In a separate terminal window, run the deployment script to deploy the bridge contracts to your local emulator:

```sh
go run main.go
```

If all is successful, you should see a long flow of event and transaction logs in your terminal with a final line resulting in:

```sh
SETUP COMPLETE! Bridge is now unpaused and ready for use.
```

### Interact with the bridge

You're now ready to interact with the bridge!

### Additional Resources

For the current state of Flow EVM across various task paths, see the following resources:
Expand Down
52 changes: 30 additions & 22 deletions flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"source": "./cadence/contracts/utils/ArrayUtils.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -23,7 +23,7 @@
"source": "./cadence/contracts/bridge/interfaces/CrossVMNFT.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -33,7 +33,7 @@
"source": "./cadence/contracts/bridge/interfaces/CrossVMToken.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand Down Expand Up @@ -71,7 +71,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridge.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -81,7 +81,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeAccessor.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -91,7 +91,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeConfig.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -101,7 +101,7 @@
"source": "./cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -111,7 +111,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeHandlers.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -121,7 +121,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeNFTEscrow.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -131,7 +131,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeTemplates.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -141,7 +141,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeTokenEscrow.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -151,7 +151,7 @@
"source": "./cadence/contracts/bridge/FlowEVMBridgeUtils.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand Down Expand Up @@ -204,7 +204,7 @@
"source": "./cadence/contracts/bridge/interfaces/IBridgePermissions.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -214,7 +214,7 @@
"source": "./cadence/contracts/bridge/interfaces/ICrossVM.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -224,7 +224,7 @@
"source": "./cadence/contracts/bridge/interfaces/IEVMBridgeNFTMinter.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -234,7 +234,7 @@
"source": "./cadence/contracts/bridge/interfaces/IEVMBridgeTokenMinter.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -244,7 +244,7 @@
"source": "./cadence/contracts/bridge/interfaces/IFlowEVMNFTBridge.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -254,7 +254,7 @@
"source": "./cadence/contracts/bridge/interfaces/IFlowEVMTokenBridge.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand Down Expand Up @@ -286,7 +286,7 @@
"source": "./cadence/contracts/utils/ScopedFTProviders.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -296,7 +296,7 @@
"source": "./cadence/contracts/utils/Serialize.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -306,7 +306,7 @@
"source": "./cadence/contracts/utils/SerializeMetadata.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand All @@ -316,7 +316,7 @@
"source": "./cadence/contracts/utils/StringUtils.cdc",
"aliases": {
"crescendo": "dfc20aee650fcbdf",
"emulator": "179b6b1cb6755e31",
"emulator": "f8d6e0586b0a20c7",
"previewnet": "7792cfb75d8dfdd8",
"testing": "0000000000000007",
"testnet": "dfc20aee650fcbdf"
Expand Down Expand Up @@ -367,10 +367,18 @@
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"emulator-service-account": {
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"emulator-flow": {
"address": "0ae53cb6e3f42a79",
"key": "c1e4c9d9dca9e4d5e9b0b5a9a8e8b9c5d6f4a8b9c5d6f4a8b9c5d6f4a8b9c5d6"
},
"emulator-flow-evm-bridge": {
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"previewnet-flow-evm-bridge": {
"address": "7792cfb75d8dfdd8",
"key": {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

// Overflow prefixes signer names with the current network - e.g. "crescendo-flow-evm-bridge"
// Ensure accounts in flow.json are named accordingly
var networks = []string{"previewnet", "crescendo", "testnet", "mainnet"}
var networks = []string{"crescendo", "emulator", "mainnet", "previewnet", "testnet"}

// Pulled from flow.json deployments. Specified here as some contracts have init arg values that
// are emitted in transaction events and cannot be hardcoded in the deployment config section
Expand Down
Loading