Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Try Buidler! https://buidler.dev

Franco Zeoli fzeoli

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

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
View deploy.js
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 => {
View sample-test.js
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() {
View buidler.config.js
require("@nomiclabs/buidler-truffle5");
module.exports = {
solc: {version: "0.5.2"}
};
View buidler.config.js
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();
View buidler.config.js
extendEnvironment((env) => {
env.hi = "hello, buidler";
});
task("envtest", (args, env) => {
console.log(env.hi);
});
module.exports = {};
View buidler.config.js
extendEnvironment((env) => {
env.hi = "hello, buidler";
});
module.exports = {};
View buidler.config.js
usePlugin("@nomiclabs/buidler-web3");
task("balance", "Prints an account's balance")
.addParam("account", "The account's address")
module.exports = {};
View buidler.config.js
usePlugin("@nomiclabs/buidler-web3");
task("balance", "Prints an account's balance");
module.exports = {};
View buidler.config.js
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");
});