-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtoken.js
More file actions
28 lines (20 loc) · 680 Bytes
/
token.js
File metadata and controls
28 lines (20 loc) · 680 Bytes
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
const ethers = require('ethers');
const TBTCToken = require("@keep-network/tbtc/artifacts/TBTCToken.json")
const config = require('./config')
const infura = config.infura_secret || process.env.INFURA_API;
const network = config.network || 'homestead'
async function main() {
let wallet
try {
const ip = new ethers.providers.InfuraProvider(network, infura);
const tbtcTokenContract = new ethers.Contract(TBTCToken.networks["1"].address, TBTCToken.abi, ip);
const ts = await tbtcTokenContract.name()
console.log(`ts ${ts}`)
} catch(err) {
console.error(`Could not authorize: ${err.message}`)
process.exit(1)
}
}
main().catch(err => {
console.error(err);
})