Skip to content

Commit 0dfb476

Browse files
committed
pre-requisities for running the build
1 parent eff8c1e commit 0dfb476

File tree

6 files changed

+52
-220
lines changed

6 files changed

+52
-220
lines changed

target_chains/ethereum/contracts/.env.template

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,3 @@ WORMHOLE_CHAIN_NAME=YOUR_CHAIN_NAME_HERE
6868
# Example: CLUSTER=mainnet
6969
CLUSTER=YOUR_CLUSTER_HERE
7070

71-
# =============================================================================
72-
# EXAMPLE VALUES FOR REFERENCE
73-
# =============================================================================
74-
#
75-
# For local testing (Anvil), you can use:
76-
# PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
77-
# RPC_URL=http://localhost:8545
78-
# INIT_SIGNERS=0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5
79-
# INIT_CHAIN_ID=2
80-
# INIT_GOV_CHAIN_ID=1
81-
# INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
82-
#
83-
# For testnet/mainnet deployment:
84-
# - Get your private key from your wallet (never commit this!)
85-
# - Use appropriate RPC URL (Alchemy, Infura, QuickNode, etc.)
86-
# - Get Etherscan API key from https://etherscan.io/apis
87-
# - Use actual guardian addresses from your network
88-
# - Set proper chain IDs and governance contracts
89-
#
90-
# ⚠️ SECURITY WARNING: Never commit your actual .env file to version control!

target_chains/ethereum/contracts/.env.test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# =============================================================================
22
# FOUNDRY TEST CONFIGURATION
33
# This file contains test values for local development and testing
4-
# Uses Foundry-native environment variable formats
54
# =============================================================================
65

76
# Deployment Configuration (Anvil/Local Testing)
@@ -13,7 +12,7 @@ ETHERSCAN_API_KEY=test_api_key_not_needed_for_local
1312
# WORMHOLE TEST CONFIGURATION
1413
# =============================================================================
1514

16-
# Guardian Configuration (comma-separated addresses - Foundry native)
15+
# Guardian Configuration (comma-separated addresses)
1716
INIT_SIGNERS=0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5,0x025ceeba2ab2a27d53d963393999eeebe83dc4ae
1817
INIT_CHAIN_ID=2
1918
INIT_GOV_CHAIN_ID=1

target_chains/ethereum/contracts/FOUNDRY_ENV_GUIDE.md

Lines changed: 0 additions & 190 deletions
This file was deleted.

target_chains/ethereum/contracts/README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ This directory contains The Pyth contract on Ethereum and utilities to deploy it
44

55
## Installation
66

7-
The contracts are built and tested using Foundry. Follow the [Foundry installation instructions](https://book.getfoundry.sh/getting-started/installation) to install it if you do not already have it.
7+
The contracts are built and tested using Foundry. You can either:
8+
9+
1. **Use the setup script (recommended)**:
10+
Go to the `contracts` directory and Run `npm run setup` to automatically install Foundry v0.3.0 AND all forge dependencies.
11+
12+
2. **Manual installation**:
13+
a) Follow the [Foundry installation instructions](https://book.getfoundry.sh/getting-started/installation) and install version v0.3.0.
14+
15+
b) Next, from the `contracts` directory, run the following command to install forge dependencies:
16+
17+
```
18+
npm run install-forge-deps
19+
```
820

921
Next, run the following command from the repo root to install required dependencies for the contract:
1022

@@ -13,11 +25,7 @@ pnpm i
1325
pnpm turbo build --filter @pythnetwork/pyth-evm-contract
1426
```
1527

16-
Next, from the `contracts` directory, run the following command to install forge dependencies:
1728

18-
```
19-
npm run install-forge-deps
20-
```
2129

2230
## Testing
2331

@@ -34,7 +42,7 @@ npm run coverage
3442

3543
Open `coverage/index.html` in your web browser to see the results.
3644

37-
## Deployment
45+
## Deployment and Governance tests
3846

3947
To deploy the contracts, you'll need to set up your environment variables and use the Foundry deployment script.
4048

@@ -55,7 +63,13 @@ anvil
5563
npm run deploy-local
5664
```
5765

58-
3. Deploy to a live network:
66+
3. Run the test suite:
67+
68+
```bash
69+
npm run test
70+
```
71+
72+
4. Deploy to a live network:
5973

6074
```bash
6175
# Make sure your .env file has the correct RPC_URL and PRIVATE_KEY

target_chains/ethereum/contracts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"prettier-plugin-solidity": "catalog:"
1212
},
1313
"scripts": {
14+
"setup-foundry": "./setup-foundry.sh",
15+
"setup": "npm run setup-foundry && npm run install-forge-deps",
1416
"build": "forge build",
1517
"test": "forge test",
16-
"test-contract": "forge test",
1718
"deploy": "forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast --verify",
1819
"deploy-local": "forge script script/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast",
1920
"sync-guardian-sets": "forge script script/SyncGuardianSets.s.sol --rpc-url $RPC_URL --broadcast",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Complete Forge setup script - installs Foundry and dependencies
3+
set -e
4+
5+
FOUNDRY_VERSION="v0.3.0"
6+
7+
echo "Setting up complete Forge environment with Foundry ${FOUNDRY_VERSION}..."
8+
9+
# Check if foundryup is available
10+
if ! command -v foundryup &> /dev/null; then
11+
echo "Installing foundryup..."
12+
curl -L https://foundry.paradigm.xyz | bash
13+
export PATH="$HOME/.foundry/bin:$PATH"
14+
fi
15+
16+
# Install the specific version
17+
echo "Installing Foundry ${FOUNDRY_VERSION}..."
18+
foundryup --version $FOUNDRY_VERSION
19+
20+
# Verify installation
21+
echo "Verifying installation..."
22+
forge --version
23+
cast --version
24+
anvil --version
25+
26+
echo "Foundry ${FOUNDRY_VERSION} installed successfully!"
27+
28+
echo "Setup complete! You can now run install-forge-deps."

0 commit comments

Comments
 (0)