-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: createX #11
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
Merged
Merged
Feat: createX #11
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
707da40
feat: integrate CreateX for proxy deployment in RLCAdapter and RLCOFT…
Le-Caignec 3a4cc1e
feat: update deployment scripts to return proxy addresses and add min…
Le-Caignec 05e40b5
feat: integrate CreateX for deploying RLCOFT implementation and proxy…
Le-Caignec 9664fea
feat: add fuzz testing for RLCOFT deployment and address uniqueness
Le-Caignec 8d2ba71
Merge remote-tracking branch 'origin/main' into feature/use-createX-f…
Le-Caignec 5aed93c
chore: update openzeppelin-contracts subproject commit reference
Le-Caignec cfa4745
feat: remove unnecessary whitespace in RLCOFT.t.sol
Le-Caignec 58950d5
feat: refactor and consolidate RLCOFT and RLCAdapter test scripts; re…
Le-Caignec cd26bae
feat: rename RLCOFT test contracts to RLCAdapter and update deploymen…
Le-Caignec 9c2fc99
Merge remote-tracking branch 'origin/main' into feature/use-createX-f…
Le-Caignec 54c902d
Merge branch 'main' into feature/use-createX-for-deployment
Le-Caignec 6649103
feat: add CREATE2 factory configuration and new deployment tests
Le-Caignec 7f54cbc
refactor: remove CREATE2 factory configuration and update deployment …
Le-Caignec a9d5123
feat: integrate CreateX factory for RLCAdapter and RLCOFT deployments
Le-Caignec f760673
refactor: move token name and symbol to state variables in RLCOFTTest
Le-Caignec fb01895
feat: update RLCAdapterScriptTest and RLCOFTMock to integrate CreateX…
Le-Caignec 99e7b4a
feat: refactor RLCOFT deployment logic to use RLCOFTDeployer for Crea…
Le-Caignec 315cc38
feat: update RLCOFTScriptTest to use constants for LayerZero endpoint…
Le-Caignec 2b9e957
refactor: update RLCAdapterScriptTest to use constants for token and …
Le-Caignec 783873e
feat: update RLCAdapter deployment logic to utilize CreateX for contr…
Le-Caignec 16301c9
feat: update GitHub Actions workflow and Makefile for improved test c…
Le-Caignec 1465285
clean import
Le-Caignec bf7703a
fix: stack too deep issue
Le-Caignec 0e36162
chore: add TODO for via_ir implementation in foundry.toml
Le-Caignec ec098fb
fix: update comments to English for consistency in RLCOFTDeployer lib…
Le-Caignec 624d837
fix: update comments to English for consistency in RLCAdapterScript a…
Le-Caignec 5316cde
fix: improve console logs for proxy deployment in RLCAdapter and RLCO…
Le-Caignec 041ad65
refactor: replace RLCOFTDeployer with UUPSProxyDeployer for contract …
Le-Caignec debca96
fix: remove createXFactory parameter from deploy functions in RLCAdap…
Le-Caignec 0819cff
fix: remove unused imports from RLCAdapter and RLCOFT scripts
Le-Caignec 0d09cbd
fix: update CREATE_X_FACTORY environment variable setup in RLCOFTTest
Le-Caignec 5b86ee7
fix: update environment variable name for CreateX factory in RLCOFTTest
Le-Caignec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ docs/ | |
| .last_deploy.json | ||
|
|
||
| .idea | ||
| .DS_Store | ||
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // SPDX-FileCopyrightText: 2025 IEXEC BLOCKCHAIN TECH <[email protected]> | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.22; | ||
|
|
||
| import {console} from "forge-std/console.sol"; | ||
| import {Vm} from "forge-std/Vm.sol"; | ||
| import {StdConstants} from "forge-std/StdConstants.sol"; | ||
| import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
| import {ICreateX} from "@createx/contracts/ICreateX.sol"; | ||
|
|
||
| /// @notice Utility library for deploying UUPS proxy contracts and their implementations using the CreateX Factory | ||
| library UUPSProxyDeployer { | ||
| /// @dev Reference to the VM cheat codes from forge-std | ||
| Vm private constant vm = StdConstants.VM; | ||
|
|
||
| /// @notice Deploys a UUPS proxy contract and its implementation using the CreateX Factory | ||
| /// @param contractName The name of the contract to deploy (used to fetch creation code) | ||
| /// @param constructorData The constructor arguments for the implementation contract | ||
| /// @param initializeData The initialization data for the proxy contract | ||
| /// @param createXFactory The address of the CreateX factory | ||
| /// @param salt The salt for deterministic deployment | ||
| /// @return The address of the deployed proxy | ||
| function deployUUPSProxyWithCreateX( | ||
| string memory contractName, | ||
| bytes memory constructorData, | ||
| bytes memory initializeData, | ||
| address createXFactory, | ||
| bytes32 salt | ||
| ) internal returns (address) { | ||
| // CreateX Factory instance | ||
| ICreateX createX = ICreateX(createXFactory); | ||
| address implementation = deployImplementationWithCreateX(contractName, constructorData, createX, salt); | ||
|
|
||
| // Deploy the proxy contract using CreateX Factory | ||
| address proxy = createX.deployCreate2AndInit( | ||
| salt, // salt | ||
| abi.encodePacked(type(ERC1967Proxy).creationCode, abi.encode(implementation, "")), // initCode | ||
| initializeData, // data for initialize | ||
| ICreateX.Values({constructorAmount: 0, initCallAmount: 0}) // values for CreateX | ||
| ); | ||
| console.log("UUPS Proxy deployed at:", proxy); | ||
|
|
||
| return proxy; | ||
| } | ||
|
|
||
| /// @notice Deploys the implementation contract using the CreateX Factory | ||
| /// @param contractName The name of the contract to deploy (used to fetch creation code) | ||
| /// @param constructorData The constructor arguments for the implementation contract | ||
| /// @param createXFactory The address of the CreateX factory | ||
| /// @param salt The salt for deterministic deployment | ||
| /// @return The address of the deployed implementation contract | ||
| function deployImplementationWithCreateX( | ||
| string memory contractName, | ||
| bytes memory constructorData, | ||
| ICreateX createXFactory, | ||
| bytes32 salt | ||
| ) internal returns (address) { | ||
| // Deploy the implementation contract using CreateX Factory | ||
| bytes memory creationCode = StdConstants.VM.getCode(contractName); | ||
| address implementation = createXFactory.deployCreate2(salt, abi.encodePacked(creationCode, constructorData)); | ||
| console.log("Implementation deployed at:", implementation); | ||
|
|
||
| return implementation; | ||
| } | ||
| } |
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
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
Oops, something went wrong.
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.
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.
Split tests for better issues isolation