-
Notifications
You must be signed in to change notification settings - Fork 7
Staging deployment #163
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
Open
RonTuretzky
wants to merge
19
commits into
dev
Choose a base branch
from
staging-deployment
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Staging deployment #163
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements issue #142 - adds CI/CD pipeline that automatically deploys all smart contracts to testnet on merge to dev branch. Features: - Triggers on push to dev branch - Builds contracts with forge build - Runs tests with fork testing - Deploys all 4 contracts: ButteredBread, YieldDistributor, NFTMultiplier, VotingStreakMultiplier - Uses GitHub Secrets for secure credential management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Generate deployment.json with contract addresses and timestamps - Add contract verification on block explorer with ETHERSCAN_API_KEY - Handle verification failures gracefully with status tracking - Upload deployment artifacts with 30-day retention - Update documentation with new secret requirements and artifact details 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
4 tasks
- Replace 'secrets.X \!= ""' with 'secrets.X' - Replace 'secrets.X == ""' with '\!secrets.X' - Fixes workflow parsing errors preventing PR #163 from running
- Remove problematic secret existence checks that cause parsing errors - Use GitHub context variables to detect fork PRs vs internal PRs - Move secret checks into bash conditionals within run steps - Add if-no-files-found: ignore to upload artifact step - Properly handle both fork PRs (no secrets) and internal PRs (with secrets)
- Add PRIVATE_KEY env var that deployment scripts expect
- Scripts use vm.envUint('PRIVATE_KEY') internally
- Keep TESTNET_PRIVATE_KEY for consistency but also set PRIVATE_KEY
- Capture both stdout and stderr from forge scripts - Check if output is valid JSON before parsing with jq - Display error output when deployment fails - Add informative status messages with emojis - Continue workflow even if individual deployments fail
- Use jq -e to properly check for valid JSON - Add fallback to empty string for jq errors - Check deployment.json exists before updating - Show output when deployment doesn't find contract address - Don't rely on forge script exit codes alone
- Use set +e/-e to capture exit codes without failing immediately - Check exit code before attempting JSON parsing - Always show forge script exit code for debugging - Ensure errors are visible in CI logs
- Add required environment variables for NFTMultiplier deployment - NFT_CONTRACT_ADDRESS, INITIAL_MULTIPLYING_FACTOR, VALID_UNTIL_BLOCK - Skip NFTMultiplier deployment if NFT_CONTRACT_ADDRESS not configured - Add continue-on-error to verification step - Use existing ETHERSCAN_API_KEY secret for contract verification
Major fixes: - Fix address extraction from forge script JSON output (use receipts array) - Add debug output to show contract addresses found in receipts - Track both proxy and implementation addresses separately - Verify implementation contracts (not just proxies) - Fix verification paths for NFTMultiplier and VotingStreakMultiplier - Add comprehensive error handling and debugging output - Display both proxy and implementation addresses in summary
- Extract ALL contract addresses from receipts array - Use array to properly handle multiple deployed contracts - Last address is proxy, second-to-last is implementation - Add fallback to returns[0].deployed_addresses if receipts empty - Show full JSON structure on debug for troubleshooting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Test plan