You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Solidity: Premint amounts below 1 with a leading fractional zero generate code that does not compile #893
The same happens for other amounts such as 0.001 or 0.001e1, and for Stablecoin, RWA, and Confidential ERC7984, which share calculatePremint.
Expected behavior
The generated line is _mint(recipient, 5 * 10 ** (decimals() - 2));, which compiles.
Cause
calculatePremint in packages/core/solidity/src/erc20.ts strips leading zeros from the integer part and trailing zeros from the fractional part, then concatenates them. Leading zeros of the fractional part remain at the start of units when the integer part is empty.
Activity