Skip to content

Commit

Permalink
Merge pull request #1060 from Alex992Y/main
Browse files Browse the repository at this point in the history
for sepolia test
  • Loading branch information
yingjingyang authored Mar 22, 2024
2 parents 84a440c + 73cdd7f commit 9f451e9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
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()],
},
},
};

0 comments on commit 9f451e9

Please sign in to comment.