Skip to content

Instantly share code, notes, and snippets.

View mehranhydary's full-sized avatar
🚀
Innovating

𝖒 mehranhydary

🚀
Innovating
View GitHub Profile
/**
* 1. Initialize new node project (npm init -y)
* 2. Run: npm install ethers
* 3. Add private key where PRIVATE_KEY
* 4. Optionally, update gas price (line 29) or chosen gas limit
* 5. Run: node mint-temporal-loot.js
* 6. NOTE: Don't forget to get an API key fgrom Alchemy and replace the variable in line 15
*/
// Imports
require("dotenv").config();
@mehranhydary
mehranhydary / check-settlement.js
Created September 3, 2021 11:59
check-settlement.js
/*
1. Run `npm init` in a new folder
2. Install ethers.js with `npm i ethers`
3. Create a file called `check-settlement.js`
4. Copy the script below and save it in the file you create
5. In your terminal, run `node check-settlement.js`
*/
require("dotenv").config();
const ethers = require("ethers");
const axios = require('axios').default;
require("dotenv").config();
const ethers = require("ethers");
const axios = require('axios').default;
const provider = new ethers.providers.JsonRpcProvider(`https://eth-mainnet.alchemyapi.io/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`);
const alg = new ethers.Contract(
"0x32353A6C91143bfd6C7d363B546e62a9A2489A20",
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"inde
/*
1. Run `npm init` in a new folder
2. Install ethers.js with `npm i ethers`
3. Create a file called `check-loot-gold.js`
4. Copy the script below and save it in the file you create
5. In your terminal, run `node check-loot-gold.js`
*/
require("dotenv").config();
const ethers = require("ethers");
/**
* 1. Initialize new node project (npm init -y)
* 2. Run: npm install ethers
* 3. Add private key where PRIVATE_KEY
* 4. Optionally, update gas price (line 29) or chosen gas limit
* 4. Run: node score-claim.js
*/
// Imports
const ethers = require("ethers");
const { parseUnits } = require("@ethersproject/units");
0x4e2Cac1d5333B775C1f2E78733C3352b84862EbA
0x58b8878336b5F2b9A071eFB7eA8ef340F489d1F2
0x1092361f4eAfDC6e4555Ee761E87Ef9c67b9e42f