decentdao / decent-contracts

Your Safe, Superpowered
https://app.fractalframework.xyz
MIT License
3 stars 3 forks source link

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

Open 0xneves opened 4 months ago

0xneves commented 4 months ago

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

function submitProposal( ... ) external returns(uint32) { 

      . . .
      unchecked { 
            totalProposalCount++;
      }
      return totalProposalCount;
}

Code Related

https://github.com/decentdao/decent-contracts/blob/75eac0d9c50d1979079603783040a34c2809b31d/contracts/azorius/Azorius.sol#L148