Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for sepolia test #1060

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion basic/11-react-express-hardhat/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

```shell
yarn

#Node 版本: v20.11.0
```

- 选择创建一个简单的项目。添加一个名为 SimpleToken.sol 的合约到 ./contracts, 编译此合约并且运行测试
Expand All @@ -21,7 +23,7 @@ npx hardhat test
- 部署

```shell
npx hardhat run scripts/deploy.js --network goerli
npx hardhat run scripts/deploy.js --network sepolia
```

- 找到你的本地节点账户的私有 key 以及 token 地址,导入到 Metamask 中
Expand Down
5 changes: 4 additions & 1 deletion basic/11-react-express-hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

```shell
yarn

#Node Version: v20.11.0
```

- Create a simple project selected. Add contract names SimpleToken.sol to ./contracts and compile the contract to run testing.
Expand All @@ -34,10 +36,11 @@ yarn
node app.js
```

- Startup react
- Startup react (open new terminal)

```shell
cd frontend
#Please ensure that it is already present the HARDHAT_NETWORK_ ID in src/components/Dapp.js has been modified to the corresponding network ID
yarn
yarn start
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { receipt_create, receipt_list} from '../api.js'
// This is the Hardhat Network id, you might change it in the hardhat.config.js
// Here's a list of network ids https://docs.metamask.io/guide/ethereum-provider.html#properties
// to use when deploying to other networks.
const HARDHAT_NETWORK_ID = "42";

const HARDHAT_NETWORK_ID = "11155111"; //sepolia network ID
// This is an error code that indicates that the user canceled a transaction
const ERROR_CODE_TX_REJECTED_BY_USER = 4001;

Expand Down
8 changes: 2 additions & 6 deletions basic/11-react-express-hardhat/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ module.exports = {
(you can put in a mnemonic here to set the deployer locally)
*/
},
goerli: {
url: 'https://goerli.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
sepolia: {
url: 'https://sepolia.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
mainnet: {
url: 'https://mainnet.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
ropsten: {
url: 'https://ropsten.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
},
};
8 changes: 2 additions & 6 deletions basic/12-token-crowdfund/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,13 @@ module.exports = {
(you can put in a mnemonic here to set the deployer locally)
*/
},
goerli: {
url: 'https://goerli.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
sepolia: {
url: 'https://sepolia.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
mainnet: {
url: 'https://mainnet.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
ropsten: {
url: 'https://ropsten.infura.io/v3/' + process.env.INFURA_ID, //<---- YOUR INFURA ID! (or it won't work)
accounts: [mnemonic()],
},
},
};
Loading