From 91551ca5bccc7d2393b2e1dd844ce8a3747c961f Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 16 Oct 2024 12:47:47 +0200 Subject: [PATCH] Add NatSpecs in Create2 --- packages/protocol/contracts/common/Create2.sol | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/protocol/contracts/common/Create2.sol b/packages/protocol/contracts/common/Create2.sol index 282bba887ca..77d100390bc 100644 --- a/packages/protocol/contracts/common/Create2.sol +++ b/packages/protocol/contracts/common/Create2.sol @@ -1,6 +1,15 @@ pragma solidity ^0.5.13; +/** + * @title Used for deploying contracts using the CREATE2 opcode. + */ library Create2 { + /** + * @notice Deploys a contract with CREATE2. + * @param salt The CREATE2 salt. + * @param initCode The contract init code to use for deployment. + * @return Address of the deployed contract. + */ function deploy(bytes32 salt, bytes memory initCode) internal returns (address) { address deployedAddress; assembly { @@ -12,6 +21,13 @@ library Create2 { return deployedAddress; } + /** + * @notice Computes the CREATE2 address for given inputs. + * @param deployer Address of the deployer. + * @param salt The CREATE2 salt. + * @param initCodeHash Hash of the init code used for deployment. + * @return The address at which such a contract would be deployed. + */ function computeAddress( address deployer, bytes32 salt,