Norton
Norton

Reputation: 83

How to run functions which accept structs as input parameters from tondev?

For example, I have a function

function addClaimers(ClaimItemImport[] claimItems) onlyOwner external

and the ClaimItemImport struct looks as follows:

struct ClaimItemImport {
    uint128 balance;
    uint256 claimAddress;
}

How to call it from tondev with parameters?

This does not work:

tondev contract run Contract.abi.json --address XYZ addClaimers -i claimItems:[[123, 0x123], [456, 0x456]]

Upvotes: 1

Views: 657

Answers (2)

Norton
Norton

Reputation: 83

I've updated my tondev + used the following syntax:

tondev contract run FidosafeDAO.abi.json addClaimers --address 0:2540afc97408aec8e094eaf2695acd8fd4c301830590214be584e4b627e5bf90 -i '{"claimItems":[{"balance":0,"claimAddress":0}]}'

Upvotes: 1

Ekaterina Pantaz
Ekaterina Pantaz

Reputation: 63

    --address 0:540c1837656674d548c934258ddec9b5fd11b543da977b0016c14b5650bc7eb5 \
    --input '{ "point": { "color": "red", "center": { "x": 1, "y": 2 } } }'

Check readme in the end of this section https://github.com/tonlabs/tondev#run-contract-deployed-on-the-network

Upvotes: 2

Related Questions