Skip to content

Commit 8075795

Browse files
committed
remove createGovernancevaa and use the custom path for deployment path
1 parent 5935c1d commit 8075795

File tree

5 files changed

+4
-142
lines changed

5 files changed

+4
-142
lines changed

contract_manager/scripts/common.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function deployIfNotCached(
3535
const key = cacheKey ?? `${chain.getId()}-${artifactName}`;
3636
return runIfNotCached(key, async () => {
3737
const artifact = JSON.parse(
38-
readFileSync(join(config.jsonOutputDir, `${artifactName}.json`), "utf8"),
38+
readFileSync(join(config.jsonOutputDir, `${artifactName}.sol`, `${artifactName}.json`), "utf8"),
3939
);
4040

4141
// Handle bytecode which can be either a string or an object with an 'object' property
@@ -74,7 +74,7 @@ export function getWeb3Contract(
7474
address: string,
7575
): Contract {
7676
const artifact = JSON.parse(
77-
readFileSync(join(jsonOutputDir, `${artifactName}.json`), "utf8"),
77+
readFileSync(join(jsonOutputDir, `${artifactName}.sol`, `${artifactName}.json`), "utf8"),
7878
);
7979
const web3 = new Web3();
8080
return new web3.eth.Contract(artifact["abi"], address);
@@ -84,7 +84,7 @@ export const COMMON_DEPLOY_OPTIONS = {
8484
"std-output-dir": {
8585
type: "string",
8686
demandOption: true,
87-
desc: "Path to the standard JSON output of the contracts (build artifact) directory",
87+
desc: "Path to the Foundry output directory (contains Contract.sol/Contract.json structure)",
8888
},
8989
"private-key": {
9090
type: "string",

target_chains/ethereum/contracts/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,6 @@ npm run receiver-submit-guardian-sets
101101

102102
This script submits the pre-configured mainnet guardian set upgrade VAAs to bring your contract up to date with the current mainnet guardian set.
103103

104-
### Utility Scripts
105-
106-
Additional utility scripts are available for testing and development:
107-
108-
#### Create Governance VAA (for testing)
109-
110-
```bash
111-
# Create a governance VAA for localnet testing
112-
GOVERNANCE_DATA=0x... npm run create-governance-vaa
113-
```
114-
115-
This script creates a properly signed governance VAA for local testing. You can customize it with environment variables:
116-
117-
- `TIMESTAMP` - VAA timestamp (defaults to current block timestamp)
118-
- `NONCE` - VAA nonce (defaults to 0)
119-
- `EMITTER_CHAIN_ID` - Chain ID of the emitter (defaults to 1)
120-
- `EMITTER_ADDRESS` - Address of the emitter (defaults to test address)
121-
- `SEQUENCE` - VAA sequence number (defaults to 0)
122-
- `GOVERNANCE_DATA` - The governance payload data (required)
123-
- `GUARDIAN_SET_INDEX` - Guardian set index (defaults to 0)
124-
- `CONSISTENCY_LEVEL` - Consistency level (defaults to 32)
125-
126104
### Gas Benchmarks
127105

128106
You can use foundry to run gas benchmark tests (which can be found in the `forge-test` directory). To run the tests with gas report

target_chains/ethereum/contracts/deploy.sh

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,7 @@ shift
2121

2222
if [ "$version" = "latest" ]; then
2323
echo "Deploying latest version"
24-
# Create a temporary directory for flattened contract artifacts
25-
contracts_dir="out/contracts"
26-
mkdir -p "$contracts_dir"
27-
28-
echo "Copying contract artifacts from Foundry output structure..."
29-
30-
# List of required contracts for EVM deployment
31-
contracts=(
32-
"PythUpgradable"
33-
"ERC1967Proxy"
34-
"ReceiverSetup"
35-
"WormholeReceiver"
36-
"ReceiverImplementation"
37-
)
38-
39-
# Copy each contract artifact
40-
for contract in "${contracts[@]}"; do
41-
source_file="./out/${contract}.sol/${contract}.json"
42-
dest_file="$contracts_dir/${contract}.json"
43-
44-
if [ -f "$source_file" ]; then
45-
cp "$source_file" "$dest_file"
46-
echo "✓ Copied ${contract}.json"
47-
else
48-
echo "Warning: ${contract}.json not found at $source_file"
49-
fi
50-
done
51-
stdoutputdir="$(pwd)/$contracts_dir"
24+
stdoutputdir="$(pwd)/out"
5225
else
5326
# make sure version has format of vX.Y.Z
5427
if [[ ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
@@ -78,11 +51,6 @@ if [ -n "${tmpdir:-}" ]; then
7851
rm -rf $tmpdir
7952
fi
8053

81-
# Clean up the contracts directory if we created it for the latest version
82-
if [ "$version" = "latest" ]; then
83-
rm -rf "out/contracts"
84-
echo "Cleaned up contracts directory"
85-
fi
8654

8755
if [ "$version" != "latest" ]; then
8856
echo "Verify the contracts by using the std-input artifacts of the contracts in https://github.com/pyth-network/pyth-crosschain/releases/tag/pyth-evm-contract-$version"

target_chains/ethereum/contracts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"deploy-and-verify": "forge script script/Deploy.s.sol --rpc-url testnet --broadcast --verify",
2020
"deploy-local": "ETHERSCAN_API_KEY= forge script script/Deploy.s.sol --slow --rpc-url local --broadcast -vvvv",
2121
"receiver-submit-guardian-sets": "forge script script/ReceiverSubmitGuardianSetUpgrades.s.sol --rpc-url $RPC_URL --broadcast",
22-
"create-governance-vaa": "forge script script/CreateLocalnetGovernanceVaa.s.sol",
2322
"install-forge-deps": "forge install foundry-rs/[email protected] --no-git",
2423
"coverage": "./coverage.sh",
2524
"test:format": "prettier --check .",

target_chains/ethereum/contracts/script/CreateLocalnetGovernanceVaa.s.sol

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

0 commit comments

Comments
 (0)