chore(tokenization): disable inclusive protocol fee + seed e2e personas#99
Open
trevormil wants to merge 3 commits into
Open
chore(tokenization): disable inclusive protocol fee + seed e2e personas#99trevormil wants to merge 3 commits into
trevormil wants to merge 3 commits into
Conversation
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sets the inclusive protocol fee to off for local-dev / e2e flows by flipping
ProtocolFeeDenominatorfrom 1000 to 0 and guarding the fee math on thatvalue. Also seeds two e2e personas (
e2e-alice/e2e-bob) inconfig.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/devflow 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 (
protocolFeeIntbecomes
sdkmath.ZeroInt()andsendProtocolFeeis never called) so the 1:1quoted amount flows end-to-end without a community-pool skim.
Test plan
go test -tags=test -count=1 ./x/tokenization/keeper/— all keeper testspass on this branch (the 3 inclusive-fee asserts skip when the fee is off,
via a new
skipIfFeeDisabled()helper; the rounding-to-zero test alsoskips since "rounds to zero" is degenerate when the fee is already zero).
ProtocolFeeDenominator = 1000incoin_transfers.go—the guarded math path is restored and the skipped tests run again.
Config changes
config.yml: addse2e-alice+e2e-bobaccounts mirroring the existingkeplr*seed pattern (BADGE + ustake + 3 IBC denoms + chaosnet badges). Localdevnet only —
ignite chain serveconsumes this file; mainnet/testnetgenesis is untouched.
🤖 Generated with Claude Code