near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
107 stars 76 forks source link

Fix setting ARGS in the factory README #181

Open ilyalesik opened 2 years ago

ilyalesik commented 2 years ago

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

GaloisField2718 commented 2 years ago

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 commented 2 years ago

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.

mohamedalichelbi commented 2 years ago

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