Skip to content

Commit

Permalink
Update deploy env
Browse files Browse the repository at this point in the history
  • Loading branch information
yutou committed Apr 14, 2024
1 parent a6c055b commit 9e83d08
Show file tree
Hide file tree
Showing 9 changed files with 13,328 additions and 962 deletions.
7 changes: 0 additions & 7 deletions .env.example

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged && npm run build
# npx lint-staged && npm run build
67 changes: 4 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,7 @@
## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:
# deploy

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
```bash
npx hardhat run scripts/01-deploy.ts --network sepolia
```
16 changes: 11 additions & 5 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {HardhatUserConfig} from 'hardhat/config'
import {config as configENV} from 'dotenv'
import { HardhatUserConfig } from 'hardhat/config'
import { config as configENV } from 'dotenv'
import '@nomicfoundation/hardhat-foundry'
import '@nomicfoundation/hardhat-toolbox'
import '@openzeppelin/hardhat-upgrades'
import 'solidity-docgen'
import 'hardhat-deploy'

if (process.env.NODE_ENV !== 'PRODUCTION') {
configENV()
}
configENV()


const config: HardhatUserConfig = {
namedAccounts: {
Expand Down Expand Up @@ -86,6 +85,13 @@ const config: HardhatUserConfig = {
accounts: [process.env.PRIVATE_KEY!],
saveDeployments: true,
zksync: false
},
sepolia: {
chainId: 11155111,
url: process.env.SEPOLIA_RPC!,
accounts: [process.env.PRIVATE_KEY!, process.env.PRIVATE_KEY2!],
saveDeployments: true,
zksync: false
}
},
etherscan: {
Expand Down
Loading

0 comments on commit 9e83d08

Please sign in to comment.