Skip to content

Commit

Permalink
Prevent setting MAX_SUPPLY below current SUPPLY
Browse files Browse the repository at this point in the history
  • Loading branch information
jdogresorg committed Aug 23, 2023
1 parent 0c541ea commit 2b2da67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions indexer/includes/actions/issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ function btnsIssue( $params=null, $data=null, $error=null){
if(!$error && isset($data->MAX_SUPPLY) && ($data->MAX_SUPPLY < MIN_TOKEN_SUPPLY || $data->MAX_SUPPLY > MAX_TOKEN_SUPPLY))
$error = 'invalid: MAX_SUPPLY (min/max)';

// Verify MAX_SUPPLY is not set below current SUPPLY
if(!$error && isset($data->MAX_SUPPLY) && $data->MAX_SUPPLY < $data->SUPPLY)
$error = 'invalid: MAX_SUPPLY < SUPPLY';

// Verify SUPPLY is at least MIN_TOKEN_SUPPLY before allowing LOCK_SUPPLY
if(!$error && $data->LOCK_SUPPLY && (($btInfo && $btInfo->SUPPLY < MIN_TOKEN_SUPPLY) || (!$btInfo && $data->MINT_SUPPLY < MIN_TOKEN_SUPPLY)))
$error = 'invalid: LOCK_SUPPLY (no supply)';
Expand Down

0 comments on commit 2b2da67

Please sign in to comment.