forked from Trymbakmahant/Liquiswap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
29 lines (17 loc) · 862 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// const {ethers} = require("ethers");
// const ABI = [
// "function approve(address spender, uint256 amount) external returns (bool)"
// ];
// const contractAddress = "CONTRACT_ADDRESS";
// const main = async () => {
// const privateKey = "PRIVATE_KEY" //your private key
// const provider = new ethers.providers.JsonRpcProvider("ALCHEMY MUMBAI KEY"); //get your key on alchemy
// const wallet = new ethers.Wallet(privateKey, provider)
// const contract = new ethers.Contract(contractAddress, ABI, provider);
// const contractWithWallet = contract.connect(wallet);
// //enter address and amount here
// const tx = await contractWithWallet.approve("SPENDER_ADDRESS(OUR CONTRACT ADDRESS IG, AMOUNT_TO_APPROVE)");
// await tx.wait();
// console.log(tx);
// };
// main().then().catch(e => console.log(e));