Through the use of this smart contract, you can raise money.
- git
- You'll know you did it right if you can run
git --version
and get an ouput likegit version x.x.x
- You'll know you did it right if you can run
- Nodejs
- You'll know you've installed nodejs right if you can run
node --version
and get an ouput like:vx.x.x
- You'll know you've installed nodejs right if you can run
- Yarn
- You'll know you've installed yarn right if you can run
yarn --version
and get an output like:x.x.x
- You might need to install it with npm if you are facing any issues.
- You'll know you've installed yarn right if you can run
git clone https://github.com/Devankit2022/Hardhat-Fund-Me.git
cd Hardhat-Fund-Me
yarn
yarn hardhat deploy
yarn hardhat test
yarn hardhat coverage
You'll want to set your SEPOLIA_RPC_URL
and PRIVATE_KEY
as environment variables. You can add them to a .env
file.
-
PRIVATE_KEY
: The private key of your account (like from metamask). -
SEPOLIA_RPC_URL
: This is url of the seplia testnet node you're working with. You can get setup with one for free from Alchemy
Head over to SEPOLIA FAUCET and get some tesnet ETH. You should see the ETH show up in your metamask.
yarn hardhat deploy --network sepolia
After deploy to a testnet or local net, you can run the scripts.
yarn hardhat run scripts/fund.js
or
yarn hardhat run scripts/withdraw.js
You can estimate how much gas things cost by running the test command, and you'll see and output file called gas-report.txt
yarn hardhat test
To get a USD estimation of gas cost, you'll need a COINMARKETCAP_API_KEY
environment variable. You can get one for free from CoinMarketCap.
If you deploy to a testnet or mainnet, you can verify it if you get an API Key from Etherscan and set it as an environemnt variable named ETHERSCAN_API_KEY
In it's current state, if you have your api key set, it will auto verify using
yarn hardhat deploy
solhint installation.
To check linting / code formatting:
yarn lint
or, to fix:
yarn lint:fix
yarn format