We at Polkassembly have been working on an exciting new feature. We want to enable users to create OpenGov proposals from Polkassembly itself.
Unfortunately, we have hit a roadblock in our endeavour.
Issue
The preimage form has options for creating preimages for Gov1, OpenGov and much more. We are unable to identify a mapping pattern for preimages to OpenGov referenda.
Which means, if a user wants to create a referendum for a specific track, how can they identify preimages relevant to that track.
What we need help with
We would love to make the process for identification of the correct pre-images easier.
For this, we would need a mapping of which pre-images are accepted across the different tracks in OpenGov. This would help in creating a custom form for users, where they can only see the relevant options.
It would be super helpful, it someone could help us with this information or direct us to a place where we can find it.
I would image the user flow of creating a proposal is something like this:
Select a track and other parameters
Construct the proposal Call / i.e. preimage
Submit
The submit action will make a batch call to add the preimage and actually submit the proposal. It should also check if the preimage is already submitted and in that case skip the add preimage part.
I will try phrasing my question in a slightly different way.
As per the user flow mentioned by you, how is the user expected to construct the proposal call / pre-image?
There are 52 options with more than 800 methods present in PolkadotJS, when a user attempts to create a pre-image.
Given that the user already knows which referendum origin they want to leverage, could we provide only relevant options to the user?
For example,
If I want to create a medium tipper proposal, probably referenda.submit or treasury.spend are the only options I may need. Most other pre-images like auction and staking may become irrelevant in this case
Hard coding it seems problematic as there is more than one route that can exist in certain cases for OpenGov.
For example, referenda.submit (select origin and then medium spender) is one way to achieve the objective of creating a medium spender proposal while treasury.spend is another.
The user would not know which one is preferred or correct
It would be extremely helpful to receive some guidance regarding the preferred routes. This would help a user with very little context to create and submit a referenda, in a standardized manner
I am not aware of any existing work on this area so you will need to build your own solution to solve this problem.
I will suggest don’t make it generic and flexible. Instead, start with something simple and gradually add more proposal types. For example, in V1 you only support making spend proposal. The user will select the proposal type (the only option is spend), and enter amount and that’s it. The dApp will pick the track based on entered amount.
In later version you could then add more proposal type such as update parachain head/wasm etc.
I created the pre-image following the instructions here:
Obviously, in retrospect, I should have not chosen the system.remark that is in the example. Now the proposal description says “Make some on-chain remark. ## Complexity - O(1)”. Is there any way to edit that since it’s on-chain? Probably not. Gosh, I’ve been a round a few years, yet I feel like such a noob.