0

I’m trying to pass a simple structure as an argument to smart contracts function.

struct Fee {
    uint16 rate;
    address payable recipient;
}

As I understood I have to do it through a tuple. In this case my tuple has type Tuple2<Uint16, Address>

I have to pass this argument to the function

    Tuple2<Uint16, String> fee = new Tuple2(new Uint16(1), "0x1231124125...");

    Function function = new Function(
        "setFee",
        Arrays.asList(fee);
        Collections.emptyList()
    );

I got "The constructor Function(String, List<Tuple2<Uint16,String>>, List<TypeReference<?>>) is undefined"

As I understood I have to pass arguments which extend Type class. But no one Tuple2<T1, T2> don’t extend Type despite Tuple2, T1, T2 are Type descendants.

How I can pass Fee, array of Fee and more complex structures to the smart contract with Java? `

0 Answers0