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

refacto: full foundry setup #91

Merged
merged 56 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b1b6367
feat: add disputer contract, scripts and tests
nlecoufl Oct 25, 2024
a70fa12
chore: uniformize hardhat config accounts
nlecoufl Oct 28, 2024
0f9b66e
feat: handle infinite approval & format headers
nlecoufl Oct 28, 2024
99f9376
scripts: skip some chains
nlecoufl Oct 30, 2024
b0894b2
fix: dispute test
nlecoufl Nov 4, 2024
bd948c7
feat: add whitelisted addresses
nlecoufl Nov 4, 2024
bf452ae
fix: deployer address
Picodes Nov 4, 2024
cc37f37
chore: deployments
Picodes Nov 4, 2024
1ba3b4b
feat: add set distributor and owner scripts
nlecoufl Nov 4, 2024
6418975
feat: add normal deploy Disputer script
nlecoufl Nov 4, 2024
9eb6140
fix: set correctly owner and deployer of disputer
nlecoufl Nov 4, 2024
289b1e4
refactor: revert owner to deployer
nlecoufl Nov 4, 2024
df5e203
feat: import CoreBorrow contract
nlecoufl Nov 14, 2024
9a9eb0f
feat: add foundry deploy scripts
nlecoufl Nov 14, 2024
cb25940
Merge branch 'feat/disputer' into refactor/deployment
nlecoufl Nov 14, 2024
094165e
wip: prepare sdk bump
nlecoufl Nov 17, 2024
37ad4bd
feat: bump sdk
nlecoufl Nov 18, 2024
ce8b427
feat: add setters to deploy script
nlecoufl Nov 18, 2024
aa2c067
feat: add fund disputer whitelist script
nlecoufl Nov 18, 2024
5b2a55e
feat: add mintAgla script
nlecoufl Nov 19, 2024
2336c92
feat: add deployCreateX script
nlecoufl Nov 20, 2024
5f69c90
feat: update merklDeploy script
nlecoufl Nov 20, 2024
ddf53c2
feat: add some control on deployer address and multisig address
nlecoufl Nov 20, 2024
ac40793
feat: verify createX is deployed
nlecoufl Nov 20, 2024
0c2b2ec
feat: deploy script improvements
nlecoufl Nov 21, 2024
b760b03
refactor: create transferInitialFunds function for better readability
nlecoufl Nov 22, 2024
c0397f7
fix: initialize core args
nlecoufl Nov 22, 2024
ae03b27
fix: add missing merkl deployer in funding
nlecoufl Nov 22, 2024
8557c31
chore: update foundry.toml
nlecoufl Nov 22, 2024
d73c9ed
feat: remove CreateX deployment from main script
nlecoufl Nov 29, 2024
178f501
feat: add Distributor, DistributorCreator and Disputer scripts
nlecoufl Nov 29, 2024
28896dc
refactor: improve scripts
nlecoufl Nov 29, 2024
76c34fb
refactor: remove hardhat for foundry
nlecoufl Nov 29, 2024
8b4dc4c
refactor: clean imports & useless files
nlecoufl Dec 2, 2024
b3ac325
refactor: clean tests
nlecoufl Dec 2, 2024
64170b0
refactor: minor tests fixes
nlecoufl Dec 2, 2024
ac976ff
ci: remove hardhat
nlecoufl Dec 2, 2024
d48bc35
ci: rename registry-token env
nlecoufl Dec 2, 2024
54091c6
ci: fix bunfig.toml token
nlecoufl Dec 2, 2024
8967f0f
fix: update bunfig.toml token
nlecoufl Dec 2, 2024
0877c9c
ci: setup repo in coverage job
nlecoufl Dec 2, 2024
1bd8801
feat: verify standard create2 is deployed
nlecoufl Dec 2, 2024
7f7ea72
feat: merge puffer token wrapper
nlecoufl Dec 2, 2024
728de05
refactor(scripts): add parameterless run functions
nlecoufl Dec 3, 2024
c706abc
docs(README): add script instructions
nlecoufl Dec 3, 2024
31794f4
feat: add swell
nlecoufl Dec 3, 2024
eb0c719
fix: foundry.toml swell rpc
nlecoufl Dec 3, 2024
2b3efd2
fix: fork test
nlecoufl Dec 3, 2024
b982a9c
refactor: delete TokenLocker.sol
nlecoufl Dec 3, 2024
c89070c
feat(scripts): add FundDisputer script
nlecoufl Dec 4, 2024
91de161
feat(scripts): add Disputer WithdrawFunds script
nlecoufl Dec 4, 2024
a77536a
refactor(ci): move coverage to separate workflow
nlecoufl Dec 4, 2024
0fb393b
fix: typos
nlecoufl Dec 4, 2024
4344389
fix: foundry.toml typo
nlecoufl Dec 4, 2024
bbda62b
chore: bump sdk
nlecoufl Dec 5, 2024
82df8f0
feat(script): add ToggleDispute script
nlecoufl Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 20 additions & 50 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,50 +1,20 @@
## Add URI and BIP39 mnemonic, and etherscan API key for every network that you plan to use
## These are used in `hardhat.config.ts` (see `nodeUrl` and `accounts` calls in network definitions)

