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

Fix linter & better organize foundry dependencies #53

Merged
merged 14 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
45 changes: 45 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [lts/*]

steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup node env
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install dependencies
run: yarn install --immutable

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

- name: Run foundry node, deploy contracts (& generate contracts typescript output)
run: yarn fork & yarn deploy:factory
MattPereira marked this conversation as resolved.
Show resolved Hide resolved

- name: Run nextjs lint
run: yarn next:lint --max-warnings=0

- name: Check typings on nextjs
run: yarn next:check-types
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"forge-gas-snapshot": "https://github.com/ylv-io/forge-gas-snapshot",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"next": "^14.0.4",
"permit2": "https://github.com/Uniswap/permit2.git#cc56ad0f3439c502c246fc5cfcc3db92bb8b7219",
"vercel": "^32.4.1"
},
"dependencies": {
"@balancer-labs/v3-monorepo": "https://github.com/balancer/balancer-v3-monorepo#head=scaffold-package-setup-deploy5"
"lint-staged": "^13.0.3"
}
}
1 change: 0 additions & 1 deletion packages/foundry/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DEPLOYER_PRIVATE_KEY=
ETHERSCAN_API_KEY=
SEPOLIA_RPC_URL=
6 changes: 3 additions & 3 deletions packages/foundry/contracts/ConstantSumFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import { ConstantSumPool } from "./ConstantSumPool.sol";
*/
contract ConstantSumFactory is BasePoolFactory {
/**
* @notice BasePoolFactory requires the pool contract's creationCode which will be used for CREATE3
* @dev The pool's creationCode is used to deploy pools via CREATE3
* @notice The pool creationCode cannot be changed after the factory has been deployed
* @param vault address of Balancer v3 Vault
* @param pauseWindowDuration for pools based on the factory deployment time
* @param vault The contract instance of the Vault
* @param pauseWindowDuration The period ( starting from deployment of this factory ) during which pools can be paused and unpaused
*/
constructor(
IVault vault,
Expand Down
1 change: 0 additions & 1 deletion packages/foundry/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ out = 'out'
libs = ['node_modules', 'lib']
test = 'test'
ffi = true
allow_paths = ['../../node_modules/']
solc_version = '0.8.24'
auto_detect_solc = false
evm_version = 'cancun'
Expand Down
3 changes: 3 additions & 0 deletions packages/foundry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
"verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/VerifyAll.s.sol --ffi --rpc-url ${1:-default_network}"
},
"dependencies": {
"@balancer-labs/v3-monorepo": "https://github.com/balancer/balancer-v3-monorepo#head=scaffold-package-setup-deploy5",
"dotenv": "~16.3.1",
"envfile": "~6.18.0",
"ethers": "~5.7.1",
"permit2": "https://github.com/Uniswap/permit2.git#cc56ad0f3439c502c246fc5cfcc3db92bb8b7219",
"qrcode": "~1.5.3",
"toml": "~3.0.0"
},
"devDependencies": {
"@types/prettier": "2",
"@types/qrcode": "1",
"forge-gas-snapshot": "https://github.com/ylv-io/forge-gas-snapshot",
"prettier": "~2.8.8",
"prettier-plugin-solidity": "^1.3.1"
}
Expand Down
12 changes: 6 additions & 6 deletions packages/foundry/remappings.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@test/=../../node_modules/@balancer-labs/v3-monorepo/pkg/
@balancer-labs/v3-solidity-utils/=../../node_modules/@balancer-labs/v3-monorepo/pkg/solidity-utils/
@balancer-labs/v3-interfaces/=../../node_modules/@balancer-labs/v3-monorepo/pkg/interfaces/
@balancer-labs/v3-vault/=../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/
permit2/=../../node_modules/permit2/
forge-gas-snapshot/=../../node_modules/forge-gas-snapshot/src/
@test/=node_modules/@balancer-labs/v3-monorepo/pkg/
@balancer-labs/v3-solidity-utils/=node_modules/@balancer-labs/v3-monorepo/pkg/solidity-utils/
@balancer-labs/v3-interfaces/=node_modules/@balancer-labs/v3-monorepo/pkg/interfaces/
@balancer-labs/v3-vault/=node_modules/@balancer-labs/v3-monorepo/pkg/vault/
permit2/=node_modules/permit2/
forge-gas-snapshot/=node_modules/forge-gas-snapshot/src/
59 changes: 23 additions & 36 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,26 +366,24 @@ const deployedContracts = {
},
],
inheritedFunctions: {
disable: "../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getActionId: "../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getAuthorizer:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
disable: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getActionId: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getAuthorizer: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getDefaultLiquidityManagement:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getDefaultPoolHooksContract:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getDeploymentAddress:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getNewPoolPauseWindowEndTime:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getOriginalPauseWindowEndTime:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getPauseWindowDuration:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getVault: "../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
isDisabled: "../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
isPoolFromFactory:
"../../node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
"node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
getVault: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
isDisabled: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
isPoolFromFactory: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/factories/BasePoolFactory.sol",
},
},
MockToken1: {
Expand Down Expand Up @@ -2069,28 +2067,17 @@ const deployedContracts = {
},
],
inheritedFunctions: {
getHookFlags:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterAddLiquidity:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterInitialize:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterRemoveLiquidity:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterSwap:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeAddLiquidity:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeInitialize:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeRemoveLiquidity:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeSwap:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onComputeDynamicSwapFee:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onRegister:
"/home/matthu/Desktop/Balancer/scaffold-balancer-v3/node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
getHookFlags: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterAddLiquidity: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterInitialize: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterRemoveLiquidity: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onAfterSwap: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeAddLiquidity: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeInitialize: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeRemoveLiquidity: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onBeforeSwap: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onComputeDynamicSwapFee: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
onRegister: "node_modules/@balancer-labs/v3-monorepo/pkg/vault/contracts/BasePoolHooks.sol",
},
},
},
Expand Down
Loading
Loading