|
1 | 1 | -include .env |
| 2 | +export |
2 | 3 |
|
3 | | -.PHONY: help deploy-base-sepolia deploy-base-mainnet verify bridge-l1-to-base-sepolia bridge-l1-to-base-mainnet |
| 4 | +.PHONY: help deploy-base-sepolia deploy-base-mainnet verify bridge-l1-to-base-sepolia bridge-l1-to-base-mainnet withdraw-base-to-l1-sepolia withdraw-base-to-l1-mainnet prove-withdrawal-sepolia prove-withdrawal-mainnet finalize-withdrawal-sepolia finalize-withdrawal-mainnet withdraw-full-sepolia withdraw-full-mainnet |
4 | 5 |
|
5 | 6 | help: ## Show help |
6 | 7 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
@@ -53,3 +54,57 @@ bridge-l1-to-base-mainnet: ## Bridge ALIGN from Ethereum to Base (requires AMOUN |
53 | 54 | cast send $(L1_BRIDGE_MAINNET) "depositERC20(address,address,uint256,uint32,bytes)" \ |
54 | 55 | $(L1_TOKEN_MAINNET) $(L2_TOKEN_MAINNET) $(AMOUNT) 200000 0x \ |
55 | 56 | --private-key $(USER_PRIVATE_KEY) --rpc-url $(L1_MAINNET_RPC_URL) |
| 57 | + |
| 58 | +bridge-l1-to-base-sepolia-to: ## Bridge ALIGN from Sepolia to BaseSepolia to a different address (requires AMOUNT, TO) |
| 59 | + cast send $(L1_TOKEN_SEPOLIA) "approve(address,uint256)" $(L1_BRIDGE_SEPOLIA) $(AMOUNT) \ |
| 60 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(L1_SEPOLIA_RPC_URL) |
| 61 | + cast send $(L1_BRIDGE_SEPOLIA) "depositERC20To(address,address,address,uint256,uint32,bytes)" \ |
| 62 | + $(L1_TOKEN_SEPOLIA) $(L2_TOKEN_SEPOLIA) $(TO) $(AMOUNT) 200000 0x \ |
| 63 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(L1_SEPOLIA_RPC_URL) |
| 64 | + |
| 65 | +bridge-l1-to-base-mainnet-to: ## Bridge ALIGN from Ethereum to Base to a different address (requires AMOUNT, TO) |
| 66 | + cast send $(L1_TOKEN_MAINNET) "approve(address,uint256)" $(L1_BRIDGE_MAINNET) $(AMOUNT) \ |
| 67 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(L1_MAINNET_RPC_URL) |
| 68 | + cast send $(L1_BRIDGE_MAINNET) "depositERC20To(address,address,address,uint256,uint32,bytes)" \ |
| 69 | + $(L1_TOKEN_MAINNET) $(L2_TOKEN_MAINNET) $(TO) $(AMOUNT) 200000 0x \ |
| 70 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(L1_MAINNET_RPC_URL) |
| 71 | + |
| 72 | +# --- Bridging Base -> L1 (withdrawal) --- |
| 73 | +# This initiates the withdrawal on L2. After this, you must: |
| 74 | +# 1. Wait ~1 hour for the L2 output to be proposed |
| 75 | +# 2. Prove the withdrawal on L1 (requires Optimism SDK or Base Bridge UI) |
| 76 | +# 3. Wait 7 days (challenge period) |
| 77 | +# 4. Finalize the withdrawal on L1 |
| 78 | +# L2StandardBridge predeploy: 0x4200000000000000000000000000000000000010 |
| 79 | + |
| 80 | +withdraw-base-to-l1-sepolia: ## Initiate ALIGN withdrawal from BaseSepolia to Sepolia (requires AMOUNT) |
| 81 | + cast send 0x4200000000000000000000000000000000000010 \ |
| 82 | + "withdraw(address,uint256,uint32,bytes)" \ |
| 83 | + $(L2_TOKEN_SEPOLIA) $(AMOUNT) 200000 0x \ |
| 84 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(BASE_SEPOLIA_RPC_URL) |
| 85 | + |
| 86 | +withdraw-base-to-l1-mainnet: ## Initiate ALIGN withdrawal from Base to Ethereum (requires AMOUNT) |
| 87 | + cast send 0x4200000000000000000000000000000000000010 \ |
| 88 | + "withdraw(address,uint256,uint32,bytes)" \ |
| 89 | + $(L2_TOKEN_MAINNET) $(AMOUNT) 200000 0x \ |
| 90 | + --private-key $(USER_PRIVATE_KEY) --rpc-url $(BASE_MAINNET_RPC_URL) |
| 91 | + |
| 92 | +# --- Prove & Finalize (requires npm install) --- |
| 93 | + |
| 94 | +prove-withdrawal-sepolia: ## Prove withdrawal on L1 Sepolia (requires TX_HASH) |
| 95 | + npx tsx scripts/withdraw.ts prove --tx-hash $(TX_HASH) --network sepolia |
| 96 | + |
| 97 | +prove-withdrawal-mainnet: ## Prove withdrawal on L1 Mainnet (requires TX_HASH) |
| 98 | + npx tsx scripts/withdraw.ts prove --tx-hash $(TX_HASH) --network mainnet |
| 99 | + |
| 100 | +finalize-withdrawal-sepolia: ## Finalize withdrawal on L1 Sepolia (requires TX_HASH) |
| 101 | + npx tsx scripts/withdraw.ts finalize --tx-hash $(TX_HASH) --network sepolia |
| 102 | + |
| 103 | +finalize-withdrawal-mainnet: ## Finalize withdrawal on L1 Mainnet (requires TX_HASH) |
| 104 | + npx tsx scripts/withdraw.ts finalize --tx-hash $(TX_HASH) --network mainnet |
| 105 | + |
| 106 | +withdraw-full-sepolia: ## Full withdrawal flow: prove + finalize on Sepolia (requires TX_HASH) |
| 107 | + npx tsx scripts/withdraw.ts full --tx-hash $(TX_HASH) --network sepolia |
| 108 | + |
| 109 | +withdraw-full-mainnet: ## Full withdrawal flow: prove + finalize on Mainnet (requires TX_HASH) |
| 110 | + npx tsx scripts/withdraw.ts full --tx-hash $(TX_HASH) --network mainnet |
0 commit comments