@lukso/lsp-smart-contracts 0.11.1 → 0.12.0-rc.0

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.
Files changed (214) hide show
  1. package/CONTRIBUTING.md +4 -0
  2. package/README.md +10 -2
  3. package/artifacts/Create2Factory.json +2 -2
  4. package/artifacts/LSP0ERC725Account.json +52 -25
  5. package/artifacts/LSP0ERC725AccountInit.json +52 -25
  6. package/artifacts/LSP11BasicSocialRecovery.json +18 -2
  7. package/artifacts/LSP11BasicSocialRecoveryInit.json +18 -2
  8. package/artifacts/LSP16UniversalFactory.json +3 -3
  9. package/artifacts/LSP1UniversalReceiverDelegateUP.json +14 -46
  10. package/artifacts/LSP1UniversalReceiverDelegateVault.json +14 -46
  11. package/artifacts/LSP23LinkedContractsFactory.json +3 -3
  12. package/artifacts/LSP4DigitalAssetMetadata.json +16 -0
  13. package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +16 -0
  14. package/artifacts/LSP6KeyManager.json +14 -9
  15. package/artifacts/LSP6KeyManagerInit.json +14 -9
  16. package/artifacts/LSP7CappedSupply.json +29 -4
  17. package/artifacts/LSP7CappedSupplyInitAbstract.json +29 -4
  18. package/artifacts/LSP7CompatibleERC20.json +48 -23
  19. package/artifacts/LSP7CompatibleERC20InitAbstract.json +48 -23
  20. package/artifacts/LSP7CompatibleERC20Mintable.json +51 -26
  21. package/artifacts/LSP7CompatibleERC20MintableInit.json +51 -26
  22. package/artifacts/LSP7DigitalAsset.json +29 -4
  23. package/artifacts/LSP7DigitalAssetInitAbstract.json +29 -4
  24. package/artifacts/LSP7Mintable.json +32 -7
  25. package/artifacts/LSP7MintableInit.json +32 -7
  26. package/artifacts/LSP8CappedSupply.json +33 -3
  27. package/artifacts/LSP8CappedSupplyInitAbstract.json +33 -3
  28. package/artifacts/LSP8CompatibleERC721.json +55 -25
  29. package/artifacts/LSP8CompatibleERC721InitAbstract.json +55 -25
  30. package/artifacts/LSP8CompatibleERC721Mintable.json +63 -28
  31. package/artifacts/LSP8CompatibleERC721MintableInit.json +63 -28
  32. package/artifacts/LSP8IdentifiableDigitalAsset.json +33 -3
  33. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +33 -3
  34. package/artifacts/LSP8Mintable.json +41 -6
  35. package/artifacts/LSP8MintableInit.json +41 -6
  36. package/artifacts/LSP9Vault.json +38 -16
  37. package/artifacts/LSP9VaultInit.json +38 -16
  38. package/artifacts/UniversalProfile.json +52 -25
  39. package/artifacts/UniversalProfileInit.json +52 -25
  40. package/contracts/Factories/Create2Factory.sol +1 -1
  41. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +0 -14
  42. package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
  43. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +122 -94
  44. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +5 -3
  45. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +54 -14
  46. package/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol +1 -1
  47. package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +1 -1
  48. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +2 -2
  49. package/contracts/LSP14Ownable2Step/LSP14Constants.sol +1 -1
  50. package/contracts/LSP14Ownable2Step/LSP14Errors.sol +9 -3
  51. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +16 -12
  52. package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +65 -96
  53. package/contracts/LSP17ContractExtension/LSP17Errors.sol +1 -1
  54. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +10 -7
  55. package/contracts/LSP17ContractExtension/LSP17Extension.sol +4 -4
  56. package/contracts/LSP17Extensions/Extension4337.sol +101 -0
  57. package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +15 -0
  58. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +1 -2
  59. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +24 -0
  60. package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +1 -0
  61. package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +0 -6
  62. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +20 -27
  63. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +18 -21
  64. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +2 -46
  65. package/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +13 -9
  66. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +39 -14
  67. package/contracts/LSP20CallVerification/LSP20Constants.sol +6 -6
  68. package/contracts/LSP20CallVerification/LSP20Errors.sol +9 -3
  69. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/ILSP23LinkedContractsFactory.sol +1 -1
  70. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/IPostDeploymentModule.sol +1 -1
  71. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23Errors.sol +1 -1
  72. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23LinkedContractsFactory.sol +5 -1
  73. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfileInitPostDeploymentModule.sol +1 -1
  74. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfilePostDeploymentModule.sol +1 -1
  75. package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +1 -1
  76. package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +8 -3
  77. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +1 -97
  78. package/contracts/LSP3ProfileMetadata/LSP3Constants.sol +1 -1
  79. package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
  80. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +8 -3
  81. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +8 -3
  82. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +4 -3
  83. package/contracts/LSP6KeyManager/LSP6Constants.sol +4 -3
  84. package/contracts/LSP6KeyManager/LSP6Errors.sol +2 -23
  85. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +0 -1
  86. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +134 -99
  87. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +0 -1
  88. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +1 -2
  89. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol +27 -0
  90. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +31 -25
  91. package/contracts/LSP6KeyManager/LSP6Utils.sol +29 -2
  92. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +10 -10
  93. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -1
  94. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +22 -8
  95. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +180 -118
  96. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +21 -7
  97. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +12 -3
  98. package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +5 -1
  99. package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +4 -1
  100. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +7 -7
  101. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +3 -3
  102. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +120 -53
  103. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +122 -53
  104. package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +3 -3
  105. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +4 -4
  106. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +2 -2
  107. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +4 -4
  108. package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +4 -4
  109. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +1 -1
  110. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +4 -4
  111. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +11 -11
  112. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +12 -1
  113. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +32 -16
  114. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +61 -11
  115. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +113 -74
  116. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +63 -10
  117. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +1 -1
  118. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +1 -1
  119. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +7 -7
  120. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +3 -3
  121. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +162 -73
  122. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +168 -84
  123. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +7 -7
  124. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +7 -7
  125. package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -3
  126. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +8 -7
  127. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +5 -3
  128. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +13 -7
  129. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +9 -8
  130. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +9 -3
  131. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +10 -8
  132. package/contracts/LSP9Vault/ILSP9Vault.sol +0 -13
  133. package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
  134. package/contracts/LSP9Vault/LSP9Errors.sol +1 -1
  135. package/contracts/LSP9Vault/LSP9VaultCore.sol +58 -41
  136. package/devdocs/LSP0ERC725Account.json +73 -45
  137. package/devdocs/LSP0ERC725AccountInit.json +73 -45
  138. package/devdocs/LSP11BasicSocialRecovery.json +13 -0
  139. package/devdocs/LSP11BasicSocialRecoveryInit.json +13 -0
  140. package/devdocs/LSP16UniversalFactory.json +9 -9
  141. package/devdocs/LSP1UniversalReceiverDelegateUP.json +1 -6
  142. package/devdocs/LSP1UniversalReceiverDelegateVault.json +1 -6
  143. package/devdocs/LSP4DigitalAssetMetadata.json +32 -10
  144. package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +32 -10
  145. package/devdocs/LSP6KeyManager.json +12 -14
  146. package/devdocs/LSP6KeyManagerInit.json +12 -14
  147. package/devdocs/LSP7CappedSupply.json +47 -20
  148. package/devdocs/LSP7CappedSupplyInitAbstract.json +47 -20
  149. package/devdocs/LSP7CompatibleERC20.json +88 -24
  150. package/devdocs/LSP7CompatibleERC20InitAbstract.json +88 -24
  151. package/devdocs/LSP7CompatibleERC20Mintable.json +88 -24
  152. package/devdocs/LSP7CompatibleERC20MintableInit.json +88 -24
  153. package/devdocs/LSP7DigitalAsset.json +47 -20
  154. package/devdocs/LSP7DigitalAssetInitAbstract.json +47 -20
  155. package/devdocs/LSP7Mintable.json +47 -20
  156. package/devdocs/LSP7MintableInit.json +47 -20
  157. package/devdocs/LSP8CappedSupply.json +57 -25
  158. package/devdocs/LSP8CappedSupplyInitAbstract.json +57 -25
  159. package/devdocs/LSP8CompatibleERC721.json +84 -31
  160. package/devdocs/LSP8CompatibleERC721InitAbstract.json +84 -31
  161. package/devdocs/LSP8CompatibleERC721Mintable.json +86 -33
  162. package/devdocs/LSP8CompatibleERC721MintableInit.json +87 -34
  163. package/devdocs/LSP8IdentifiableDigitalAsset.json +61 -26
  164. package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +57 -25
  165. package/devdocs/LSP8Mintable.json +59 -27
  166. package/devdocs/LSP8MintableInit.json +60 -28
  167. package/devdocs/LSP9Vault.json +57 -35
  168. package/devdocs/LSP9VaultInit.json +57 -35
  169. package/devdocs/UniversalProfile.json +73 -45
  170. package/devdocs/UniversalProfileInit.json +73 -45
  171. package/dist/constants.cjs.js +4323 -2361
  172. package/dist/constants.d.ts +2933 -1022
  173. package/dist/constants.es.js +4322 -2361
  174. package/package.json +8 -6
  175. package/userdocs/LSP0ERC725Account.json +17 -8
  176. package/userdocs/LSP0ERC725AccountInit.json +17 -8
  177. package/userdocs/LSP16UniversalFactory.json +26 -1
  178. package/userdocs/LSP1UniversalReceiverDelegateUP.json +1 -11
  179. package/userdocs/LSP1UniversalReceiverDelegateVault.json +1 -11
  180. package/userdocs/LSP4DigitalAssetMetadata.json +7 -4
  181. package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +7 -4
  182. package/userdocs/LSP6KeyManager.json +0 -5
  183. package/userdocs/LSP6KeyManagerInit.json +0 -5
  184. package/userdocs/LSP7CappedSupply.json +14 -6
  185. package/userdocs/LSP7CappedSupplyInitAbstract.json +13 -5
  186. package/userdocs/LSP7CompatibleERC20.json +15 -5
  187. package/userdocs/LSP7CompatibleERC20InitAbstract.json +15 -5
  188. package/userdocs/LSP7CompatibleERC20Mintable.json +15 -5
  189. package/userdocs/LSP7CompatibleERC20MintableInit.json +15 -5
  190. package/userdocs/LSP7DigitalAsset.json +15 -5
  191. package/userdocs/LSP7DigitalAssetInitAbstract.json +15 -5
  192. package/userdocs/LSP7Mintable.json +15 -5
  193. package/userdocs/LSP7MintableInit.json +15 -5
  194. package/userdocs/LSP8CappedSupply.json +13 -5
  195. package/userdocs/LSP8CappedSupplyInitAbstract.json +12 -4
  196. package/userdocs/LSP8CompatibleERC721.json +27 -17
  197. package/userdocs/LSP8CompatibleERC721InitAbstract.json +27 -17
  198. package/userdocs/LSP8CompatibleERC721Mintable.json +28 -18
  199. package/userdocs/LSP8CompatibleERC721MintableInit.json +29 -19
  200. package/userdocs/LSP8IdentifiableDigitalAsset.json +15 -5
  201. package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +14 -4
  202. package/userdocs/LSP8Mintable.json +15 -5
  203. package/userdocs/LSP8MintableInit.json +16 -6
  204. package/userdocs/LSP9Vault.json +20 -11
  205. package/userdocs/LSP9VaultInit.json +20 -11
  206. package/userdocs/UniversalProfile.json +17 -8
  207. package/userdocs/UniversalProfileInit.json +17 -8
  208. package/artifacts/LSP4Compatibility.json +0 -216
  209. package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +0 -25
  210. package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +0 -38
  211. package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +0 -83
  212. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +0 -175
  213. package/devdocs/LSP4Compatibility.json +0 -79
  214. package/userdocs/LSP4Compatibility.json +0 -20
