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

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

Open
2 tasks
0xneves opened this issue May 22, 2024 · 0 comments
Open
2 tasks

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

0xneves opened this issue May 22, 2024 · 0 comments

Comments

@0xneves
Copy link

0xneves commented May 22, 2024

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

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