This file contains hidden or 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 { anyValue } from "@nomicfoundation/hardhat-chai-matchers/withArgs"; | |
import { | |
time, | |
loadFixture, | |
} from "@nomicfoundation/hardhat-toolbox/network-helpers"; | |
import { expect } from "chai"; | |
import hre from "hardhat"; | |
// v3: import { network } from "hardhat" | |
// v3: const { ethers } = network.connect() |
This file contains hidden or 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.28; | |
import { Error } from "./lib/Error.sol"; | |
import { Event } from "./lib/Event.sol"; | |
import { console } from "forge-std/console.sol"; | |
contract CustomERC20 { | |
string private _name; |
This file contains hidden or 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.28; | |
import { Test } from "forge-std/Test.sol"; | |
import { console } from "forge-std/console.sol"; | |
import { CustomERC20 } from "../../contracts/CustomERC20.sol"; | |
import { Error } from "../../contracts/lib/Error.sol"; | |
import { Event } from "../../contracts/lib/Event.sol"; | |
contract CustomERC20Test is Test { |
This file contains hidden or 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
const ethers = require('ethers'); | |
const localStorage = require('localStorage'); | |
const axios = require('axios'); | |
function createHdWallet() { | |
const HdWallet = ethers.HDNodeWallet.createRandom(); | |
console.log(HdWallet); | |
// ethers.HDNodeWallet.fromSeed(HdWallet.mnemonic.computeSeed()) |
This file contains hidden or 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
const ethers = require('ethers'); | |
const localStorage = require('localStorage'); | |
function generateMnemonic() { | |
let randomEntropyBytes = ethers.utils.randomBytes(16); | |
return ethers.utils.entropyToMnemonic(randomEntropyBytes); | |
} | |
function createHdWallet() { |
This file contains hidden or 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
Implement contract inheritance, where the parent contract implements 3 setter functions, and two getter functions. The child contract should be able to override one of the parent contract. |
This file contains hidden or 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; | |
contract ParentContract { | |
uint256 public firstVal; | |
uint256 public secondVal; | |
string public stringVal; | |
function setFirstValue(uint256 _value) public virtual { | |
firstVal = _value; |