Skip to content

fix: use actual fee_divisor in swap receipt instead of hardcoded 100#35

Open
Grizouforever wants to merge 1 commit intoentrius:testfrom
Grizouforever:fix/receipt-fee-divisor
Open

fix: use actual fee_divisor in swap receipt instead of hardcoded 100#35
Grizouforever wants to merge 1 commit intoentrius:testfrom
Grizouforever:fix/receipt-fee-divisor

Conversation

@Grizouforever
Copy link
Copy Markdown

Summary

_display_receipt hardcodes fee_divisor = 100 and displays (1%) while every other function in the swap flow reads the fee divisor from the contract via get_fee_divisor(). If the on-chain fee changes via alw admin set-fee-divisor, the receipt shows an incorrect fee amount and percentage.

Changes

allways/cli/swap_commands/swap.py:

  • Add fee_divisor parameter to _display_receipt() with DEFAULT_FEE_DIVISOR fallback
  • Compute fee percentage dynamically instead of hardcoding (1%)
  • Pass fee_divisor from the caller where it's already read from the contract

_display_receipt hardcodes fee_divisor = 100 while the rest of the
swap flow reads it from the contract via get_fee_divisor(). If the
on-chain fee changes, the receipt shows incorrect fee amounts.

Accept fee_divisor as a parameter with DEFAULT_FEE_DIVISOR fallback,
and compute the fee percentage dynamically instead of hardcoding 1%.
@Grizouforever
Copy link
Copy Markdown
Author

Hi! This PR is ready for review — all 139/139 tests pass. Happy to address any feedback. Thanks!

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