Last active
May 15, 2019 15:41
-
-
Save fzeoli/58e76aa9429b73248921c4897e146823 to your computer and use it in GitHub Desktop.
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
usePlugin("@nomiclabs/buidler-web3"); | |
task("balance", "Prints an account's balance") | |
.addParam("account", "The account's address") | |
.setAction(async taskArgs => { | |
const account = web3.utils.toChecksumAddress(taskArgs.account); | |
const balance = await web3.eth.getBalance(account); | |
console.log(web3.utils.fromWei(balance, "ether"), "ETH"); | |
}); | |
module.exports = {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment