@lambdalf-dev/ethereum-contracts
v3.0.0
Published
An alternative to Open Zeppelin contracts for deployment with cheaper gas cost
Downloads
183
Readme
Ethereum Contracts
This project is an attempt to create a more efficient implementation of the common interface IERC721 compared to Open Zeppelin's implementation.
Installation
Hardhat
Run npm install
in the command line to install the list of dependencies.
Foundry
Ensure you have rust installed. Afterwards, follow the installation guide to install Foundry (https://book.getfoundry.sh/getting-started/installation). Finally, run the following command to install the necessary libraries for forge testing.
git submodule update --init --recursive
Commands
Hardhat
npx hardhat help
Display Hardhat help sectionnpx hardhat clean
Cleans hardhat generated filesnpx hardhat compile
Compiles the contract and generate artifactsnpx hardhat test
Runs the test suite and generate a gas usage reportnpx hardhat coverage
Runs the test suite and generates a coverage reportnpx hardhat check
Runs the linter testnpx hardhat run scripts/deployTest.js --network goerli
Runs the deployment script on Goerli testnet (requires ALCHEMY_API_KEY and TEST_PRIVATE_KEY)npx hardhat verify <contract address> --network goerli [constructor parameters]
Verify the contract on Goerli testnet (requires ETHERSCAN_API_KEY)npx hardhat run scripts/deploy.js --network mainnet
Runs the deployment script on Ethereum mainnet (requires ALCHEMY_API_KEY and PRIVATE_KEY)npx hardhat verify <contract address> --network mainnet [constructor parameters]
Verify the contract on Ethereum mainnet (requires ETHERSCAN_API_KEY)npx hardhat generate-proofs
Generate a set of proofs for the list of addresses saved in/generate-proofs/whitelist.js
(requires SIGNER_PRIVATE_KEY and SIGNER_ADDRESS)npx hardhat generate-proofs-hardhat
Generate a set of proofs for each hardhat signernpx hardhat create-wallet
Creates a brand new wallet and displays its Private Key and Address on the console
Foundry
forge test
Run all tests under test/foundryforge test -m <TEST NAME>
Run only tests with the following TEST_NAMEforge test -v
Run tests (or single tests with-m
) in verbose mode. This can be extended to-vvvvv
for the most amount of verbosityforge test --debug <TEST_NAME>
Run TEST_NAME in debuggerforge coverage --report debug
Run test coverage and generate coverage report in command lineforge coverage --report lcov
Run test coverage and generate coverage report file
Contents
contracts
: The list of contracts included in the library.create-wallet
: A hardhat task that creates a new wallet and displays its address and private key on the command line.generate-proofs
: A hardhat task to generate a list of proofs to work with theWhitelist
contract. Requires setting a whitelist.js file that is not included.lib
: A list of libraries necessary to run forge test suite.snapshot
: A hardhat task that creates a snapshot of a collection.test/hardhat
: The hardhat test suite for the library.test/foundry
: The foundry test suite for the library.