-
-
Save NaoyaTabakomori/987246aaa8c508286f6ed0d833803714 to your computer and use it in GitHub Desktop.
ChristmasStockingの解法(賄賂が渡っていることの確認)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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