1

i want to call other module's function in my contract, but i haven't it's source code, just can see it's bytecode onchain;

in sodility has interface contract, and just need a proto(interface) , then can call any contract even has no source code as fllow:

so how to do it in sui move?

pragma solidity ^0.4.0;

contract InfoFeed {

    function info() payable returns (uint ret);
}


contract Consumer {
    function deposit() payable returns (uint){
        return msg.value;
    } 

    function left() constant returns (uint){
         return this.balance;
    }

    function callFeed(address addr) returns (uint) { 
        return InfoFeed(addr).info.value(1).gas(8000)(); 
        // here i no need to get source code for InfoFeed implements, and can call it with address 
    }
}
sleeping
  • 31
  • 4

0 Answers0