Calling Contracts from Other Contracts
Contracts call other contracts using Solidity-like syntax. For example:
Rubidity doesn't have interfaces so your call must be preceded by a full contract definition or an abstract contract as above. As in Solidity, typically you would use an import statement instead of defining the contract directly:
Low-level calls
If you don't know the interface in advance, you can use the low-level call function on addresses:
Calldata should be a JSON string with keys function and args.
As in Solidity, low-level calls will return false instead of throwing an error. Data will be string, not bytes as in Solidity.
Last updated