Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: send token (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko authored Sep 6, 2023
1 parent f9cfb87 commit bc43ded
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/test/send-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const main = async function (...args: string[]) {
gasLimit: 5_000_000,
})
const txReceipt = await tx.wait()

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const logs = txReceipt.events?.find((e: any) => e.event === 'TokenDeployed')

Expand All @@ -105,7 +106,8 @@ const main = async function (...args: string[]) {

// Approve token burn
const erc20 = new Contract(tokenAddress, ERC20.abi, wallet)
await erc20.approve(erc20Messaging.address, amount)
const tx1 = await erc20.approve(erc20Messaging.address, amount)
await tx1.wait()

// Send token
console.log(
Expand All @@ -120,16 +122,18 @@ const main = async function (...args: string[]) {
' token address:',
tokenAddress
)
const tx = await erc20Messaging.sendToken(

const tx2 = await erc20Messaging.sendToken(
cc.TARGET_SUBNET_ID_4,
tokenAddress,
receiverAddress,
amount,
{
gasLimit: 5_000_000,
gasLimit: 5_100_000,
}
)
const txReceipt = await tx.wait()
const txReceipt = await tx2.wait()

const logs = txReceipt.events?.find(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(e: any) =>
Expand Down

0 comments on commit bc43ded

Please sign in to comment.