-
Notifications
You must be signed in to change notification settings - Fork 0
/
stakeOf.js
24 lines (19 loc) · 961 Bytes
/
stakeOf.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
// Right-click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running forging stake script - stakeOf...');
// ##### ONLY SET THE FOLLOWING VALUES #####
const OWNER_ADDRESS = ""; // If owner is different from caller, specify it here.
// ##### DO NOT MAKE ANY MORE CHANGES TO THE SCRIPT #####
const accounts = await web3.eth.getAccounts();
const callerAddress = accounts[0];
const ownerAddress = !OWNER_ADDRESS ? callerAddress : OWNER_ADDRESS;
// This is the contract address for the Forger Stake Delegation contract. DO NOT CHANGE THIS VALUE.
const contractAddress = "0x0000000000000000000022222222222222222222";
const abi = require("./abi/forger_stake_delegation.json");
const contract = new web3.eth.Contract(abi, contractAddress);
await contract.methods.stakeOf(ownerAddress).call().then(console.log);
} catch (e) {
console.log("Error:" + e.message);
}
})()