Description
When payment_token_decimals is provided at registration it must match the on-chain payment-token contract's decimals(). Reject mismatches with a structured error to prevent display corruption.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/lib.rs, docs/multi-offering-payment-token-independence.md
- Guard must be robust to token contracts that revert on decimals()
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/decimals-consistency
- Implement changes
- Query token decimals via cross-contract call
- Compare with declared value
- Reject with
DecimalsMismatch
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Token contract returning zero decimals and reverting decimals
- Include test output and security notes
Example commit message
feat: guard against decimals mismatch on register
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
When
payment_token_decimalsis provided at registration it must match the on-chain payment-token contract'sdecimals(). Reject mismatches with a structured error to prevent display corruption.Requirements and context
src/lib.rs,docs/multi-offering-payment-token-independence.mdSuggested execution
git checkout -b feat/decimals-consistencyDecimalsMismatchTest and commit
cargo test --allExample commit message
feat: guard against decimals mismatch on registerGuidelines