namada
namada copied to clipboard
Murisi/denominated fee amount on 0.28.0
Describe your changes
Made changes necessary to enable hardware wallets to first correctly display amounts in different tokens and second sign over them. Specifically, the following changes were made:
- Converted
WrapperTx::amount_per_gas_unitfromAmounttoDenominatedAmountto enable the hardware wallet to display amount with correct precision regardless of the token. - Modified the protocol to always align the
DenominatedAmount::denomfield before extracting theDenominatedAmount::admountfield so that hardware wallet users cannot be tricked into signing unrelated amounts. - Added checked high level operations (like add, subtract, and multiply) to
DenominatedAmountto reduce the potential for arithmetic mistakes when manipulating the significand and denomination. - Fixed the redacting of
Transfer::amountandTransfer::tokenfor fully shielded transactions. Also fixed the bug whereTransfer::amountand its denomination did not correspond toTransfer::token.
The following are known omissions from this PR:
- Ethereum bridge pool transactions:
EthereumBridgePool::amountandEthereumBridgePool::fee_amountshould probably be converted fromAmounttoDenominatedAmountto allow the hardware wallet to display quantities properly, and the protocol should safely convert them back toAmounts.
Indicate on which release or other PRs this topic is based on
Namada v0.28.0
Checklist before merging to draft
- [x] I have added a changelog
- [x] Git history is in acceptable state