Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Fix loading custom tokens with 0 decimals. #198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions js/main-unminified.js
Original file line number Diff line number Diff line change
Expand Up @@ -118063,7 +118063,13 @@
unsafeResult.constructor.name
? new BigNumber(safeResult)
: safeResult;
callback(void 0, finalResult);

// "0x" is an bad result, a real result 'uint = 0' would have padded zeros 0x0000...
if (functionName === 'decimals' && result === '0x') {
callback("No decimals property at address", undefined);
} else {
callback(void 0, finalResult);
}
} catch (errJson) {
retries > 0
? setTimeout(function() {
Expand Down Expand Up @@ -118109,7 +118115,13 @@
unsafeResult.constructor.name
? new BigNumber(safeResult)
: safeResult;
callback(void 0, finalResult);

// "0x" is an bad result, a real result 'uint = 0' would have padded zeros 0x0000...
if (functionName === 'decimals' && result === '0x') {
callback("No decimals property at address", undefined);
} else {
callback(void 0, finalResult);
}
} catch (errJson) {
proxy(1);
}
Expand Down Expand Up @@ -128731,7 +128743,7 @@
'decimals',
[],
function(err, result) {
!err && result > 0
!err && result && result.greaterThanOrEqualTo(0)
? ((token.decimals = result.toNumber()),
self.utility.call(
self.web3,
Expand Down