Skip to content

V3 adoption scripts - #44

Merged
DicksonWu654 merged 11 commits into
security-alliance:mainfrom
DicksonWu654:v3-adoption-scripts
Feb 1, 2026
Merged

V3 adoption scripts#44
DicksonWu654 merged 11 commits into
security-alliance:mainfrom
DicksonWu654:v3-adoption-scripts

Conversation

@DicksonWu654

Copy link
Copy Markdown
Contributor

No description provided.

- Introduced the AddChains script for adding chains to an existing Agreement contract, including JSON parsing and validation.
- Implemented unit tests for the AddChains script to ensure functionality for adding single and multiple chains, as well as handling edge cases like duplicate chains.
- Added a sample JSON file for testing chain addition scenarios.
- Introduced addChains.json and agreementDetails.json to provide sample data for chain addition and agreement specifications.
- Updated paths in AddChains and AdoptSafeHarbor scripts to reference the new example JSON files.
- Updated the test_addChains_multipleTimes function to reset the PROTOCOL_PRIVATE_KEY environment variable before each batch addition.
- This change ensures that the correct owner key is used consistently, preventing potential test failures due to environment changes.
…ripts

BAD AI. NO PK IN .ENV. DON'T ENBARRASS ME IN FRONT OF PATRICK

- Updated AddChains and AdoptSafeHarbor scripts to use msg.sender for ownership validation instead of relying on the PROTOCOL_PRIVATE_KEY environment variable.
- Adjusted documentation to reflect changes in environment variable usage and default JSON paths.
- Modified unit tests to remove unnecessary environment variable setups, ensuring cleaner test cases and consistent ownership handling.
…cripts

- Simplified function signatures in AddChains and AdoptSafeHarbor scripts for better clarity.
- Consolidated console log statements for consistent formatting.
- Removed unnecessary blank lines to enhance code cleanliness in unit tests.
- Reformatted envTest.json and parseTest.json files to enhance readability by structuring the JSON data with proper indentation and line breaks.
- This change improves clarity and maintainability of test data used in unit tests.
- Simplified function signatures and reduced unnecessary code in the AddChains script for improved readability.
- Updated JSON file reading methods to use vm.readFile for consistency.
- Enhanced unit tests by removing redundant environment variable setups and improving test data structure.
- Consolidated console log statements for better output formatting.
…ement creation

- Modified the AdoptSafeHarbor script to directly use the provided salt from the config instead of generating a new one based on the protocol name and timestamp.
- This change enhances the clarity and predictability of the agreement creation process.
- Replaced the previous test JSON file with a new agreement.json file containing updated protocol details.
- Adjusted test cases in AdoptSafeHarborTest to reference the new agreement.json path, ensuring consistency in JSON parsing.
- Removed outdated identity and invalid agreement JSON files to streamline test data.
…cripts

- Changed the method for checking JSON keys from vm.keyExists to vm.keyExistsJson for improved clarity and consistency in JSON handling.
- Adjusted the _parseBountyTerms function in AdoptSafeHarbor to be pure, enhancing its performance and clarity.
@DicksonWu654
DicksonWu654 merged commit ed10607 into security-alliance:main Feb 1, 2026
1 of 2 checks passed
@DicksonWu654
DicksonWu654 deleted the v3-adoption-scripts branch February 1, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant