-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
39 lines (24 loc) · 1.39 KB
/
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
30
31
32
33
34
35
36
37
38
39
// 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));
const date = new Date();
// const currentDate = date.getTime();
// const currentDate = date.getDate() + '-' + (date.getMonth() + 1) + '-' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes();
const currentDate = date.toLocaleString('en-GB', {timeZone: 'Europe/London'})
const time = currentDate.split('/')[0] + '-' + currentDate.split('/')[1] + '-' + currentDate.split('/')[2] + " " + currentDate.split(':')[0] + ":" + currentDate.split(':')[1];
// console.log('time is ', time);
console.log(currentDate + ' (UTC + 0)')