Repository navigation
Conversation
…n-name transfers free
Contributor
CI Summary
|
re-gius
marked this pull request as ready for review
October 13, 2026 14:50
3 tasks
# Conflicts: # README.md # contracts/escrow/DotnsNameEscrow.sol # contracts/registrars/DotnsRegistrarController.sol
This branch has not been deployed
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.
Description
Fixes #337. Fees went into
DotnsNameEscrow.protocolFees, which nothing could spend. This removes every source of that pot and gives governance a way to move out what is already there (30 DOT on Polkadot Asset Hub, 20 PAS on Paseo).Cross-payer registrations lock a deposit for the owner. When someone pays for another account's registration, the price used to go to the fee pot and the owner got a zero-amount position.
_settleEscrownow locks the charge as the owner's refundable deposit, whoever pays.depositProtocolFeeandProtocolFeeDepositParamsare removed.Every transfer is free. A transfer no longer costs the name's price when the recipient is below the name's band or the sender's tier, granted names included. The bands apply at registration only. The deposit still moves with the name:
chargeTransferFeebecomes a non-payablerebindPosition(tokenId, to).PopRules.transferFloor,DotnsRegistrar.quoteTransferFeeand their helpers are removed, and so are_creditRefundandRefundCredited, which only transfer overpayments used. Existing refund entries stay claimable.Transfers are no longer payable. The registrar's transfer overrides only existed to forward a fee. They are removed, so the registrar uses OpenZeppelin's non-payable functions, and a transfer that sends value fails. That made the OpenZeppelin payable patches unnecessary:
patches/,scripts/shell/apply-oz-patches.sh, itssetup.bashcall and the CI steps that ran it are removed. So is the gas-report step that copied the PR head's patches to build master.Root can withdraw protocol fees.
withdrawProtocolFees(address to, uint256 amount)moves part or all ofprotocolFeesto an address governance chooses. It checksSystemUtils.originIsRoot(), like the other Root gates. It can spend only the fee balance: deposits, pending withdrawals and refund entries stay out of reach.Type
Scope
Related Issues
#337
Fixes
Closes #337 and #336
Checklist
Code
forge buildpassesforge testpassesTesting
Security
selfdestructordelegatecallDocumentation
Breaking Changes
Breaking changes:
IDotnsRegistrar.quoteTransferFee,TransferFeeRequired,IPopRules.transferFloor,IDotnsNameEscrow.chargeTransferFee,ChargeTransferFeeParams,depositProtocolFee,ProtocolFeeDepositParams,CrossTierFeePaid,RefundCreditedandInsufficientValue.IDotnsNameEscrow.rebindPosition,withdrawProtocolFees,ProtocolFeesWithdrawn,NotRoot,ProtocolFeesExceededandProtocolFeeTransferFailed.transferFromand bothsafeTransferFromoverloads are no longer payable.How to test
Notes
Upgrade the
DotnsRegistrar,DotnsNameEscrow,PopRulesandDotnsRegistrarControllerproxies together, in one atomicUtility.batch_allfrom the owner account. The current registrar callschargeTransferFeeandtransferFloor, and the new one callsrebindPosition, so upgrading any of the first three alone makes transfers revert. Storage layout is unchanged and no initializer runs. Then re-declare each key's codehash and the protocol version, asDEPLOYMENT_CHECKLIST.mddescribes.After the upgrade, a Root referendum can call
withdrawProtocolFeesto move out the existing balance (30 DOT on Polkadot Asset Hub, 20 PAS on Paseo). dotns-sdk needs a follow-up to stop quoting fees and attaching value to transfers.