-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathauction_end.js
More file actions
25 lines (21 loc) · 822 Bytes
/
auction_end.js
File metadata and controls
25 lines (21 loc) · 822 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
const BN = require("bn.js");
module.exports = async function (callback) {
try {
let frac = new BN(10);
frac = frac.pow(new BN(18));
let NFToken = artifacts.require("NFToken");
let tokenInstance = await NFToken.deployed();
let Auction = artifacts.require("Auction");
let auctionInstance = await Auction.deployed();
let tokenId = await auctionInstance.nftokenId();
await auctionInstance.auctionEnd();
let balance = await web3.eth.getBalance(auctionInstance.address);
balance = new BN(balance).div(frac);
console.log('auction balance end: ', balance.toString());
owner = await tokenInstance.ownerOf(tokenId);
console.log('owner after: ', owner);
callback()
} catch (e) {
callback(e);
}
};