9

solidity合约里面定义的合约是如何定义的,有点理解不清楚

 3 years ago
source link: https://learnblockchain.cn/question/1743
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
solidity合约里面定义的合约是如何定义的,有点理解不清楚 | 登链社区 | 技术问答

solidity合约里面定义的合约是如何定义的,有点理解不清楚

pragma solidity ^0.4.22;

contract father{
    
    function dahan() external pure  returns(string){
        
        return "dahan";
    }
    
}
contract outside{
    
    father public f= new father();
    function testf() public view returns(string){
        return f.dahan();
    }
}

我想问一下,这个 outside 合约里 new 了一个 father 合约,它是不是算 outside 合约的成员变量?如果它和 father 是一模一样的,那它是怎么部署的?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK