soroban-cli: The transaction fails when using a Stellar multisig account

Open
#490 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
blockchain, cli

Research direction

Start by reproducing the documented soroban contract invoke command with the multisig account and additional signer. Trace the CLI's transaction submission and authorization handling; the issue is complete when this invocation succeeds and the contract call returns normally.

Written by the indexing model from the issue text.

Description

bug
What version are you using?
soroban 0.6.0 (7421c1383beae274d41e503fa44e248b1dbe9b05)
soroban-env 0.0.14 (d06aaddca61f011cc64ec098b464233423197c3a)
soroban-env interface version 29
stellar-xdr 0.0.14 (55f47d302a3bbcd34cf32bfcd28abccfaeffc5e0)
xdr next (df18148747e807618acf4639db41c4fd6f0be9fc)
What did you do?
soroban contract invoke \
    --secret-key SBG...API \
    --id 10e14c1aa5b4a320068bc05e3406d9bec6f8060f1ea33c1b11621746867e5e16 \
    --rpc-url https://horizon-futurenet.stellar.cash:443/soroban/rpc \
    --network-passphrase 'Test SDF Future Network ; October 2022' \
    --fn increment \
    -- \
    --user GB3...7LB \
    --value 1

The secret key SBG...API belongs to the additional signer of the GB3...7LB account, and has sufficient weight to invoke the contract.

The contract:

pub enum DataKey {
    Counter(Address),
}

pub struct IncrementContract;

#[contractimpl]
impl IncrementContract {
    pub fn increment(env: Env, user: Address, value: u32) -> u32 {
		
        user.require_auth();
		
        let key = DataKey::Counter(user.clone());

        let mut count: u32 = env
            .storage()
            .get(&key)
            .unwrap_or(Ok(0))
            .unwrap();

        count += value;

        env.storage().set(&key, &count);

        count
    }
}
What did you expect to see?

A successful contract invocation.

What did you see instead?

error: transaction submission failed

Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.