Skip to content

Commit

Permalink
merge main, update yarn.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman committed Apr 1, 2024
2 parents 903e25f + ea030a8 commit 0df2b24
Show file tree
Hide file tree
Showing 50 changed files with 1,485 additions and 278 deletions.
46 changes: 24 additions & 22 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435)
ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342)
ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649)
ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917)
E2E:testE2E() (gas: 83632522)
E2E:testE2E() (gas: 84675625)
FixedDelegateErc20WalletTest:testInit() (gas: 5822575)
FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805)
FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218)
Expand Down Expand Up @@ -93,11 +93,12 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658)
L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371)
L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242)
L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360)
L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 30363122)
L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 30367353)
L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 25498765)
L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 30365353)
L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 30384446)
L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 30524001)
L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 30528232)
L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 25659644)
L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 30526232)
L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 30545325)
NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153)
OutboxActionsTest:testAddOutbxesAction() (gas: 651420)
OutboxActionsTest:testCantAddEOA() (gas: 968990)
OutboxActionsTest:testCantReAddOutbox() (gas: 974388)
Expand Down Expand Up @@ -176,25 +177,26 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7930546)
SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8171934)
SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8172795)
SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102)
SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 215127)
SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 318348)
SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 281704)
SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35255)
SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 542695)
SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253049)
SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 431856)
SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 671552)
SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 176798)
SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 644396)
SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7095881)
SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78091)
SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19744)
SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42365)
SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40019)
SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 270750)
SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 333730)
SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 296589)
SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35278)
SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 582574)
SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253153)
SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 456505)
SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 677159)
SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 194733)
SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 674020)
SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7256741)
SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78113)
SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19740)
SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42427)
SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 39905)
SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483444)
SequencerActionsTest:testCantAddZeroAddress() (gas: 235614)
SetInitialGovParamsActionTest:testL1() (gas: 259904)
SetInitialGovParamsActionTest:testL2() (gas: 688888)
SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 374240)
TokenDistributorTest:testClaim() (gas: 5742744)
TokenDistributorTest:testClaimAndDelegate() (gas: 5850827)
TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5748244)
Expand Down Expand Up @@ -231,7 +233,7 @@ TokenDistributorTest:testZeroDelegateTo() (gas: 4132733)
TokenDistributorTest:testZeroOwner() (gas: 4132646)
TokenDistributorTest:testZeroReceiver() (gas: 4132675)
TokenDistributorTest:testZeroToken() (gas: 71889)
TopNomineesGasTest:testTopNomineesGas() (gas: 4502786)
TopNomineesGasTest:testTopNomineesGas() (gas: 4502996)
UpgradeExecRouteBuilderTest:testAIP1Point2() (gas: 1322645)
UpgradeExecRouteBuilderTest:testRouteBuilderErrors() (gas: 1127374)
UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2583801)
Expand Down
48 changes: 48 additions & 0 deletions docs/creating-a-proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Creating a core proposal

The following is a guide to creating an on-chain Arbitrum DAO core governor proposal.

