Block frozen asset transfer; Fix post dispatch weight call#1962
Merged
Conversation
Neopallium
approved these changes
Jun 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request tightens settlement transfer rules to prevent bypassing frozen-asset restrictions for NFT transfers within the same DID, and fixes the post-dispatch weight accounting for utility::force_batch to align with its declared weight function.
Changes:
- Fix
utility::force_batchpost-dispatch base weight to useWeightInfo::force_batch(was incorrectly usingWeightInfo::batch). - Block same-DID NFT transfers via
settlement::transfer_fundswhen the underlying asset is frozen by addingensure_asset_is_not_frozen. - Add a runtime test covering the new “frozen NFT asset cannot be transferred” behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pallets/utility/src/lib.rs |
Corrects force_batch post-dispatch weight to match the extrinsic’s weight model (force_batch). |
pallets/settlement/src/lib.rs |
Adds frozen-asset enforcement for same-DID NFT transfers in transfer_funds. |
pallets/runtime/tests/src/settlement_pallet/transfer_funds.rs |
Adds a regression test ensuring frozen NFT assets are rejected by transfer_funds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Diff Security Audit -
|
| File | Lines | Risk | Why |
|---|---|---|---|
ethereum_bridge.rs |
156 | High | Processes external Ethereum RPC input; affects user funds and asset tokens |
substrate_api.rs |
203 | High | Handles Substrate RPC calls; affects transaction records and portfolio balances |
contract_interface.rs |
92 | Medium | Smart contract ABI methods; affects asset tokens and identity records |
admin_cli.rs |
78 | Medium | CLI command processing; affects user funds and transaction records |
Low Risk (No Action Needed)
- Type definitions
- CLI argument parsing
- DB schema updates
- Documentation changes
- Logging and error handling improvements
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.
changelog
other
force_batch;