Skip to content

Commit

Permalink
Update to force_collapsing_supply
Browse files Browse the repository at this point in the history
  • Loading branch information
v16Studios committed Oct 10, 2024
1 parent d3b9248 commit cde617a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion database/schema/mysql-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ CREATE TABLE `collections` (
`owner_wallet_id` bigint unsigned NOT NULL,
`max_token_count` varchar(255) DEFAULT NULL,
`max_token_supply` varchar(255) DEFAULT NULL,
`force_single_mint` tinyint(1) NOT NULL DEFAULT '0',
`force_collapsing_supply` tinyint(1) NOT NULL DEFAULT '0',
`royalty_wallet_id` bigint unsigned DEFAULT NULL,
`royalty_percentage` double(8,2) DEFAULT NULL,
`is_frozen` tinyint(1) NOT NULL DEFAULT '0',
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/BatchProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ protected function processBatch(BeamType $type): int
'initialSupply' => $this->tokenCreatedCache[$key] ? null : $claim->quantity,
'amount' => $this->tokenCreatedCache[$key] ? $claim->quantity : null,
'cap' => [
'type' => $claim->quantity == 1 || $claim->collection?->force_single_mint ? TokenMintCapType::COLLAPSING_SUPPLY->name : null,
'amount' => $claim->collection?->force_single_mint ? 1 : null,
'type' => $claim->quantity == 1 || $claim->collection?->force_collapsing_supply ? TokenMintCapType::COLLAPSING_SUPPLY->name : null,
'amount' => $claim->collection?->force_collapsing_supply ? 1 : null,
],
'listingForbidden' => false,
'behaviour' => null,
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/TokensDoNotExistInBeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function prepareStatement(?Model $beam, ?string $collectionId = nu
(tokens.is_currency is false OR tokens.is_currency is NULL)
AND (
collections.max_token_supply = '1'
OR (collections.force_single_mint is true AND tokens.supply = '1')
OR (collections.force_collapsing_supply is true AND tokens.supply = '1')
OR (tokens.cap='" . TokenMintCapType::SUPPLY->name . "' AND tokens.cap_supply = '1')
OR (tokens.cap='" . TokenMintCapType::COLLAPSING_SUPPLY->name . "' AND tokens.supply = '1')
)
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Traits/CreateCollectionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function prepareCollectionData(?string $publicKey = null): void
'owner_wallet_id' => $this->wallet->id,
'max_token_count' => fake()->numberBetween(1),
'max_token_supply' => (string) fake()->numberBetween(1),
'force_single_mint' => fake()->boolean(),
'force_collapsing_supply' => fake()->boolean(),
'is_frozen' => false,
'token_count' => '0',
'attribute_count' => '0',
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function test_it_can_listens_to_events(): void
event($event = new TokenDestroyed($tokenDestroyed));
$this->collection->update([
'max_token_supply' => 100,
'force_single_mint' => false,
'force_collapsing_supply' => false,
]);
BeamClaim::where('beam_id', $this->beam->id)->first()->update([
'collection_id' => $this->collection->id,
Expand Down

0 comments on commit cde617a

Please sign in to comment.