#ETH_NODE_URI_MAINNET=""
#MNEMONIC_MAINNET=""
#MAINNET_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_POLYGON=""
#MNEMONIC_POLYGON=""
#POLYGON_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_ARBITRUM=""
#MNEMONIC_ARBITRUM=""
#ARBITRUM_ETHERSCAN_API_KEY=""

# DEPLOYER_PRIVATE_KEY=""

# ETH_NODE_URI_MODE=
# ETHERSCAN_API_KEY_MODE=""
# MODE_ETHERSCAN_API_KEY=""

# ETH_NODE_URI_ASTAR=
# ETHERSCAN_API_KEY_ASTAR=""
# MODE_ETHERSCAN_API_ASTAR=""

# ETH_NODE_URI_ASTARZKEVM=
# ETHERSCAN_API_KEY_ASTARZKEVM=""
# MODE_ETHERSCAN_API_ASTARZKEVM=""

#ETH_NODE_URI_ROOTSTOCK=
#ROOTSTOCK_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_TAIKO=
#TAIKO_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_SEI=
#SEI_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_MOONBEAM=
#MOONBEAM_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_SKALE=
#SKALE_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_CELO=
#CELO_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_FRAXTAL=
#FRAXTAL_ETHERSCAN_API_KEY=""

## These are used in foundry.toml

# Global Settings
DEPLOYER_ADDRESS=""
DEPLOYER_PRIVATE_KEY="" # PRIVATE KEY of 0xA9DdD91249DFdd450E81E1c56Ab60E1A62651701
MERKL_DEPLOYER_PRIVATE_KEY="" # PRIVATE KEY of 0x9f76a95AA7535bb0893cf88A146396e00ed21A12
MNEMONIC=""

#HARDHAT_IGNITION_CONFIRM_DEPLOYMENT=false # uncomment to ignore deployments validation
DEPLOY_SALT=""

# Localhost (chainId: X)
LOCALHOST_NODE_URI="http://127.0.0.1:8545"
LOCALHOST_MNEMONIC=""
LOCALHOST_ETHERSCAN_API_KEY=""

# <NETWORK> (chainId: <CHAIN_ID>)
<NETWORK>_NODE_URI=""
<NETWORK>_MNEMONIC=""
<NETWORK>_ETHERSCAN_API_KEY=""
79 changes: 0 additions & 79 deletions .eslintrc.js

This file was deleted.

30 changes: 13 additions & 17 deletions .github/actions/setup-repo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,26 @@ inputs:
runs:
using: 'composite'
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=version::$(yarn -v)"

- uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
with:
node-version: '20'
bun-version: latest

- uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
id: bun-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}

key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-bun-

- name: Install dependencies
shell: bash
run: echo "//npm.pkg.github.com/:_authToken=$GH_REGISTRY_ACCESS_TOKEN" >> .npmrc && yarn install --frozen-lockfile --verbose && rm -f .npmrc
run: bun install
env:
GH_REGISTRY_ACCESS_TOKEN: ${{ inputs.registry-token }}
SDK_READ_ACCESS_TOKEN: ${{ inputs.registry-token }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
73 changes: 5 additions & 68 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Setup repo
uses: ./.github/actions/setup-repo
with:
registry-token: ${{ secrets.GH_REGISTRY_ACCESS_TOKEN }}

- name: Install dependencies
run: yarn install
registry-token: ${{ secrets.SDK_READ_ACCESS_TOKEN }}

- name: Run solhint
run: yarn lint:check
run: bun lint

- name: 'Add lint summary'
run: |
Expand All @@ -47,26 +39,14 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Setup repo
uses: ./.github/actions/setup-repo
with:
registry-token: ${{ secrets.GH_REGISTRY_ACCESS_TOKEN }}

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

- name: Compile hardhat
run: yarn hardhat:compile

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
registry-token: ${{ secrets.SDK_READ_ACCESS_TOKEN }}

- name: Compile foundry
run: yarn foundry:compile --sizes
run: bun foundry:compile --sizes --skip scripts/utils/CreateXConstants.sol

- name: 'Cache the build so that it can be re-used by the other jobs'
uses: 'actions/cache/save@v3'
Expand All @@ -85,44 +65,6 @@ jobs:
echo "## Build result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

hardhat-tests:
needs: ['build', 'lint']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: 'Restore the cached build'
uses: 'actions/cache/restore@v3'
with:
fail-on-cache-miss: true
key: 'build-${{ github.sha }}'
path: |
cache-forge
out
cache-hh
artifacts
typechain
node_modules

- run: export NODE_OPTIONS=--max_old_space_size=11264

- name: Run unit tests
run: yarn hardhat:test
env:
ENABLE_GAS_REPORT: true
CI: true
ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }}

- name: 'Add test summary'
run: |
echo "## Hardhat Unit tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

foundry-tests:
needs: ['build', 'lint']
runs-on: ubuntu-latest
Expand All @@ -131,11 +73,6 @@ jobs:
with:
submodules: 'recursive'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: 'Restore the cached build'
uses: 'actions/cache/restore@v3'
with:
Expand All @@ -150,7 +87,7 @@ jobs:
node_modules

- name: Run Foundry tests
run: yarn foundry:test
run: bun foundry:test
env:
ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }}
ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }}
Expand Down
Loading
Loading