Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare dev > main #681

Open
wants to merge 105 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
0c332ad
Rename params
ngmachado Apr 10, 2024
827d3d5
Merge branch 'dev' into basic_action_change_arg_name
pi0neerpat Apr 22, 2024
2a66eea
Merge pull request #612 from open-dollar:basic_action_change_arg_name
pi0neerpat Apr 22, 2024
df01844
add target to codecov
ngmachado Apr 23, 2024
9a6140d
removed extra 'startBroadcast' line (#647)
MrDeadCe11 Apr 23, 2024
4c351d2
Merge pull request #649 from open-dollar/618
pi0neerpat Apr 24, 2024
e8fb328
Update timelock mindelay (#651)
MrDeadCe11 Apr 24, 2024
270c4cd
Gov script modifiable per collateral (#654)
MrDeadCe11 Apr 24, 2024
3b4b4a2
4 21 24 deployment (#643)
cupOJoseph Apr 24, 2024
b3de720
Add script DeployVault721Mainnet (#648)
pi0neerpat Apr 25, 2024
a3b03cc
Fix readme table
pi0neerpat Apr 25, 2024
e10a139
add proxy singleton script (#657)
daopunk Apr 26, 2024
51fce2f
Gov script improvements (#653)
MrDeadCe11 Apr 29, 2024
66d7f86
Fix Basic actions (#659)
MrDeadCe11 Apr 29, 2024
7665e9a
update stabilityFee and svg text
daopunk May 1, 2024
6fde524
governor => tlc_gov
daopunk May 1, 2024
f8a864f
edit comment, rm broadcasts
daopunk May 1, 2024
a42b4eb
follow sol rules
daopunk May 1, 2024
17ba796
update collateral text
daopunk May 1, 2024
b9204b1
update collateral & debt lookups
daopunk May 1, 2024
153a8fa
add saviour gas burner (#661)
ngmachado May 1, 2024
2263ed2
svg changes
daopunk May 1, 2024
5f948a3
edit svg
daopunk May 1, 2024
1b99626
Add DeployNFTRendererMainnet
pi0neerpat May 1, 2024
a106091
add stabilityFee mapping
daopunk May 1, 2024
afb8e5a
Merge branch 'nfv-stabilityFee' of https://github.com/open-dollar/od-…
daopunk May 1, 2024
1588c61
Update DeployNFTRendererMainnet to call updateStabilityFee
pi0neerpat May 1, 2024
3651fcc
Deploy new NFV Renderer
pi0neerpat May 1, 2024
a2beffb
Merge pull request #667 from open-dollar/nfv-stabilityFee
daopunk May 1, 2024
2bb7d4e
nod to v20 (#670)
pi0neerpat May 3, 2024
c14764f
Update Revoke Script (#668)
daopunk May 3, 2024
58b698e
Basic action exit deltaDebt fix (#674)
MrDeadCe11 May 3, 2024
5e00e76
Add collateral sepolia test (#666)
MrDeadCe11 May 3, 2024
b4acf9b
pass tests
daopunk May 3, 2024
42948f1
create PrankSwitch contract
daopunk May 3, 2024
abcea67
add use case comment
daopunk May 3, 2024
a7db9bc
edit comment
daopunk May 3, 2024
b4e60b8
Merge pull request #669 from open-dollar/update-var-name
daopunk May 3, 2024
b009bcc
reenter test
daopunk May 3, 2024
0a69bff
Merge pull request #676 from open-dollar/fix-nfvRenderer-tests
daopunk May 3, 2024
7c23916
Update readme
pi0neerpat May 3, 2024
a76a92b
simplify logic
daopunk May 3, 2024
0cec1c4
Deploy basic actions 5-3-24 (#679)
pi0neerpat May 4, 2024
06cbc01
Merge pull request #677 from open-dollar/prankSwitch-refactor
daopunk May 5, 2024
c6fa21b
Merge branch 'dev' into sepoliaDeploymentTest
daopunk May 6, 2024
738315c
rm redundant test
daopunk May 6, 2024
83dbbe4
add E2EDeploymentMainnetTest
daopunk May 6, 2024
0dc26ee
refactor
daopunk May 6, 2024
7a1d63d
change var name
daopunk May 6, 2024
caa16cc
E2e safemanager tests (#680)
MrDeadCe11 May 6, 2024
26e3825
Merge pull request #678 from open-dollar/sepoliaDeploymentTest
daopunk May 7, 2024
045a96a
increase by magnitude
daopunk May 7, 2024
c0bebcc
fixed tests (#686)
MrDeadCe11 May 7, 2024
3d31abf
Merge pull request #685 from open-dollar/increase-fuzz-reject-rate
daopunk May 7, 2024
a42668d
pass tests
daopunk May 7, 2024
4597b99
Merge pull request #688 from open-dollar/fix-gov-test
daopunk May 9, 2024
db72c32
fix interface
daopunk May 9, 2024
08c9353
Merge pull request #693 from open-dollar/fix-safeManager-proxy
daopunk May 10, 2024
853efb8
cleantree
daopunk May 11, 2024
7aac224
forge install: ds-test
daopunk May 11, 2024
b7575ae
Update export action (#684)
pi0neerpat May 11, 2024
11a7f5a
Merge branch 'dev' into fix-imports
pi0neerpat May 11, 2024
7321f6b
Merge pull request #697 from open-dollar/fix-imports
daopunk May 12, 2024
1e6213e
solidity-exporter-actions v2.0.15
pi0neerpat May 13, 2024
5e2be44
exporter-action to v2.0.16
pi0neerpat May 13, 2024
bec4076
Add example flexible proposal (#695)
pi0neerpat May 21, 2024
d24ccc4
change test params
daopunk May 21, 2024
e31c215
Merge pull request #706 from open-dollar/fix-package
daopunk May 21, 2024
22d75d0
691 allow script gen (#705)
MrDeadCe11 May 22, 2024
04ddd4b
add allow safe call to the protectSafe function in basicActions. (#704)
MrDeadCe11 May 22, 2024
93ab5d0
increase readability
daopunk May 22, 2024
7ecf592
increase readability
daopunk May 22, 2024
c2beba2
Update export-abis.yml (#709)
pi0neerpat May 24, 2024
0f28885
Remove shadow declaration warnings from scripts (#710)
pi0neerpat Jun 3, 2024
5ca9dfe
Merge pull request #708 from open-dollar/fix-math
daopunk Jun 5, 2024
8de75a0
add pessimistic report
pi0neerpat Jun 13, 2024
d6742b6
update common actions deployment script (#719)
pi0neerpat Jun 19, 2024
aa32dc9
Remove governance manager (#726)
MrDeadCe11 Jun 28, 2024
7f2c4f4
add tokens to mainnet fork setup
daopunk Jun 29, 2024
e2c07a6
add test oracles
daopunk Jun 29, 2024
317262a
fix test
daopunk Jun 29, 2024
d805d33
Merge pull request #727 from open-dollar/token-setup
daopunk Jun 29, 2024
c104e73
add liq test
daopunk Jul 3, 2024
f8bf2dc
edit comment
daopunk Jul 3, 2024
31edfb2
change test params
daopunk Jul 3, 2024
b30ce33
add liquidation tests
daopunk Jul 4, 2024
3a0d416
add more details about liquidation
daopunk Jul 5, 2024
482434a
format emits
daopunk Jul 8, 2024
478d50b
add OD fix
daopunk Jul 9, 2024
984c17c
Merge pull request #731 from open-dollar/liq-test
daopunk Jul 9, 2024
234e7c3
refactor cast tokens
daopunk Jul 9, 2024
31c8796
Merge pull request #735 from open-dollar/test-deploy-refactor
daopunk Jul 11, 2024
5f1f266
init
daopunk Jul 12, 2024
5e5466a
add address book
daopunk Jul 12, 2024
62462d5
add common functions
daopunk Jul 12, 2024
878ce28
add common setup functions
daopunk Jul 12, 2024
0843a8a
refine imports
daopunk Jul 12, 2024
eea5c60
refine imports
daopunk Jul 12, 2024
4229080
remove redundant code
daopunk Jul 12, 2024
bfcc410
fix warnings
daopunk Jul 13, 2024
161d990
Merge pull request #737 from open-dollar/address-book
daopunk Jul 13, 2024
c1dff81
fix arb safetyPrice
daopunk Jul 24, 2024
09fafe5
add coverage badge
pi0neerpat Jul 24, 2024
00b33fa
Merge pull request #741 from open-dollar/arb-test-params
daopunk Jul 24, 2024
522eb99
Add 3% per year
pi0neerpat Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/workflows/export-abis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
generate_interfaces:
if: github.repository == 'open-dollar/od-contracts'
runs-on: ubuntu-latest
strategy:
matrix:
export_type: ['interfaces', 'contracts']

steps:
- uses: actions/checkout@v3
Expand All @@ -32,22 +35,24 @@ jobs:
- name: Build project and generate out directory
run: yarn build

- name: Add typechain to install dependencies
run: yarn add typechain @typechain/web3-v1 @typechain/ethers-v6
- name: Generate canary tag
if: github.ref_name != 'main'
run: yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version

- name: Run Interface Exporter Action
uses: open-dollar/solidity-exporter-action@v1.0.1
- name: Export Solidity - ${{ matrix.export_type }}
uses: open-dollar/solidity-exporter-action@v2.0.17
with:
out_dir: "out"
typing_type: "ethers-v6"
package_name: "@opendollar/abis"
destination_dir: "abis-package"
package_name: '@opendollar'
out: 'out'
interfaces: 'src/interfaces'
contracts: 'src/contracts'
libraries: 'src/libraries'
scripts: 'script'
tests: 'test'

- name: Generate canary tag
if: github.ref_name != 'main'
run: cd abis-package && yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version
export_type: '${{ matrix.export_type }}'

- name: Publish
run: cd abis-package && npm publish --access public
run: cd export/@opendollar/${{ matrix.export_type }} && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 8 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
forge:
name: Run Unit and E2E Tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -46,15 +51,16 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
cache: true

- name: Install forge dependencies
run: forge install

- name: Install yarn dependencies
run: yarn install --frozen-lockfile

- name: Precompile using 0.8.19 and via-ir=false
run: yarn build
- name: Build
run: forge build

- name: "Create env file"
run: |
Expand All @@ -68,30 +74,3 @@ jobs:
- name: Run tests
shell: bash
run: yarn test

# coverage:
# name: Run Coverage Tests
# runs-on: ubuntu-latest

# strategy:
# matrix:
# node-version: [16.x]

# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# cache: "yarn"
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
# - run: yarn install
# - run: yarn build
# - run: yarn coverage
# - uses: codecov/codecov-action@v3
# with:
# files: ./coverage/lcov.info
# flags: production
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
yarn-error.log
node_modules
.DS_STORE
.nvmrc

# Foundry files
cache
Expand All @@ -21,6 +22,7 @@ lcov.info
!/**/.gitkeep
.vscode/


# Docs build files
docs/book
docs/src/src/
Expand Down
11 changes: 2 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
[submodule "lib/ds-test"]
path = lib/ds-test
url = https://github.com/dapphub/ds-test
[submodule "lib/isolmate"]
path = lib/isolmate
url = https://github.com/defi-wonderland/isolmate
[submodule "lib/prb-test"]
path = lib/prb-test
url = https://github.com/paulrberg/prb-test
branch = 0.5.5
path = lib/ds-test
url = https://github.com/dapphub/ds-test
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC.
Copyright (C) 2020 Reflexer Labs, INC.
Copyright (C) 2015-2020 DappHub, LLC
Copyright (C) 2023 Reflexer Labs, INC.
Copyright (C) 2024 OpenFi Foundation

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down
185 changes: 12 additions & 173 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
</a>
</p>

[![codecov](https://codecov.io/gh/open-dollar/od-contracts/graph/badge.svg?token=SDTNS69Q36)](https://codecov.io/gh/open-dollar/od-contracts)

This repository contains the core smart contract code for Open Dollar.

# Resources
Expand All @@ -22,21 +24,23 @@ This repository contains the core smart contract code for Open Dollar.

**Contract Deployments**

Addresses for testnet can be found in the app: https://app.dev.opendollar.com/stats
Addresses for can be found in the app: https://app.opendollar.com/stats

**Tools**

- `@opendollar/abis` - ABI interfaces are published automatically from this repo, on merge to `main` https://www.npmjs.com/package/@opendollar/abis
- `@opendollar/sdk` - Library to interact with Open Dollar smart contracts https://github.com/open-dollar/od-sdk

# Audits
# Audits

| Audit | Date | Auditor | Commit | Changes Since Audit | Report |
| --------- | ------------- | --------------------------------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| contracts | October, 2023 | [Cod4rena](https://code4rena.com) | [f401eb5](https://github.com/open-dollar/od-contracts/commit/f401eb5) | [View Changes](https://github.com/open-dollar/od-contracts/compare/f401eb5...main) | [View Report](https://code4rena.com/reports/2023-10-opendollar) |
| app | March, 2024 | [Quantstamp](https://www.quantstamp.com/) | [7c9b18c](https://github.com/open-dollar/od-app/commit/7c9b18c) | [View Changes](https://github.com/open-dollar/od-app/compare/7c9b18c...main) | [View Report](https://certificate.quantstamp.com/full/open-dollar-d-app/f0ff4333-535d-4de6-96e0-8573623c18bf/index.html) |
| contracts | April, 2024 | [Quantstamp](https://www.quantstamp.com/) | [6cdc848](https://github.com/open-dollar/od-contracts/commit/6cdc848) | [View Changes](https://github.com/open-dollar/od-contracts/compare/6cdc848...main) | [View Report](https://certificate.quantstamp.com/full/open-dollar-smart-contract-audit/202828fa-eb09-4d33-beab-c1ebee11ebd1/index.html) |
| relayer | April, 2024 | [Pashov Audit Group](https://www.pashov.net/) | [453222d](https://github.com/open-dollar/od-relayer/commit/453222d) | [View Changes](https://github.com/open-dollar/od-relayer/compare/453222d...main) | [View Report](https://github.com/pashov/audits/blob/master/team/pdf/OpenDollar-security-review.pdf) |

| Audit Number | Date | Auditor | Commit | Changes Since Audit | Report |
|--------------|------|---------|--------|---------------------|--------|
| 1 | October, 2023 | [Cod4rena](https://code4rena.com) | [f401eb5](https://github.com/open-dollar/od-contracts/commit/f401eb5) | [View Changes](https://github.com/open-dollar/od-contracts/compare/f401eb5...main) | [View Report](https://code4rena.com/reports/2023-10-opendollar) |
| 2 | March, 2024 | [Quantstamp](https://www.trailofbits.com/) | [39d1a1c](https://github.com/open-dollar/od-contracts/commit/39d1a1c) | [View Changes](https://github.com/open-dollar/od-contracts/compare/39d1a1c...main) | Report to be published |
| 3 | April, 2024 | [Pessimistic](https://pessimistic.io/) | [a0b7640](https://github.com/open-dollar/od-contracts/commit/a0b7640) | [View Changes](https://github.com/open-dollar/od-contracts/compare/a0b7640...main) | Report to be published |
| 4 | April, 2024 | [Pashov Audit Group](https://www.pashov.net/) | [453222d](https://github.com/open-dollar/od-relayer/commit/453222d) | [View Changes](https://github.com/open-dollar/od-relayer/compare/453222d...main) | Report to be published |
A Security Scan was performed by [Pessimistic](https://pessimistic.io/) April, 2024 at [a0b7640](https://github.com/open-dollar/od-contracts/commit/a0b7640). ([View Report](https://github.com/pessimistic-io/scans/blob/main/Open%20Dollar%20Security%20Scan%20Results.pdf))

Additional audits completed prior to forking this codebase can be found here: https://github.com/hai-on-op/audit-reports

Expand All @@ -53,171 +57,6 @@ Run:

When running `forge`, you can specify the profile to use using the FOUNDRY_PROFILE environment variable. e.g. `export FOUNDRY_PROFILE=test && forge test`. Alternatively, you can add `FOUNDRY_PROFILE=test` to `.env` and run `source .env`.

## Governance Actions

OpenDollar governance follows the common pattern of:

- proposing a governance action
- queuing the governance action
- executing the governance action

We include a set of governance scripts in `script/testScripts/gov` which allow DAO members to propose, queue and execute different governance actions.

> NOTE: It is important that you use the `governance` profile when running the different scripts otherwise the reading and writing of JSON files will not work.

### Overview

#### General Files

- [`JSONScript.s.sol`](script/testScripts/gov/JSONScript.s.sol): provides functionality for building JSON objects for proposing governance actions, parsing the proposal id for queuing proposals and parsing JSON objects for execution of the proposals.

#### Proposing Governance Actions

The current list of governance operations that can be proposed:

- Add Collateral: Adding a new collateral type to the system which can be borrowed against
- Update NFT Renderer: Sets the canonical NFT Renderer contract on Vault721

The input for the proposal is specific to the proposal and what that proposal requires.

The output is always a JSON file which includes at least the following `proposalParams`:

```
{
"proposalId": uint256,
"targets": address[],
"values": uint256[]
"calldatas": bytes[],
"description": string,
"descriptionHash": bytes32
}
```

The JSON output may also include some extra params just for informative purposes.

##### Add Collateral

[`ProposeAddCollateral.s.sol`](script/testScripts/gov/AddCollateralAction/ProposeAddCollateral.s.sol)

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `GLOBAL_SETTLEMENT_ADDRESS`: address of the global settlement contract
- `ADD_COLLATERAL_NEW_COLLATERAL_TYPE`: bytes32 value of the new collateral type
- `ADD_COLLATERAL_NEW_COLLATERAL_ADDRESS`: address of the new collateral address
- `ADD_COLLATERAL_MINIMUM_BID`: minimum bid for the collateral auctions (wad)
- `ADD_COLLATERAL_MIN_DISCOUNT`: minimum discount for the collateral auctions (wad %)
- `ADD_COLLATERAL_MAX_DISCOUNT`: maximum discount for the collateral auctions (wad %)
- `ADD_COLLATERAL_PER_SECOND_DISCOUNT_UPDATE_RATE`: Per second rate at which the discount is updated (ray)

This script proposes adding a new collateral to the system (deploys new contracts via the collateral join and collateral auction house factories).

##### Update NFT Renderer

[`ProposeUpdateNFTRenderer.s.sol`](script/testScripts/gov/UpdateNFTRendererAction/ProposeUpdateNFTRenderer.s.sol)

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `VAULT_721_ADDRESS`: address of the Vault721 contract
- `ORACLE_RELAYER_ADDRESS`: address of the oracle relayer
- `TAX_COLLECTOR_ADDRESS`: address of the tax collector
- `COLLATERAL_JOIN_FACTORY_ADDRESS`: address of the collateral join factory

This script proposes setting a new NFTRenderer contract on the Vault721 contract (deploys new NFTRenderer contract).

##### Update Block Delay

[`ProposeUpdateBlockDelay.s.sol`](script/testScripts/gov/UpdateBlockDelayAction/ProposeUpdateBlockDelay.s.sol)

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `VAULT_721_ADDRESS`: address of the Vault721 contract
- `BLOCK_DELAY`: the number of blocks to wait before being able to transfer after collateral or debt has been updated for allowlisted addresses

This script proposes setting a new block delay on the Vault721 contract.

##### Update Time Delay

[`ProposeUpdateTimeDelay.s.sol`](script/testScripts/gov/UpdateTimeDelayAction/ProposeUpdateTimeDelay.s.sol)

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `VAULT_721_ADDRESS`: address of the Vault721 contract
- `TIME_DELAY`: the amount of time to wait before being able to transfer after collateral or debt has been updated for non-allowlisted addresses

This script proposes setting a new time delay on the Vault721 contract.

##### Update PIDController Params

[`ProposeUpdatePidController.s.sol`](script/testScripts/gov/UpdatePidControllerAction/ProposeUpdatePidController.s.sol)

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `PID_CONTROLLER_ADDRESS`: address of PID controller
- `SEED_PROPOSER`: new seed proposer address
- `NOISE_BARRIER`: new noise barrier value
- `INTEGRAL_PERIOD_SIZE`: new integral period size value
- `FEEDBACK_OUTPUT_UPPER_BOUND`: new feedback output upper bound value
- `FEEDBACK_OUTPUT_LOWER_BOUND`: new feedback output lower bound value
- `PER_SECOND_CUMULATIVE_LEAK`: new per second cumulative leak value
- `KP`: new kp value
- `KI`: new ki value
- `PRICE_DEVIATION_CUMULATIVE`: new deviation observation integral value

> NOTE: see [`IPIDController.sol`](src/interfaces/IPIDController.sol) for more information about this.

This script proposes updating params on the PIDController contract.

#### Queuing Governance Actions

**Required env vars:**

- `GOVERNANCE_ADDRESS`: address of OD Governance
- `JSON_FILE_PATH`: the path to the desired JSON proposal file
- `GOV_EXECUTOR_PK`: the private key of the queuer of the governance action

[`QueueProposal.s.sol`](script/testScripts/gov/QueueProposal.s.sol) is used to queue a proposal given the path of the JSON file which you want, e.g. `export JSON_FILE_PATH=gov-output/1-add-collateral-proposal.json`.

This script extracts the proposal id and queues the proposal via the OD governance contract. This script can be used arbitrarily for any proposal.

#### Executing Governance Actions

**Required env vars:**

- `GOVERNANCE_ADDRESS`: address of OD Governance
- `JSON_FILE_PATH`: the path to the desired JSON proposal file
- `GOV_EXECUTOR_PK`: the private key of the executor of the governance action

[`ExecuteProposal.s.sol`](script/testScripts/gov/ExecuteProposal.s.sol) is used to execute a proposal given the path of the JSON file you want, e.g. `export JSON_FILE_PATH=gov-output/1-add-collateral-proposal.json`.

The script extracts the necessary execution params from the JSON-the same params used during the proposal and executes the proposal. This script can be used arbitrarily for any proposal.

##### ERC20 Transfer

[`ProposeERC20Transfer.s.sol`](script/testScripts/gov/ProposeERC20Transfer.s.sol)

> NOTE: This script uses `transferFrom` to allow the governance to manage transfers from governance balance but also to allow the governance to transfer tokens from any address to any address

**Required env vars:**

- `GOV_EXECUTOR_PK`: private key of the governance executor
- `GOVERNANCE_ADDRESS`: address of OD Governance
- `ERC20_TRANSFER_TOKEN_ADDRESS`: address of the ERC20 contract
- `ERC20_TRANSFER_FROM_ADDRESS`: address of the sender of the ERC20 tokens
- `ERC20_TRANSFER_RECEIVER_ADDRESS`: address of the receiver of the ERC20 tokens
- `ERC20_TRANSFER_AMOUNT`: amount to be transferred

This script proposes transferring ERC20 tokens from one address to another.

# Development

## Anvil
Expand Down
Loading
Loading