diff --git a/.cspell.json b/.cspell.json index f592be0..8378aab 100644 --- a/.cspell.json +++ b/.cspell.json @@ -27,7 +27,9 @@ "disbalancing", "disbalanced", "USDY", - "YARO" + "YARO", + "Soroban", + "Sepolia" ], "flagWords": [], "ignorePaths": [ diff --git a/scripts/helper.ts b/scripts/helper.ts index ae552df..f042bf6 100644 --- a/scripts/helper.ts +++ b/scripts/helper.ts @@ -2,6 +2,7 @@ import {BaseContract, ContractTransaction} from 'ethers'; import bs58 from 'bs58'; const TronWeb = require('tronweb'); +const base32 = require('base32.js'); export async function handleDeployResult(contract: BaseContract) { console.log('Contract address: ', contract.address); @@ -48,6 +49,11 @@ export function solanaAddressToBytes32(address: string): string { return bufferToHex(buffer); } +export function sorobanAddressToBytes32(address: string): string { + const buffer = base32.decode(address); + return bufferToHex(buffer.slice(1, 33)); +} + function tronAddressToEthAddress(address: string): string { return Buffer.from(TronWeb.utils.crypto.decodeBase58Address(address)) .toString('hex')