Skip to content

Instantly share code, notes, and snippets.

require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-ethers");
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract Vault {
// a contract where the owner create grant for a beneficiary;
//allows beneficiary to withdraw only when time elapse
//allows owner to withdraw before time elapse
//get information of a beneficiary
//amount of ethers in the smart contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
@title Counter Contract
@author Jesse Raymond
@notice This is a simple counter contract, where users can increment and decrement the value of the variable count(see below), once every 30 seconds.
@dev Key concepts in solidity i used:
- Modifier,
- Internal function,
@apow2
apow2 / axios.js
Last active June 27, 2023 06:20
use axios to get data from IPFS
import axios from "axios";
let myContract;
let init = async () => {
await ethStore.setProvider("https://api.avax-test.network/ext/bc/C/rpc");
await ethStore.setBrowserProvider();
let contract = await new $web3.eth.Contract(abi, contractAddress);
if ($chainId != 43113) {
alert("Warning: You are not connected to Avalanche Fuji test-net!");
}