@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.
@@ -931,34 +931,34 @@ const ErrorSelectors = {
931
931
  },
932
932
  LSP16UniversalFactory: {
933
933
  /**
934
- * error CannotInitializeContract()
934
+ * error ContractInitializationFailed()
935
935
  *
936
- * 0x068c2f17 = keccak256('CannotInitializeContract()')
936
+ * 0xc1ee8543 = keccak256('ContractInitializationFailed()')
937
937
  */
938
- "0x068c2f17": {
939
- sig: "CannotInitializeContract()",
938
+ "0xc1ee8543": {
939
+ sig: "ContractInitializationFailed()",
940
940
  inputs: [],
941
- name: "CannotInitializeContract",
941
+ name: "ContractInitializationFailed",
942
942
  type: "error",
943
943
  userdoc: [
944
944
  {
945
- details: "reverts with this error when there is no revert reason bubbled up by the target contract when initializing"
945
+ details: "Reverts when there is no revert reason bubbled up by the contract created when initializing"
946
946
  }
947
947
  ]
948
948
  },
949
949
  /**
950
- * error InvalidMsgValueDistribution()
950
+ * error InvalidValueSum()
951
951
  *
952
- * 0x02045484 = keccak256('InvalidMsgValueDistribution()')
952
+ * 0x2fd9ca91 = keccak256('InvalidValueSum()')
953
953
  */
954
- "0x02045484": {
955
- sig: "InvalidMsgValueDistribution()",
954
+ "0x2fd9ca91": {
955
+ sig: "InvalidValueSum()",
956
956
  inputs: [],
957
- name: "InvalidMsgValueDistribution",
957
+ name: "InvalidValueSum",
958
958
  type: "error",
959
959
  userdoc: [
960
960
  {
961
- details: "reverts when msg.value sent to {deployCreate2Init} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`"
961
+ details: "Reverts when msg.value sent to {deployCreate2AndInitialize} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`"
962
962
  }
963
963
  ]
964
964
  }
@@ -10516,14 +10516,15 @@ const EventSigHashes = {
10516
10516
  * event ContractCreated(
10517
10517
  * address indexed contractCreated,
10518
10518
  * bytes32 indexed providedSalt,
10519
- * bool indexed initializable,
10519
+ * bytes32 generatedSalt,
10520
+ * bool indexed initialized,
10520
10521
  * bytes initializeCalldata
10521
10522
  * )
10522
10523
  *
10523
- * 0xc587425c92859c27d4383bf2eb0ab8ea1670c48039f8d6375b9947b82a20f746 = keccak256('ContractCreated(address,bytes32,bool,bytes)')
10524
+ * 0x8872a323d65599f01bf90dc61c94b4e0cc8e2347d6af4122fccc3e112ee34a84 = keccak256('ContractCreated(address,bytes32,bytes32,bool,bytes)')
10524
10525
  */
10525
- "0xc587425c92859c27d4383bf2eb0ab8ea1670c48039f8d6375b9947b82a20f746": {
10526
- sig: "ContractCreated(address,bytes32,bool,bytes)",
10526
+ "0x8872a323d65599f01bf90dc61c94b4e0cc8e2347d6af4122fccc3e112ee34a84": {
10527
+ sig: "ContractCreated(address,bytes32,bytes32,bool,bytes)",
10527
10528
  anonymous: false,
10528
10529
  inputs: [
10529
10530
  {
@@ -10538,10 +10539,16 @@ const EventSigHashes = {
10538
10539
  name: "providedSalt",
10539
10540
  type: "bytes32"
10540
10541
  },
10542
+ {
10543
+ indexed: false,
10544
+ internalType: "bytes32",
10545
+ name: "generatedSalt",
10546
+ type: "bytes32"
10547
+ },
10541
10548
  {
10542
10549
  indexed: true,
10543
10550
  internalType: "bool",
10544
- name: "initializable",
10551
+ name: "initialized",
10545
10552
  type: "bool"
10546
10553
  },
10547
10554
  {
@@ -10557,9 +10564,10 @@ const EventSigHashes = {
10557
10564
  details: "Emitted whenever a contract is created",
10558
10565
  params: {
10559
10566
  contractCreated: "The address of the contract created",
10560
- initializable: "The Boolean that specifies if the contract is a initializable or not",
10561
- initializeCalldata: "The bytes provided as initializeCalldata",
10562
- providedSalt: "The bytes32 salt provided by the deployer"
10567
+ generatedSalt: "The salt used by the `CREATE2` opcode for contract deployment",
10568
+ initializeCalldata: "The bytes provided as initializeCalldata (Empty string when `initialized` is set to false)",
10569
+ initialized: "The Boolean that specifies if the contract must be initialized or not",
10570
+ 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"
10563
10571
  }
10564
10572
  }
10565
10573
  }
@@ -17120,22 +17128,25 @@ const FunctionSelectors = {
17120
17128
  },
17121
17129
  /**
17122
17130
  * function initialize(
17123
- * address newOwner
17131
+ * address initialOwner
17124
17132
  * )
17125
17133
  *
17126
17134
  * 0xc4d66de8 = keccak256('initialize(address)')
17127
17135
  */
17128
17136
  "0xc4d66de8": {
17129
17137
  sig: "initialize(address)",
17130
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
17138
+ inputs: [
17139
+ { internalType: "address", name: "initialOwner", type: "address" }
17140
+ ],
17131
17141
  name: "initialize",
17132
17142
  outputs: [],
17133
17143
  stateMutability: "payable",
17134
17144
  type: "function",
17135
17145
  devdoc: {
17136
- details: "Sets the owner of the contract",
17137
- params: { newOwner: "the owner of the contract" }
17138
- }
17146
+ 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.",
17147
+ params: { initialOwner: "the owner of the contract" }
17148
+ },
17149
+ userdoc: { notice: "Initializing the contract owner to: `initialOwner`" }
17139
17150
  },
17140
17151
  /**
17141
17152
  * function isValidSignature(
@@ -18042,55 +18053,75 @@ const FunctionSelectors = {
18042
18053
  },
18043
18054
  LSP16UniversalFactory: {
18044
18055
  /**
18045
- * function calculateAddress(
18056
+ * function computeAddress(
18046
18057
  * bytes32 byteCodeHash,
18047
18058
  * bytes32 providedSalt,
18048
18059
  * bool initializable,
18049
- * bytes initializeCallData
18060
+ * bytes initializeCalldata
18050
18061
  * )
18051
18062
  *
18052
- * 0x8d23bbe1 = keccak256('calculateAddress(bytes32,bytes32,bool,bytes)')
18063
+ * 0x3b315680 = keccak256('computeAddress(bytes32,bytes32,bool,bytes)')
18053
18064
  */
18054
- "0x8d23bbe1": {
18055
- sig: "calculateAddress(bytes32,bytes32,bool,bytes)",
18065
+ "0x3b315680": {
18066
+ sig: "computeAddress(bytes32,bytes32,bool,bytes)",
18056
18067
  inputs: [
18057
18068
  { internalType: "bytes32", name: "byteCodeHash", type: "bytes32" },
18058
18069
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18059
18070
  { internalType: "bool", name: "initializable", type: "bool" },
18060
- { internalType: "bytes", name: "initializeCallData", type: "bytes" }
18071
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18061
18072
  ],
18062
- name: "calculateAddress",
18073
+ name: "computeAddress",
18063
18074
  outputs: [{ internalType: "address", name: "", type: "address" }],
18064
18075
  stateMutability: "view",
18065
18076
  type: "function",
18066
18077
  devdoc: {
18067
- 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."
18078
+ 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.",
18079
+ params: {
18080
+ byteCodeHash: "The keccak256 hash of the bytecode to be deployed",
18081
+ initializable: "A boolean that indicates whether an external call should be made to initialize the contract after deployment",
18082
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18083
+ 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"
18084
+ },
18085
+ returns: { _0: "The address where the contract will be deployed" }
18068
18086
  }
18069
18087
  },
18070
18088
  /**
18071
- * function calculateProxyAddress(
18072
- * address baseContract,
18089
+ * function computeERC1167Address(
18090
+ * address implementationContract,
18073
18091
  * bytes32 providedSalt,
18074
18092
  * bool initializable,
18075
- * bytes initializeCallData
18093
+ * bytes initializeCalldata
18076
18094
  * )
18077
18095
  *
18078
- * 0x5f4ed88f = keccak256('calculateProxyAddress(address,bytes32,bool,bytes)')
18096
+ * 0xe888edcb = keccak256('computeERC1167Address(address,bytes32,bool,bytes)')
18079
18097
  */
18080
- "0x5f4ed88f": {
18081
- sig: "calculateProxyAddress(address,bytes32,bool,bytes)",
18098
+ "0xe888edcb": {
18099
+ sig: "computeERC1167Address(address,bytes32,bool,bytes)",
18082
18100
  inputs: [
18083
- { internalType: "address", name: "baseContract", type: "address" },
18101
+ {
18102
+ internalType: "address",
18103
+ name: "implementationContract",
18104
+ type: "address"
18105
+ },
18084
18106
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18085
18107
  { internalType: "bool", name: "initializable", type: "bool" },
18086
- { internalType: "bytes", name: "initializeCallData", type: "bytes" }
18108
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18087
18109
  ],
18088
- name: "calculateProxyAddress",
18110
+ name: "computeERC1167Address",
18089
18111
  outputs: [{ internalType: "address", name: "", type: "address" }],
18090
18112
  stateMutability: "view",
18091
18113
  type: "function",
18092
18114
  devdoc: {
18093
- 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."
18115
+ 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.",
18116
+ params: {
18117
+ implementationContract: "The contract to create a clone of according to ERC1167",
18118
+ initializable: "A boolean that indicates whether an external call should be made to initialize the proxy contract after deployment",
18119
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18120
+ 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"
18121
+ },
18122
+ returns: {
18123
+ _0: "The address where the ERC1167 proxy contract will be deployed"
18124
+ }
18094
18125
  }
18095
18126
  },
18096
18127
  /**
@@ -18112,11 +18143,16 @@ const FunctionSelectors = {
18112
18143
  stateMutability: "payable",
18113
18144
  type: "function",
18114
18145
  devdoc: {
18115
- 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."
18146
+ 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.",
18147
+ params: {
18148
+ byteCode: "The bytecode of the contract to be deployed",
18149
+ 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"
18150
+ },
18151
+ returns: { _0: "The address of the deployed contract" }
18116
18152
  }
18117
18153
  },
18118
18154
  /**
18119
- * function deployCreate2Init(
18155
+ * function deployCreate2AndInitialize(
18120
18156
  * bytes byteCode,
18121
18157
  * bytes32 providedSalt,
18122
18158
  * bytes initializeCalldata,
@@ -18124,10 +18160,10 @@ const FunctionSelectors = {
18124
18160
  * uint256 initializeCalldataMsgValue
18125
18161
  * )
18126
18162
  *
18127
- * 0xcace0e47 = keccak256('deployCreate2Init(bytes,bytes32,bytes,uint256,uint256)')
18163
+ * 0xcdbd473a = keccak256('deployCreate2AndInitialize(bytes,bytes32,bytes,uint256,uint256)')
18128
18164
  */
18129
- "0xcace0e47": {
18130
- sig: "deployCreate2Init(bytes,bytes32,bytes,uint256,uint256)",
18165
+ "0xcdbd473a": {
18166
+ sig: "deployCreate2AndInitialize(bytes,bytes32,bytes,uint256,uint256)",
18131
18167
  inputs: [
18132
18168
  { internalType: "bytes", name: "byteCode", type: "bytes" },
18133
18169
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
@@ -18143,82 +18179,117 @@ const FunctionSelectors = {
18143
18179
  type: "uint256"
18144
18180
  }
18145
18181
  ],
18146
- name: "deployCreate2Init",
18182
+ name: "deployCreate2AndInitialize",
18147
18183
  outputs: [{ internalType: "address", name: "", type: "address" }],
18148
18184
  stateMutability: "payable",
18149
18185
  type: "function",
18150
18186
  devdoc: {
18151
- 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."
18187
+ 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`.",
18188
+ params: {
18189
+ byteCode: "The bytecode of the contract to be deployed",
18190
+ constructorMsgValue: "The value sent to the contract during deployment",
18191
+ initializeCalldata: "The calldata to be executed on the created contract",
18192
+ initializeCalldataMsgValue: "The value sent to the contract during initialization",
18193
+ 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"
18194
+ },
18195
+ returns: { _0: "The address of the deployed contract" }
18152
18196
  }
18153
18197
  },
18154
18198
  /**
18155
- * function deployCreate2Proxy(
18156
- * address baseContract,
18199
+ * function deployERC1167Proxy(
18200
+ * address implementationContract,
18157
18201
  * bytes32 providedSalt
18158
18202
  * )
18159
18203
  *
18160
- * 0x7cdf3c5a = keccak256('deployCreate2Proxy(address,bytes32)')
18204
+ * 0x49d8abed = keccak256('deployERC1167Proxy(address,bytes32)')
18161
18205
  */
18162
- "0x7cdf3c5a": {
18163
- sig: "deployCreate2Proxy(address,bytes32)",
18206
+ "0x49d8abed": {
18207
+ sig: "deployERC1167Proxy(address,bytes32)",
18164
18208
  inputs: [
18165
- { internalType: "address", name: "baseContract", type: "address" },
18209
+ {
18210
+ internalType: "address",
18211
+ name: "implementationContract",
18212
+ type: "address"
18213
+ },
18166
18214
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" }
18167
18215
  ],
18168
- name: "deployCreate2Proxy",
18216
+ name: "deployERC1167Proxy",
18169
18217
  outputs: [{ internalType: "address", name: "", type: "address" }],
18170
18218
  stateMutability: "nonpayable",
18171
18219
  type: "function",
18172
18220
  devdoc: {
18173
- 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."
18221
+ 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.",
18222
+ params: {
18223
+ implementationContract: "The contract address to use as the base implementation behind the proxy that will be deployed",
18224
+ 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"
18225
+ },
18226
+ returns: { _0: "The address of the minimal proxy deployed" }
18174
18227
  }
18175
18228
  },
18176
18229
  /**
18177
- * function deployCreate2ProxyInit(
18178
- * address baseContract,
18230
+ * function deployERC1167ProxyAndInitialize(
18231
+ * address implementationContract,
18179
18232
  * bytes32 providedSalt,
18180
18233
  * bytes initializeCalldata
18181
18234
  * )
18182
18235
  *
18183
- * 0x43c329ae = keccak256('deployCreate2ProxyInit(address,bytes32,bytes)')
18236
+ * 0x5340165f = keccak256('deployERC1167ProxyAndInitialize(address,bytes32,bytes)')
18184
18237
  */
18185
- "0x43c329ae": {
18186
- sig: "deployCreate2ProxyInit(address,bytes32,bytes)",
18238
+ "0x5340165f": {
18239
+ sig: "deployERC1167ProxyAndInitialize(address,bytes32,bytes)",
18187
18240
  inputs: [
18188
- { internalType: "address", name: "baseContract", type: "address" },
18241
+ {
18242
+ internalType: "address",
18243
+ name: "implementationContract",
18244
+ type: "address"
18245
+ },
18189
18246
  { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18190
18247
  { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18191
18248
  ],
18192
- name: "deployCreate2ProxyInit",
18249
+ name: "deployERC1167ProxyAndInitialize",
18193
18250
  outputs: [{ internalType: "address", name: "", type: "address" }],
18194
18251
  stateMutability: "payable",
18195
18252
  type: "function",
18196
18253
  devdoc: {
18197
- 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."
18254
+ 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.",
18255
+ params: {
18256
+ implementationContract: "The contract address to use as the base implementation behind the proxy that will be deployed",
18257
+ initializeCalldata: "The calldata to be executed on the created contract",
18258
+ 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"
18259
+ },
18260
+ returns: { _0: "The address of the minimal proxy deployed" }
18198
18261
  }
18199
18262
  },
18200
18263
  /**
18201
18264
  * function generateSalt(
18265
+ * bytes32 providedSalt,
18202
18266
  * bool initializable,
18203
- * bytes initializeCallData,
18204
- * bytes32 providedSalt
18267
+ * bytes initializeCalldata
18205
18268
  * )
18206
18269
  *
18207
- * 0x602dcc96 = keccak256('generateSalt(bool,bytes,bytes32)')
18270
+ * 0x1a17ccbf = keccak256('generateSalt(bytes32,bool,bytes)')
18208
18271
  */
18209
- "0x602dcc96": {
18210
- sig: "generateSalt(bool,bytes,bytes32)",
18272
+ "0x1a17ccbf": {
18273
+ sig: "generateSalt(bytes32,bool,bytes)",
18211
18274
  inputs: [
18275
+ { internalType: "bytes32", name: "providedSalt", type: "bytes32" },
18212
18276
  { internalType: "bool", name: "initializable", type: "bool" },
18213
- { internalType: "bytes", name: "initializeCallData", type: "bytes" },
18214
- { internalType: "bytes32", name: "providedSalt", type: "bytes32" }
18277
+ { internalType: "bytes", name: "initializeCalldata", type: "bytes" }
18215
18278
  ],
18216
18279
  name: "generateSalt",
18217
18280
  outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
18218
18281
  stateMutability: "pure",
18219
18282
  type: "function",
18220
18283
  devdoc: {
18221
- 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."
18284
+ 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.",
18285
+ params: {
18286
+ initializable: "The Boolean that specifies if the contract must be initialized or not",
18287
+ initializeCalldata: "The calldata to be executed on the created contract if `initializable` is set to `true`",
18288
+ 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"
18289
+ },
18290
+ returns: {
18291
+ _0: "The generated salt which will be used for CREATE2 deployment"
18292
+ }
18222
18293
  }
18223
18294
  }
18224
18295
  },
@@ -31089,22 +31160,25 @@ const FunctionSelectors = {
31089
31160
  },
31090
31161
  /**
31091
31162
  * function initialize(
31092
- * address newOwner
31163
+ * address initialOwner
31093
31164
  * )
31094
31165
  *
31095
31166
  * 0xc4d66de8 = keccak256('initialize(address)')
31096
31167
  */
31097
31168
  "0xc4d66de8": {
31098
31169
  sig: "initialize(address)",
31099
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
31170
+ inputs: [
31171
+ { internalType: "address", name: "initialOwner", type: "address" }
31172
+ ],
31100
31173
  name: "initialize",
31101
31174
  outputs: [],
31102
31175
  stateMutability: "payable",
31103
31176
  type: "function",
31104
- devdoc: { params: { newOwner: "the owner of the contract" } },
31105
- userdoc: {
31106
- notice: "Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key"
31107
- }
31177
+ devdoc: {
31178
+ 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.",
31179
+ params: { initialOwner: "the owner of the contract" }
31180
+ },
31181
+ userdoc: { notice: "Initializing the contract owner to: `initialOwner`" }
31108
31182
  },
31109
31183
  /**
31110
31184
  * function isValidSignature(
@@ -31324,6 +31398,20 @@ const FunctionSelectors = {
31324
31398
  };
31325
31399
  const ContractsDocs = {};
31326
31400
  const StateVariables = {
31401
+ LSP16UniversalFactory: {
31402
+ /**
31403
+ * stateVariable _EMPTY_BYTE()
31404
+ *
31405
+ * 0x3bc60789 = keccak256('_EMPTY_BYTE()')
31406
+ */
31407
+ "0x3bc60789": {
31408
+ sig: "_EMPTY_BYTE()",
31409
+ type: "stateVariable",
31410
+ devdoc: {
31411
+ details: "placeholder for the `initializeCallData` param when the `initializable` boolean is set to `false`."
31412
+ }
31413
+ }
31414
+ },
31327
31415
  LSP8CompatibleERC721: {
31328
31416
  /**
31329
31417
  * stateVariable _operatorApprovals()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/lsp-smart-contracts",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "The reference implementation for universal profiles smart contracts",
5
5
  "directories": {
6
6
  "test": "test"
@@ -37,7 +37,8 @@
37
37
  },
38
38
  "./userdocs/*": "./userdocs",
39
39
  "./devdocs/*": "./devdocs/*",
40
- "./artifacts/*": "./artifacts/*"
40
+ "./artifacts/*": "./artifacts/*",
41
+ "./dist/*": "./dist/*"
41
42
  },
42
43
  "scripts": {
43
44
  "test": "hardhat test",
@@ -21,6 +21,9 @@
21
21
  "acceptOwnership()": {
22
22
  "notice": "Achieves the goal of LSP14Ownable2Step by implementing a 2-step ownership transfer process."
23
23
  },
24
+ "constructor": {
25
+ "notice": "Deploying the contract with owner set to: `initialOwner`"
26
+ },
24
27
  "getData(bytes32)": {
25
28
  "notice": "Gets singular data at a given `dataKey`"
26
29
  },
@@ -21,12 +21,18 @@
21
21
  "acceptOwnership()": {
22
22
  "notice": "Achieves the goal of LSP14Ownable2Step by implementing a 2-step ownership transfer process."
23
23
  },
24
+ "constructor": {
25
+ "notice": "deploying a `LSP0ERC725AccountInit` base contract to be used behind proxy"
26
+ },
24
27
  "getData(bytes32)": {
25
28
  "notice": "Gets singular data at a given `dataKey`"
26
29
  },
27
30
  "getDataBatch(bytes32[])": {
28
31
  "notice": "Gets array of data for multiple given keys"
29
32
  },
33
+ "initialize(address)": {
34
+ "notice": "Initializing the contract owner to: `initialOwner`"
35
+ },
30
36
  "isValidSignature(bytes32,bytes)": {
31
37
  "notice": "Achieves the goal of EIP-1271 by validating signatures of smart contracts according to their own logic."
32
38
  },
@@ -22,7 +22,7 @@
22
22
  "notice": "Achieves the goal of LSP14Ownable2Step by implementing a 2-step ownership transfer process."
23
23
  },
24
24
  "constructor": {
25
- "notice": "Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key"
25
+ "notice": "Deploying the contract with owner set to: `initialOwner`"
26
26
  },
27
27
  "getData(bytes32)": {
28
28
  "notice": "Gets singular data at a given `dataKey`"
@@ -21,6 +21,9 @@
21
21
  "acceptOwnership()": {
22
22
  "notice": "Achieves the goal of LSP14Ownable2Step by implementing a 2-step ownership transfer process."
23
23
  },
24
+ "constructor": {
25
+ "notice": "deploying a `UniversalProfileInit` base contract to be used behind proxy"
26
+ },
24
27
  "getData(bytes32)": {
25
28
  "notice": "Gets singular data at a given `dataKey`"
26
29
  },
@@ -28,7 +31,7 @@
28
31
  "notice": "Gets array of data for multiple given keys"
29
32
  },
30
33
  "initialize(address)": {
31
- "notice": "Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key"
34
+ "notice": "Initializing the contract owner to: `initialOwner`"
32
35
  },
33
36
  "isValidSignature(bytes32,bytes)": {
34
37
  "notice": "Achieves the goal of EIP-1271 by validating signatures of smart contracts according to their own logic."