Skip to content

Commit

Permalink
fixed issue with getTokenInfo() setting DECIMALS incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
jdogresorg committed May 14, 2024
1 parent 1f7e8a5 commit 15dab84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions indexer/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ function getTokenInfo($tick=null, $tick_id=null, $block_index=null, $tx_index=nu
'OWNER' => ($row->transfer) ? $row->transfer : $row->owner,
'MAX_SUPPLY' => $row->max_supply,
'MAX_MINT' => $row->max_mint,
// Force decimal precision to a integer value
'DECIMALS' => (isset($row->decimals)) ? intval($row->decimals) : 0,
'DESCRIPTION' => $row->description,
'LOCK_MAX_SUPPLY' => $row->lock_max_supply,
Expand All @@ -953,6 +954,9 @@ function getTokenInfo($tick=null, $tick_id=null, $block_index=null, $tx_index=nu
if(substr($key,0,5)=='LOCK_')
if($data[$key]==1)
continue;
// Prevent changing decimal precision
if($key=='DECIMALS' && $data[$key]>$value)
continue;
// Skip setting value if value is null or empty (use last explicit value)
if(!isset($value) || $value=='')
continue;
Expand Down

0 comments on commit 15dab84

Please sign in to comment.