#What would be correct way of providing parameters? I tried -- args but not worked see attached error

1 messages · Page 1 of 1 (latest)

rotund forge
low vessel
snow star
#

If you have the latest soroban-cli tools, things have changed. After your --id xxxxx try -- create --seller <address> --sell_price <number> --buy_price <number>. Note the space between the -- and create

rotund forge
#

Okay let me try it, Thank you

sly hull
#

Also try --help to get a help doc for your contract. If you write comments above your method with /// Comment it will show up in the help doc.

#

... --id .. -- --help Will list all functions which are subcommands. Then ``... --id .. -- create --help` will show the function's arguments and example inputs for each.

rotund forge
rotund forge
sly hull
sly hull
rotund forge
#

soroban contract invoke --help --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm --id 61e3cb08e151f6bd3c7a69f97e13b6ee762f05b24cd21b73cef5c3e3ac3d1e59 -- create --seller "GAD77QJZFQSYMYL2ORVBJBKFJCYKOXFLGIROY3TAL6Z6R4HMFKBY2C2B" --sell_price 5 --buy_price 5

sly hull
#

soroban contract invoke --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm --id 61e3cb08e151f6bd3c7a69f97e13b6ee762f05b24cd21b73cef5c3e3ac3d1e59 -- create --help

rotund forge
sly hull
#

Hmm this suggests that sell_price and buy_price are booleans and seller is i256 not an address. What are the rust signatures for the functions?

sly hull
#

Ah yeah duh it's above sorry. What about using

soroban contract inspect --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm
rotund forge
sly hull
#

This was the part that I was interested in.

FunctionV0(
        ScSpecFunctionV0 {
            doc: StringM(),
            name: ScSymbol(
                StringM(create),
            ),
            inputs: VecM(
                [
                    ScSpecFunctionInputV0 {
                        doc: StringM(),
                        name: StringM(seller),
                        type_: I256,
                    },
                    ScSpecFunctionInputV0 {
                        doc: StringM(),
                        name: StringM(sell_price),
                        type_: Bool,
                    },
                    ScSpecFunctionInputV0 {
                        doc: StringM(),
                        name: StringM(buy_price),
                        type_: Bool,
                    },
                ],
            ),
            outputs: VecM(
                [],
            ),
        },
    ),

According to this the types were what I thought. It's weird that it differs. Which version of the sdk are you using?

rotund forge
#

0.7.0

#

the latest one

sly hull
#

Do you have a repo I could clone? Otherwise I would try

[dependencies.soroban-sdk]
version = "0.7.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2"

[dependencies.soroban-auth]
version = "0.7.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2"

That's what I've been using.

rotund forge
#

Oh, I created this project in the old version and upgraded the version yesterday.

sly hull
# rotund forge I have this

Try replacing with:

[dependencies]
soroban-sdk = { version = "0.7.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2"}

[dev-dependencies]
soroban-sdk = { version = "0.7.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2", features = ["testutils"] }

And then see if you get the same when you recompile

rotund forge
#

rust-analyzer is throwing this exception

sly hull