这个代币提供了一种增加论坛活跃度的方法,用户可以在平台上发布对于某个帖子的评论任务,设置此次任务的 LDO 代币奖励,别的用户可以通过评论完成任务,领取 LDO 代币奖励
- 在各大插件商店安装 meta mask,这个工具用于和区块链进行交互
- 前往 https://sepolia-faucet.pk910.de/ 挖一些 sepolia 以太坊代币(只是模拟挖矿),用作交易 gas 费(因为只能使用 sepolia 以太坊作为 gas 费)
- 在 meta mask 手动切换为测试网络 sepolia
The first things you need to do are cloning this repository and installing its dependencies:
git clone https://github.com/NomicFoundation/hardhat-boilerplate.git
cd hardhat-boilerplate
npm install
Once installed, let's run Hardhat's testing network:
npx hardhat node
Then, on a new terminal, go to the repository's root folder and run this to deploy your contract:
npx hardhat run scripts/deploy.js --network localhost
在 sepolia 测试网部署
npx hardhat run scripts/deploy.js --network sepolia
Finally, we can run the frontend with:
cd frontend
pnpm install
pnpm dev
Last but not least, you can gain some test token:
npx hardhat --network localhost faucet <your-metamask-address>
Open http://localhost:3000/ to see your Dapp. You will
need to have Coinbase Wallet or Metamask installed and listening to
localhost 8545
.
http://127.0.0.1:8545 链 ID: 31337
npx hardhat console
const accounts = await ethers.getSigners();
console.log("Accounts:", accounts.map(account => account.address));
You can find detailed instructions on using this repository and many tips in its documentation.
- Writing and compiling contracts
- Setting up the environment
- Testing Contracts
- Setting up your wallet
- Hardhat's full documentation
For a complete introduction to Hardhat, refer to this guide.
This repository uses our recommended hardhat setup, by using our @nomicfoundation/hardhat-toolbox
. When you use this plugin, you'll be able to:
- Deploy and interact with your contracts using ethers.js and the
hardhat-ethers
plugin. - Test your contracts with Mocha, Chai and our own Hardhat Chai Matchers plugin.
- Interact with Hardhat Network with our Hardhat Network Helpers.
- Verify the source code of your contracts with the hardhat-etherscan plugin.
- Get metrics on the gas used by your contracts with the hardhat-gas-reporter plugin.
- Measure your tests coverage with solidity-coverage.
This project also includes a sample frontend/Dapp, which uses Create React App.
Invalid nonce
errors: if you are seeing this error on thenpx hardhat node
console, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed bySettings > Advanced > Clear activity tab data
.
Hardhat for Visual Studio Code is the official Hardhat extension that adds advanced support for Solidity to VSCode. If you use Visual Studio Code, give it a try!
If you need help with this project, or with Hardhat in general, please read this guide to learn where and how to get it.
For the latest news about Hardhat, follow us on Twitter, and don't forget to star our GitHub repository!
Happy building!