@artblocks/contracts 1.0.4 → 1.1.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 (120) hide show
  1. package/README.md +2 -2
  2. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  3. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +97 -10
  4. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +4 -4
  5. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +4 -9
  6. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +4 -9
  7. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -9
  8. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +4 -9
  9. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
  10. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +4 -4
  11. package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
  12. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +19 -0
  13. package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
  14. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +8 -101
  15. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
  16. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
  17. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
  18. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
  19. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
  20. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
  21. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
  22. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
  23. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
  24. package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
  25. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
  26. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  27. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  28. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
  29. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
  30. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
  31. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
  32. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
  33. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
  34. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  35. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
  36. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
  37. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
  38. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
  39. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
  40. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  41. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
  42. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
  43. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
  44. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
  45. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
  46. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
  47. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
  48. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +51 -717
  49. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
  50. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
  51. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
  52. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
  53. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
  54. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
  55. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  56. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
  57. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
  58. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
  59. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
  60. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
  61. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
  62. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
  63. package/contracts/DependencyRegistryV0.sol +84 -16
  64. package/contracts/archive/readme.md +16 -0
  65. package/contracts/engine/README.md +21 -0
  66. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +4 -10
  67. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +4 -10
  68. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +4 -10
  69. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +4 -10
  70. package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
  71. package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
  72. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +3 -0
  73. package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
  74. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +11 -20
  75. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
  76. package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
  77. package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
  78. package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
  79. package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
  80. package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
  81. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +4 -67
  82. package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
  83. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +7 -155
  84. package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
  85. package/contracts/libs/v0.8.x/ABHelpers.sol +14 -14
  86. package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
  87. package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
  88. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +163 -38
  89. package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
  90. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +144 -37
  91. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
  92. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +250 -110
  93. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +257 -48
  94. package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
  95. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +778 -103
  96. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +135 -13
  97. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +567 -187
  98. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +480 -322
  99. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +214 -76
  100. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +347 -304
  101. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
  102. package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1 -54
  103. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +388 -628
  104. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
  105. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
  106. package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
  107. package/contracts/minter-suite/Minters/MinterSEAV1.sol +327 -664
  108. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +278 -303
  109. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
  110. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
  111. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +538 -622
  112. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
  113. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
  114. package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
  115. package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
  116. package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
  117. package/contracts/mock/ReentrancyMockShared.sol +48 -0
  118. package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
  119. package/contracts/randomizer/shared/SharedRandomizerV0.sol +78 -70
  120. package/package.json +39 -33
@@ -4,168 +4,20 @@
4
4
  pragma solidity ^0.8.0;
5
5
 
6
6
  interface ISharedMinterV0 {
7
- // This section defines events for generic project minter configuration updates
8
- /**
9
- * @dev Strings not supported. Recommend conversion of (short) strings to
10
- * bytes32 to remain gas-efficient.
11
- */
12
- /**
13
- * @notice Generic project minter configuration event. Removes key `_key`
14
- * for project `_projectId`.
15
- */
16
- event ConfigKeyRemoved(
17
- uint256 indexed _projectId,
18
- address indexed _coreContract,
19
- bytes32 _key
20
- );
21
- /// BOOL
22
- /**
23
- * @notice Generic project minter configuration event. Sets value of key
24
- * `_key` to `_value` for project `_projectId`.
25
- */
26
- event ConfigValueSet(
27
- uint256 indexed _projectId,
28
- address indexed _coreContract,
29
- bytes32 _key,
30
- bool _value
31
- );
32
- /// UINT256
33
- /**
34
- * @notice Generic project minter configuration event. Sets value of key
35
- * `_key` to `_value` for project `_projectId`.
36
- */
37
- event ConfigValueSet(
38
- uint256 indexed _projectId,
39
- address indexed _coreContract,
40
- bytes32 _key,
41
- uint256 _value
42
- );
43
- /**
44
- * @notice Generic project minter configuration event. Adds value `_value`
45
- * to the set of uint256 at key `_key` for project `_projectId`.
46
- */
47
- event ConfigValueAddedToSet(
48
- uint256 indexed _projectId,
49
- address indexed _coreContract,
50
- bytes32 _key,
51
- uint256 _value
52
- );
53
- /**
54
- * @notice Generic project minter configuration event. Removes value
55
- * `_value` to the set of uint256 at key `_key` for project `_projectId`.
56
- */
57
- event ConfigValueRemovedFromSet(
58
- uint256 indexed _projectId,
59
- address indexed _coreContract,
60
- bytes32 _key,
61
- uint256 _value
62
- );
63
- /// ADDRESS
64
- /**
65
- * @notice Generic project minter configuration event. Sets value of key
66
- * `_key` to `_value` for project `_projectId`.
67
- */
68
- event ConfigValueSet(
69
- uint256 indexed _projectId,
70
- address indexed _coreContract,
71
- bytes32 _key,
72
- address _value
73
- );
74
- /**
75
- * @notice Generic project minter configuration event. Adds value `_value`
76
- * to the set of addresses at key `_key` for project `_projectId`.
77
- */
78
- event ConfigValueAddedToSet(
79
- uint256 indexed _projectId,
80
- address indexed _coreContract,
81
- bytes32 _key,
82
- address _value
83
- );
84
- /**
85
- * @notice Generic project minter configuration event. Removes value
86
- * `_value` to the set of addresses at key `_key` for project `_projectId`.
87
- */
88
- event ConfigValueRemovedFromSet(
89
- uint256 indexed _projectId,
90
- address indexed _coreContract,
91
- bytes32 _key,
92
- address _value
93
- );
94
- /// BYTES32
95
- /**
96
- * @notice Generic project minter configuration event. Sets value of key
97
- * `_key` to `_value` for project `_projectId`.
98
- */
99
- event ConfigValueSet(
100
- uint256 indexed _projectId,
101
- address indexed _coreContract,
102
- bytes32 _key,
103
- bytes32 _value
104
- );
105
- /**
106
- * @notice Generic project minter configuration event. Adds value `_value`
107
- * to the set of bytes32 at key `_key` for project `_projectId`.
108
- */
109
- event ConfigValueAddedToSet(
110
- uint256 indexed _projectId,
111
- address indexed _coreContract,
112
- bytes32 _key,
113
- bytes32 _value
114
- );
115
- /**
116
- * @notice Generic project minter configuration event. Removes value
117
- * `_value` to the set of bytes32 at key `_key` for project `_projectId`.
118
- */
119
- event ConfigValueRemovedFromSet(
120
- uint256 indexed _projectId,
121
- address indexed _coreContract,
122
- bytes32 _key,
123
- bytes32 _value
124
- );
125
- ///////////////////////////
126
- /**
127
- * @notice Price per token in wei updated for project `_projectId` to
128
- * `_pricePerTokenInWei`.
129
- */
130
- event PricePerTokenInWeiUpdated(
131
- uint256 indexed _projectId,
132
- address indexed _coreContract,
133
- uint256 indexed _pricePerTokenInWei
134
- );
135
- /**
136
- * @notice Currency updated for project `_projectId` to symbol
137
- * `_currencySymbol` and address `_currencyAddress`.
138
- */
139
- event ProjectCurrencyInfoUpdated(
140
- uint256 indexed _projectId,
141
- address indexed _coreContract,
142
- address indexed _currencyAddress,
143
- string _currencySymbol
144
- );
145
- /**
146
- * @notice Local max invocations for project `_projectId`, tied to core contract `_coreContractAddress`,
147
- * updated to `_maxInvocations`.
148
- */
149
- event ProjectMaxInvocationsLimitUpdated(
150
- uint256 indexed _projectId,
151
- address indexed _coreContract,
152
- uint256 _maxInvocations
153
- );
154
-
155
7
  // Sets the local max invocations for a given project, checking that the provided max invocations is
156
8
  // less than or equal to the global max invocations for the project set on the core contract.
157
9
  // This does not impact the max invocations value defined on the core contract.
158
10
  function manuallyLimitProjectMaxInvocations(
159
- uint256 _projectId,
160
- address _coreContract,
161
- uint24 _maxInvocations
11
+ uint256 projectId,
12
+ address coreContract,
13
+ uint24 maxInvocations
162
14
  ) external;
163
15
 
164
16
  // Called to make the minter contract aware of the max invocations for a
165
17
  // given project.
166
18
  function syncProjectMaxInvocationsToCore(
167
- uint256 _projectId,
168
- address _coreContract
19
+ uint256 projectId,
20
+ address coreContract
169
21
  ) external;
170
22
 
171
23
  // getter function of public variable
@@ -177,8 +29,8 @@ interface ISharedMinterV0 {
177
29
  // and currency address, assuming this is project's minter.
178
30
  // Supersedes any defined core price.
179
31
  function getPriceInfo(
180
- uint256 _projectId,
181
- address _coreContract
32
+ uint256 projectId,
33
+ address coreContract
182
34
  )
183
35
  external
184
36
  view
@@ -15,9 +15,9 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
15
15
  );
16
16
 
17
17
  /**
18
- * @notice Contract at `_hashSeedSetterContract` allowed to assign
19
- * token hash seeds on core contract `_coreContract` for project
20
- * `_projectId`.
18
+ * @notice Contract at `hashSeedSetterContract` allowed to assign
19
+ * token hash seeds on core contract `coreContract` for project
20
+ * `projectId`.
21
21
  */
22
22
  event HashSeedSetterForProjectUpdated(
23
23
  address indexed coreContract,
@@ -26,7 +26,7 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
26
26
  );
27
27
 
28
28
  /**
29
- * @notice Project with ID `_projectId` is is or is not using a hash seed
29
+ * @notice Project with ID `projectId` is is or is not using a hash seed
30
30
  * setter contract to assign token hash seeds on core contract.
31
31
  */
32
32
  event ProjectUsingHashSeedSetterUpdated(
@@ -39,15 +39,15 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
39
39
  * @notice Allows the artist of a project to set the contract that is
40
40
  * allowed to assign hash seeds to tokens. Typically, this is expected to
41
41
  * be a minter contract, such as `MinterPolyptychV1`.
42
- * @param _coreContract - the core contract that is being configured
43
- * @param _projectId - the project ID that is being configured
44
- * @param _hashSeedSetterContract - the contract that is allowed to assign
42
+ * @param coreContract - the core contract that is being configured
43
+ * @param projectId - the project ID that is being configured
44
+ * @param hashSeedSetterContract - the contract that is allowed to assign
45
45
  * hash seeds to tokens
46
46
  */
47
47
  function setHashSeedSetterContract(
48
- address _coreContract,
49
- uint256 _projectId,
50
- address _hashSeedSetterContract
48
+ address coreContract,
49
+ uint256 projectId,
50
+ address hashSeedSetterContract
51
51
  ) external;
52
52
 
53
53
  /**
@@ -60,48 +60,48 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
60
60
  * An example use case is where the artist wants to mint a polyptych panel
61
61
  * (second, third, etc.) of a project, and therefore wants to re-use
62
62
  * specific hash seeds of the original project.
63
- * @param _coreContract - The address of the core contract
64
- * @param _projectId - The ID of the project to be toggled
63
+ * @param coreContract - The address of the core contract
64
+ * @param projectId - The ID of the project to be toggled
65
65
  */
66
66
  function toggleProjectUseAssignedHashSeed(
67
- address _coreContract,
68
- uint256 _projectId
67
+ address coreContract,
68
+ uint256 projectId
69
69
  ) external;
70
70
 
71
71
  /**
72
72
  * @notice Pre-set the hash seed for a token. This function is only
73
73
  * callable by the hash seed setter contract of the project.
74
- * @param _coreContract - The address of the core contract of `_tokenId`
75
- * @param _tokenId - The ID of the token to set the hash seed for
76
- * @param _hashSeed - The hash seed to set for `_tokenId`
77
- * @dev Only callable by the hash seed setter contract of `_coreContract`.
74
+ * @param coreContract - The address of the core contract of `tokenId`
75
+ * @param tokenId - The ID of the token to set the hash seed for
76
+ * @param hashSeed - The hash seed to set for `tokenId`
77
+ * @dev Only callable by the hash seed setter contract of `coreContract`.
78
78
  */
79
79
  function preSetHashSeed(
80
- address _coreContract,
81
- uint256 _tokenId,
82
- bytes12 _hashSeed
80
+ address coreContract,
81
+ uint256 tokenId,
82
+ bytes12 hashSeed
83
83
  ) external;
84
84
 
85
85
  /**
86
- * @notice Boolean representing whether or not project with ID `_projectId`
87
- * on core contract `_coreContract` is currently using a hash seed setter
86
+ * @notice Boolean representing whether or not project with ID `projectId`
87
+ * on core contract `coreContract` is currently using a hash seed setter
88
88
  * contract to assign hash seeds to tokens.
89
89
  */
90
90
  function projectUsesHashSeedSetter(
91
- address _coreContract,
92
- uint256 _projectId
93
- ) external view returns (bool _usingHashSeedSetter);
91
+ address coreContract,
92
+ uint256 projectId
93
+ ) external view returns (bool usingHashSeedSetter);
94
94
 
95
95
  /**
96
96
  * Returns the hash seed setter contract for a given core contract.
97
97
  * Returns address(0) if no hash seed setter contract is set for the core.
98
- * @param _coreContract - The address of the core contract
99
- * @param _projectId - The ID of the project to query
98
+ * @param coreContract - The address of the core contract
99
+ * @param projectId - The ID of the project to query
100
100
  */
101
101
  function hashSeedSetterContracts(
102
- address _coreContract,
103
- uint256 _projectId
104
- ) external view returns (address _hashSeedSetterContract);
102
+ address coreContract,
103
+ uint256 projectId
104
+ ) external view returns (address hashSeedSetterContract);
105
105
 
106
106
  /**
107
107
  * Returns the current pre-assigned hash seed for a given token ID.
@@ -112,12 +112,12 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
112
112
  * the hash seed is generated on-chain by the pseudorandom atomic contract
113
113
  * and is not stored on-chain in this randomizer contract, and therefore
114
114
  * this function will return bytes12(0).
115
- * @param _coreContract - The address of the core contract of `_tokenId`
116
- * @param _tokenId - The ID of the token to get the hash seed for
117
- * @return _hashSeed - The stored hash seed for `_tokenId`
115
+ * @param coreContract - The address of the core contract of `tokenId`
116
+ * @param tokenId - The ID of the token to get the hash seed for
117
+ * @return hashSeed - The stored hash seed for `tokenId`
118
118
  */
119
119
  function preAssignedHashSeed(
120
- address _coreContract,
121
- uint256 _tokenId
122
- ) external view returns (bytes12 _hashSeed);
120
+ address coreContract,
121
+ uint256 tokenId
122
+ ) external view returns (bytes12 hashSeed);
123
123
  }
@@ -14,42 +14,42 @@ library ABHelpers {
14
14
  uint256 constant ONE_MILLION = 1_000_000;
15
15
 
16
16
  /**
17
- * Convert token id to project id.
18
- * @param _tokenId The id of the token.
17
+ * @notice Function to convert token id to project id.
18
+ * @param tokenId The id of the token.
19
19
  */
20
20
  function tokenIdToProjectId(
21
- uint256 _tokenId
21
+ uint256 tokenId
22
22
  ) internal pure returns (uint256) {
23
23
  // int division properly rounds down
24
24
  // @dev unchecked because will never divide by zero
25
25
  unchecked {
26
- return _tokenId / ONE_MILLION;
26
+ return tokenId / ONE_MILLION;
27
27
  }
28
28
  }
29
29
 
30
30
  /**
31
- * Convert token id to token number.
32
- * @param _tokenId The id of the token.
31
+ * @notice Function to convert token id to token number.
32
+ * @param tokenId The id of the token.
33
33
  */
34
34
  function tokenIdToTokenNumber(
35
- uint256 _tokenId
35
+ uint256 tokenId
36
36
  ) internal pure returns (uint256) {
37
37
  // mod returns remainder, which is the token number
38
38
  // @dev no way to disable mod zero check in solidity, so not unchecked
39
- return _tokenId % ONE_MILLION;
39
+ return tokenId % ONE_MILLION;
40
40
  }
41
41
 
42
42
  /**
43
- * Convert project id and token number to token id.
44
- * @param _projectId The id of the project.
45
- * @param _tokenNumber The token number.
43
+ * @notice Function to convert project id and token number to token id.
44
+ * @param projectId The id of the project.
45
+ * @param tokenNumber The token number.
46
46
  */
47
47
  function tokenIdFromProjectIdAndTokenNumber(
48
- uint256 _projectId,
49
- uint256 _tokenNumber
48
+ uint256 projectId,
49
+ uint256 tokenNumber
50
50
  ) internal pure returns (uint256) {
51
51
  // @dev intentionally not unchecked to ensure overflow detection, which
52
52
  // would likley only occur in a malicious call
53
- return (_projectId * ONE_MILLION) + _tokenNumber;
53
+ return (projectId * ONE_MILLION) + tokenNumber;
54
54
  }
55
55
  }
