Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor transferCrossChain to support been extended by user in zetachain/UniversalNFTCore.sol #46

Open
andresaiello opened this issue Jan 27, 2025 · 0 comments

Comments

@andresaiello
Copy link
Collaborator

Right now transferCrossChain in UniversalNFTCore it's like this:

 function transferCrossChain(
        uint256 tokenId,
        address receiver,
        address destination
    ) public payable {
// code

then if developer use it out of the box it's not using the gas in an efficient way because the calls will be externals. But to refactor to external should consider another refactor also like mentioned in issue #45

I recommend to refactor like this:

 function transferCrossChain(
        uint256 tokenId,
        address receiver,
        address destination
    ) external payable {
_transferCrossChain(     tokenId,
        receiver,
        destination);
}

 function _transferCrossChain(
        uint256 tokenId,
        address receiver,
        address destination
    ) internal virtual{
// code
}

then if a developer wants to extend it it's just an internal call

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

No branches or pull requests

1 participant