optimism-v2 icon indicating copy to clipboard operation
optimism-v2 copied to clipboard

Gateway DAO

Open CAPtheorem opened this issue 4 years ago • 0 comments

The DAO UI is currently unprepared for handing over control of the LP fees to the DAO.

Per below, the createProposal can only accommodate freeform text of changing coding threshold.

Soon, it will need to accommodate dozens of different actions, not just two.

1/ Please add a 'type' parameter to the functions, such as

type === 1 -> free form text type === 2 -> change voting Th type === 3 -> change LP fees

2/ Then, have the add proposal modal send a type parameters, and

3/ As a function of that type parameter, change the parameters to delegateCheck.propose(

4/ Notably, this kind of structure is a dead end: let voting = text ? 0 : ethers.utils.parseEther(votingThreshold) since it cannot accommodate dozens of distance DAO actions.

  //Create Proposal
  async createProposal({ votingThreshold = null, text = null }) {

    if( this.delegateContract === null ) return

    try {
      const delegateCheck = await this.delegateContract.attach(allAddresses.GovernorBravoDelegator)

      let address = [delegateCheck.address]
      let values = [0]
      let signatures = text ? [''] : ['_setProposalThreshold(uint256)'] // the function that will carry out the proposal
      let voting = text ? 0 : ethers.utils.parseEther(votingThreshold)
      let callData = [ethers.utils.defaultAbiCoder.encode( // the parameter for the above function
        ['uint256'],
        [voting]
      )]
      let description = text ? text : `# Changing Proposal Threshold to ${votingThreshold} Boba`;

      let res = await delegateCheck.propose(
        address,
        values,
        signatures,
        callData,
        description
      )
      return res
    } catch (error) {
      throw new Error(error.message)
    }
  }

CAPtheorem avatar Oct 25 '21 20:10 CAPtheorem