Skip to content

feat: add a return with the proposal ID created #90

@0xneves

Description

@0xneves

Feature Request

Describe the Feature Request

I was just submitting a proposal for the first time and after it was successful my first thought was to execute the proposal. But the only way to get the proposal ID is by calling the totalProposalCount() and checking if yours was the last one created. It's more practical to simply return the ID, enhancing the developer experience and frontend integrations.

Describe Preferred Solution

  • Add the uint32 proposal ID as a return for submitProposal function.
  • Add unchecked for impossible to overflow counter.
function submitProposal( ... ) external returns(uint32) { 
   
      . . .
      unchecked { 
            totalProposalCount++;
      }
      return totalProposalCount;
}

Code Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions