From 9734d5dacdc366586219ab8d4c6e642c37b09aa5 Mon Sep 17 00:00:00 2001 From: Joao Victor Pereira Santos Date: Tue, 19 Dec 2023 16:42:57 -0300 Subject: [PATCH] refactor: [ISSUE-119] Format approveToken.ts file --- scripts/approveToken.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/approveToken.ts b/scripts/approveToken.ts index 63aa195..dd4ca4c 100644 --- a/scripts/approveToken.ts +++ b/scripts/approveToken.ts @@ -1,33 +1,33 @@ -import { ethers } from "hardhat" +import { ethers } from "hardhat"; import { ERC20ABI } from "../test/utils/utils"; export async function main() { - // Get the first account from the list of accounts - const [signer] = await ethers.getSigners(); + // Get the first account from the list of accounts + const [signer] = await ethers.getSigners(); - // Get the Swaplace address from .env file - const swaplaceAddress: string = process.env.SWAPLACE_ADDRESS || ""; + // Get the Swaplace address from .env file + const swaplaceAddress: string = process.env.SWAPLACE_ADDRESS || ""; - // Get the token contract, replace to the token that you want approve - const tokenContract = ''; + // Get the token contract, replace to the token that you want approve + const tokenContract = ""; - // Get the token instance - const Token = new ethers.Contract(tokenContract, ERC20ABI, signer); + // Get the token instance + const Token = new ethers.Contract(tokenContract, ERC20ABI, signer); - // Get the value to approve token, replace to value that you need - const valueApproveToken = BigInt(99999 * (10**18)); - - // Make the approve - const tx = Token.approve(swaplaceAddress, valueApproveToken) + // Get the value to approve token, replace to value that you need + const valueApproveToken = BigInt(99999 * 10 ** 18); - // Wait for the transaction to be mined - await tx.wait(); + // Make the approve + const tx = Token.approve(swaplaceAddress, valueApproveToken); - // Log the transaction hash - console.log("\nTransaction Hash: ", tx); + // Wait for the transaction to be mined + await tx.wait(); + + // Log the transaction hash + console.log("\nTransaction Hash: ", tx); } main().catch((error) => { - console.error(error); - process.exitCode = 1; + console.error(error); + process.exitCode = 1; });