Prior to creating a proposal, it should be publically discussed on the Arbitrum Forum and a an off-chian temperature-check snapshot poll should be conducted; see [Arbitrum DAO docs](https://docs.arbitrum.foundation/how-tos/create-submit-dao-proposal#step-2-submit-your-on-chain-proposal-using-tally) for details.

Once a temperature check has passed, the following things can be done:

1. **Create Action Contract(s)**: Create the Governance Action Contract(s) for the proposal. See [here](../src/gov-action-contracts/README.md) for a guide to Governance Action Contracts.

1. **(Optional) Unit Tests**: Write unit tests for the Action Contracts if appropriate, i.e., if they introduce non-trivial new logic.

1. **Deploy And Verify Action Contracts**: Using `forge create`, deploy Action Contracts on their appropriate chain(s) (Ethereum, Arbitrum One, or Nova) and verify their bytecode on etherscan/arbiscan. (Note that no additional scripting should be used/required for Action Contract deployment.)

1. **Generate Propoposal Calldata**:
a. Create a new directory under ./scripts/proposals/ for your proposal data, e.g.

```
mkdir ./scipts/proposals/AIPMyProp
```
b. Generate proposal data using `yarn gen:proposalData` using the addresses of the deloyed action contracts, and providing a path to store the new JSON file.
For example:
```
yarn gen:proposalData \
--govChainProviderRPC https://arb1.arbitrum.io/rpc \
--actionChainIds 1 42161 \
--actionAddresses 0xAddressA 0xAddressB \
--writeToJsonPath ./scipts/proposals/AIPMyProp/my-prop-data.json
```
Note that the indices for the chain ids correspond with those of the action contracts. E.g., in the example, 0xAddressA should be deployed on chain 1 (Ethereum) and 0xAddressB should be deployed on chain 42161 (Arbitrum One.)
Run `yarn gen:proposalData --help` to see all optional parameters.
Once the data JSON is properly created, it can be included in a public pull request to this repo.
Note that while some prior proposals include description text and/or deployment scripts, that is no longer necessary.
1. **Run Simulation**
Using the calldata generated in the previous step, test the proposal using [the Arbitrum DAO governance seatbelt](https://github.com/ArbitrumFoundation/governance-seatbelt). Include the configuration in a PR to the seatbelt repo ([example](https://github.com/ArbitrumFoundation/governance-seatbelt/pull/26)).
The seatbelt will generate a human readable report of all of the state changes in the proposal; only proceed if the report's result are what is expected.
1. **Submit Proposal In Tally UI** See [here](./submit_a_proposal.md).
4 changes: 2 additions & 2 deletions docs/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The core, treasury, and security-council-member-removal governors all have a min
- **Timelock vs Governor Execution**
An operation queued in the core-governor-timelock or the treasury-governor-timelock can be executed permissionlessly on either its associated governor (typical) or on the timelock itself (atypical). The execution will be the same in either case, but in the later case, the governor’s `ProposalExecuted` event will not be emitted.

- **Two L1 Proxy Admins**
There are two L1 proxy admins - one for the governance contracts, once for the governed core Nitro contracts. Note that both proxy admins have the same owner (the DAO), and thus this has no material effect on the DAO's affordances.
- **Multiple L1 Proxy Admins**
There are 3 L1 proxy admins - one for the governance contracts, one for the governed core Nitro contracts of Arb1, and one for the governed core Nitro contracts of Nova. Note that all proxy admins have the same owner (the DAO), and thus this has no material effect on the DAO's affordances.

- **Non-excluded L2 Timelock**
ARB in both the treasury timelock and the DAO treasury can be transferred via treasury gov DAO vote; however, only ARB in the DAO treasury is excluded from the quorum numerator calculation. Thus, the DAO’s ARB should ideally all be stored in the DAO Treasury.
Expand Down
Binary file modified docs/security-council-colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/security-council-election-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Security Council Election Flow

```mermaid
graph TD
Z["Contender registration (7 days)"] --> A
A["Nominee selection (7 days)"] --> B["Compliance check by foundation (14 days)"]
B --> C["Member election (21 days)"]
C --> D["Security council manager (0 days)"]
D --> E["L2 Timelock (3 days)\nWithdrawal period (~1 week)\nL1 Timelock (3 days)"]
E --> F["Individual council updates (0 days)"]
```
Binary file removed docs/security-council-election-flow.png
Binary file not shown.
32 changes: 19 additions & 13 deletions docs/security-council-mgmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ The election process and update stages are performed via on-chain smart contract

Process for selecting and voting for the new cohort of Security council members.

1. **Nominee Selection (7 days).** Candidates must gain 0.2% of total votable tokens in order to make it to the next step.
2. **Compliance check by Foundation (14 days).** As dictated in the Constitution, the selected nominees must undergo a compliance check to ensure they comply with the legal requirements, service agreements, and additional rules dictated by the Constitution.
3. **Member election (21 days).** Votes are cast and the top 6 nominees are selected.
1. **Candidate registration (7 days)** Candidates must put themselves up for nomination in order to receive votes.
2. **Nominee selection (7 days).** Candidates must gain 0.2% of total votable tokens in order to make it to the next step.
3. **Compliance check by Foundation (14 days).** As dictated in the Constitution, the selected nominees must undergo a compliance check to ensure they comply with the legal requirements, service agreements, and additional rules dictated by the Constitution.
4. **Member election (21 days).** Votes are cast and the top 6 nominees are selected.

## Update Stages

Expand All @@ -37,12 +38,21 @@ Process to install the newly elected cohort of Security Council members into the

# Election Stages in detail

## 1. Nominee selection (7 days)

This stage consists of handling election timing, candidate registration, candidate endorsement:
## 1. Election creation and candidate registration (7 days)

- **Election creation.** Elections can be created by anyone, but only every 6 months. The election alternates between targeting the positions on the two cohorts. Once created, this first stage of the election process lasts for 7 days.
- **Candidate registration.** During these 7 days, any candidate can register, unless they are already a member of the other cohort. Members of the current cohort (the cohort up for election) are allowed to register for re-election.

### Implementation details

A new proposal is created each election cycle by calling `SecurityCouncilNomineeElectionGovernor.createElection`. Once a proposal is created it will be "Pending" for 7 days.

Voting is not allowed while the proposal is pending.

During the 7 day pending window, contenders register themselves by signing an EIP712 message of type `AddContenderMessage(uint256 proposalId)` and calling `SecurityCouncilNomineeElectionGovernor.addContender`.

## 2. Nominee selection (7 days)

- **Endorsing candidates.** Delegates can endorse a candidate during this 7 day window. A single delegate can split their vote across multiple candidates. No candidate can accrue more than 0.2% of all votable tokens.
- **Fallback in case of too few candidates.** In the event that fewer than 6 candidates receive a 0.2% endorsement, the Arbitrum Foundation will randomly select members from the outgoing cohort to make up to 6 candidates.

Expand All @@ -55,13 +65,9 @@ It inherits most of its functionality from the OpenZeppelin Governor contracts,
- Custom counting module to allow delegates to endorse multiple candidates.
- Overridden proposal and execution to make the governor single purpose.

This governor contract has the following general interface relevant to the first stage:

- A new proposal is created each election cycle by calling `createElection`
- Contenders can make themselves eligible to receive votes by calling `addContender`.
- Delegates can call `castVoteWithReasonAndParams` or `castVoteWithReasonAndParamsBySig` supplying custom arguments in the params to indicate which candidate they wish to endorse with what weight.
Delegates can call `castVoteWithReasonAndParams` supplying custom arguments in the params to indicate which candidate they wish to endorse with what weight.

## 2. Compliance check by the Foundation (14 days)
## 3. Compliance check by the Foundation (14 days)

The Foundation will be given 14 days to vet the prospective nominees. If they find that a candidate does not meet the compliance check, they can exclude the candidate from progressing to the next stage. The compliance rules are not detailed here, and will instead be published by the Foundation, but note that grounds for exclusion will include greater than 3 members of a given organisation being represented in the nominee set (as described in section 4 of the Constitution).

Expand All @@ -77,7 +83,7 @@ The Governor smart contract enforces that at least a 2 week time period be provi

Once the compliance check has completed, anyone can call the `execute` function on the `SecurityCouncilNomineeElectionGovernor` to proceed to the member election stage.

## 3. Member election (21 days)
## 4. Member election (21 days)

The voting process can begin once a set of compliant candidates have been successfully nominated.

Expand Down
Loading

0 comments on commit 0df2b24

Please sign in to comment.