Repository navigation
Conversation
…y for ERC-20 compatibility
Author
|
Closed for further internal architecture analysis and design. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Back in 2020-2021, there were community discussions regarding Waves asset limitations compared to EVM ecosystems: specifically the historical 8-decimal cap and the friction it causes when bridging, tokenizing, or interacting with standard ERC-20 tokens (which standardly use 18 decimals). While back then it was debated, practical EVM/Web3 compatibility has shown that full 18-decimal support and preserving 256-bit
totalSupplyprecision is essential for seamless interoperability.This PR addresses this limitation cleanly, allowing assets to be issued with up to 18 decimals and ensuring full EVM RPC compatibility without altering binary serialization schemes or breaking backward compatibility.
Key Changes
MaxAssetDecimalsfrom 8 to 18:IssueTransaction.scala, updatedMaxAssetDecimals = 18.buf.put(decimals.value)/buf.getByte) and Protobuf usesint32varint. Decimal values in the range0..18use the exact same byte representation.0..8decimals) deserialize and validate identically.totalSupply()in EVM RPC (EthRpcRoute):EthRpcRoute.scala, added/updatedtotalSupply()(0x18160ddd) call to retrieve_.totalVolume.bigIntegerencoded asUint256.HighDecimalsIssueSpecvalidating:IssueTransactionV2Specificationto confirm 0 regressions on historical tx bytes.