From 0c541ea4bdf70e68754ac6383a098115057c53ab Mon Sep 17 00:00:00 2001 From: J-Dog Date: Wed, 23 Aug 2023 12:24:44 -0700 Subject: [PATCH] Prevent LOCK_SUPPLY if no supply is issued - fixes issue #13 --- indexer/includes/actions/issue.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indexer/includes/actions/issue.php b/indexer/includes/actions/issue.php index d1a2395..ae160bf 100644 --- a/indexer/includes/actions/issue.php +++ b/indexer/includes/actions/issue.php @@ -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)';