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

Issue in providing cw4_stake.wasm contract values for initiating #878

Closed
hakimehmordadi opened this issue Aug 11, 2023 · 4 comments
Closed

Comments

@hakimehmordadi
Copy link

hakimehmordadi commented Aug 11, 2023

Hi, I'm facing with issue for prepare denom for initiating cw4_stake.wasm contract?

These are properties which are need for initiaing:

pub struct InstantiateMsg {
    /// denom of the token to stake
    pub denom: Denom,
    pub tokens_per_weight: Uint128,
    pub min_bond: Uint128,
    pub unbonding_period: Duration,
}

I've provided blow INIT but I'm getting error for providing denom value.

INIT='{"denom":"native","tokens_per_weight":1,"min_bond":1,"unbonding_period":{"time":3600}}'

My denum is udmotus but when I use it I get error as well.

Error:
Error: rpc error: code = InvalidArgument desc = failed to execute message; message index: 0: Error parsing into type cw4_stake::msg::InstantiateMsg: Invalid type: instantiate wasm contract failed: invalid request

@ueco-jb
Copy link
Collaborator

ueco-jb commented Aug 11, 2023

Your both Denom and Uitn128 type usage is incorrect.
If you want to see how it supposed to be used, generate schema for that contract and pay attention to the types.
Correct form would be:

{
   "denom": {
      "native": "ujuno"
   },
   "tokens_per_weight": "1",
   "min_bond": "1",
   "unbonding_period": {
      "time": 3600
   }
}

Also, next time please just questions on discord instead of creating an issue: https://discord.gg/b28Q7EvNGY

@ueco-jb ueco-jb closed this as completed Aug 11, 2023
@hakimehmordadi
Copy link
Author

Hi, I changed the denom as you said but still there is an issue:
For bellow params:

INIT='{"denom":{"native":"utmotus"},"tokens_per_weight": 1,"min_bond": 1,"unbonding_period":{"time":3600}}'

I'm getting below issue:

Error: rpc error: code = InvalidArgument desc = failed to execute message; message index: 0: Error parsing into type cw4_stake::msg::InstantiateMsg: Invalid type: instantiate wasm contract failed: invalid request

@ueco-jb
Copy link
Collaborator

ueco-jb commented Aug 13, 2023

Because Uint128 is parsed from String. You're missing quotation marks next to min_bond and tokens_per_weight.

@hakimehmordadi
Copy link
Author

Yea, I see types in this link and they are not string, but after settin up those as string, issue fixed. Thank you so much

pub tokens_per_weight: Uint128,

I will close this conversation as answered and solved.

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

No branches or pull requests

2 participants