File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export const ADDRESSES = {
2+ bridge : "0xA6d78F4F39A9dEE0d62f2B4DFb969e645dA016D8" ,
3+ wrappedSOL : "0xfDaB33bcbD3801BE97056c3541cEC59760E23a3B" ,
4+ wrappedSPL : "0x8cB2961F96325c64572a67d855ebAB50A3c8332D" ,
5+ } as const ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { decodeEventLog } from "viem/utils";
88import type { Bridge } from "../../target/types/bridge" ;
99import { BRIDGE_ABI } from "../utils/bridge.abi" ;
1010import { getConstantValue } from "../utils/constants" ;
11+ import { ADDRESSES } from "../addresses" ;
1112
1213const TRANSACTION_HASH =
1314 "0x1558d0b5366a42738af3952ff985ed27e604a405793dec8476a38ff2cd3100b8" ;
@@ -156,7 +157,7 @@ async function generateProof(
156157 // FIXME: Something is off here, the returned proof does not match the MMR root registered in the OutputRoot PDA
157158 // even though we're using the same block number
158159 const [ rawProof , totalLeafCount ] = await publicClient . readContract ( {
159- address : "0xA6d78F4F39A9dEE0d62f2B4DFb969e645dA016D8" ,
160+ address : ADDRESSES . bridge ,
160161 abi : BRIDGE_ABI ,
161162 functionName : "generateProof" ,
162163 args : [ event . message . nonce ] ,
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ import { toBytes } from "viem";
66import type { Bridge } from "../../target/types/bridge" ;
77import { confirmTransaction } from "../utils/confirm-tx" ;
88import { getConstantValue } from "../utils/constants" ;
9+ import { ADDRESSES } from "../addresses" ;
910
1011type BridgeSolParams = Parameters < Program < Bridge > [ "methods" ] [ "bridgeSol" ] > ;
1112
12- const WRAPPED_SOL_ADDRESS = "0xfDaB33bcbD3801BE97056c3541cEC59760E23a3B" ;
13-
1413async function main ( ) {
1514 const provider = anchor . AnchorProvider . env ( ) ;
1615 anchor . setProvider ( provider ) ;
@@ -22,7 +21,7 @@ async function main() {
2221 const to : BridgeSolParams [ 1 ] = [
2322 ...toBytes ( "0x0000000000000000000000000000000000000000" ) ,
2423 ] ;
25- const remoteToken : BridgeSolParams [ 2 ] = [ ...toBytes ( WRAPPED_SOL_ADDRESS ) ] ;
24+ const remoteToken : BridgeSolParams [ 2 ] = [ ...toBytes ( ADDRESSES . wrappedSOL ) ] ;
2625 const amount : BridgeSolParams [ 3 ] = new anchor . BN ( 1 ) ;
2726 const call : BridgeSolParams [ 4 ] = null ;
2827
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import { toBytes } from "viem";
1010import type { Bridge } from "../../target/types/bridge" ;
1111import { confirmTransaction } from "../utils/confirm-tx" ;
1212import { getConstantValue } from "../utils/constants" ;
13-
14- const WRAPPED_SPL_ADDRESS = "0x0000000000000000000000000000000000000000" ;
13+ import { ADDRESSES } from "../addresses" ;
1514
1615type BridgeSplParams = Parameters < Program < Bridge > [ "methods" ] [ "bridgeSpl" ] > ;
1716
@@ -26,7 +25,7 @@ async function main() {
2625 const to : BridgeSplParams [ 1 ] = [
2726 ...toBytes ( "0x0000000000000000000000000000000000000000" ) , // Recipient on Base
2827 ] ;
29- const remoteToken : BridgeSplParams [ 2 ] = [ ...toBytes ( WRAPPED_SPL_ADDRESS ) ] ;
28+ const remoteToken : BridgeSplParams [ 2 ] = [ ...toBytes ( ADDRESSES . wrappedSPL ) ] ;
3029 const amount : BridgeSplParams [ 3 ] = new anchor . BN ( 1 ) ;
3130 const call : BridgeSplParams [ 4 ] = null ;
3231
You can’t perform that action at this time.
0 commit comments