File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
contracts/token/extensions Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ abstract contract ConfidentialFungibleTokenERC20Wrapper is ConfidentialFungibleT
155155 _receivers[requestID] = to;
156156 }
157157
158+ /**
159+ * @dev Returns the default number of decimals of the underlying ERC-20 token that is being wrapped.
160+ * Used as a default fallback when {_tryGetAssetDecimals} fails to fetch decimals of the underlying
161+ * ERC-20 token.
162+ */
163+ function _defaultUnderlyingDecimals () internal pure virtual returns (uint8 ) {
164+ return 18 ;
165+ }
166+
158167 /**
159168 * @dev Returns the maximum number that will be used for {decimals} by the wrapper.
160169 */
@@ -169,6 +178,6 @@ abstract contract ConfidentialFungibleTokenERC20Wrapper is ConfidentialFungibleT
169178 if (success && encodedDecimals.length == 32 ) {
170179 return abi.decode (encodedDecimals, (uint8 ));
171180 }
172- return 18 ;
181+ return _defaultUnderlyingDecimals () ;
173182 }
174183}
You can’t perform that action at this time.
0 commit comments