繁体   English   中英

多边形智能合约可以调用以太坊智能合约功能吗?

[英]Can polygon smart contract call an Ethereum smart contract function?

pragma solidity ^0.8.0;
interface AnotherContract {
    function walletOfOwner(address owner) external view returns (uint256[] memory);
}

contract Test{
    uint public similarity;
    uint256 public hasRedPill;
    function test() public view returns(uint256  ){
       AnotherContract anotherContract = AnotherContract(address(0x116486FD64Ba04F7B789278B239E2e5A1e2f7b39));
      return anotherContract.walletOfOwner(msg.sender).length;
    }


}

我在这里使用的合约地址已经部署在以太坊区块链上。

我想在 Polygon 上部署测试合同。 但它似乎无法调用 walletOfOwner() 函数。 但是如果两个合约都部署在同一个网络上,它就可以正常工作。 那么,有什么方法可以在这些合约之间建立跨链连接。

我对此很陌生。 请帮忙。

那么,有什么方法可以在这些合约之间建立跨链连接。

不,在实践中,不可能。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM