Skip to content

Commit

Permalink
Merge pull request #667 from lukso-network/develop
Browse files Browse the repository at this point in the history
chore(release): v0.11.0-rc.1
  • Loading branch information
CJ42 authored Aug 8, 2023
2 parents 80b85d1 + 9db488a commit 3889bcd
Show file tree
Hide file tree
Showing 12 changed files with 609 additions and 601 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.11.0-rc.1](https://github.com/lukso-network/lsp-smart-contracts/compare/v0.1...v0.11.0-rc.1) (2023-08-08)

### ⚠ BREAKING CHANGES

- refactor: rename LSP23 to LinkedContractsFactory (#658)

### Bug Fixes

- build: add LSP23 in artifacts (#662)
- failing tests for lsp23 + add LSP23 test suite in CI ([#657](https://github.com/lukso-network/lsp-smart-contracts/issues/657)) ([0e5d9bf](https://github.com/lukso-network/lsp-smart-contracts/commit/0e5d9bf7f9b212976f5c754b28f96b37a8039076))

## [0.11.0-rc.0](https://github.com/lukso-network/lsp-smart-contracts/compare/v0.10.3...v0.11.0-rc.0) (2023-08-04)

### ⚠ BREAKING CHANGES
Expand Down
174 changes: 174 additions & 0 deletions contracts/LSP23LinkedContractsDeployment/ILinkedContractsFactory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ILinkedContractsFactory {
event DeployedContracts(
address indexed primaryContract,
address indexed secondaryContract,
PrimaryContractDeployment primaryContractDeployment,
SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
);

event DeployedERC1167Proxies(
address indexed primaryContract,
address indexed secondaryContract,
PrimaryContractDeploymentInit primaryContractDeploymentInit,
SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
);

/**
* @param salt A unique value used to ensure each created proxies are unique. (Can be used to deploy the contract at a desired address.)
* @param fundingAmount The value to be sent with the deployment transaction.
* @param creationBytecode The bytecode of the contract with the constructor params.
*/
struct PrimaryContractDeployment {
bytes32 salt;
uint256 fundingAmount;
bytes creationBytecode;
}

/**
* @param fundingAmount The value to be sent with the deployment transaction.
* @param creationBytecode The constructor + runtime bytecode (without the primary contract's address as param)
* @param addPrimaryContractAddress If set to `true`, this will append the primary contract's address + the `extraConstructorParams` to the `creationBytecode`.
* @param extraConstructorParams Params to be appended to the `creationBytecode` (after the primary contract address) if `addPrimaryContractAddress` is set to `true`.
*/
struct SecondaryContractDeployment {
uint256 fundingAmount;
bytes creationBytecode;
bool addPrimaryContractAddress;
bytes extraConstructorParams;
}

/**
* @param salt A unique value used to ensure each created proxies are unique. (Can be used to deploy the contract at a desired address.)
* @param fundingAmount The value to be sent with the deployment transaction.
* @param implementationContract The address of the contract that will be used as a base contract for the proxy.
* @param initializationCalldata The calldata used to initialise the contract. (initialization should be similar to a constructor in a normal contract.)
*/
struct PrimaryContractDeploymentInit {
bytes32 salt;
uint256 fundingAmount;
address implementationContract;
bytes initializationCalldata;
}

/**
* @param fundingAmount The value to be sent with the deployment transaction.
* @param implementationContract The address of the contract that will be used as a base contract for the proxy.
* @param initializationCalldata The first part of the initialisation calldata, everything before the primary contract address.
* @param addPrimaryContractAddress If set to `true`, this will append the primary contract's address + the `extraInitializationParams` to the `initializationCalldata`.
* @param extraInitializationParams Params to be appended to the `initializationCalldata` (after the primary contract address) if `addPrimaryContractAddress` is set to `true`
*/
struct SecondaryContractDeploymentInit {
uint256 fundingAmount;
address implementationContract;
bytes initializationCalldata;
bool addPrimaryContractAddress;
bytes extraInitializationParams;
}

/**
* @dev Deploys a primary and a secondary linked contract.
* @notice Contracts deployed. Contract Address: `primaryContractAddress`. Primary Contract Address: `primaryContractAddress`
*
* @param primaryContractDeployment Contains the needed parameter to deploy a contract. (`salt`, `fundingAmount`, `creationBytecode`)
* @param secondaryContractDeployment Contains the needed parameter to deploy the secondary contract. (`fundingAmount`, `creationBytecode`, `addPrimaryContractAddress`, `extraConstructorParams`)
* @param postDeploymentModule The module to be executed after deployment
* @param postDeploymentModuleCalldata The data to be passed to the post deployment module
*
* @return primaryContractAddress The address of the primary contract.
* @return secondaryContractAddress The address of the secondary contract.
*/
function deployContracts(
PrimaryContractDeployment calldata primaryContractDeployment,
SecondaryContractDeployment calldata secondaryContractDeployment,
address postDeploymentModule,
bytes calldata postDeploymentModuleCalldata
)
external
payable
returns (
address primaryContractAddress,
address secondaryContractAddress
);

/**
* @dev Deploys proxies of a primary contract and a secondary linked contract
* @notice Contract proxies deployed. Primary Proxy Address: `primaryContractAddress`. Secondary Contract Proxy Address: `secondaryContractAddress`
*
* @param primaryContractDeploymentInit Contains the needed parameters to deploy a proxy contract. (`salt`, `fundingAmount`, `implementationContract`, `initializationCalldata`)
* @param secondaryContractDeploymentInit Contains the needed parameters to deploy the secondary proxy contract. (`fundingAmount`, `implementationContract`, `addPrimaryContractAddress`, `initializationCalldata`, `extraInitializationParams`)
* @param postDeploymentModule The module to be executed after deployment.
* @param postDeploymentModuleCalldata The data to be passed to the post deployment module.
*
* @return primaryContractAddress The address of the deployed primary contract proxy
* @return secondaryContractAddress The address of the deployed secondary contract proxy
*/
function deployERC1167Proxies(
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
SecondaryContractDeploymentInit
calldata secondaryContractDeploymentInit,
address postDeploymentModule,
bytes calldata postDeploymentModuleCalldata
)
external
payable
returns (
address primaryContractAddress,
address secondaryContractAddress
);

/**
* @dev Computes the addresses of a primary contract and a secondary linked contract
*
* @param primaryContractDeployment Contains the needed parameter to deploy the primary contract. (`salt`, `fundingAmount`, `creationBytecode`)
* @param secondaryContractDeployment Contains the needed parameter to deploy the secondary contract. (`fundingAmount`, `creationBytecode`, `addPrimaryContractAddress`, `extraConstructorParams`)
* @param postDeploymentModule The module to be executed after deployment
* @param postDeploymentModuleCalldata The data to be passed to the post deployment module
*
* @return primaryContractAddress The address of the deployed primary contract.
* @return secondaryContractAddress The address of the deployed secondary contract.
*/
function computeAddresses(
PrimaryContractDeployment calldata primaryContractDeployment,
SecondaryContractDeployment calldata secondaryContractDeployment,
address postDeploymentModule,
bytes calldata postDeploymentModuleCalldata
)
external
view
returns (
address primaryContractAddress,
address secondaryContractAddress
);

/**
* @dev Computes the addresses of a primary and a secondary linked contracts proxies to be created
*
* @param primaryContractDeploymentInit Contains the needed parameters to deploy a primary proxy contract. (`salt`, `fundingAmount`, `implementationContract`, `initializationCalldata`)
* @param secondaryContractDeploymentInit Contains the needed parameters to deploy the secondary proxy contract. (`fundingAmount`, `implementationContract`, `addPrimaryContractAddress`, `initializationCalldata`, `extraInitializationParams`)
* @param postDeploymentModule The module to be executed after deployment.
* @param postDeploymentModuleCalldata The data to be passed to the post deployment module.
*
* @return primaryContractAddress The address of the deployed primary contract proxy
* @return secondaryContractAddress The address of the deployed secondary contract proxy
*/
function computeERC1167Addresses(
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
SecondaryContractDeploymentInit
calldata secondaryContractDeploymentInit,
address postDeploymentModule,
bytes calldata postDeploymentModuleCalldata
)
external
view
returns (
address primaryContractAddress,
address secondaryContractAddress
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.4;

interface IPostDeploymentModule {
function executePostDeployment(
address ownerControlledContract,
address ownerContract,
address primaryContract,
address secondaryContract,
bytes calldata calldataToPostDeploymentModule
) external;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ error InvalidValueSum();

/**
* @dev Reverts when the deployment & intialisation of the contract has failed.
* @notice Failed to deploy & initialise the Controlled Contract Proxy. Error: `errorData`.
* @notice Failed to deploy & initialise the Primary Contract Proxy. Error: `errorData`.
*
* @param errorData Potentially information about why the deployment & intialisation have failed.
*/
error ControlledContractProxyInitFailureError(bytes errorData);
error PrimaryContractProxyInitFailureError(bytes errorData);

/**
* @dev Reverts when the deployment & intialisation of the owner contract has failed.
* @notice Failed to deploy & initialise the Owner Contract Proxy. Error: `errorData`.
* @dev Reverts when the deployment & intialisation of the secondary contract has failed.
* @notice Failed to deploy & initialise the Secondary Contract Proxy. Error: `errorData`.
*
* @param errorData Potentially information about why the deployment & intialisation have failed.
*/
error OwnerContractProxyInitFailureError(bytes errorData);
error SecondaryContractProxyInitFailureError(bytes errorData);
Loading

0 comments on commit 3889bcd

Please sign in to comment.