mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			615 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			615 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract Helper {
 | 
						|
    bytes3 name;
 | 
						|
    bool flag;
 | 
						|
 | 
						|
    constructor(bytes3 x, bool f) {
 | 
						|
        name = x;
 | 
						|
        flag = f;
 | 
						|
    }
 | 
						|
 | 
						|
    function getName() public returns (bytes3 ret) {
 | 
						|
        return name;
 | 
						|
    }
 | 
						|
 | 
						|
    function getFlag() public returns (bool ret) {
 | 
						|
        return flag;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
contract Main {
 | 
						|
    Helper h;
 | 
						|
 | 
						|
    constructor() {
 | 
						|
        h = new Helper("abc", true);
 | 
						|
    }
 | 
						|
 | 
						|
    function getFlag() public returns (bool ret) {
 | 
						|
        return h.getFlag();
 | 
						|
    }
 | 
						|
 | 
						|
    function getName() public returns (bytes3 ret) {
 | 
						|
        return h.getName();
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
// ----
 | 
						|
// getFlag() -> true
 | 
						|
// getName() -> "abc"
 |