sputnik-dao-contract icon indicating copy to clipboard operation
sputnik-dao-contract copied to clipboard

Fix setting ARGS in the factory README

Open ilyalesik opened this issue 2 years ago • 3 comments

In the current version calling near call $CONTRACT_ID create "{\"name\": \"test\", \"public_key\": null, \"args\": \"$ARGS\"}" throws

Error: {"index":3,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"missing field `config`\", line: 1, column: 165)', sputnikdao2/src/lib.rs:83:1"}}

The new method (sputnikdao) accepts config, policy args

ilyalesik avatar May 31 '22 13:05 ilyalesik

Hi, I have a question. How to make vote_period, proposal_bond,... initialise at the creation in ARGS ? Because here you have removed it.

GaloisField2718 avatar May 31 '22 15:05 GaloisField2718

Hi, I have a question. How to make vote_period, proposal_bond,... initialise at the creation in ARGS ? Because here you have removed it.

In modifying policy.rs (205::208) and compile it ./build.sh new dao has right default_policy. But now I have ERR_MIN_BOND.

"ExecutionError":"Smart contract panicked: panicked at 'assertion failed: `(left == right)`\n  left: `1000000000000000000000000`,\n right: `10000000000000000000000`: ERR_MIN_BOND', sputnikdao2/src/proposals.rs:491:9"

In proposal.rs :

assert_eq!(
            env::attached_deposit(),
            policy.proposal_bond.0,
            "ERR_MIN_BOND"
        )

I don't know what to modify this part to solve this error.

GaloisField2718 avatar May 31 '22 18:05 GaloisField2718

In the current version calling near call $CONTRACT_ID create "{\"name\": \"test\", \"public_key\": null, \"args\": \"$ARGS\"}" throws

Error: {"index":3,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"missing field `config`\", line: 1, column: 165)', sputnikdao2/src/lib.rs:83:1"}}

The new method (sputnikdao) accepts config, policy args

Is the code in the main branch outdated? The factory's create() according to this doesn't accept a public_key param anymore, also no config. The mainnet contract seems to accept config but not public_key

mohamedalichelbi avatar Jun 10 '22 10:06 mohamedalichelbi