Skip to content

Commit

Permalink
Prevent LOCK_SUPPLY if no supply is issued
Browse files Browse the repository at this point in the history
- fixes issue #13
  • Loading branch information
jdogresorg committed Aug 23, 2023
1 parent 4f8c99d commit 0c541ea
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 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)';

// Verify DECIMAL min/max
if(!$error && isset($data->DECIMALS) && ($data->DECIMALS < MIN_TOKEN_DECIMALS || $data->DECIMALS > MAX_TOKEN_DECIMALS))
$error = 'invalid: DECIMALS (min/max)';
Expand Down

0 comments on commit 0c541ea

Please sign in to comment.