Skip to content

feat: Sovryn Perimeter Fee display on withdraw and close flows - #1151

Open
tjcloa wants to merge 2 commits into
developfrom
sovryn-perimeter-fee
Open

feat: Sovryn Perimeter Fee display on withdraw and close flows#1151
tjcloa wants to merge 2 commits into
developfrom
sovryn-perimeter-fee

Conversation

@tjcloa

@tjcloa tjcloa commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Sovryn Perimeter Fee — fee display on withdraw and close flows

Shows the perimeter fee (rate, amount, and net "You will receive") on lending
withdrawals, borrower exits, Zero collateral withdrawal/close, and the surplus-claim
view. Part of the Security Perimeter phase 1 release (SIP-0094).

Dormant until governance acts

Display is gated purely on on-chain state and fails hidden: a fee row renders only
when the deployed ExitFeeController quotes an active policy with a non-zero rate and
fee for that surface. Until SIP-0094 executes and charging is enabled, every form
renders exactly as it does on develop today — no feature flag, no env var, nothing to
configure. Once charging is enabled on-chain, the display lights up on its own (quotes
are cached for 30 seconds).

Merge timing — opposite of the contract PRs, deliberately

The contract PRs (Sovryn-smart-contracts#580, zero-contracts#10) merge only after
the SIP executes. This PR should merge and deploy before charging is enabled: the
UI is provably inert until then, and having it live first guarantees users see the fee
the moment it exists. The one ordering that must not happen is enabling charging while
the dapp still lacks this UI — fees would apply without being displayed.

Notes for reviewers

  • All user-facing copy says "Perimeter fee" (renamed from the internal working title
    during this port; tests pin the new copy). Internal identifiers and the on-chain
    surface-id constants are unchanged — the ids are keccak hashes verified against the
    deployed consumer contracts.
  • Rebased onto current develop. The Trezor connectSrc sanitizer hardening that
    travelled with the original branch is not in this PR — it already landed on
    develop independently (d96a4247).
  • Affected tests: 11 suites / 38 tests green locally via the pre-commit hook.
  • The Spanish locale remains the app-wide English-fallback stub; no fee-specific
    regression there.

Ports the perimeter-fee UI to the public repo, rebased onto current develop
(base moved 4971f72 -> 6cd8343). Shows the fee row, tooltip, and net
'You will receive' amount on lending withdrawals, borrower exits, Zero
collateral withdrawal/close, and the surplus-claim view.

Display is gated purely on on-chain state and fails hidden: the row renders
only when the controller quotes an active policy with a non-zero rate and
fee. While the perimeter is deployed-but-disabled (its state until
SIP-0094 executes and the Exchequer enables charging), every form renders
exactly as it does today. No feature flag, no env var.

All user-facing copy says 'Perimeter fee' (renamed from the working title
during this port, tests updated to pin the new copy). Internal identifiers
and the on-chain surface-id constants are unchanged — the ids are keccak
hashes verified against the deployed consumer contracts. The Spanish locale
remains the app-wide stub (falls back to English), unchanged by this
change.
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for sovryn-dapp ready!

Name Link
🔨 Latest commit fccdf28
🔍 Latest deploy log https://app.netlify.com/projects/sovryn-dapp/deploys/6a7e427130eb7a00086b6142
😎 Deploy Preview https://deploy-preview-1151.preview.sovryns.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fccdf28

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
frontend Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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