Skip to main content

LSP23LinkedContractsFactory

Standard Specifications
Solidity implementation

Public Methods​

Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally.

computeAddresses​

References
function computeAddresses(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);

Parameters​

NameTypeDescription
primaryContractDeploymentILSP23LinkedContractsFactory.PrimaryContractDeployment-
secondaryContractDeploymentILSP23LinkedContractsFactory.SecondaryContractDeployment-
postDeploymentModuleaddress-
postDeploymentModuleCalldatabytes-

Returns​

NameTypeDescription
primaryContractAddressaddress-
secondaryContractAddressaddress-

computeERC1167Addresses​

References
  • Specification details: LSP-23-LinkedContractsDeployment
  • Solidity implementation: LSP23LinkedContractsFactory.sol
  • Function signature: computeERC1167Addresses(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)
  • Function selector: 0x8da85898
function computeERC1167Addresses(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);

Parameters​

NameTypeDescription
primaryContractDeploymentInitILSP23LinkedContractsFactory.PrimaryContractDeploymentInit-
secondaryContractDeploymentInitILSP23LinkedContractsFactory.SecondaryContractDeploymentInit-
postDeploymentModuleaddress-
postDeploymentModuleCalldatabytes-

Returns​

NameTypeDescription
primaryContractAddressaddress-
secondaryContractAddressaddress-

deployContracts​

References
function deployContracts(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);

Parameters​

NameTypeDescription
primaryContractDeploymentILSP23LinkedContractsFactory.PrimaryContractDeployment-
secondaryContractDeploymentILSP23LinkedContractsFactory.SecondaryContractDeployment-
postDeploymentModuleaddress-
postDeploymentModuleCalldatabytes-

Returns​

NameTypeDescription
primaryContractAddressaddress-
secondaryContractAddressaddress-

deployERC1167Proxies​

References
  • Specification details: LSP-23-LinkedContractsDeployment
  • Solidity implementation: LSP23LinkedContractsFactory.sol
  • Function signature: deployERC1167Proxies(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)
  • Function selector: 0x17c042c4
function deployERC1167Proxies(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);

Parameters​

NameTypeDescription
primaryContractDeploymentInitILSP23LinkedContractsFactory.PrimaryContractDeploymentInit-
secondaryContractDeploymentInitILSP23LinkedContractsFactory.SecondaryContractDeploymentInit-
postDeploymentModuleaddress-
postDeploymentModuleCalldatabytes-

Returns​

NameTypeDescription
primaryContractAddressaddress-
secondaryContractAddressaddress-

Internal Methods​

Any method labeled as internal serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs.

Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities.

_deployPrimaryContract​

function _deployPrimaryContract(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);

_deploySecondaryContract​

function _deploySecondaryContract(struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);

_deployAndInitializePrimaryContractProxy​

function _deployAndInitializePrimaryContractProxy(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);

_deployAndInitializeSecondaryContractProxy​

function _deployAndInitializeSecondaryContractProxy(struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);

_generatePrimaryContractSalt​

function _generatePrimaryContractSalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractGeneratedSalt);

_generatePrimaryContractProxySalt​

function _generatePrimaryContractProxySalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractProxyGeneratedSalt);

Events​

DeployedContracts​

References
  • Specification details: LSP-23-LinkedContractsDeployment
  • Solidity implementation: LSP23LinkedContractsFactory.sol
  • Event signature: DeployedContracts(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)
  • Event topic hash: 0x1ea27dabd8fd1508e844ab51c2fd3d9081f2684346857f9187da6d4a1aa7d3e6
event DeployedContracts(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata);

Emitted when a primary and secondary contract are deployed.

Parameters​

NameTypeDescription
primaryContract indexedaddressAddress of the deployed primary contract.
secondaryContract indexedaddressAddress of the deployed secondary contract.
primaryContractDeploymentILSP23LinkedContractsFactory.PrimaryContractDeploymentParameters used for the primary contract deployment.
secondaryContractDeploymentILSP23LinkedContractsFactory.SecondaryContractDeploymentParameters used for the secondary contract deployment.
postDeploymentModuleaddressAddress of the post-deployment module.
postDeploymentModuleCalldatabytesCalldata passed to the post-deployment module.

DeployedERC1167Proxies​

References
  • Specification details: LSP-23-LinkedContractsDeployment
  • Solidity implementation: LSP23LinkedContractsFactory.sol
  • Event signature: DeployedERC1167Proxies(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)
  • Event topic hash: 0xb03dbe7a02c063899f863d542410b5b038c8f537045be3a26e7144e0074e1c7b
event DeployedERC1167Proxies(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata);

Emitted when proxies of a primary and secondary contract are deployed.

Parameters​

NameTypeDescription
primaryContract indexedaddressAddress of the deployed primary contract proxy.
secondaryContract indexedaddressAddress of the deployed secondary contract proxy.
primaryContractDeploymentInitILSP23LinkedContractsFactory.PrimaryContractDeploymentInitParameters used for the primary contract proxy deployment.
secondaryContractDeploymentInitILSP23LinkedContractsFactory.SecondaryContractDeploymentInitParameters used for the secondary contract proxy deployment.
postDeploymentModuleaddressAddress of the post-deployment module.
postDeploymentModuleCalldatabytesCalldata passed to the post-deployment module.

Errors​

InvalidValueSum​

References
error InvalidValueSum();

Invalid value sent.

Reverts when the msg.value sent is not equal to the sum of value used for the deployment of the contract & its owner contract.


PrimaryContractProxyInitFailureError​

References
error PrimaryContractProxyInitFailureError(bytes errorData);

Failed to deploy & initialise the Primary Contract Proxy. Error: errorData.

Reverts when the deployment & intialisation of the contract has failed.

Parameters​

NameTypeDescription
errorDatabytesPotentially information about why the deployment & intialisation have failed.

SecondaryContractProxyInitFailureError​

References
error SecondaryContractProxyInitFailureError(bytes errorData);

Failed to deploy & initialise the Secondary Contract Proxy. Error: errorData.

Reverts when the deployment & intialisation of the secondary contract has failed.

Parameters​

NameTypeDescription
errorDatabytesPotentially information about why the deployment & intialisation have failed.