Skip to content

chore(tokenization): disable inclusive protocol fee + seed e2e personas#99

Open
trevormil wants to merge 3 commits into
masterfrom
chore/disable-protocol-fee-local
Open

chore(tokenization): disable inclusive protocol fee + seed e2e personas#99
trevormil wants to merge 3 commits into
masterfrom
chore/disable-protocol-fee-local

Conversation

@trevormil
Copy link
Copy Markdown
Collaborator

Summary

Sets the inclusive protocol fee to off for local-dev / e2e flows by flipping
ProtocolFeeDenominator from 1000 to 0 and guarding the fee math on that
value. Also seeds two e2e personas (e2e-alice / e2e-bob) in config.yml.

Why

The 0.1% inclusive protocol fee breaks the 1:1 redeem math on prediction-market
escrows: deposit pulls 99.9% net into escrow but the matching settlement-redeem
approval is configured to pay back 100%, so every full-balance redeem reverts
with insufficient ibc/F082B65C…. The aggregator e2e suite — and any test/dev
flow that round-trips a market deposit through a winner/push redeem — hits this
wall as designed.

Flipping the denominator to 0 short-circuits the fee math (protocolFeeInt
becomes sdkmath.ZeroInt() and sendProtocolFee is never called) so the 1:1
quoted amount flows end-to-end without a community-pool skim.

Test plan

  • go test -tags=test -count=1 ./x/tokenization/keeper/ — all keeper tests
    pass on this branch (the 3 inclusive-fee asserts skip when the fee is off,
    via a new skipIfFeeDisabled() helper; the rounding-to-zero test also
    skips since "rounds to zero" is degenerate when the fee is already zero).
  • Re-enabling: set ProtocolFeeDenominator = 1000 in coin_transfers.go
    the guarded math path is restored and the skipped tests run again.

Config changes

config.yml: adds e2e-alice + e2e-bob accounts mirroring the existing
keplr* seed pattern (BADGE + ustake + 3 IBC denoms + chaosnet badges). Local
devnet only — ignite chain serve consumes this file; mainnet/testnet
genesis is untouched.

🤖 Generated with Claude Code

trevormil and others added 3 commits May 20, 2026 22:33
Sets ProtocolFeeDenominator to 0 so the inclusive 0.1% fee on coin transfers
is a no-op. Guarded by `if ProtocolFeeDenominator > 0` in ExecuteCoinTransfers
so flipping the constant back to 1000 (or any value) instantly re-enables it.

Why now: prediction-market escrows quote 1:1 redeem (1 USDC per YES/NO at
settlement), but the 0.1% fee on the deposit's coin transfer leaves the escrow
short of what the matching redeem will pull back. Result on local dev: every
full-balance redeem reverts with "insufficient ibc/F082B65C…" because the
escrow has 99.9% of gross while the redeem asks for 100%. Disabling the fee
lets the 1:1 math hold cleanly for local + e2e flows.

Also: seed `e2e-alice` + `e2e-bob` personas in config.yml so a fresh
`ignite chain serve --reset-once` brings them up with USDC + IBC test balances
ready for the bitbadges-pm aggregator e2e suite (see #98).

Tests in inclusive_protocol_fees_test.go gain a `skipIfFeeDisabled()` guard —
the asserts encode the OLD non-zero-fee behavior and would otherwise fail.
Re-enabling the fee (constant back to 1000) automatically re-enables those tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a fourth keplr-style devnet account so the bb1rf737jw22hamxv3pg29jm7wxhyxqwtl4400y0x
wallet starts with the same BADGE/USDC/IBC/chaosnet balances as keplr1–3 and
e2e-alice/e2e-bob. Local devnet only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a `faucet` account at bb17yp2zp63wlu2zvzmjl04qhv8y6vvsscygzm3k3 with
~1M USDC equivalent so the bitbadges-pm dispense-USDC button has something
to hand out. Mnemonic stored in bitbadges-pm/apps/aggregator/fixtures/faucet.json
(gitignored).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant