Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting ARGS in the factory README #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ilyalesik
Copy link

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

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
Copy link

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

@@ -16,9 +16,9 @@ set CONTRACT_ID "dev-1608694678554-8567049"
near call $CONTRACT_ID new '{}' --accountId $CONTRACT_ID

# bash
ARGS=`echo '{"purpose": "test", "council": ["testmewell.testnet", "illia"], "bond": "1000000000000000000000000", "vote_period": "1800000000000", "grace_period": "1800000000000"}' | base64`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can decide about bond value, voting period and grace_period but after modifications we can't.

How we could improve ARGS to define them ?

@GaloisField2718
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants