Summary
A key invariant of the contract is that total supply always equals the sum of all individual holder balances. Tests that modify supply or balances should verify this invariant after every state change. A shared assertion helper makes this check easy to add to any test.
Scope
- Add
assert_supply_equals_holder_sum(env, creator_id, holders: Vec<Address>) test helper
- Reads total supply and each holder's balance, sums balances, asserts equality
- Panics with a descriptive message showing total supply and computed sum if they differ
- Use the helper in existing buy, sell, and transfer tests
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
A key invariant of the contract is that total supply always equals the sum of all individual holder balances. Tests that modify supply or balances should verify this invariant after every state change. A shared assertion helper makes this check easy to add to any test.
Scope
assert_supply_equals_holder_sum(env, creator_id, holders: Vec<Address>)test helperAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram