Macro cfx_executor::make_solidity_function
source · macro_rules! make_solidity_function { ( $(#[$attr:meta])* $visibility:vis struct $name:ident ($input:ty, $interface:expr ); ) => { ... }; ( $(#[$attr:meta])* $visibility:vis struct $name:ident ($input:ty, $interface:expr, $output:ty ); ) => { ... }; }
Expand description
Make a solidity interface function, it requires three parameters
- The type of input parameters.
- The string to compute interface signature.
- The type of output parameters.
For example, in order to make a function with interface get_whitelist(address user, address contract) public returns bool, you should use
use cfx_executor::{make_solidity_function, internal_contract::InterfaceTrait};
use cfx_types::{Address,U256};
use sha3_macro::keccak;
make_solidity_function!{
struct WhateverStructName((Address, Address), "get_whitelist(address,address)", bool);
}
If the function has no return value, the third parameter can be omitted.