[][src]Function ontio_std::runtime::call_contract

pub fn call_contract(addr: &Address, input: &[u8]) -> Vec<u8>

With this method, another contract can be called, When calling Neo contract and native contract across contracts, the parameter construction is slightly different. Please refer to the corresponding examples.

addr: Called contract address

input: Parameters required to call the target contract method

Example

let mut sink = Sink::new(16);
let addr = Address::repeat_byte(1u8);
sink.write(("balance_of".to_string(), &addr));
let res = runtime::call_contract(&addr, sink.bytes());