简体   繁体   English

如何跨网络传输 ERC721 代币

[英]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.以下链接可能会让您深入了解它应该如何完成。

near rainbow bridge彩虹桥附近

avalanche bridge 雪崩桥

cosmos IBC宇宙IBC

polkadot bridges 波卡桥

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何创建标准 ERC721 代币 - how to create standard ERC721 token 如何将令牌发送到 ERC721 合约? - How to get token sent to a ERC721 contract? 我们可以在实施ERC721令牌的同时将应付款修改器添加到转移功能吗? - Can we add payable modifier to transfer function while implementing ERC721 token? 如何使用 ERC721 将 NFT 从一个账户转移到另一个账户? - How to transfer a NFT from one account to another using ERC721? 如何使用版税调用 Openzeppelin safeTransferFrom() function 以避免错误,ERC721:所有者查询不存在的令牌? - How to call Openzeppelin safeTransferFrom() function with Royalty to avoid error, ERC721: owner query for nonexistent token? 如何查看 ERC721 代币在不同市场的最新出价? - How to see the most recent bids on different marketplaces for ERC721 token? 可铸造的ERC721的众筹 - CappedCrowdsale of mintable ERC721 来自 web3 的 MintTo 合同给出错误 - ERC721:转移到非 ERC721Receiver 实施者 - MintTo contract from web3 gives error - ERC721: transfer to non ERC721Receiver implementer 如何在 ERC721 合约中调用 ERC20 合约函数 - how to call a ERC20 contract fucntion inside ERC721 contract 多边形区块链上 MetaMask 的内部 JSON-RPC 错误。 `ERC721:转接呼叫者既不是所有者也不是批准的。` - Internal JSON-RPC error with MetaMask on Polygon Blockchain. `ERC721: transfer caller is not owner nor approved.`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM