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

fix: send token #106

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading