@@ -192,11 +192,43 @@ contract ExtensionDropSinglePhase1155 is DSTest, Test {
192
192
ext.claim (receiver, 0 , 10 , address (0 ), 0 , alp, "" );
193
193
assertEq (ext.getSupplyClaimedByWallet (0 , receiver), 10 );
194
194
195
+ vm.roll (100 );
195
196
ext.setClaimConditions (0 , conditions[0 ], true );
196
197
assertEq (ext.getSupplyClaimedByWallet (0 , receiver), 0 );
197
198
198
199
vm.prank (receiver, receiver);
199
200
ext.claim (receiver, 0 , 10 , address (0 ), 0 , alp, "" );
200
201
assertEq (ext.getSupplyClaimedByWallet (0 , receiver), 10 );
201
202
}
203
+
204
+ /**
205
+ * note: Testing state; unique condition Id for every token.
206
+ */
207
+ function test_state_claimCondition_uniqueConditionId () public {
208
+ ext.setCondition (true );
209
+ vm.warp (1 );
210
+
211
+ address receiver = address (0x123 );
212
+ address claimer1 = address (0x345 );
213
+ bytes32 [] memory proofs = new bytes32 [](0 );
214
+ uint256 _tokenId = 0 ;
215
+
216
+ MyDropSinglePhase1155.AllowlistProof memory alp;
217
+ alp.proof = proofs;
218
+
219
+ MyDropSinglePhase1155.ClaimCondition[] memory conditions = new MyDropSinglePhase1155.ClaimCondition [](1 );
220
+ conditions[0 ].maxClaimableSupply = 100 ;
221
+ conditions[0 ].quantityLimitPerWallet = 100 ;
222
+
223
+ ext.setClaimConditions (_tokenId, conditions[0 ], false );
224
+
225
+ vm.prank (claimer1, claimer1);
226
+ ext.claim (receiver, _tokenId, 100 , address (0 ), 0 , alp, "" );
227
+
228
+ assertEq (ext.getSupplyClaimedByWallet (_tokenId, claimer1), 100 );
229
+
230
+ // supply claimed for other tokenIds should be 0
231
+ assertEq (ext.getSupplyClaimedByWallet (1 , claimer1), 0 );
232
+ assertEq (ext.getSupplyClaimedByWallet (2 , claimer1), 0 );
233
+ }
202
234
}
0 commit comments