#What would be correct way of providing parameters? I tried -- args but not worked see attached error
1 messages · Page 1 of 1 (latest)
--fn function was remove with the latest version, check how you can do it here: https://soroban.stellar.org/docs/getting-started/hello-world
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
Okay let me try it, Thank you
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.
Sure will do, Thank you
I upgraded to the latest version and now shows this error. I tried -- help but no format or suggestion is there about this error.
Can you see what I am doing wrong here?
What is the output from ... -- create --help?
This is the help for invoke. WHat was the full command?
soroban contract invoke --help --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm --id 61e3cb08e151f6bd3c7a69f97e13b6ee762f05b24cd21b73cef5c3e3ac3d1e59 -- create --seller "GAD77QJZFQSYMYL2ORVBJBKFJCYKOXFLGIROY3TAL6Z6R4HMFKBY2C2B" --sell_price 5 --buy_price 5
soroban contract invoke --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm --id 61e3cb08e151f6bd3c7a69f97e13b6ee762f05b24cd21b73cef5c3e3ac3d1e59 -- create --help
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?
Ah yeah duh it's above sorry. What about using
soroban contract inspect --wasm target/wasm32-unknown-unknown/release/manage_prices.wasm
I am unable to understand it but here's the response of this command:
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?
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.
Oh, I created this project in the old version and upgraded the version yesterday.
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
rust-analyzer is throwing this exception
Remove the first soroban-sdk =