Skip to content

Commit

Permalink
chore: actioned code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed Apr 16, 2024
1 parent 9d54089 commit 1dc2114
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion foundry/.env.arbitrum-one.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ETHERSCAN_API_KEY="" # this must be an arbiscan api key
FOX_TOKEN_ADDRESS=""
PRIVATE_KEY=""
RPC_URL="https://arbitrum-mainnet.infura.io/v3/$INFURA_API_KEY"
RPC_URL="https://arbitrum-mainnet.infura.io/v3/<INFURA_API_KEY>"
VERIFIER_URL="https://api.arbiscan.io/api"
2 changes: 1 addition & 1 deletion foundry/.env.arbitrum-sepolia.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ETHERSCAN_API_KEY="" # this must be an arbiscan api key
FOX_TOKEN_ADDRESS=""
PRIVATE_KEY=""
RPC_URL="https://arbitrum-sepolia.infura.io/v3/$INFURA_API_KEY"
RPC_URL="https://arbitrum-sepolia.infura.io/v3/<INFURA_API_KEY>"
VERIFIER_URL="https://api-sepolia.arbiscan.io/api"
2 changes: 1 addition & 1 deletion foundry/.env.mainnet.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ETHERSCAN_API_KEY=""
FOX_TOKEN_ADDRESS="0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d"
PRIVATE_KEY=""
RPC_URL="https://mainnet.infura.io/v3/$INFURA_API_KEY"
RPC_URL="https://mainnet.infura.io/v3/<INFURA_API_KEY>"
VERIFIER_URL="https://api.etherscan.io/api"
2 changes: 1 addition & 1 deletion foundry/.env.sepolia.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ETHERSCAN_API_KEY=""
FOX_TOKEN_ADDRESS=""
PRIVATE_KEY=""
RPC_URL="https://sepolia.infura.io/v3/$INFURA_API_KEY"
RPC_URL="https://sepolia.infura.io/v3/<INFURA_API_KEY>"
VERIFIER_URL="https://api-sepolia.etherscan.io/api"
31 changes: 26 additions & 5 deletions foundry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

1. Install foundry https://book.getfoundry.sh/getting-started/installation
2. Install slither `brew install slither-analyzer`
3. Set up .env files:
1. Copy an example .env file for your chosen environment:
```shell
cp .env.<your-chosen-env>.example .env.<your-chosen-env>
```
2. Fill in the needed env vars there

### Private key

To derive a private key 0 from your mnemonic:

```shell
cast wallet derive-private-key $MNEMONIC 0
cast wallet derive-private-key <YOUR_MNEMONIC> 0
```

### Faucets
Expand All @@ -25,17 +31,32 @@ https://faucet.circle.com/

## Deploying

### Local deployment
Deploying locally is different to deploying directly to a network for 2 reasons:
1. Its being deployed to a fork of another network (typically ethereum mainnet) rather than a real network.
2. There's no local instance of etherscan, so etherscan verification is skipped.
When deploying locally, it's necessary to start a local fork before deploying:

```shell
# RPC_URL for your env can be accessible with `source .env.<your-chosen-env`.
anvil --rpc-url $RPC_URL
```

### Deployment steps

```shell
cd foundry
# Install
make install
forge install
# Deploy
./deploy.sh --env arbitrum-sepolia
./deploy.sh --env <your-chosen-env>
# Test the contract deployed
cast call $CONTRACT_PROXY_ADDRESS "version()(uint256)" --rpc-url https://arbitrum-sepolia.infura.io/v3/$INFURA_API_KEY
# Test the proxy contract has been deployed with the correct version.
# RPC_URL for your env can be accessible with `source .env.<your-chosen-env`.
cast call <CONTRACT_PROXY_ADDRESS> "version()(uint256)" --rpc-url $RPC_URL
```

### Manually verifying
Expand Down

0 comments on commit 1dc2114

Please sign in to comment.