Skip to content

Instantly share code, notes, and snippets.

@fzeoli
Last active May 15, 2019 15:41
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 fzeoli/58e76aa9429b73248921c4897e146823 to your computer and use it in GitHub Desktop.
Save fzeoli/58e76aa9429b73248921c4897e146823 to your computer and use it in GitHub Desktop.
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