[英]How to transfer an ERC721 token across networks
Please pardon me if this question sounds dumb, but I am a little new to this concept and there are not many resources out there I could find.如果这个问题听起来很愚蠢,请原谅我,但我对这个概念有点陌生,而且我能找到的资源并不多。 Thanks.
谢谢。
Suppose I have created a ERC721 smart contract and used that to mint an NFT token.假设我创建了一个 ERC721 智能合约并用它来铸造一个 NFT 代币。 Now I want to be able to transfer that token from one network to another.
现在我希望能够将该令牌从一个网络转移到另一个网络。 I know to mint transfer the NFT to another user, the owner needs to approve the transaction.
我知道要将 NFT 转移给另一个用户,所有者需要批准交易。 I have already tried this on rinkeby testnet.
我已经在 rinkeby 测试网上试过了。 But I have no idea how to transfer from say rinkeby testnet to another network.
但我不知道如何从说 rinkeby 测试网转移到另一个网络。 Please see my mint and transfer functions below:
请参阅下面的我的薄荷和转移功能:
function _transfer(
address _from,
address _to,
uint256 _tokenId
) external payable {
require(ownerOf(_tokenId) == _from);
_owners[_tokenId] = _to;
_balances[_from]--;
_balances[_to]++;
emit Transfer(_from, _to, _tokenId);
}
function _mint(address _to, uint256 _tokenId)
internal
uniqueToken(_tokenId)
notZeroAddress(_to)
{
_owners[_tokenId] = _to;
_balances[_to] += 1;
tokenExist[_tokenId] = true;
emit Transfer(address(0), msg.sender, _tokenId);
}
I would appreciate any assistance.我将不胜感激。 Thanks.
谢谢。
Cross chain (network) transactions need a bridge.跨链(网络)交易需要一个桥梁。 It can be a centralized one or it can be trust-less and decentralized one like near rainbow bridge.
它可以是集中式的,也可以是像彩虹桥附近那样的去信任和去中心化的。
It's not a trivial problem to tackle.这不是一个小问题。
Following links might give you insight on how it should get done.以下链接可能会让您深入了解它应该如何完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.