Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
52 changes: 52 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# IPC Cross-Chain Bridge — Environment Configuration Template
# Copy to .env and fill in all values before running deploy or smoke-test.
# NEVER commit .env to version control.

# ─── Private keys ─────────────────────────────────────────────────────────────
# Single deployer key used for both Filecoin Calibration and Ethereum Sepolia.
# Must have sufficient balance on both networks for gas + IPC fees.
PRIVATE_KEY=0x<your_private_key_here>

# ─── Filecoin Calibration ─────────────────────────────────────────────────────
FILECOIN_RPC_URL=https://api.calibration.node.glif.io/rpc/v1
FILECOIN_CHAIN_ID=314159

# Address of the IPC Gateway on Filecoin Calibration.
# Deployed by the IPC team — get from https://github.com/consensus-shipyard/ipc
FILECOIN_IPC_GATEWAY=0x<filecoin_ipc_gateway_address>

# Optional: existing ERC20 token to lock on Filecoin.
# If blank, the deploy script will deploy a test ERC20 (TestToken).
FILECOIN_TOKEN_ADDRESS=

# IPC fee forwarded with each cross-message (in attoFIL / wei).
# Must cover IPC gateway dispatch cost. Default: 0.01 FIL.
IPC_FEE=10000000000000000

# ─── Ethereum Sepolia ─────────────────────────────────────────────────────────
ETHEREUM_RPC_URL=https://rpc.sepolia.org
ETHEREUM_CHAIN_ID=11155111

# Address of the IPC Gateway on Ethereum Sepolia.
ETHEREUM_IPC_GATEWAY=0x<ethereum_ipc_gateway_address>

# ─── IPC Subnet (bridge-relay actor) ─────────────────────────────────────────
# The IPC subnet where the bridge-relay WASM actor runs.
# Format: /r<root_chain_id>/<subnet_actor_address>
IPC_SUBNET_ID=/r314159/0x<subnet_actor_address>

# Source chain ID for the IPC subnet (Filecoin Calibration root = 314159).
IPC_SUBNET_ROOT=314159

# ─── Wrapped token metadata (for BridgeMint.deployAndRegisterAsset) ───────────
# Used when FILECOIN_TOKEN_ADDRESS is set to register a new wrapped token on Ethereum.
WRAPPED_TOKEN_NAME="Wrapped Test Token (IPC Bridge)"
WRAPPED_TOKEN_SYMBOL="wTT.ipc"

# ─── Output (populated by deploy-all.sh; used by smoke-test.sh) ───────────────
# These are written to deployments.json automatically — you can also set them
# manually if re-using a prior deployment.
BRIDGE_LOCK_ADDRESS=
BRIDGE_MINT_ADDRESS=
FILECOIN_TOKEN=
WRAPPED_TOKEN_ADDRESS=
22 changes: 22 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ members = [
"fendermint/actors-builtin-car",
"fendermint/actors/api",
"fendermint/actors/chainmetadata",
"fendermint/actors/bridge-relay",
"fendermint/actors/activity-tracker",
"fendermint/actors/eam",
"fendermint/actors/init",
Expand Down
48 changes: 48 additions & 0 deletions Makefile.bridge
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Makefile.bridge — IPC Cross-Chain Bridge targets
# Include in the root Makefile with: include Makefile.bridge
#
# Usage:
# make deploy-all — deploy all bridge contracts to testnets
# make smoke-test — run end-to-end smoke test
# make bridge-clean — remove generated deployment artifacts
# make bridge-help — show this help

BRIDGE_SCRIPTS := scripts/bridge
BRIDGE_ENV := .env

.PHONY: deploy-all smoke-test bridge-clean bridge-help

## deploy-all: Deploy BridgeLock (Calibration) + BridgeMint (Sepolia) and wire them together.
deploy-all: $(BRIDGE_ENV)
@bash $(BRIDGE_SCRIPTS)/deploy-all.sh

## smoke-test: Run end-to-end smoke test (requires deploy-all to have run first).
smoke-test: $(BRIDGE_ENV) contracts/deployments/deployments.json
@bash $(BRIDGE_SCRIPTS)/smoke-test.sh

## bridge-status: Print current deployment addresses.
bridge-status:
@if [ -f contracts/deployments/deployments.json ]; then \
echo "=== Bridge Deployment Status ==="; \
cat contracts/deployments/deployments.json | python3 -m json.tool; \
else \
echo "No deployments.json found. Run 'make deploy-all' first."; \
fi

## bridge-clean: Remove deployment artifacts (does NOT affect on-chain contracts).
bridge-clean:
rm -f contracts/deployments/deployments.json
rm -f contracts/deployments/bridge-lock-*.json
rm -f contracts/deployments/bridge-mint-*.json
rm -f contracts/deployments/test-token-*.json

## bridge-help: Show bridge Makefile targets.
bridge-help:
@echo "IPC Bridge Makefile targets:"
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / make /'

$(BRIDGE_ENV):
@echo "ERROR: .env not found. Run: cp .env.example .env && vim .env" && exit 1

contracts/deployments/deployments.json:
@echo "ERROR: No deployment found. Run 'make deploy-all' first." && exit 1
Loading
Loading