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

New Feature: Proposal Templates #1828

Open
arlai-mk opened this issue Dec 18, 2024 · 0 comments
Open

New Feature: Proposal Templates #1828

arlai-mk opened this issue Dec 18, 2024 · 0 comments

Comments

@arlai-mk
Copy link

Some proposals (I am thinking of Smart Contract Execute proposals) may benefit from some kind of templating.

The way I imagine it is that anyone could create a template with

  • Smart Contract address
  • JSON Execute message
    Within the JSON message, we could select some fields that would be mapped to some "template variables".

Then, when someone wants to create a proposal based on that template (e.g. "Swap USDC to NTRN on Astroport" template), they would just need to fill in some fields:

  • belief price
  • max spread
    And it would automatically create the proposal, by filling the correct information in the JSON directly.

For a "swap USDC to NTRN on Astroport", we would have something like:
SC address: neutron18c8qejysp4hgcfuxdpj4wf29mevzwllz5yh8uayjxamwtrs0n9fshq9vtv
Execute Smart Contract Message:

{
  "swap": {
    "belief_price": "<BELIEF_PRICE>",
    "max_spread": "<MAX_SPREAD>",
    "offer_asset": {
      "amount": "<FUNDS.AMOUNT>",
      "info": {
        "native_token": {
          "denom": "ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81"
        }
      }
    }
  }
}

Just for this specific case, we could also restrict the funds to be only one denom possible: USDC. Not sure if it should be made restricted in the UI, or if just a description on the template would work, something like "Please only provide Noble USDC as funds for this proposal".
For some cases, restricting may not make sense, so it may just be a nice-to-have feature for later (maybe would need a separate issue when / if this feature is developed).

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

1 participant