Description
initialize_with_max_supply sets a cap but there is no public view to read it back. The SDK needs this to display whether the token has a supply cap and what it is.
What to do
Confirm max_supply(e: Env) -> i128 exists in contract.rs. If missing, add it:
pub fn max_supply(e: Env) -> i128 {
e.storage().instance().get(&DataKey::MaxSupply).unwrap_or(0i128)
}
Add tests: returns 0 when no cap set, returns the configured cap when set.
Files touched
src/contract.rs
src/test.rs
PR requirement
Closes #[issue_id] — Timeframe: 24 hours
Description
initialize_with_max_supplysets a cap but there is no public view to read it back. The SDK needs this to display whether the token has a supply cap and what it is.What to do
Confirm
max_supply(e: Env) -> i128exists incontract.rs. If missing, add it:Add tests: returns
0when no cap set, returns the configured cap when set.Files touched
src/contract.rssrc/test.rsPR requirement
Closes #[issue_id]— Timeframe: 24 hours