Skip to content

Instantly share code, notes, and snippets.

View fzeoli's full-sized avatar
💭
Try Buidler! https://buidler.dev

Franco Zeoli fzeoli

💭
Try Buidler! https://buidler.dev
View GitHub Profile

Instructions

  1. Double check your eligibility. If you are not in this list of github IDs, you will not be included in the claim process
  2. Click the Fork button on the top right of this page

Group_1

  1. Edit the newly forked gist
  2. Delete all text
  3. Paste in the the Public ID you generated at https://gov.element.fi/zk/github
async function main() {
const Greeter = artifacts.require("Greeter");
const greeter = await Greeter.new("Hello, Buidler!");
console.log("Greeter deployed to:", greeter.address);
}
main()
.then(() => process.exit(0))
.catch(error => {
const assert = require("assert");
describe("Ethereum provider", function() {
it("Should return the accounts", async function() {
const accounts = await ethereum.send("eth_accounts");
assert(accounts.length !== 0, "No account was returned");
});
});
contract("Greeter", function() {
require("@nomiclabs/buidler-truffle5");
module.exports = {
solc: {version: "0.5.2"}
};
extendEnvironment((env) => {
const wrapper = new EthersProviderWrapper(env.ethereum);
env.ethers = {
provider: wrapper,
getContract: async function (name) {
const artifact = await readArtifact(env.config.paths.artifacts, name);
const bytecode = artifact.bytecode;
const signers = await env.ethers.signers();
extendEnvironment((env) => {
env.hi = "hello, buidler";
});
task("envtest", (args, env) => {
console.log(env.hi);
});
module.exports = {};
extendEnvironment((env) => {
env.hi = "hello, buidler";
});
module.exports = {};
usePlugin("@nomiclabs/buidler-web3");
task("balance", "Prints an account's balance")
.addParam("account", "The account's address")
module.exports = {};
usePlugin("@nomiclabs/buidler-web3");
task("balance", "Prints an account's balance");
module.exports = {};
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");
});