@@ -3,8 +3,8 @@
3
3
 
4
4
  pragma solidity ^0.8.0;
5
5
 
6
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
7
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
6
+ import {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
7
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
8
8
 
9
9
  /**
10
10
  * @title Art Blocks Authorization Minter Library
@@ -16,111 +16,110 @@ import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
16
16
 
17
17
  library AuthLib {
18
18
  /**
19
- * function to restrict access to only AdminACL allowed calls, where
19
+ * @notice Function to restrict access to only AdminACL allowed calls, where
20
20
  * AdminACL is the admin of an IMinterFilterV1.
21
21
  * Reverts if not allowed.
22
- * @param _minterFilterAddress address of the minter filter to be checked,
22
+ * @param minterFilterAddress address of the minter filter to be checked,
23
23
  * should implement IMinterFilterV1
24
- * @param _sender address of the caller
25
- * @param _contract address of the contract being called
26
- * @param _selector selector of the function being called
24
+ * @param sender address of the caller
25
+ * @param contract_ address of the contract being called
26
+ * @param selector selector of the function being called
27
27
  */
28
28
  function onlyMinterFilterAdminACL(
29
- address _minterFilterAddress,
30
- address _sender,
31
- address _contract,
32
- bytes4 _selector
29
+ address minterFilterAddress,
30
+ address sender,
31
+ address contract_,
32
+ bytes4 selector
33
33
  ) internal {
34
34
  require(
35
35
  _minterFilterAdminACLAllowed({
36
- _minterFilterAddress: _minterFilterAddress,
37
- _sender: _sender,
38
- _contract: _contract,
39
- _selector: _selector
36
+ minterFilterAddress: minterFilterAddress,
37
+ sender: sender,
38
+ contract_: contract_,
39
+ selector: selector
40
40
  }),
41
41
  "Only MinterFilter AdminACL"
42
42
  );
43
43
  }
44
44
 
45
45
  /**
46
- * Function to restrict access to only AdminACL allowed calls, where
47
- * AdminACL is the admin of a core contract at `_coreContract`.
46
+ * @notice Function to restrict access to only AdminACL allowed calls, where
47
+ * AdminACL is the admin of a core contract at `coreContract`.
48
48
  * Reverts if not allowed.
49
- * @param _coreContract address of the core contract to be checked
50
- * @param _sender address of the caller
51
- * @param _contract address of the contract being called
52
- * @param _selector selector of the function being called
49
+ * @param coreContract address of the core contract to be checked
50
+ * @param sender address of the caller
51
+ * @param contract_ address of the contract being called
52
+ * @param selector selector of the function being called
53
53
  */
54
54
  function onlyCoreAdminACL(
55
- address _coreContract,
56
- address _sender,
57
- address _contract,
58
- bytes4 _selector
55
+ address coreContract,
56
+ address sender,
57
+ address contract_,
58
+ bytes4 selector
59
59
  ) internal {
60
60
  require(
61
61
  _coreAdminACLAllowed({
62
- _coreContract: _coreContract,
63
- _sender: _sender,
64
- _contract: _contract,
65
- _selector: _selector
62
+ coreContract: coreContract,
63
+ sender: sender,
64
+ contract_: contract_,
65
+ selector: selector
66
66
  }),
67
67
  "Only Core AdminACL allowed"
68
68
  );
69
69
  }
70
70
 
71
71
  /**
72
- * @notice Throws if `_sender` is any account other than the artist of the
73
- * specified project `_projectId` on core contract `_coreContract`.
74
- * Requirements: `msg.sender` must be the artist associated with
75
- * `_projectId` on `_coreContract`.
76
- * @param _projectId The ID of the project being checked.
77
- * @param _coreContract The address of the GenArt721CoreContractV3_Base
72
+ * @notice Throws if `sender` is any account other than the artist of the
73
+ * specified project `projectId` on core contract `coreContract`.
74
+ * @param projectId The ID of the project being checked.
75
+ * @param coreContract The address of the GenArt721CoreContractV3_Base
78
76
  * contract.
79
- * @param _sender Wallet to check. Typically, the address of the caller.
77
+ * @param sender Wallet to check. Typically, the address of the caller.
78
+ * @dev `sender` must be the artist associated with `projectId` on `coreContract`.
80
79
  */
81
80
  function onlyArtist(
82
- uint256 _projectId,
83
- address _coreContract,
84
- address _sender
81
+ uint256 projectId,
82
+ address coreContract,
83
+ address sender
85
84
  ) internal view {
86
85
  require(
87
86
  _senderIsArtist({
88
- _projectId: _projectId,
89
- _coreContract: _coreContract,
90
- _sender: _sender
87
+ projectId: projectId,
88
+ coreContract: coreContract,
89
+ sender: sender
91
90
  }),
92
91
  "Only Artist"
93
92
  );
94
93
  }
95
94
 
96
95
  /**
97
- * function to restrict access to only the artist of a project, or AdminACL
96
+ * @notice Function to restrict access to only the artist of a project, or AdminACL
98
97
  * allowed calls, where AdminACL is the admin of a core contract at
99
- * `_coreContract`.
100
- * @param _projectId id of the project
101
- * @param _coreContract address of the core contract to be checked
102
- * @param _sender address of the caller
103
- * @param _contract address of the contract being called
104
- * @param _selector selector of the function being called
98
+ * `coreContract`.
99
+ * @param projectId id of the project
100
+ * @param coreContract address of the core contract to be checked
101
+ * @param sender address of the caller
102
+ * @param contract_ address of the contract being called
103
+ * @param selector selector of the function being called
105
104
  */
106
105
  function onlyCoreAdminACLOrArtist(
107
- uint256 _projectId,
108
- address _coreContract,
109
- address _sender,
110
- address _contract,
111
- bytes4 _selector
106
+ uint256 projectId,
107
+ address coreContract,
108
+ address sender,
109
+ address contract_,
110
+ bytes4 selector
112
111
  ) internal {
113
112
  require(
114
113
  _senderIsArtist({
115
- _projectId: _projectId,
116
- _coreContract: _coreContract,
117
- _sender: _sender
114
+ projectId: projectId,
115
+ coreContract: coreContract,
116
+ sender: sender
118
117
  }) ||
119
118
  _coreAdminACLAllowed({
120
- _coreContract: _coreContract,
121
- _sender: _sender,
122
- _contract: _contract,
123
- _selector: _selector
119
+ coreContract: coreContract,
120
+ sender: sender,
121
+ contract_: contract_,
122
+ selector: selector
124
123
  }),
125
124
  "Only Artist or Core Admin ACL"
126
125
  );
@@ -131,67 +130,67 @@ library AuthLib {
131
130
  // ------------------------------------------------------------------------
132
131
 
133
132
  /**
134
- * Private function that returns if minter filter contract's AdminACL
135
- * allows `_sender` to call function with selector `_selector` on contract
136
- * `_contract`.
137
- * @param _minterFilterAddress address of the minter filter to be checked.
133
+ * @notice Private function that returns if minter filter contract's AdminACL
134
+ * allows `sender` to call function with selector `selector` on contract
135
+ * `contract`.
136
+ * @param minterFilterAddress address of the minter filter to be checked.
138
137
  * Should implement IMinterFilterV1.
139
- * @param _sender address of the caller
140
- * @param _contract address of the contract being called
141
- * @param _selector selector of the function being called
138
+ * @param sender address of the caller
139
+ * @param contract_ address of the contract being called
140
+ * @param selector selector of the function being called
142
141
  */
143
142
  function _minterFilterAdminACLAllowed(
144
- address _minterFilterAddress,
145
- address _sender,
146
- address _contract,
147
- bytes4 _selector
143
+ address minterFilterAddress,
144
+ address sender,
145
+ address contract_,
146
+ bytes4 selector
148
147
  ) private returns (bool) {
149
148
  return
150
- IMinterFilterV1(_minterFilterAddress).adminACLAllowed({
151
- _sender: _sender,
152
- _contract: _contract,
153
- _selector: _selector
149
+ IMinterFilterV1(minterFilterAddress).adminACLAllowed({
150
+ sender: sender,
151
+ contract_: contract_,
152
+ selector: selector
154
153
  });
155
154
  }
156
155
 
157
156
  /**
158
- * Private function that returns if core contract's AdminACL allows
159
- * `_sender` to call function with selector `_selector` on contract
160
- * `_contract`.
161
- * @param _coreContract address of the core contract to be checked
162
- * @param _sender address of the caller
163
- * @param _contract address of the contract being called
164
- * @param _selector selector of the function being called
157
+ * @notice Private function that returns if core contract's AdminACL allows
158
+ * `sender` to call function with selector `selector` on contract
159
+ * `contract`.
160
+ * @param coreContract address of the core contract to be checked
161
+ * @param sender address of the caller
162
+ * @param contract_ address of the contract being called
163
+ * @param selector selector of the function being called
165
164
  */
166
165
  function _coreAdminACLAllowed(
167
- address _coreContract,
168
- address _sender,
169
- address _contract,
170
- bytes4 _selector
166
+ address coreContract,
167
+ address sender,
168
+ address contract_,
169
+ bytes4 selector
171
170
  ) private returns (bool) {
172
171
  return
173
- IGenArt721CoreContractV3_Base(_coreContract).adminACLAllowed({
174
- _sender: _sender,
175
- _contract: _contract,
176
- _selector: _selector
172
+ IGenArt721CoreContractV3_Base(coreContract).adminACLAllowed({
173
+ _sender: sender,
174
+ _contract: contract_,
175
+ _selector: selector
177
176
  });
178
177
  }
179
178
 
180
179
  /**
181
- * Private function that returns if `_sender` is the artist of `_projectId`
182
- * on `_coreContract`.
183
- * @param _projectId project ID to check
184
- * @param _coreContract core contract to check
185
- * @param _sender wallet to check
180
+ * @notice Private function that returns if `sender` is the artist of `projectId`
181
+ * on `coreContract`.
182
+ * @param projectId project ID to check
183
+ * @param coreContract core contract to check
184
+ * @param sender wallet to check
186
185
  */
187
186
  function _senderIsArtist(
188
- uint256 _projectId,
189
- address _coreContract,
190
- address _sender
187
+ uint256 projectId,
188
+ address coreContract,
189
+ address sender
191
190
  ) private view returns (bool senderIsArtist) {
192
191
  return
193
- _sender ==
194
- IGenArt721CoreContractV3_Base(_coreContract)
195
- .projectIdToArtistAddress(_projectId);
192
+ sender ==
193
+ IGenArt721CoreContractV3_Base(coreContract)
194
+ .projectIdToArtistAddress(projectId);
196
195
  }
197
196
  }