Skip to content

Instantly share code, notes, and snippets.

@m9800
Last active October 12, 2022 20:11
Show Gist options
  • Save m9800/a7d9b89701b8b06663a2bd98f54face5 to your computer and use it in GitHub Desktop.
Save m9800/a7d9b89701b8b06663a2bd98f54face5 to your computer and use it in GitHub Desktop.
 function crossChainTransfer(
       uint256 crossChainId,
       address to,
       uint256 tokenId
   ) external {
       if (!_isValidChainId(crossChainId)) revert InvalidDestinationChainId();
       if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert InvalidTransferCaller();
        
       _burnWarrior(tokenId);
 
       emit CrossChainTransfer(
           crossChainId,
           addressByChainId[crossChainId],
           abi.encode(tokenId, msg.sender, to)
       )
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment