@lukso/lsp-smart-contracts 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -935,34 +935,34 @@ const ErrorSelectors = {
935
935
  },
936
936
  LSP16UniversalFactory: {
937
937
  /**
938
- * error CannotInitializeContract()
938
+ * error ContractInitializationFailed()
939
939
  *
940
- * 0x068c2f17 = keccak256('CannotInitializeContract()')
940
+ * 0xc1ee8543 = keccak256('ContractInitializationFailed()')
941
941
  */
942
- "0x068c2f17": {
943
- sig: "CannotInitializeContract()",
942
+ "0xc1ee8543": {
943
+ sig: "ContractInitializationFailed()",
944
944
  inputs: [],
945
- name: "CannotInitializeContract",
945
+ name: "ContractInitializationFailed",
946
946
  type: "error",
947
947
  userdoc: [
948
948
  {
949
- details: "reverts with this error when there is no revert reason bubbled up by the target contract when initializing"
949
+ details: "Reverts when there is no revert reason bubbled up by the contract created when initializing"
950
950
  }
951
951
  ]
952
952
  },
953
953
  /**
954
- * error InvalidMsgValueDistribution()
954
+ * error InvalidValueSum()
955
955
  *
956
- * 0x02045484 = keccak256('InvalidMsgValueDistribution()')
956
+ * 0x2fd9ca91 = keccak256('InvalidValueSum()')
957
957
  */
958
- "0x02045484": {
959
- sig: "InvalidMsgValueDistribution()",
958
+ "0x2fd9ca91": {
959
+ sig: "InvalidValueSum()",
960
960
  inputs: [],
961
- name: "InvalidMsgValueDistribution",
961
+ name: "InvalidValueSum",
962
962
  type: "error",
963
963
  userdoc: [
964
964
  {
965
- details: "reverts when msg.value sent to {deployCreate2Init} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`"
965
+ details: "Reverts when msg.value sent to {deployCreate2AndInitialize} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`"
966
966
  }
967
967
  ]
968
968
  }
@@ -10520,14 +10520,15 @@ const EventSigHashes = {
10520
10520
  * event ContractCreated(
10521
10521
  * address indexed contractCreated,
10522
10522
  * bytes32 indexed providedSalt,
10523
- * bool indexed initializable,
10523
+ * bytes32 generatedSalt,
10524
+ * bool indexed initialized,
10524
10525
  * bytes initializeCalldata
10525
10526
  * )
10526
10527
  *
10527
- * 0xc587425c92859c27d4383bf2eb0ab8ea1670c48039f8d6375b9947b82a20f746 = keccak256('ContractCreated(address,bytes32,bool,bytes)')
10528
+ * 0x8872a323d65599f01bf90dc61c94b4e0cc8e2347d6af4122fccc3e112ee34a84 = keccak256('ContractCreated(address,bytes32,bytes32,bool,bytes)')
10528
10529
  */
10529
- "0xc587425c92859c27d4383bf2eb0ab8ea1670c48039f8d6375b9947b82a20f746": {
10530
- sig: "ContractCreated(address,bytes32,bool,bytes)",
10530
+ "0x8872a323d65599f01bf90dc61c94b4e0cc8e2347d6af4122fccc3e112ee34a84": {
10531
+ sig: "ContractCreated(address,bytes32,bytes32,bool,bytes)",
10531
10532
  anonymous: false,
10532
10533
  inputs: [
10533
10534
  {
@@ -10542,10 +10543,16 @@ const EventSigHashes = {
10542
10543
  name: "providedSalt",
10543
10544
  type: "bytes32"
10544
10545
  },
10546
+ {
10547
+ indexed: false,
10548
+ internalType: "bytes32",
10549
+ name: "generatedSalt",
10550
+ type: "bytes32"
10551
+ },
10545
10552
  {
10546
10553
  indexed: true,
10547
10554
  internalType: "bool",
10548
- name: "initializable",
10555
+ name: "initialized",
10549
10556
  type: "bool"
10550
10557
  },
10551
10558
  {
@@ -10561,9 +10568,10 @@ const EventSigHashes = {
10561
10568
  details: "Emitted whenever a contract is created",
10562
10569
  params: {
10563
10570
  contractCreated: "The address of the contract created",
10564
- initializable: "The Boolean that specifies if the contract is a initializable or not",
10565
- initializeCalldata: "The bytes provided as initializeCalldata",
10566
- providedSalt: "The bytes32 salt provided by the deployer"
10571
+ generatedSalt: "The salt used by the `CREATE2` opcode for contract deployment",
10572
+ initializeCalldata: "The bytes provided as initializeCalldata (Empty string when `initialized` is set to false)",
10573
+ initialized: "The Boolean that specifies if the contract must be initialized or not",
10574
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
10567
10575
  }
10568
10576
  }
10569
10577
  }
@@ -17124,22 +17132,25 @@ const FunctionSelectors = {
17124
17132
  },
17125
17133
  /**
17126
17134
  * function initialize(
17127
- * address newOwner
17135
+ * address initialOwner
17128
17136
  * )
17129
17137
  *
17130
17138
  * 0xc4d66de8 = keccak256('initialize(address)')
17131
17139
  */
17132
17140
  "0xc4d66de8": {
17133
17141
  sig: "initialize(address)",
17134
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
17142
+ inputs: [
17143
+ { internalType: "address", name: "initialOwner", type: "address" }
17144
+ ],
17135
17145
  name: "initialize",
17136
17146
  outputs: [],
17137
17147
  stateMutability: "payable",
17138
17148
  type: "function",
17139
17149
  devdoc: {
17140
- details: "Sets the owner of the contract",
17141
- params: { newOwner: "the owner of the contract" }
17142
- }
17150
+ details: "Set `initialOwner` as the contract owner. The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier. The `initialize(address)` function also allows funding the contract on initialization. Emitted Events: - ValueReceived: when the contract is funded on initialization.",
17151
+ params: { initialOwner: "the owner of the contract" }
17152
+ },
17153
+ userdoc: { notice: "Initializing the contract owner to: `initialOwner`" }
17143
17154
  },
17144
17155
  /**
17145
17156
  * function isValidSignature(
@@ -18046,55 +18057,75 @@ const FunctionSelectors = {
18046
18057
  },
18047
18058
  LSP16UniversalFactory: {
18048
18059
  /**
18049
- * function calculateAddress(
18060
+ * function computeAddress(
18050
18061
  * bytes32 byteCodeHash,
18051
18062
  * bytes32 providedSalt,
18052
18063
  * bool initializable,
18053
- * bytes initializeCallData
18064
+ * bytes initializeCalldata
18054
18065
  * )
18055
18066
  *
18056
- * 0x8d23bbe1 = keccak256('calculateAddress(bytes32,bytes32,bool,bytes)')
18067
+ * 0x3b315680 = keccak256('computeAddress(bytes32,bytes32,bool,bytes)')
18057
18068
  */
18058
- "0x8d23bbe1": {
18059
- sig: "calculateAddress(bytes32,bytes32,bool,bytes)",
18069
+ "0x3b315680": {
18070
+ sig: "computeAddress(bytes32,bytes32,bool,bytes)",
18060
18071
  inputs: [
18061
18072
  { internalType: "bytes32", name: "byteCodeHash", type: "bytes32" },
18062
18073
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18063
18074
  { internalType: "bool", name: "initializable", type: "bool" },
18064
- { internalType: "bytes", name: "initializeCallData", type: "bytes" }
18075
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18065
18076
  ],
18066
- name: "calculateAddress",
18077
+ name: "computeAddress",
18067
18078
  outputs: [{ internalType: "address", name: "", type: "address" }],
18068
18079
  stateMutability: "view",
18069
18080
  type: "function",
18070
18081
  devdoc: {
18071
- details: "Returns the address where a contract will be stored if deployed via `CREATE2`. The address is constructed using the parameters below. Any change in one of them will result in a new destination address."
18082
+ details: "Computes the address of a contract to be deployed using CREATE2, based on the input parameters. Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.",
18083
+ params: {
18084
+ byteCodeHash: "The keccak256 hash of the bytecode to be deployed",
18085
+ initializable: "A boolean that indicates whether an external call should be made to initialize the contract after deployment",
18086
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18087
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18088
+ },
18089
+ returns: { _0: "The address where the contract will be deployed" }
18072
18090
  }
18073
18091
  },
18074
18092
  /**
18075
- * function calculateProxyAddress(
18076
- * address baseContract,
18093
+ * function computeERC1167Address(
18094
+ * address implementationContract,
18077
18095
  * bytes32 providedSalt,
18078
18096
  * bool initializable,
18079
- * bytes initializeCallData
18097
+ * bytes initializeCalldata
18080
18098
  * )
18081
18099
  *
18082
- * 0x5f4ed88f = keccak256('calculateProxyAddress(address,bytes32,bool,bytes)')
18100
+ * 0xe888edcb = keccak256('computeERC1167Address(address,bytes32,bool,bytes)')
18083
18101
  */
18084
- "0x5f4ed88f": {
18085
- sig: "calculateProxyAddress(address,bytes32,bool,bytes)",
18102
+ "0xe888edcb": {
18103
+ sig: "computeERC1167Address(address,bytes32,bool,bytes)",
18086
18104
  inputs: [
18087
- { internalType: "address", name: "baseContract", type: "address" },
18105
+ {
18106
+ internalType: "address",
18107
+ name: "implementationContract",
18108
+ type: "address"
18109
+ },
18088
18110
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18089
18111
  { internalType: "bool", name: "initializable", type: "bool" },
18090
- { internalType: "bytes", name: "initializeCallData", type: "bytes" }
18112
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18091
18113
  ],
18092
- name: "calculateProxyAddress",
18114
+ name: "computeERC1167Address",
18093
18115
  outputs: [{ internalType: "address", name: "", type: "address" }],
18094
18116
  stateMutability: "view",
18095
18117
  type: "function",
18096
18118
  devdoc: {
18097
- details: "Returns the address of an EIP1167 proxy contract. The address is constructed using the parameters below. Any change in one of them will result in a new destination address."
18119
+ details: "Computes the address of an ERC1167 proxy contract based on the input parameters. Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.",
18120
+ params: {
18121
+ implementationContract: "The contract to create a clone of according to ERC1167",
18122
+ initializable: "A boolean that indicates whether an external call should be made to initialize the proxy contract after deployment",
18123
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18124
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18125
+ },
18126
+ returns: {
18127
+ _0: "The address where the ERC1167 proxy contract will be deployed"
18128
+ }
18098
18129
  }
18099
18130
  },
18100
18131
  /**
@@ -18116,11 +18147,16 @@ const FunctionSelectors = {
18116
18147
  stateMutability: "payable",
18117
18148
  type: "function",
18118
18149
  devdoc: {
18119
- details: "Deploys a contract using `CREATE2`. The address where the contract will be deployed can be known in advance via {calculateAddress}. The salt is a hash of the `providedSalt` together with an empty byte, to prevent mimicing the `deployCreate2Init()` and other functions. This method allow users to have the same contracts at the same address across different chains with the same parameters. Using the same `byteCode` and salt multiple time will revert, since the contract cannot be deployed twice at the same address."
18150
+ details: "Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function. This function deploys contracts without initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details. Using the same `byteCode` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address. If the constructor of the contract to deploy is payable, value can be sent to this function to fund the created contract. However, sending value to this function while the constructor is not payable will result in a revert.",
18151
+ params: {
18152
+ byteCode: "The bytecode of the contract to be deployed",
18153
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18154
+ },
18155
+ returns: { _0: "The address of the deployed contract" }
18120
18156
  }
18121
18157
  },
18122
18158
  /**
18123
- * function deployCreate2Init(
18159
+ * function deployCreate2AndInitialize(
18124
18160
  * bytes byteCode,
18125
18161
  * bytes32 providedSalt,
18126
18162
  * bytes initializeCalldata,
@@ -18128,10 +18164,10 @@ const FunctionSelectors = {
18128
18164
  * uint256 initializeCalldataMsgValue
18129
18165
  * )
18130
18166
  *
18131
- * 0xcace0e47 = keccak256('deployCreate2Init(bytes,bytes32,bytes,uint256,uint256)')
18167
+ * 0xcdbd473a = keccak256('deployCreate2AndInitialize(bytes,bytes32,bytes,uint256,uint256)')
18132
18168
  */
18133
- "0xcace0e47": {
18134
- sig: "deployCreate2Init(bytes,bytes32,bytes,uint256,uint256)",
18169
+ "0xcdbd473a": {
18170
+ sig: "deployCreate2AndInitialize(bytes,bytes32,bytes,uint256,uint256)",
18135
18171
  inputs: [
18136
18172
  { internalType: "bytes", name: "byteCode", type: "bytes" },
18137
18173
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
@@ -18147,82 +18183,117 @@ const FunctionSelectors = {
18147
18183
  type: "uint256"
18148
18184
  }
18149
18185
  ],
18150
- name: "deployCreate2Init",
18186
+ name: "deployCreate2AndInitialize",
18151
18187
  outputs: [{ internalType: "address", name: "", type: "address" }],
18152
18188
  stateMutability: "payable",
18153
18189
  type: "function",
18154
18190
  devdoc: {
18155
- details: "Deploys a contract using `CREATE2`. The address where the contract will be deployed can be known in advance via {calculateAddress}. The salt is a hash of the `providedSalt` and and the `initializeCallData`. This method allow users to have the same contracts at the same address across different chains with the same parameters. The msg.value is split according to the parameters of the function The msg.value sent to this contract MUST be the sum of the two parameters: `constructorMsgValue` and `initializeCalldataMsgValue` Using the same `byteCode` and salt multiple time will revert, since the contract cannot be deployed twice at the same address."
18191
+ details: "Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function. This function deploys contracts with initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`. See {generateSalt} function for more details. Using the same `byteCode`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address. If the constructor or the initialize function of the contract to deploy is payable, value can be sent along with the deployment/initialization to fund the created contract. However, sending value to this function while the constructor/initialize function is not payable will result in a revert. Will revert if the `msg.value` sent to the function is not equal to the sum of `constructorMsgValue` and `initializeCalldataMsgValue`.",
18192
+ params: {
18193
+ byteCode: "The bytecode of the contract to be deployed",
18194
+ constructorMsgValue: "The value sent to the contract during deployment",
18195
+ initializeCalldata: "The calldata to be executed on the created contract",
18196
+ initializeCalldataMsgValue: "The value sent to the contract during initialization",
18197
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18198
+ },
18199
+ returns: { _0: "The address of the deployed contract" }
18156
18200
  }
18157
18201
  },
18158
18202
  /**
18159
- * function deployCreate2Proxy(
18160
- * address baseContract,
18203
+ * function deployERC1167Proxy(
18204
+ * address implementationContract,
18161
18205
  * bytes32 providedSalt
18162
18206
  * )
18163
18207
  *
18164
- * 0x7cdf3c5a = keccak256('deployCreate2Proxy(address,bytes32)')
18208
+ * 0x49d8abed = keccak256('deployERC1167Proxy(address,bytes32)')
18165
18209
  */
18166
- "0x7cdf3c5a": {
18167
- sig: "deployCreate2Proxy(address,bytes32)",
18210
+ "0x49d8abed": {
18211
+ sig: "deployERC1167Proxy(address,bytes32)",
18168
18212
  inputs: [
18169
- { internalType: "address", name: "baseContract", type: "address" },
18213
+ {
18214
+ internalType: "address",
18215
+ name: "implementationContract",
18216
+ type: "address"
18217
+ },
18170
18218
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" }
18171
18219
  ],
18172
- name: "deployCreate2Proxy",
18220
+ name: "deployERC1167Proxy",
18173
18221
  outputs: [{ internalType: "address", name: "", type: "address" }],
18174
18222
  stateMutability: "nonpayable",
18175
18223
  type: "function",
18176
18224
  devdoc: {
18177
- details: "Deploys and returns the address of a clone that mimics the behaviour of `baseContract`. The address where the contract will be deployed can be known in advance via {calculateProxyAddress}. This function uses the CREATE2 opcode and a salt to deterministically deploy the clone. The salt is a hash of the `providedSalt` toegther with an empty byte, to prevent mimicing the `deployCreate2ProxyInit()` and other functions. This method allow users to have the same contracts at the same address across different chains with the same parameters. Using the same `baseContract` and salt multiple time will revert, since the clones cannot be deployed twice at the same address."
18225
+ details: "Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeERC1167Address} function. This function deploys contracts without initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details. See {generateSalt} function for more details. Using the same `implementationContract` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address. Sending value to the contract created is not possible since the constructor of the ERC1167 minimal proxy is not payable.",
18226
+ params: {
18227
+ implementationContract: "The contract address to use as the base implementation behind the proxy that will be deployed",
18228
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18229
+ },
18230
+ returns: { _0: "The address of the minimal proxy deployed" }
18178
18231
  }
18179
18232
  },
18180
18233
  /**
18181
- * function deployCreate2ProxyInit(
18182
- * address baseContract,
18234
+ * function deployERC1167ProxyAndInitialize(
18235
+ * address implementationContract,
18183
18236
  * bytes32 providedSalt,
18184
18237
  * bytes initializeCalldata
18185
18238
  * )
18186
18239
  *
18187
- * 0x43c329ae = keccak256('deployCreate2ProxyInit(address,bytes32,bytes)')
18240
+ * 0x5340165f = keccak256('deployERC1167ProxyAndInitialize(address,bytes32,bytes)')
18188
18241
  */
18189
- "0x43c329ae": {
18190
- sig: "deployCreate2ProxyInit(address,bytes32,bytes)",
18242
+ "0x5340165f": {
18243
+ sig: "deployERC1167ProxyAndInitialize(address,bytes32,bytes)",
18191
18244
  inputs: [
18192
- { internalType: "address", name: "baseContract", type: "address" },
18245
+ {
18246
+ internalType: "address",
18247
+ name: "implementationContract",
18248
+ type: "address"
18249
+ },
18193
18250
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18194
18251
  { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18195
18252
  ],
18196
- name: "deployCreate2ProxyInit",
18253
+ name: "deployERC1167ProxyAndInitialize",
18197
18254
  outputs: [{ internalType: "address", name: "", type: "address" }],
18198
18255
  stateMutability: "payable",
18199
18256
  type: "function",
18200
18257
  devdoc: {
18201
- details: "Deploys and returns the address of a clone that mimics the behaviour of `baseContract`. The address where the contract will be deployed can be known in advance via {calculateProxyAddress}. This function uses the CREATE2 opcode and a salt to deterministically deploy the clone. The salt is a hash of the `providedSalt` and and the `initializeCallData`. This method allow users to have the same contracts at the same address across different chains with the same parameters. Using the same `baseContract` and salt multiple time will revert, since the clones cannot be deployed twice at the same address."
18258
+ details: "Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeERC1167Address} function. This function deploys contracts with initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`. See {generateSalt} function for more details. Using the same `implementationContract`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address. If the initialize function of the contract to deploy is payable, value can be sent along to fund the created contract while initializing. However, sending value to this function while the initialize function is not payable will result in a revert.",
18259
+ params: {
18260
+ implementationContract: "The contract address to use as the base implementation behind the proxy that will be deployed",
18261
+ initializeCalldata: "The calldata to be executed on the created contract",
18262
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18263
+ },
18264
+ returns: { _0: "The address of the minimal proxy deployed" }
18202
18265
  }
18203
18266
  },
18204
18267
  /**
18205
18268
  * function generateSalt(
18269
+ * bytes32 providedSalt,
18206
18270
  * bool initializable,
18207
- * bytes initializeCallData,
18208
- * bytes32 providedSalt
18271
+ * bytes initializeCalldata
18209
18272
  * )
18210
18273
  *
18211
- * 0x602dcc96 = keccak256('generateSalt(bool,bytes,bytes32)')
18274
+ * 0x1a17ccbf = keccak256('generateSalt(bytes32,bool,bytes)')
18212
18275
  */
18213
- "0x602dcc96": {
18214
- sig: "generateSalt(bool,bytes,bytes32)",
18276
+ "0x1a17ccbf": {
18277
+ sig: "generateSalt(bytes32,bool,bytes)",
18215
18278
  inputs: [
18279
+ { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18216
18280
  { internalType: "bool", name: "initializable", type: "bool" },
18217
- { internalType: "bytes", name: "initializeCallData", type: "bytes" },
18218
- { internalType: "bytes32", name: "providedSalt", type: "bytes32" }
18281
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18219
18282
  ],
18220
18283
  name: "generateSalt",
18221
18284
  outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
18222
18285
  stateMutability: "pure",
18223
18286
  type: "function",
18224
18287
  devdoc: {
18225
- details: "Calculates the salt used to deploy the contract by hashing (Keccak256) the following parameters as packed encoded respectively: an initializable boolean, the initializeCallData if and only if the contract is initializable, and the salt provided by the deployer. The initializable boolean was added before the provided arguments as if it was not used, and we are deploying proxies on another chain, people can use the `deployCreate2(..)` function to deploy the same bytecode + the same salt to get the same address of the contract on another chain without applying the effect of initializing."
18288
+ details: "Generates the salt used to deploy the contract by hashing the following parameters (concatenated together) with keccak256: - the `providedSalt` - the `initializable` boolean - the `initializeCalldata`, only if the contract is initializable (the `initializable` boolean is set to `true`) The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is used along with these parameters: - `initializable` boolean - `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`). These three parameters are concatenated together and hashed to generate the final salt for CREATE2. This approach ensures that in order to reproduce an initializable contract at the same address on another chain, not only the `providedSalt` is required to be the same, but also the initialize parameters within the `initializeCalldata` must also be the same. This maintains consistent deployment behaviour. Users are required to initialize contracts with the same parameters across different chains to ensure contracts are deployed at the same address across different chains. ----------- Example (for initializable contracts) For an existing contract A on chain 1 owned by X, to replicate the same contract at the same address with the same owner X on chain 2, the salt used to generate the address should include the initializeCalldata that assigns X as the owner of contract A. For instance, if another user, Y, tries to deploy the contract at the same address on chain 2 using the same providedSalt, but with a different initializeCalldata to make Y the owner instead of X, the generated address would be different, preventing Y from deploying the contract with different ownership at the same address. ----------- However, for non-initializable contracts, if the constructor has arguments that specify the deployment behavior, they will be included in the bytecode. Any change in the constructor arguments will lead to a different contract's bytecode which will result in a different address on other chains. ----------- Example (for non-initializable contracts) If a contract is deployed with specific constructor arguments on chain 1, these arguments are embedded within the bytecode. For instance, if contract B is deployed with a specific `tokenName` and `tokenSymbol` on chain 1, and a user wants to deploy the same contract with the same `tokenName` and `tokenSymbol` on chain 2, they must use the same constructor arguments to produce the same bytecode. This ensures that the same deployment behaviour is maintained across different chains, as long as the same bytecode is used. If another user Z, tries to deploy the same contract B at the same address on chain 2 using the same `providedSalt` but different constructor arguments (a different `tokenName` and/or `tokenSymbol`), the generated address will be different. This prevents user Z from deploying the contract with different constructor arguments at the same address on chain 2. ----------- The providedSalt was hashed to produce the salt used by CREATE2 opcode to prevent users from deploying initializable contracts using non-initializable functions such as {deployCreate2} without having the initialization call. In other words, if the providedSalt was not hashed and was used as it is as the salt by the CREATE2 opcode, malicious users can check the generated salt used for the already deployed initializable contract on chain 1, and deploy the contract from {deployCreate2} function on chain 2, with passing the generated salt of the deployed contract as providedSalt that will produce the same address but without the initialization, where the malicious user can initialize after.",
18289
+ params: {
18290
+ initializable: "The Boolean that specifies if the contract must be initialized or not",
18291
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18292
+ providedSalt: "The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment"
18293
+ },
18294
+ returns: {
18295
+ _0: "The generated salt which will be used for CREATE2 deployment"
18296
+ }
18226
18297
  }
18227
18298
  }
18228
18299
  },
@@ -31093,22 +31164,25 @@ const FunctionSelectors = {
31093
31164
  },
31094
31165
  /**
31095
31166
  * function initialize(
31096
- * address newOwner
31167
+ * address initialOwner
31097
31168
  * )
31098
31169
  *
31099
31170
  * 0xc4d66de8 = keccak256('initialize(address)')
31100
31171
  */
31101
31172
  "0xc4d66de8": {
31102
31173
  sig: "initialize(address)",
31103
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
31174
+ inputs: [
31175
+ { internalType: "address", name: "initialOwner", type: "address" }
31176
+ ],
31104
31177
  name: "initialize",
31105
31178
  outputs: [],
31106
31179
  stateMutability: "payable",
31107
31180
  type: "function",
31108
- devdoc: { params: { newOwner: "the owner of the contract" } },
31109
- userdoc: {
31110
- notice: "Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key"
31111
- }
31181
+ devdoc: {
31182
+ details: "Set `initialOwner` as the contract owner and set the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store. The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier. The `initialize(address)` function also allows funding the contract on initialization. Emitted Events: - ValueReceived: when the contract is funded on initialization.",
31183
+ params: { initialOwner: "the owner of the contract" }
31184
+ },
31185
+ userdoc: { notice: "Initializing the contract owner to: `initialOwner`" }
31112
31186
  },
31113
31187
  /**
31114
31188
  * function isValidSignature(
@@ -31328,6 +31402,20 @@ const FunctionSelectors = {
31328
31402
  };
31329
31403
  const ContractsDocs = {};
31330
31404
  const StateVariables = {
31405
+ LSP16UniversalFactory: {
31406
+ /**
31407
+ * stateVariable _EMPTY_BYTE()
31408
+ *
31409
+ * 0x3bc60789 = keccak256('_EMPTY_BYTE()')
31410
+ */
31411
+ "0x3bc60789": {
31412
+ sig: "_EMPTY_BYTE()",
31413
+ type: "stateVariable",
31414
+ devdoc: {
31415
+ details: "placeholder for the `initializeCallData` param when the `initializable` boolean is set to `false`."
31416
+ }
31417
+ }
31418
+ },
31331
31419
  LSP8CompatibleERC721: {
31332
31420
  /**
31333
31421
  * stateVariable _operatorApprovals()