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
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); |
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
// 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 |
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
// 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, |
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
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!"); | |
} |