Skip to content

DO NOT MERGE: Save cra receiver proxy - #211

Open
dmytro-horbatenko wants to merge 1 commit into
feat/bond-tokens-on-zerogfrom
feat/save-cre-receiver-proxy
Open

DO NOT MERGE: Save cra receiver proxy#211
dmytro-horbatenko wants to merge 1 commit into
feat/bond-tokens-on-zerogfrom
feat/save-cre-receiver-proxy

Conversation

@dmytro-horbatenko

Copy link
Copy Markdown
Contributor

No description provided.

@dmytro-horbatenko dmytro-horbatenko changed the title feat: save cra receiver proxy DO NOT MERGE: Save cra receiver proxy Apr 24, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the SaveCreReceiverProxy deployment infrastructure, including submodules, Hardhat plugin configurations, and a setup script. Feedback highlights an invalid Solidity version (0.8.33), an incorrect file path for the dependency compiler, and the need to use environment variables for the sources path to maintain build compatibility. Further improvements are suggested regarding hardcoded addresses, non-standard package versioning, and the brittle nature of patching submodules with sed.

Comment thread hardhat.config.ts
// directory and let `hardhat-dependency-compiler` pull
// `save/.../SaveCreReceiverProxy.sol` (forge remapping) in as the only graph.
// Main branch must NOT merge this; restore `sources: 'contracts'`.
sources: 'contracts-save-cre',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The sources path has been changed to contracts-save-cre, which disables the main project contracts. To make this configuration safe for merging and avoid breaking the build for other developers, consider using an environment variable to toggle the source directory.

Suggested change
sources: 'contracts-save-cre',
sources: process.env.DEPLOY_SAVE_CRE ? 'contracts-save-cre' : 'contracts',

Comment thread hardhat.config.ts
},
dependencyCompiler: {
paths: [
'save/contracts/src/save-cre-receiver-proxy/SaveCreReceiverProxy.sol',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The path for SaveCreReceiverProxy.sol appears to be missing the lib/ prefix. Since the submodule is located in lib/save, the path should reflect this to ensure the hardhat-dependency-compiler plugin can locate the file.

Suggested change
'save/contracts/src/save-cre-receiver-proxy/SaveCreReceiverProxy.sol',
'lib/save/contracts/src/save-cre-receiver-proxy/SaveCreReceiverProxy.sol',

Comment thread hardhat.config.ts
// upstream `llama-risk/save`'s `foundry.toml` (`optimizer`,
// `optimizer_runs`, `via_ir`) before mainnet deploy. Tracked in
// docs/superpowers/specs/2026-04-23-save-cre-receiver-proxy-mainnet-deploy-design.md §10.
version: '0.8.33',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Solidity version 0.8.33 is not a released version of the compiler. This will cause Hardhat to fail when attempting to download the compiler. Please use a valid version such as 0.8.23 or 0.8.28.

Comment on lines +11 to +13
const REGISTRY = '0x2D6e9F608807436DE5D9603B00Abe3FEd1Bc809d';
const EXPECTED_FORWARDER = '0x0b93082D9b3C7C97fAcd250082899BAcf3af3885';
const EXPECTED_AUTHOR = '0xFD1ebE54d435bDd9a81A4BF204756a20AeB7Ee71';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding addresses for REGISTRY, EXPECTED_FORWARDER, and EXPECTED_AUTHOR limits the script's usability across different environments. It is recommended to move these values to a configuration file or environment variables.

Comment on lines +61 to +62
sed -i 's|@openzeppelin/contracts/access/|@openzeppelin/contracts@5.0.2/access/|' "$proxy"
sed -i 's|@openzeppelin/contracts/utils/|@openzeppelin/contracts@5.0.2/utils/|' "$abs"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Modifying submodule files with sed is a brittle workaround for import conflicts. These changes are not persistent across submodule updates or resets. It is better to resolve these conflicts using Hardhat's remapping capabilities or by updating the upstream repository.

Comment thread package.json
"@layerzerolabs/oft-evm": "3.2.1",
"@layerzerolabs/toolbox-hardhat": "0.6.12",
"@nomicfoundation/hardhat-chai-matchers": "1.0.4",
"@nomicfoundation/hardhat-foundry": "hh2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The version alias "hh2" for @nomicfoundation/hardhat-foundry is non-standard and potentially confusing. It is recommended to use a standard semver range.

Suggested change
"@nomicfoundation/hardhat-foundry": "hh2",
"@nomicfoundation/hardhat-foundry": "^1.2.1",

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