@@ -20,7 +20,17 @@ import {
20
20
  // constants
21
21
  import {ALL_REGULAR_PERMISSIONS} from "../LSP6KeyManager/LSP6Constants.sol";
22
22
  import {_INTERFACEID_LSP11} from "./LSP11Constants.sol";
23
- import "./LSP11Errors.sol";
23
+ import {
24
+ CallerIsNotGuardian,
25
+ GuardianAlreadyExist,
26
+ GuardianDoNotExist,
27
+ GuardiansNumberCannotGoBelowThreshold,
28
+ ThresholdCannotBeHigherThanGuardiansNumber,
29
+ SecretHashCannotBeZero,
30
+ AddressZeroNotAllowed,
31
+ ThresholdNotReachedForRecoverer,
32
+ WrongPlainSecret
33
+ } from "./LSP11Errors.sol";
24
34
 
25
35
  /**
26
36
  * @title Core Implementation of LSP11-BasicSocialRecovery standard
@@ -75,42 +85,68 @@ abstract contract LSP11BasicSocialRecoveryCore is
75
85
  /**
76
86
  * @inheritdoc ILSP11BasicSocialRecovery
77
87
  */
78
- function target() public view virtual returns (address) {
88
+ function target() public view virtual override returns (address) {
79
89
  return _target;
80
90
  }
81
91
 
82
92
  /**
83
93
  * @inheritdoc ILSP11BasicSocialRecovery
84
94
  */
85
- function getRecoveryCounter() public view virtual returns (uint256) {
95
+ function getRecoveryCounter()
96
+ public
97
+ view
98
+ virtual
99
+ override
100
+ returns (uint256)
101
+ {
86
102
  return _recoveryCounter;
87
103
  }
88
104
 
89
105
  /**
90
106
  * @inheritdoc ILSP11BasicSocialRecovery
91
107
  */
92
- function getGuardians() public view virtual returns (address[] memory) {
108
+ function getGuardians()
109
+ public
110
+ view
111
+ virtual
112
+ override
113
+ returns (address[] memory)
114
+ {
93
115
  return _guardians.values();
94
116
  }
95
117
 
96
118
  /**
97
119
  * @inheritdoc ILSP11BasicSocialRecovery
98
120
  */
99
- function isGuardian(address _address) public view virtual returns (bool) {
121
+ function isGuardian(
122
+ address _address
123
+ ) public view virtual override returns (bool) {
100
124
  return _guardians.contains(_address);
101
125
  }
102
126
 
103
127
  /**
104
128
  * @inheritdoc ILSP11BasicSocialRecovery
105
129
  */
106
- function getGuardiansThreshold() public view virtual returns (uint256) {
130
+ function getGuardiansThreshold()
131
+ public
132
+ view
133
+ virtual
134
+ override
135
+ returns (uint256)
136
+ {
107
137
  return _guardiansThreshold;
108
138
  }
109
139
 
110
140
  /**
111
141
  * @inheritdoc ILSP11BasicSocialRecovery
112
142
  */
113
- function getRecoverySecretHash() public view virtual returns (bytes32) {
143
+ function getRecoverySecretHash()
144
+ public
145
+ view
146
+ virtual
147
+ override
148
+ returns (bytes32)
149
+ {
114
150
  return _recoverySecretHash;
115
151
  }
116
152
 
@@ -119,14 +155,16 @@ abstract contract LSP11BasicSocialRecoveryCore is
119
155
  */
120
156
  function getGuardianChoice(
121
157
  address guardian
122
- ) public view virtual returns (address) {
158
+ ) public view virtual override returns (address) {
123
159
  return _guardiansChoice[_recoveryCounter][guardian];
124
160
  }
125
161
 
126
162
  /**
127
163
  * @inheritdoc ILSP11BasicSocialRecovery
128
164
  */
129
- function addGuardian(address newGuardian) public virtual onlyOwner {
165
+ function addGuardian(
166
+ address newGuardian
167
+ ) public virtual override onlyOwner {
130
168
  if (_guardians.contains(newGuardian))
131
169
  revert GuardianAlreadyExist(newGuardian);
132
170
 
@@ -137,7 +175,9 @@ abstract contract LSP11BasicSocialRecoveryCore is
137
175
  /**
138
176
  * @inheritdoc ILSP11BasicSocialRecovery
139
177
  */
140
- function removeGuardian(address existingGuardian) public virtual onlyOwner {
178
+ function removeGuardian(
179
+ address existingGuardian
180
+ ) public virtual override onlyOwner {
141
181
  if (!_guardians.contains(existingGuardian))
142
182
  revert GuardianDoNotExist(existingGuardian);
143
183
  if (_guardians.length() == _guardiansThreshold)
@@ -152,7 +192,7 @@ abstract contract LSP11BasicSocialRecoveryCore is
152
192
  */
153
193
  function setGuardiansThreshold(
154
194
  uint256 newThreshold
155
- ) public virtual onlyOwner {
195
+ ) public virtual override onlyOwner {
156
196
  if (newThreshold > _guardians.length())
157
197
  revert ThresholdCannotBeHigherThanGuardiansNumber(
158
198
  newThreshold,
@@ -169,7 +209,7 @@ abstract contract LSP11BasicSocialRecoveryCore is
169
209
  */
170
210
  function setRecoverySecretHash(
171
211
  bytes32 newRecoverSecretHash
172
- ) public virtual onlyOwner {
212
+ ) public virtual override onlyOwner {
173
213
  if (newRecoverSecretHash == bytes32(0)) revert SecretHashCannotBeZero();
174
214
 
175
215
  _recoverySecretHash = newRecoverSecretHash;
@@ -181,7 +221,7 @@ abstract contract LSP11BasicSocialRecoveryCore is
181
221
  */
182
222
  function selectNewController(
183
223
  address addressSelected
184
- ) public virtual onlyGuardians {
224
+ ) public virtual override onlyGuardians {
185
225
  uint256 currentRecoveryCounter = _recoveryCounter;
186
226
 
187
227
  _guardiansChoice[currentRecoveryCounter][msg.sender] = addressSelected;
@@ -199,7 +239,7 @@ abstract contract LSP11BasicSocialRecoveryCore is
199
239
  address recoverer,
200
240
  string memory plainSecret,
201
241
  bytes32 newSecretHash
202
- ) public virtual {
242
+ ) public virtual override {
203
243
  // caching storage variables
204
244
  uint256 currentRecoveryCounter = _recoveryCounter;
205
245
  address[] memory guardians = _guardians.values();
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: CC0-1.0
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  // --- ERC165 interface ids
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: CC0-1.0
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  // --- Errors
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  /**
@@ -59,7 +59,7 @@ interface ILSP14Ownable2Step {
59
59
  * @dev Transfer ownership of the contract from the current {owner()} to the {pendingOwner()}.
60
60
  *
61
61
  * Once this function is called:
62
- * - The current {owner()} will loose access to the functions restricted to the {owner()} only.
62
+ * - The current {owner()} will lose access to the functions restricted to the {owner()} only.
63
63
  * - The {pendingOwner()} will gain access to the functions restricted to the {owner()} only.
64
64
  *
65
65
  * @notice `msg.sender` is accepting ownership of contract: `address(this)`.
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  bytes4 constant _INTERFACEID_LSP14 = 0x94be5999;
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  /**
@@ -8,7 +8,7 @@ pragma solidity ^0.8.4;
8
8
  * @param renounceOwnershipStart The start timestamp when one can confirm the renouncement of ownership.
9
9
  * @param renounceOwnershipEnd The end timestamp when one can confirm the renouncement of ownership.
10
10
  */
11
- error NotInRenounceOwnershipInterval(
11
+ error LSP14NotInRenounceOwnershipInterval(
12
12
  uint256 renounceOwnershipStart,
13
13
  uint256 renounceOwnershipEnd
14
14
  );
@@ -17,10 +17,16 @@ error NotInRenounceOwnershipInterval(
17
17
  * @dev Reverts when trying to transfer ownership to the `address(this)`.
18
18
  * @notice Cannot transfer ownership to the address of the contract itself.
19
19
  */
20
- error CannotTransferOwnershipToSelf();
20
+ error LSP14CannotTransferOwnershipToSelf();
21
21
 
22
22
  /**
23
23
  * @dev Reverts when pending owner accept ownership in the same transaction of transferring ownership.
24
24
  * @notice Cannot accept ownership in the same transaction with {transferOwnership(...)}.
25
25
  */
26
26
  error LSP14MustAcceptOwnershipInSeparateTransaction();
27
+
28
+ /**
29
+ * @dev Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.
30
+ * @param caller The address that tried to accept ownership.
31
+ */
32
+ error LSP14CallerNotPendingOwner(address caller);
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // interfaces
@@ -13,7 +13,12 @@ import {
13
13
  import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
14
14
 
15
15
  // errors
16
- import "./LSP14Errors.sol";
16
+ import {
17
+ LSP14CallerNotPendingOwner,
18
+ LSP14MustAcceptOwnershipInSeparateTransaction,
19
+ LSP14CannotTransferOwnershipToSelf,
20
+ LSP14NotInRenounceOwnershipInterval
21
+ } from "./LSP14Errors.sol";
17
22
 
18
23
  // constants
19
24
  import {
@@ -45,12 +50,12 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
45
50
  /**
46
51
  * @dev The block number saved when initiating the process of renouncing ownerhsip.
47
52
  */
48
- uint256 private _renounceOwnershipStartedAt;
53
+ uint256 internal _renounceOwnershipStartedAt;
49
54
 
50
55
  /**
51
56
  * @dev see {pendingOwner()}
52
57
  */
53
- address private _pendingOwner;
58
+ address internal _pendingOwner;
54
59
 
55
60
  /**
56
61
  * @dev The boolean that indicates whether the contract is in an active ownership transfer phase
@@ -72,7 +77,7 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
72
77
  *
73
78
  * @custom:info If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
74
79
  */
75
- function pendingOwner() public view virtual returns (address) {
80
+ function pendingOwner() public view virtual override returns (address) {
76
81
  return _pendingOwner;
77
82
  }
78
83
 
@@ -106,7 +111,7 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
106
111
  *
107
112
  * @custom:requirements This function can only be called by the {pendingOwner()}.
108
113
  */
109
- function acceptOwnership() public virtual NotInTransferOwnership {
114
+ function acceptOwnership() public virtual override NotInTransferOwnership {
110
115
  address previousOwner = owner();
111
116
 
112
117
  _acceptOwnership();
@@ -154,7 +159,8 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
154
159
  * @custom:requirements `newOwner` cannot be the address of the contract itself.
155
160
  */
156
161
  function _transferOwnership(address newOwner) internal virtual {
157
- if (newOwner == address(this)) revert CannotTransferOwnershipToSelf();
162
+ if (newOwner == address(this))
163
+ revert LSP14CannotTransferOwnershipToSelf();
158
164
 
159
165
  _pendingOwner = newOwner;
160
166
  delete _renounceOwnershipStartedAt;
@@ -164,10 +170,8 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
164
170
  * @dev Set the pending owner of the contract as the new owner.
165
171
  */
166
172
  function _acceptOwnership() internal virtual {
167
- require(
168
- msg.sender == pendingOwner(),
169
- "LSP14: caller is not the pendingOwner"
170
- );
173
+ if (msg.sender != pendingOwner())
174
+ revert LSP14CallerNotPendingOwner(msg.sender);
171
175
 
172
176
  _setOwner(msg.sender);
173
177
  delete _pendingOwner;
@@ -196,7 +200,7 @@ abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
196
200
  }
197
201
 
198
202
  if (currentBlock < confirmationPeriodStart) {
199
- revert NotInRenounceOwnershipInterval(
203
+ revert LSP14NotInRenounceOwnershipInterval(
200
204
  confirmationPeriodStart,
201
205
  confirmationPeriodEnd
202
206
  );
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // libraries
@@ -8,13 +8,13 @@ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
8
8
  // errors
9
9
 
10
10
  /**
11
- * @dev Reverts when there is no revert reason bubbled up by the contract created when initializing
11
+ * @notice Couldn't initialize the contract.
12
+ * @dev Reverts when there is no revert reason bubbled up by the created contract when initializing
12
13
  */
13
14
  error ContractInitializationFailed();
14
15
 
15
16
  /**
16
- * @dev Reverts when msg.value sent to {deployCreate2AndInitialize} function is not equal to the sum of the
17
- * `initializeCalldataMsgValue` and `constructorMsgValue`
17
+ * @dev Reverts when `msg.value` sent to {deployCreate2AndInitialize(..)} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`
18
18
  */
19
19
  error InvalidValueSum();
20
20
 
@@ -61,16 +61,17 @@ contract LSP16UniversalFactory {
61
61
  bytes private constant _EMPTY_BYTE = "";
62
62
 
63
63
  /**
64
- * @dev Emitted whenever a contract is created
65
- * @param contractCreated The address of the contract created
66
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
67
- * that will be used by the `CREATE2` opcode for contract deployment
68
- * @param generatedSalt The salt used by the `CREATE2` opcode for contract deployment
69
- * @param initialized The Boolean that specifies if the contract must be initialized or not
70
- * @param initializeCalldata The bytes provided as initializeCalldata (Empty string when `initialized` is set to false)
64
+ * @notice Contract created. Contract address: `createdContract`.
65
+ * @dev Emitted whenever a contract is created.
66
+ *
67
+ * @param createdContract The address of the contract created.
68
+ * @param 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.
69
+ * @param generatedSalt The salt used by the `CREATE2` opcode for contract deployment.
70
+ * @param initialized The Boolean that specifies if the contract must be initialized or not.
71
+ * @param initializeCalldata The bytes provided as initializeCalldata (Empty string when `initialized` is set to false).
71
72
  */
72
73
  event ContractCreated(
73
- address indexed contractCreated,
74
+ address indexed createdContract,
74
75
  bytes32 indexed providedSalt,
75
76
  bytes32 generatedSalt,
76
77
  bool indexed initialized,
@@ -78,24 +79,20 @@ contract LSP16UniversalFactory {
78
79
  );
79
80
 
80
81
  /**
81
- * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed
82
- * can be known in advance via the {computeAddress} function.
82
+ * @notice Contract deployed. Salt, `providedSalt`, used.
83
+ *
84
+ * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function.
83
85
  *
84
86
  * This function deploys contracts without initialization (external call after deployment).
85
87
  *
86
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with
87
- * keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details.
88
+ * 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.
88
89
  *
89
- * Using the same `byteCode` and `providedSalt` multiple times will revert, as the contract cannot be deployed
90
- * twice at the same address.
90
+ * Using the same `byteCode` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address.
91
91
  *
92
- * If the constructor of the contract to deploy is payable, value can be sent to this function to fund
93
- * the created contract. However, sending value to this function while the constructor is not payable will
94
- * result in a revert.
92
+ * 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.
95
93
  *
96
94
  * @param byteCode The bytecode of the contract to be deployed
97
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
98
- * that will be used by the `CREATE2` opcode for contract deployment
95
+ * @param 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
99
96
  *
100
97
  * @return The address of the deployed contract
101
98
  */
@@ -121,28 +118,22 @@ contract LSP16UniversalFactory {
121
118
  }
122
119
 
123
120
  /**
124
- * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed
125
- * can be known in advance via the {computeAddress} function.
121
+ * @notice Contract deployed. Salt, `providedSalt`, used.
122
+ *
123
+ * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function.
126
124
  *
127
125
  * This function deploys contracts with initialization (external call after deployment).
128
126
  *
129
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with
130
- * keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`.
131
- * See {generateSalt} function for more details.
127
+ * 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.
132
128
  *
133
- * Using the same `byteCode`, `providedSalt` and `initializeCalldata` multiple times will revert, as the
134
- * contract cannot be deployed twice at the same address.
129
+ * Using the same `byteCode`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address.
135
130
  *
136
- * If the constructor or the initialize function of the contract to deploy is payable, value can be sent along
137
- * with the deployment/initialization to fund the created contract. However, sending value to this function while
138
- * the constructor/initialize function is not payable will result in a revert.
131
+ * 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.
139
132
  *
140
- * Will revert if the `msg.value` sent to the function is not equal to the sum of `constructorMsgValue` and
141
- * `initializeCalldataMsgValue`.
133
+ * Will revert if the `msg.value` sent to the function is not equal to the sum of `constructorMsgValue` and `initializeCalldataMsgValue`.
142
134
  *
143
135
  * @param byteCode The bytecode of the contract to be deployed
144
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
145
- * that will be used by the `CREATE2` opcode for contract deployment
136
+ * @param 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
146
137
  * @param initializeCalldata The calldata to be executed on the created contract
147
138
  * @param constructorMsgValue The value sent to the contract during deployment
148
139
  * @param initializeCalldataMsgValue The value sent to the contract during initialization
@@ -186,24 +177,22 @@ contract LSP16UniversalFactory {
186
177
  }
187
178
 
188
179
  /**
189
- * @dev Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed
190
- * can be known in advance via the {computeERC1167Address} function.
180
+ * @notice Proxy deployed. Salt, `providedSalt`, used.
181
+ *
182
+ * @dev 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.
191
183
  *
192
184
  * This function deploys contracts without initialization (external call after deployment).
193
185
  *
194
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with
195
- * keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details.
186
+ * 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.
196
187
  *
197
188
  * See {generateSalt} function for more details.
198
189
  *
199
- * Using the same `implementationContract` and `providedSalt` multiple times will revert, as the contract cannot be deployed
200
- * twice at the same address.
190
+ * Using the same `implementationContract` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address.
201
191
  *
202
192
  * Sending value to the contract created is not possible since the constructor of the ERC1167 minimal proxy is not payable.
203
193
  *
204
194
  * @param implementationContract The contract address to use as the base implementation behind the proxy that will be deployed
205
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
206
- * that will be used by the `CREATE2` opcode for contract deployment
195
+ * @param 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
207
196
  *
208
197
  * @return The address of the minimal proxy deployed
209
198
  */
@@ -229,25 +218,22 @@ contract LSP16UniversalFactory {
229
218
  }
230
219
 
231
220
  /**
221
+ * @notice Proxy deployed & initialized. Salt, `providedSalt`, used.
222
+ *
232
223
  * @dev Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed
233
224
  * can be known in advance via the {computeERC1167Address} function.
234
225
  *
235
226
  * This function deploys contracts with initialization (external call after deployment).
236
227
  *
237
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with
238
- * keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`.
228
+ * 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))`.
239
229
  * See {generateSalt} function for more details.
240
230
  *
241
- * Using the same `implementationContract`, `providedSalt` and `initializeCalldata` multiple times will revert, as the
242
- * contract cannot be deployed twice at the same address.
231
+ * Using the same `implementationContract`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address.
243
232
  *
244
- * If the initialize function of the contract to deploy is payable, value can be sent along to fund the created
245
- * contract while initializing. However, sending value to this function while the initialize function is not
246
- * payable will result in a revert.
233
+ * 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.
247
234
  *
248
235
  * @param implementationContract The contract address to use as the base implementation behind the proxy that will be deployed
249
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
250
- * that will be used by the `CREATE2` opcode for contract deployment
236
+ * @param 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
251
237
  * @param initializeCalldata The calldata to be executed on the created contract
252
238
  *
253
239
  * @return The address of the minimal proxy deployed
@@ -285,14 +271,12 @@ contract LSP16UniversalFactory {
285
271
 
286
272
  /**
287
273
  * @dev Computes the address of a contract to be deployed using CREATE2, based on the input parameters.
288
- * Any change in one of these parameters will result in a different address. When the `initializable`
289
- * boolean is set to `false`, `initializeCalldata` will not affect the function output.
274
+ *
275
+ * 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.
290
276
  *
291
277
  * @param byteCodeHash The keccak256 hash of the bytecode to be deployed
292
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
293
- * that will be used by the `CREATE2` opcode for contract deployment
294
- * @param initializable A boolean that indicates whether an external call should be made to initialize the
295
- * contract after deployment
278
+ * @param 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
279
+ * @param initializable A boolean that indicates whether an external call should be made to initialize the contract after deployment
296
280
  * @param initializeCalldata The calldata to be executed on the created contract if `initializable` is set to `true`
297
281
  *
298
282
  * @return The address where the contract will be deployed
@@ -313,14 +297,12 @@ contract LSP16UniversalFactory {
313
297
 
314
298
  /**
315
299
  * @dev Computes the address of an ERC1167 proxy contract based on the input parameters.
316
- * Any change in one of these parameters will result in a different address. When the `initializable`
317
- * boolean is set to `false`, `initializeCalldata` will not affect the function output.
300
+ *
301
+ * 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.
318
302
  *
319
303
  * @param implementationContract The contract to create a clone of according to ERC1167
320
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
321
- * that will be used by the `CREATE2` opcode for contract deployment
322
- * @param initializable A boolean that indicates whether an external call should be made to initialize the
323
- * proxy contract after deployment
304
+ * @param 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
305
+ * @param initializable A boolean that indicates whether an external call should be made to initialize the proxy contract after deployment
324
306
  * @param initializeCalldata The calldata to be executed on the created contract if `initializable` is set to `true`
325
307
  *
326
308
  * @return The address where the ERC1167 proxy contract will be deployed
@@ -344,61 +326,48 @@ contract LSP16UniversalFactory {
344
326
  }
345
327
 
346
328
  /**
347
- * @dev Generates the salt used to deploy the contract by hashing the following parameters (concatenated
348
- * together) with keccak256:
349
- *
350
- * - the `providedSalt`
351
- * - the `initializable` boolean
352
- * - the `initializeCalldata`, only if the contract is initializable (the `initializable` boolean is set to `true`)
353
- *
354
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is
355
- * used along with these parameters:
356
- * - `initializable` boolean
357
- * - `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`).
358
- * These three parameters are concatenated together and hashed to generate the final salt for CREATE2.
329
+ * @dev Generates the salt used to deploy the contract by hashing the following parameters (concatenated together) with keccak256:
330
+ * 1. the `providedSalt`
331
+ * 2. the `initializable` boolean
332
+ * 3. the `initializeCalldata`, only if the contract is initializable (the `initializable` boolean is set to `true`)
359
333
  *
360
- * This approach ensures that in order to reproduce an initializable contract at the same address on another chain,
361
- * not only the `providedSalt` is required to be the same, but also the initialize parameters within the `initializeCalldata`
362
- * must also be the same.
334
+ * - The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is used along with these parameters:
335
+ * 1. `initializable` boolean
336
+ * 2. `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`).
363
337
  *
364
- * This maintains consistent deployment behaviour. Users are required to initialize contracts with the same parameters across
365
- * different chains to ensure contracts are deployed at the same address across different chains.
338
+ * - 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.
366
339
  *
367
- * -----------
368
- * Example (for initializable contracts)
340
+ * 1. Example (for initializable contracts)
369
341
  *
370
- * For an existing contract A on chain 1 owned by X, to replicate the same contract at the same address with
342
+ * - For an existing contract A on chain 1 owned by X, to replicate the same contract at the same address with
371
343
  * the same owner X on chain 2, the salt used to generate the address should include the initializeCalldata
372
344
  * that assigns X as the owner of contract A.
373
345
  *
374
- * For instance, if another user, Y, tries to deploy the contract at the same address
346
+ * - For instance, if another user, Y, tries to deploy the contract at the same address
375
347
  * on chain 2 using the same providedSalt, but with a different initializeCalldata to make Y the owner instead of X,
376
348
  * the generated address would be different, preventing Y from deploying the contract with different ownership
377
349
  * at the same address.
378
- * -----------
379
350
  *
380
- * However, for non-initializable contracts, if the constructor has arguments that specify the deployment behavior, they
351
+ * - However, for non-initializable contracts, if the constructor has arguments that specify the deployment behavior, they
381
352
  * will be included in the bytecode. Any change in the constructor arguments will lead to a different contract's bytecode
382
353
  * which will result in a different address on other chains.
383
354
  *
384
- * -----------
385
- * Example (for non-initializable contracts)
355
+ * 2. Example (for non-initializable contracts)
386
356
  *
387
- * If a contract is deployed with specific constructor arguments on chain 1, these arguments are embedded within the bytecode.
357
+ * - If a contract is deployed with specific constructor arguments on chain 1, these arguments are embedded within the bytecode.
388
358
  * For instance, if contract B is deployed with a specific `tokenName` and `tokenSymbol` on chain 1, and a user wants to deploy
389
359
  * the same contract with the same `tokenName` and `tokenSymbol` on chain 2, they must use the same constructor arguments to
390
360
  * produce the same bytecode. This ensures that the same deployment behaviour is maintained across different chains,
391
361
  * as long as the same bytecode is used.
392
362
  *
393
- * If another user Z, tries to deploy the same contract B at the same address on chain 2 using the same `providedSalt`
363
+ * - If another user Z, tries to deploy the same contract B at the same address on chain 2 using the same `providedSalt`
394
364
  * but different constructor arguments (a different `tokenName` and/or `tokenSymbol`), the generated address will be different.
395
365
  * This prevents user Z from deploying the contract with different constructor arguments at the same address on chain 2.
396
- * -----------
397
366
  *
398
- * The providedSalt was hashed to produce the salt used by CREATE2 opcode to prevent users from deploying initializable contracts
367
+ * - The providedSalt was hashed to produce the salt used by CREATE2 opcode to prevent users from deploying initializable contracts
399
368
  * using non-initializable functions such as {deployCreate2} without having the initialization call.
400
369
  *
401
- * In other words, if the providedSalt was not hashed and was used as it is as the salt by the CREATE2 opcode, malicious users
370
+ * - In other words, if the providedSalt was not hashed and was used as it is as the salt by the CREATE2 opcode, malicious users
402
371
  * can check the generated salt used for the already deployed initializable contract on chain 1, and deploy the contract
403
372
  * from {deployCreate2} function on chain 2, with passing the generated salt of the deployed contract as providedSalt
404
373
  * that will produce the same address but without the initialization, where the malicious user can initialize after.
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  /**