Skip to content

Instantly share code, notes, and snippets.

@NaoyaTabakomori
Created December 27, 2018 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaoyaTabakomori/987246aaa8c508286f6ed0d833803714 to your computer and use it in GitHub Desktop.
Save NaoyaTabakomori/987246aaa8c508286f6ed0d833803714 to your computer and use it in GitHub Desktop.
ChristmasStockingの解法(賄賂が渡っていることの確認)
var fs = require('fs');
var Web3 = require('web3');
var web3 = new Web3('wss://ropsten.infura.io/ws');
var christmasStockingABI = JSON.parse(fs.readFileSync('./build/contracts/ChristmasStocking.json')).abi;
var christmasStockingAddress = '0x408F56C4541BD00Ec836102d06F7Ee6A2A820678';
var christmasStocking = new web3.eth.Contract(christmasStockingABI, christmasStockingAddress);
var address = 'your address';
var privkey = 'your priv key';
checkStocking();
async function checkStocking() {
balance = await christmasStocking.methods.balanceOf(address).call();
console.log(balance);
web3.currentProvider.connection.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment