@@ -5,12 +5,12 @@ import gasZipFacetArtifact from '../../out/GasZipFacet.sol/GasZipFacet.json'
5
5
import { ILiFi } from '../../typechain'
6
6
import { SupportedChain } from './utils/demoScriptChainConfig'
7
7
import {
8
+ addressToBytes32RightPadded ,
8
9
ensureBalance ,
9
10
executeTransaction ,
10
11
setupEnvironment ,
11
12
} from './utils/demoScriptHelpers'
12
13
import { IGasZip } from '../../typechain/GasZipFacet'
13
- import { PublicKey } from '@solana/web3.js'
14
14
15
15
dotenv . config ( )
16
16
@@ -25,22 +25,23 @@ const NON_EVM_ADDRESS = '0x11f111f111f111F111f111f111F111f111f111F1'
25
25
async function main ( ) {
26
26
// === Set up environment ===
27
27
const srcChain : SupportedChain = 'arbitrum'
28
- const destinationChainId = 245 // solana (non evm) - custom destination chain id for gas.zip - check here (https://dev.gas.zip/gas/chain-support/outbound)
28
+ const nativeDestinationChainId = 80094 // berachain
29
+ const gasZipDestinationChainId = 143 // berachain - custom destination chain id for gas.zip - check here (https://dev.gas.zip/gas/chain-support/outbound)
29
30
30
31
const { publicClient, walletAccount, lifiDiamondContract } =
31
32
await setupEnvironment ( srcChain , GAS_ZIP__FACET_ABI )
32
33
const signerAddress = walletAccount . address
33
- // const userReceiver = addressToBytes32RightPadded({evm_address} ) // <== in case of evm address
34
- const userReceiver = `0x${ new PublicKey (
35
- 'DDMe5C8EhVhaVZRu3ukqhXF5CqnjuxhxbXBXj7pZnTw6'
36
- )
37
- . toBuffer ( )
38
- . toString ( 'hex' ) } `
34
+ const userReceiver = addressToBytes32RightPadded ( signerAddress ) // <== in case of evm address
35
+ // const userReceiver = `0x${new PublicKey(
36
+ // 'DDMe5C8EhVhaVZRu3ukqhXF5CqnjuxhxbXBXj7pZnTw6'
37
+ // )
38
+ // .toBuffer()
39
+ // .toString('hex') }` // <== in case of svm address
39
40
40
41
// === Contract addresses ===
41
42
const SRC_TOKEN_ADDRESS = zeroAddress as `0x${string } ` // native token
42
43
43
- const amount = parseUnits ( '0.001 ' , 18 ) // 0.001 * 1e18
44
+ const amount = parseUnits ( '0.0005 ' , 18 ) // 0.0005 * 1e18
44
45
45
46
console . info ( `Bridge ${ amount } native from ${ srcChain } --> Solana` )
46
47
console . info ( `Connected wallet address: ${ signerAddress } ` )
@@ -55,15 +56,15 @@ async function main() {
55
56
referrer : zeroAddress ,
56
57
sendingAssetId : zeroAddress , // <-- native token
57
58
receiver : NON_EVM_ADDRESS ,
58
- destinationChainId,
59
+ destinationChainId : nativeDestinationChainId ,
59
60
minAmount : amount ,
60
61
hasSourceSwaps : false ,
61
62
hasDestinationCall : false ,
62
63
}
63
64
64
65
const gasZipData : IGasZip . GasZipDataStruct = {
65
66
receiverAddress : userReceiver ,
66
- destinationChains : destinationChainId ,
67
+ destinationChains : gasZipDestinationChainId ,
67
68
}
68
69
69
70
// === Start bridging ===
0 commit comments