Skip to content

Commit 59ef450

Browse files
author
Joey Santoro
committed
update README
1 parent d54a7f3 commit 59ef450

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

proposals/README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,65 @@ These files will be used to programatically generate the proposal calldata for s
1313

1414
Make sure these files are up to date and approved by the Fei Core smart contracts team before continuing development.
1515

16-
### Updating Permissions
16+
## Step 2 (Optional): Updating Permissions
1717
If your proposal updates the access control permissions of a contract, you need to list/remove the address key in the appropriate sections of `/contract-addresses/permissions.json`
1818

1919
The key names are the same as the ones in `/contract-addresses/mainnet-addresses.json`
2020

2121
These permissiones are validated against on-chain state in the last e2e test
2222

23+
## Step 3: Proposal Mocking and Integration Test
24+
Write a script following the template of `proposals/dao/fip_x.js`. See below for descriptions of each of the `deploy`, `setup`,`teardown`, and `validate` functions. Only `validate` is required.
2325

24-
## Optional Step 2: Does Proposal Require New Contract Deployments?
26+
Add an object with the key `fip_x` to `end-to-end/proposals_config.json`,
2527

26-
Whether a deployment of a new instance of a pre-exisiting or new contract, if your proposal requires a new contract deployment you'll need to write a deploy script.
28+
Your proposal will be run before any integration tests via `npm run test:e2e`. Fill in the following parameters:
29+
* deploy - set to true only if you added a deploy script for your proposal in the optional step, otherwise false. This will run your deploy script before the integration tests and add the contract objects as keys in `contracts` parameter of each of the hooks.
30+
* exec - When true, the e2e tests will run the actual proposal through the dao instead of the `run` hook which mocks the behavior. It imports the proposal steps from the `proposals/description/fip_x.json` file
2731

28-
See examples in the `deploy` folder, name your file `fip_x.js`
32+
### Step 3a (Optional): deploy() - Contract Deployments:
33+
Whether a deployment of a new instance of a pre-exisiting or new contract, if your proposal requires a new contract deployment you'll need to write a deploy script.
2934

30-
The deploy script is automatically run before any e2e tests if it is present in the `end-to-end/proposals_config.json`. The contract objects will be present in the setup, run, teardown and validate hooks as keys in the `contracts` parameter.
35+
The deploy script is automatically run before any e2e tests if the deploy flag is set to true in the `end-to-end/proposals_config.json`. The contract objects will be present in the setup, run, teardown and validate hooks as keys in the `contracts` parameter.
3136

3237
This is useful for fully testing the deploy script against a mainnet fork before deploying to mainnet.
3338

34-
To execute the deployment run:
35-
* mainnet - `DEPLOY_FILE=fip_x npm run deploy:main`
36-
* local - `DEPLOY_FILE=fip_x npm run deploy:localhost`
37-
3839
If your proposal requires new code additions to succeed, these need to be developed and reviewed. It should first be reviewed by the Fei Core smart contracts team and the team of any relevant integrations before sending to audit.
3940

40-
## Step 3: Proposal Mocking and Integration Test
41-
Write a script following the template of `proposals/dao/fip_x.js`. The script should use the injected `addresses`, `contracts`, and `oldContracts` parameters to trigger the appropriate governor functions with the intended inputs.
41+
### Step 3b (Optional): setup() - Pre-DAO steps
42+
The setup hook should contain operational actions from third parties including any address impersonation that occur BEFORE the DAO proposal executes. See `test/helpers.ts#getImpersonatedSigner` and `test/helpers.ts#forceETH`.
43+
44+
The script should use the injected `addresses`, `contracts`, and `oldContracts` parameters to trigger the appropriate governor functions with the intended inputs.
4245

4346
* `addresses` contains a flat mapping of address names to addresses found in `contract-addresses/mainnetAddresses`
4447
* `contracts` contains a flat mapping of contract names to contract objects using the specified artifact and contract from `contract-addresses/mainnetAddresses` AFTER all of the deploy and upgrade steps have taken place
4548

4649
* `oldContracts` contains a flat mapping of contract names to contract objects using the specified artifact and contract from `contract-addresses/mainnetAddresses` from BEFORE all of the deploy and upgrade steps have taken place, in case actions need to be taken on the prior versions of upgraded contracts
4750

48-
The setup, teardown, and validation hooks are used to compare the output of the dao script to the actual on-chain calldata proposed to the governor.
51+
### Step 3c (Optional): teardown() - Post-DAO steps
52+
The teardown hook should contain operational actions from third parties including any address impersonation that occur AFTER the DAO proposal executes.
4953

50-
Add an object with the key `fip_x` to `end-to-end/proposals_config.json`,
54+
Uses the same `addresses`, `contracts`, and `oldContracts` parameters as `setup()`.
5155

52-
Your proposal will be run before any integration tests via `npm run test:e2e`. Fill in the following parameters:
53-
* deploy - set to true only if you added a deploy script for your proposal in the optional step, otherwise false. This will run your deploy script before the integration tests and add the contract objects as keys in `contracts` parameter of each of the hooks.
54-
* exec - When true, the e2e tests will run the actual proposal through the dao instead of the `run` hook which mocks the behavior. It imports the proposal steps from the `proposals/description/fip_x.json` file
56+
### Step 3d: validate() - Post-DAO invariant checks
57+
The validate hook should contain any invariant checks that all parameters, roles, and funds are as expected post-DAO and teardown.
58+
59+
Use the mocha testing assertions such as `expect()` to make sure errors fail loudly.
5560

5661
## Optional Step 4: Deploying and Updating Addresses
5762
If your contract has an optional deployment step from above, you need to deploy your new contracts to mainnet before moving on to Step 5.
5863

64+
Run `DEPLOY_FILE=fip_x npm run deploy:fip`
65+
5966
Run your deploy script if you had one from step 2. Update `/contract-addresses/mainnet-addresses.json` with the new contract addresses.
6067

6168
Update the fork block inside the hardhat config and set the deploy flag to false in the config entry for `fip_x` in `end-to-end/proposals_config.json`
6269

6370
Finally rerun `npm run test:e2e` and make sure everything passes as expected.
6471

65-
## Step 5: Testing Exact Proposal
66-
67-
This script does a full end-to-end DAO proposal, vote, queue, and execution on the exact proposal to be submitted to the DAO.
68-
69-
The goal of this step is to compare the execution results of the calldata to the mock script from step 3. Any setup and teardown calls in the `proposals/dao/fip_x.js` file will still execute, but the run step is replaced by the execution of the proposal steps in `proposals/description/fip_x.json`.
70-
71-
Set the exec flag to true into the config entry for `fip_x` in `end-to-end/proposals_config.json`
72-
73-
Then run `npm run test:e2e`
74-
75-
## Step 6: Propose on-chain
72+
## Step 5: Propose on-chain
7673
Construct the calldata by running `DEPLOY_FILE=fip_x npm run calldata`
7774

78-
Send a transaction to the Fei DAO (0xE087F94c3081e1832dC7a22B48c6f2b5fAaE579B) using the calldata
75+
Send a transaction to the Fei DAO [0x0BEF27FEB58e857046d630B2c03dFb7bae567494](https://etherscan.io/address/0x0bef27feb58e857046d630b2c03dfb7bae567494) using the calldata
7976

8077
Verify on https://www.withtally.com/governance/fei/ that your proposal submitted and everything looks as expected

0 commit comments

Comments
 (0)