Skip to content

Commit

Permalink
Merge branch 'main' into election-tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman committed Sep 27, 2023
2 parents b1b9877 + 24a5286 commit f8954f0
Show file tree
Hide file tree
Showing 24 changed files with 1,728 additions and 102 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ignore Dockerfile
*.Dockerfile
Dockerfile

# Ignore docker-compose files
docker-compose.yml
docker-compose.override.yml

# Ignore .git and .cache directories
.git
.cache

# Ignore log, tmp, and dist directories
log/*
tmp/*
dist/*
1,439 changes: 1,439 additions & 0 deletions audits/code4rena_9_20_2023.md

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion docs/proposalMonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ yarn build
ETH_RPC=<your ethereum rpc here> yarn propmon
```

Then navigate to `localhost:8080/propMonUi/propMonUi.html` in a browser. You will need to wait around 30 seconds whilst the propmon discovers all proposals and their stages. The propmon creates a proposalStage.json file that contains a json representation of the data you see on the web page.
Then navigate to `localhost:8080/propMonUi/propMonUi.html` in a browser. You will need to wait around 30 seconds whilst the propmon discovers all proposals and their stages. The propmon creates a proposalStage.json file that contains a json representation of the data you see on the web page.

## Running with docker
```
docker build -t propmon -f propMon.Dockerfile .
docker run -p 8080:8080 -e ETH_RPC=<your ethereum rpc here> propmon
```
Navigate to `localhost:8080/propMonUi/propMonUi.html`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"coverage:report": "yarn coverage:filtered-report && yarn coverage:htmlreport && yarn coverage:open-report",
"coverage:refresh": "yarn coverage:filtered-report && yarn coverage:htmlreport",
"propmon:ui": "cd src-ts && http-server . -p 8080",
"propmon:service": "ts-node ./src-ts/proposalMonitorCli.ts --jsonOutputLocation ./src-ts/propMonUi/proposalState.json --l1RpcUrl $ETH_RPC --govChainRpcUrl https://arb1.arbitrum.io/rpc --novaRpcUrl https://nova.arbitrum.io/rpc --coreGovernorAddress 0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9 --treasuryGovernorAddress 0x789fC99093B09aD01C34DC7251D0C89ce743e5a4 --sevenTwelveCouncil 0x895c9fc6bcf06e553b54A9fE11D948D67a9B76FA --nomineeElectionGovernorAddress 0x8a1cDA8dee421cD06023470608605934c16A05a0 --pollingIntervalSeconds 1",
"propmon:service": "ts-node ./src-ts/proposalMonitorCli.ts --jsonOutputLocation ./src-ts/propMonUi/proposalState.json --l1RpcUrl $ETH_RPC --govChainRpcUrl https://arb1.arbitrum.io/rpc --novaRpcUrl https://nova.arbitrum.io/rpc --coreGovernorAddress 0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9 --treasuryGovernorAddress 0x789fC99093B09aD01C34DC7251D0C89ce743e5a4 --sevenTwelveCouncil 0x895c9fc6bcf06e553b54A9fE11D948D67a9B76FA --nomineeElectionGovernorAddress 0x8a1cDA8dee421cD06023470608605934c16A05a0 --pollingIntervalSeconds 5",
"propmon": "yarn propmon:service & yarn propmon:ui"
},
"devDependencies": {
Expand Down
17 changes: 17 additions & 0 deletions propMon.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dockerfile
FROM node:16

WORKDIR /app

COPY package.json ./
COPY yarn.lock ./

RUN yarn install

COPY . .

RUN git submodule update --init --recursive

RUN yarn build

CMD ["yarn", "propmon"]
7 changes: 4 additions & 3 deletions scripts/contractVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class ContractVerifier {
arbitrumDAOConstitution: "src/ArbitrumDAOConstitution.sol:ArbitrumDAOConstitution",
l1Executor: this.TUP,
l1ProxyAdmin: this.PROXY_ADMIN,
l1TimelockLogic: "src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock",
l1Timelock: this.TUP,
vestedWalletFactory: "src/ArbitrumVestingWalletFactory.sol:ArbitrumVestingWalletsFactory",
l2TokenDistributor: "src/TokenDistributor.sol:TokenDistributor",
Expand All @@ -65,9 +66,9 @@ export class ContractVerifier {
ArbGoerliSetInitialGovParamsAction: "src/gov-action-contracts/goerli/ArbGoerliSetInitialGovParamsAction.sol:ArbGoerliSetInitialGovParamsAction",
AIP1Point2Action: "src/gov-action-contracts/AIPs/AIP1Point2Action.sol:AIP1Point2Action",
AIP4Action: "src/gov-action-contracts/AIPs/AIP4Action.sol:AIP4Action",
SetSweepReceiverAction: "src/gov-action-contracts/AIPs/MiscAIP/SetSweepReceiverAction.sol:SetSweepReceiverAction",
UpdateGasChargeAction: "src/gov-action-contracts/AIPs/MiscAIP/UpdateGasChargeAction.sol:UpdateGasChargeAction",
UpdateL1CoreTimelockAction: "src/gov-action-contracts/AIPs/MiscAIP/UpdateL1CoreTimelockAction.sol:UpdateL1CoreTimelockAction",
SetSweepReceiverAction: "src/gov-action-contracts/AIPs/AIP7/SetSweepReceiverAction.sol:SetSweepReceiverAction",
UpdateGasChargeAction: "src/gov-action-contracts/AIPs/AIP7/UpdateGasChargeAction.sol:UpdateGasChargeAction",
UpdateL1CoreTimelockAction: "src/gov-action-contracts/AIPs/AIP7/UpdateL1CoreTimelockAction.sol:UpdateL1CoreTimelockAction",
ArbitrumFoundationVestingWalletProxy: this.TUP,
ArbitrumFoundationVestingWalletLogic: "src/ArbitrumFoundationVestingWallet.sol:ArbitrumFoundationVestingWallet",
};
Expand Down
5 changes: 3 additions & 2 deletions scripts/genGoverningChainTargetedProposalArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export const generateArbSysArgs = async (
l2Provider: JsonRpcProvider,
l2UpgradeAddr: string,
description: string,
useSchedule = false,
upgradeValue = BigNumber.from(0),
actionIfaceStr = "function perform() external",
upgradeArgs = []
upgradeArgs = [],
) => {
const actionIface = new utils.Interface([actionIfaceStr]);
const upgradeData = actionIface.encodeFunctionData("perform", upgradeArgs);
Expand Down Expand Up @@ -58,5 +59,5 @@ export const generateArbSysArgs = async (
};

const proposalCreator = new RoundTripProposalCreator(L1GovConfig, [upgradeConfig]);
return proposalCreator.createRoundTripCallDataForArbSysCall([l2UpgradeAddr], [upgradeValue],[upgradeData], description);
return proposalCreator.createRoundTripCallDataForArbSysCall([l2UpgradeAddr], [upgradeValue],[upgradeData], description, useSchedule);
};
4 changes: 2 additions & 2 deletions scripts/proposals/AIP12/data/42161-AIP1.2-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"actionChainID": 42161,
"actionAddress": "0x6274106eedD4848371D2C09e0352d67B795ED516",
"actionChainID": [42161],
"actionAddress": ["0x6274106eedD4848371D2C09e0352d67B795ED516"],
"description": "\nCategory: Constitutional - Process\n\nAbstract:\nThis document (“AIP-1.2”) proposes amendments to the Constitution, and The Arbitrum Foundation Amended & Restated Memorandum & Articles of Association (the “A&R M&A”) and Bylaws (the “Bylaws”) to (1) remove references to AIP-1, and (2) make other changes reflecting feedback from the community.\n\nMotivation:\nAIP-1 set out critical aspects of governance and included key governance documents for the ArbitrumDAO, and The Arbitrum Foundation which referenced AIP-1 throughout: the ArbitrumDAO Constitution (the “Constitution”), the Bylaws and the A&R M&A. However, after vigorous community debate, AIP-1 did not pass.\n\nRationale:\nThe Constitution is a foundational document that lays out the governance system and capabilities of the ArbitrumDAO; the Bylaws and A&R M&A outline The Arbitrum Foundation’s relationship with and obligations to the ArbitrumDAO. These documents should be updated, via amendment, to remove references to AIP-1 and also to reflect other changes requested by the community during the debate process over AIP-1.\n\nSpecifications:\n\nAmendments to the Constitution (https://drive.google.com/file/d/1pIYxg9rJzIPcP0bvQAaPgmLITM9rVBIf/view?usp=share_link)\n-Remove references to AIP-1, except as reference to the moment the original Constitution became effective.\n-Make explicit that proposals to amend The Arbitrum Foundation’s A&R M&A and Bylaws take the form of a Constitutional AIP.\n-Make explicit that the DAO may make a Non-Constitutional Funding AIP with respect to the Administrative Budget Wallet.\n-Lower the threshold number of Votable Tokens required for an AIP to be posted on-chain from 5,000,000 $ARB to 1,000,000 $ARB.\n-Add a new Section 5, which details the Data Availability Committee, including processes for removing and appointing Data Availability Committee members.\n\nAmendments to the Bylaws (https://drive.google.com/file/d/1VLYNk9VYUWMl0sL2wchot6I6arHCzd4r/view?usp=share_link)\n-Remove references to AIP-1.\n-Clarify that the definition of “Administrative Budget Wallet” includes all assets that are contributed to or otherwise acquired by the Administrative Budget Wallet, inclusive of assets specifically approved by the ArbitrumDAO. As pointed out by the DAO in its feedback in response to AIP-1, the “Administrative Budget Wallet” defined term in the Bylaws was unclear and didn’t clearly reflect the reality of The Arbitrum Foundation’s receipt of 7.5% of the token supply upon the $ARB token genesis.\n-Remove references to “Special Grants” and replace with the concept of Arbitrum ecosystem growth.\n-Remove “AIP Threshold” defined term as it is not used elsewhere in the Bylaws\n-Clarify that the ArbitrumDAO may replace The Arbitrum Foundation’s directors, change the number of directors, and require The Arbitrum Foundation to take certain actions.\n\nAmendments to the A&R M&A (https://drive.google.com/file/d/1Zmi5w21skdwuC7EAe59mYBC_4fS1vqzJ/view?usp=share_link)\n-Remove references to AIP-1.\n",
"arbSysSendTxToL1Args": {
"l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
Expand Down
11 changes: 6 additions & 5 deletions scripts/proposals/AIP12/generateProposalData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generateArbSysArgs } from "../../genGoverningChainTargetedProposalArgs";
import { JsonRpcProvider } from "@ethersproject/providers";
import { SingleActionCoreGovProposal } from "../coreGovProposalInterface";
import { CoreGovPropposal } from "../coreGovProposalInterface";
import fs from "fs";
import dotenv from "dotenv";
dotenv.config();
Expand Down Expand Up @@ -55,11 +55,12 @@ const main = async () => {
l1Provider,
l2Provider,
actionAddress,
description
description,
true
);
const proposal: SingleActionCoreGovProposal = {
actionChainID: chainId,
actionAddress,
const proposal: CoreGovPropposal = {
actionChainID: [chainId],
actionAddress: [actionAddress],
description,
arbSysSendTxToL1Args: {
l1Timelock: l1TimelockTo,
Expand Down
8 changes: 6 additions & 2 deletions scripts/proposals/AIP4/data/42161-AIP4-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"actionChainID": 42161,
"actionAddress": "0x85792f6BF346e3Bfd3A275318aDd2c44A1058447",
"actionChainID": [
42161
],
"actionAddress": [
"0x85792f6BF346e3Bfd3A275318aDd2c44A1058447"
],
"description": "\nProposal: Update Security Council Election Start Date to Ensure Time for Security Audit\n\nCategory: Constitutional - Process\n\nHigh Level Overview\nThe ArbitrumDAO Constitution specifies that the first Security Council election should start on the 15th September alongside a specification for the election.\n\nAn on-chain implementation of the entire election is still a work in progress. The Arbitrum Foundation has sponsored the implementation of a smart contract suite by Offchain Labs, an extension of Tally’s user interface, and the respective audits.\n\nThis proposal seeks to revise the ArbitrumDAO Constitution to provide flexibility for the start date of the election. If passed by a Constitutional Vote, the new start date will be on the 15th September or the earliest possible date in which an on-chain election can begin.\n\nThe motivation to change the election’s start date is to provide time for the implementation to be completed, security audits to be performed, for the community to gain confidence in the quality of its implementation and for the Arbitrum DAO to vote on a separate Constitutional AIP to install an on-chain election system.\n\nThe overarching goal is to still allow the election to begin on the 15th September, but it is prudent to provide leeway and ensure all parties, especially the Arbitrum DAO, are confident in the election software’s security and completeness.\n\nPath to a Smart Contract Enabled Election\nThis proposal seeks approval from the Arbitrum DAO that the first and all subsequent security elections should be performed via the on-chain election process.\n\nThe activation of the Security Council election is dependent on:\n\nComplete implementation for the on-chain smart contracts,\nComplete implementation of the user interface,\nSmart contract audit by a highly regarded auditing firm,\nAll parties, including the Arbitrum DAO, have gained confidence in the implementation’s completeness and security,\nSuccessful Constitutional Vote by the DAO to install the new election software.\nA vote on this proposal is approving that the above conditions are mandatory for any election software before it can be installed into the on-chain smart contracts.\n\nModified Start Date for Election\nThe implementation sponsored by the Arbitrum Foundation should be ready for the start date of the 15th September.\n\nEven so, given the naunces of implementation details and the potential security risks to a critical part of the system, we believe it is still prudent to provide leeway and extra time for the Security Council elections to begin some time after the required date set out by The Arbitrum Foundation.\n\nAfter all, it is not just about having a complete implementation, but ensuring all parties have confidence that all efforts have made been to minimize the risk of bugs in the implementation.\n\nRevision to ArbitrumDAO Constitution\nThe revised text focuses on the election beginning at the earliest possible date from the 15th September. Additionally, the election can only begin once an on-chain election system is installed via a separate Constitutional Vote.\n\nAll future elections can begin six months after the previous election. As such, the chosen date for the first election will decide the earliest start date for the next election.\n\nFor extra clarity in the text, we have renamed “September Cohort” to “First Cohort” and “March Cohort” to “Second Cohort”\n\nFinally, to remove any ambiguity, all security council members are expected to serve the time until the new Security Council members are installed in the respective smart contracts.\n\nCurrent text of ArbitrumDAO Constitution:\nThe Security Council has 12 members, who are divided into a September Cohort of 6 members, and a March Cohort of 6 members. Every year on September 15, 12:00 UTC, an election starts for the 6 September Cohort seats; and every year on March 15, 12:00 UTC, an election starts for the 6 March Cohort seats.\n\nThis means that the initial September Cohort will serve an initial term of 6 months, whereas the initial March Cohort will serve an initial term of 1 year.\n\nThe initial Security Council Cohorts were determined by randomly splitting the 12 members into two 6-member cohorts - 6 members in the September Cohort and 6 members in the March Cohort. The members of the initial Security Council Cohorts are detailed in a transparency report here.\n\nProposed Revision of Arbitrum Constitution:\nThe Security Council has 12 members, who are divided into two Cohorts of 6 members.\n\nThe initial Security Council Cohorts were determined by randomly splitting the 12 members into two 6-member cohorts - 6 members in the ‘First Cohort’ and 6 members in the ‘Second Cohort’. The members of the initial Security Council Cohorts are detailed in a transparency report here.\n\nThe first security election is scheduled to begin on the 15th September 2023 or the earliest possible date. The election can only begin upon the availability of an on-chain election process that was approved and installed by the Arbitrum DAO. This first election replaces the ‘First Cohort’. The next election replaces the ‘Second Cohort,’ and so forth.\n\nThe date chosen for the first election will form the basis for all future elections. Every election should begin 6 months after the previous election has started and it will replace its respective cohort of 6 members.\n\nAll Security Council members are expected to serve their term until the election is complete and the new Security Council members are installed.\n",
"arbSysSendTxToL1Args": {
"l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
Expand Down
11 changes: 6 additions & 5 deletions scripts/proposals/AIP4/generateProposalData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generateArbSysArgs } from "../../genGoverningChainTargetedProposalArgs";
import { JsonRpcProvider } from "@ethersproject/providers";
import { SingleActionCoreGovProposal } from "../coreGovProposalInterface";
import { CoreGovPropposal } from "../coreGovProposalInterface";
import fs from "fs";
import dotenv from "dotenv";
dotenv.config();
Expand Down Expand Up @@ -86,11 +86,12 @@ const main = async () => {
l1Provider,
l2Provider,
actionAddress,
description
description,
true
);
const proposal: SingleActionCoreGovProposal = {
actionChainID: chainId,
actionAddress,
const proposal: CoreGovPropposal = {
actionChainID: [chainId],
actionAddress: [actionAddress],
description,
arbSysSendTxToL1Args: {
l1Timelock: l1TimelockTo,
Expand Down
17 changes: 17 additions & 0 deletions scripts/proposals/AIP7/data/42161-AIP7-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"actionChainID": [
42161,
42161,
1
],
"actionAddress": [
"0x7b1247f443359d1447cf25e73380bc9b99f2628f",
"0xbaba4daf5800b9746f58c724f05e03880850d578",
"0xbaba4daf5800b9746f58c724f05e03880850d578"
],
"description": "Security council non emergency upgrade August 2023",
"arbSysSendTxToL1Args": {
"l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
"calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000d8f89f9f53c79fc7bf389cd37f76d8b2a56855078ca9c102bb8fda9978b5f529000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c0000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd0000000000000000000000007b1247f443359d1447cf25e73380bc9b99f2628f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000baba4daf5800b9746f58c724f05e03880850d57800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000baba4daf5800b9746f58c724f05e03880850d57800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const main = async () => {
console.log("UpdateL1CoreTimelockAction deployed at", action3.address);

await l1Verifier.verifyWithAddress(
"l1Timelock",
"l1TimelockLogic",
newTimelockLogic.address,
);

Expand Down
Loading

0 comments on commit f8954f0

Please sign in to comment.