-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Etherform workflow improvements #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add ability to specify a Foundry profile when integrating Etherform workflows. The profile applies to deployment, upgrade safety, and verification steps, while CI tests run with the default profile (optimizer off) to avoid test failures. Profile validation catches undefined profiles early with helpful error messages. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
c5a35b6 to
3c3048e
Compare
🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Verification is now skipped if blockscout_url is not set in network config. This allows deploying to networks without Blockscout support. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Uses process substitution instead of pipe to properly track failures across loop iterations. The step now exits with error code 1 when any contract fails verification after 3 attempts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The --guess-constructor-args flag requires an RPC URL to fetch deployed bytecode and determine constructor arguments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Restructure _deploy-testnet.yml into two jobs (read-config + deploy) so environment: can reference the config output - Add read-testnet-config and read-mainnet-config jobs to _foundry-cicd.yml - Deploy jobs now use environment: from network config for secret resolution - Secrets (PRIVATE_KEY, RPC_URL) now resolve from GitHub Environments based on the "environment" field in deploy-networks.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace --guess-constructor-args with explicit constructor args extracted from broadcast file. This fixes verification for contracts that use external libraries. Changes: - Extract .arguments from broadcast transactions - Get constructor signature from contract ABI via forge inspect - Encode args with cast abi-encode - Pass encoded args to forge verify-contract --constructor-args - Remove --rpc-url (only needed for guessing) - Gracefully handle contracts without constructor args 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fix jq parse errors when processing constructor arguments: - Use jq -e to safely check if arguments array exists - Validate ABI JSON before parsing - Use mapfile to properly handle args with special characters - Pass args as bash array to preserve quoting for cast abi-encode This fixes "Invalid numeric literal" errors when arguments contain hex addresses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Convert multiline contract-paths input to properly formatted YAML list for dorny/paths-filter. This fixes the error: "can not read a block mapping entry; a multiline key may not be an implicit key" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@hudsonhrh can you demonstarte this working with a pr to the foundry-counter-upgradeable repo and include it in here? |
RonTuretzky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase off of #13
|
|
||
| # Extract and verify each deployed contract with retry logic | ||
| jq -c '.transactions[] | select(.transactionType == "CREATE")' "$BROADCAST_FILE" | while read -r tx; do | ||
| # Use process substitution to avoid subshell issues with variable tracking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this change? why is it necessary?
|
|
||
| echo "Verifying $CONTRACT_NAME at $CONTRACT_ADDR..." | ||
|
|
||
| # Build constructor args if present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this info not in the run-latest json?
| jobs: | ||
| deploy-testnet: | ||
| name: Deploy to Testnet | ||
| read-config: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we decoupling this so that it can be re-used for testnet/mainnet?
Summary
Major improvements to Etherform CI/CD workflows including deployment profiles, GitHub Environments support, and robust contract verification.
Features
Deployment Profiles (
deployment-foundry-profile)GitHub Environments Support
environment:from network config for per-network secrets"environment"field indeploy-networks.jsonRobust Contract Verification
blockscout_urlis omitted/empty in network config--guess-constructor-argsfailures)Commits
3ad9cf8_foundry-cicd.ymlreusable workflow3c3048edeployment-foundry-profileinput to all workflows58ddecd77f745e9d2381f7b38f11--guess-constructor-args)b9a5466f5b700ae82dcdbUsage
Network config with environments:
{ "testnets": [{ "name": "sepolia", "blockscout_url": "https://eth-sepolia.blockscout.com", "environment": "testnet-sepolia" }], "mainnets": [{ "name": "ethereum", "blockscout_url": "https://eth.blockscout.com", "environment": "production-ethereum" }] }closes #8, closes #7, closes #4
Tested with integration wit this repo https://github.com/PerpetualOrganizationArchitect/POP/actions/runs/19974105263/job/57286120003?pr=54
🤖 Generated with Claude Code