From d2bfd0cbd1107f3012996cb6fef9d9704ec7ee42 Mon Sep 17 00:00:00 2001 From: Yaroslav Nekryach Date: Fri, 12 Apr 2024 13:40:17 +0300 Subject: [PATCH 1/2] Added sorobanAddressToBytes32 --- scripts/helper.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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') From 0e3c5d6c3eb1e71ddca123652bbba68e2cc2479d Mon Sep 17 00:00:00 2001 From: Yaroslav Nekryach Date: Fri, 12 Apr 2024 13:54:43 +0300 Subject: [PATCH 2/2] Fixed spellcheck --- .cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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": [