Skip to content

Conversation

@huyhuynh3103
Copy link
Contributor

Description

This pull request introduces several improvements to the artifact generation and deployment scripts, focusing on better error handling, output clarity, and minor usability enhancements. The most significant changes are the addition of JSON field sanitization to prevent invalid artifacts, improved logging, and the removal of unnecessary tracing pauses in Solidity libraries.

Artifact generation robustness and output improvements:

  • Added sanitize_json_field and sanitize_string_field helper functions in generate-artifact.sh to ensure that generated JSON fields are valid and to default to null or empty strings when fields are missing or invalid, preventing malformed artifacts.
  • Added a log statement to print the source_name variable in generate-artifact.sh for easier debugging and traceability.

Script usability enhancements:

  • Added the --color always flag to the forge script command in run.sh to ensure colored output, improving readability.
  • Removed the redundant contract compilation step (forge build) from run.sh, assuming contracts are already compiled or compilation is handled elsewhere.

Solidity library simplification:

  • Removed unnecessary vm.pauseTracing() and vm.resumeTracing() calls from LibArtifact.sol and LibDeploy.sol, simplifying the code and avoiding potential side effects from tracing state changes. [1] [2] [3]

Checklist

  • I have clearly commented on all the main functions following the NatSpec Format
  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works

@huyhuynh3103 huyhuynh3103 merged commit 1144c80 into mainnet Jan 12, 2026
1 check passed
@huyhuynh3103 huyhuynh3103 deleted the fix/enhance-artifact-generation branch January 12, 2026 04:35
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.

2 participants