Skip to content

Improve forcedTransfer for NFT precompile. - #2003

Merged
HenriqueNogara merged 1 commit into
developfrom
improve-nft-precompile-controller-transfer
Sep 10, 2026
Merged

Improve forcedTransfer for NFT precompile.#2003
HenriqueNogara merged 1 commit into
developfrom
improve-nft-precompile-controller-transfer

Conversation

@HenriqueNogara

Copy link
Copy Markdown
Contributor

changelog

new features

  • Add address to to forcedTransfer in NonFungibleAssetStub.sol

@HenriqueNogara
HenriqueNogara requested review from Neopallium and a lite review from Copilot and removed request for Neopallium September 10, 2026 16:33
@Neopallium
Neopallium marked this pull request as ready for review September 10, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Solidity stub ABI change requires regenerating and committing the corresponding NonFungibleAssetStub.bin artifact to keep embedded runtime bytecode in sync.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the NFT precompile’s forcedTransfer API to accept an explicit destination address, aligning the Solidity interface, Rust precompile dispatch, and integration test helpers so agents can forcibly transfer an NFT to a chosen recipient.

Changes:

  • Extend forcedTransfer in INonFungibleAsset to forcedTransfer(address from, address to, uint256 tokenId).
  • Update the Rust precompile implementation to route through pallet_nft::controller_transfer_to and emit events with the provided to.
  • Update integration helper/test call sites to pass the new to argument and validate event fields.
File summaries
File Description
precompiles/src/interfaces/NonFungibleAssetStub.sol Updates the Solidity interface + stub implementation signature for forcedTransfer to include to.
pallets/precompiles/src/interface/nft/erc7943.rs Adjusts the precompile handler to accept to, dispatch controller_transfer_to, and emit events with the correct destination.
integration/tests/revive_erc721.rs Updates the forced transfer integration test to pass to and assert the event’s to field.
integration/src/erc721_helper.rs Updates the ERC721 helper wrapper to include the new to argument in the call encoding.
Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread precompiles/src/interfaces/NonFungibleAssetStub.sol
@HenriqueNogara
HenriqueNogara enabled auto-merge (squash) September 10, 2026 16:40
@HenriqueNogara
HenriqueNogara merged commit 7af68c7 into develop Sep 10, 2026
20 checks passed
@HenriqueNogara
HenriqueNogara deleted the improve-nft-precompile-controller-transfer branch September 10, 2026 17:08
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.

3 participants