Skip to content

Commit

Permalink
Added proposal to change voting period (#15030)
Browse files Browse the repository at this point in the history
* - Added proposal to lower change duration
- Modified command in README.md to test proposals locally on fork of base instead of mainnet

* refactor and clean up

* feat(ui): adding another method to advance tabs (#15035)

adding another method to advance

* feature(unlock-app): Migrate Unlock accounts (#15033)

* legacy auth wrapper

* migration page

* migration layout

* update privy config

* legacy hooks and providers

* update dashboard header

* legacy auth context

* add migration compoenents

* update SignInAccount

* update EnterCode component

* update EnterCode component

* update providers

* clean up

* trigger upon successful email verification

* add connectingwaas component

* update SignInAccount

* add legacy hooks

* clean up

* linting

* some cleanup

* more cleanup

* more cleanup

* more work

* better syntax

* update ConnectViaEmail component

* adding another method to advance

* fix accountType

* dedicated page for google sign in

* update password signin component

* update popup component

* update google signin component

* adding migration with code

* update MigrateUserContent component

* removed extra file

* once more

* update google auth flow and usage

* styling

* fixed styling

* update import usage

* updated title

* use privy callback

* add link to direct to dashboard settings

* cleanup

---------

Co-authored-by: Julien Genestoux <[email protected]>

* feat(smart-contracts): add lock upgrade test (#15034)

lock upgrade test

* feat(smart-contracts): emit `PaymentReceipt` event (#14832)

* refactor legacy purcahse function

* basic testing

* update main helper to use logic

* fix lock helper

* add docstrings to interface

* pay referrers

* lint fixes

* fix lint

* fix erc20 keys helper

* emit `PurchaseReceipt` event

* add events

* fire event in extend + add some tests

* test for tip

* rename to `PaymentReceipt`

* fix receipts

* feature(unlock-app): Prompt user to sign out before account migration (#15036)

* update modal component

* add sign out prompt component

* update user migration content

* feature(locksmith): re-enable captcha for staging (#15037)

re-enable captcha

* fix(unlock-app): actually showing the captcha component (#15038)

actually showing the captcha component

* feature(unlock-app): Improve wallet migration with responsiveness, auth, and feedback (#15040)

* responsiveness

* fully authenticate after import & comprehensive user feedback

* fix(unlock-app): using captcha in both places (#15041)

using captcha in both places

* feat(unlock-app): waiting on migration

* feat(unlock-app): creating a waas wallet for debugging purposes

* fix(unlock-app): Fix UI conflict with sign-out prompt during account migration (#15043)

* update migration feedback component

* set and apply migration status

* fix(unlock-app): Fix Google OAuth flow for account migration and add error logging (#15044)

* update waas utility function

* update google sign in component

* update component for google oauth

* fix(unlock-app): Better oauth state handling (#15045)

better popup oauth state handling

* fix(unlock-app): refactor waas util and clean up sessions (#15046)

* refactor keyUtil

* improve google sign in component

* sign out nextauth session upon successful privy login

* cleanup

* feat(locksmith): API for eventcaster is now async (#15039)

* wip

* adding file

* refactor

* more

* setting value from 1password

* wip

* adding async jobs

* cleaned up

* cleanup

---------

Co-authored-by: Julien Genestoux <[email protected]>
Co-authored-by: txbì <[email protected]>
Co-authored-by: Clément Renaud <[email protected]>
  • Loading branch information
4 people authored Nov 13, 2024
1 parent 9c79424 commit 50c3952
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 6 deletions.
12 changes: 6 additions & 6 deletions governance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ When using an async function to parse a proposal, you can pass params to the fun
**CLI call**

```sh
RUN_FORK=1 yarn hardhat gov --gov-address 0x440d9D4E66d39bb28FB58729Cb4D3ead2A595591 \
--proposal proposals/my-proposal.js
RUN_FORK=8453 yarn hardhat gov --gov-address 0x65bA0624403Fc5Ca2b20479e9F626eD4D78E0aD9 \
--proposal proposals/up/my-proposal.js
0x000000 1000
```

Expand Down Expand Up @@ -200,19 +200,19 @@ module.exports = async function (params) {

check [`./proposals/002-set-protocol-fee.js`](./proposals/002-set-protocol-fee.js) for an example.

2. Test you proposal locally on a mainnet fork
2. Test your proposal locally on a base fork

```shell
RUN_FORK=1 yarn hardhat gov --gov-address 0x440d9D4E66d39bb28FB58729Cb4D3ead2A595591 \
--proposal proposals/<your-proposal>.js
RUN_FORK=8453 yarn hardhat gov --gov-address 0x65bA0624403Fc5Ca2b20479e9F626eD4D78E0aD9 \
--proposal proposals/up/<your-proposal>.js
```

Additionnaly, you can pass arguments to your proposal script via CLI positional args.

3. When things are ready, post it to the DAO!

```
yarn hardhat gov:submit --proposal proposals/<your-proposal>.js --network mainnet
yarn hardhat gov:submit --proposal proposals/<your-proposal>.js --network base
```

4. Head to [Tally](https://www.withtally.com/governance/unlock) to see your proposal. NB: this may take some time as it requires X block confirmations
Expand Down
71 changes: 71 additions & 0 deletions governance/proposals/up/002-change-voting-duration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const { ethers } = require('hardhat')
const { UPGovernor } = require('@unlock-protocol/contracts')
const { base } = require('@unlock-protocol/networks')

const VOTING_DELAY = 4 * 24 * 60 * 60 // 4 days in seconds
const VOTING_PERIOD = 6 * 24 * 60 * 60 // 6 days in seconds
const MIN_DELAY = 2 * 24 * 60 * 60 // 2 days in seconds
const BASE_GOVERNOR_ADDRESS = base.dao.governor
const BASE_TIMELOCK_ADDRESS = '0xB34567C4cA697b39F72e1a8478f285329A98ed1b'

module.exports = async () => {
console.log(`Proposal to change voting duration and minDelay`)

// Governor interface for voting delay and voting period
const governorInterface = new ethers.Interface(UPGovernor.abi)

// TimelockController interface for minDelay
const timelockInterface = new ethers.Interface([
'function updateDelay(uint256)',
])

// Encode data for each function call
const votingDelayCalldata = governorInterface.encodeFunctionData(
'setVotingDelay',
[VOTING_DELAY]
)
const votingPeriodCalldata = governorInterface.encodeFunctionData(
'setVotingPeriod',
[VOTING_PERIOD]
)
const minDelayCalldata = timelockInterface.encodeFunctionData('updateDelay', [
MIN_DELAY,
])

// Prepare function calls
const calls = [
{
contractAddress: BASE_GOVERNOR_ADDRESS,
calldata: votingDelayCalldata,
value: 0,
operation: 0,
},
{
contractAddress: BASE_GOVERNOR_ADDRESS,
calldata: votingPeriodCalldata,
value: 0,
operation: 0,
},
{
contractAddress: BASE_TIMELOCK_ADDRESS,
calldata: minDelayCalldata,
value: 0,
operation: 0,
},
]

const proposalName = `Lower Voting Duration for Unlock DAO
This proposal sets the voting delay, and voting period in the Governor contract,
as well as the minimum delay for execution (minDelay) in the timelock contract.
## About this proposal
The proposal contains calls to update the voting delay, voting period, and
minDelay.`

return {
proposalName,
calls,
}
}

0 comments on commit 50c3952

Please sign in to comment.