Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on: ["push", "pull_request"]

name: hyperdrive

jobs:
check:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: install node
uses: actions/setup-node@v3
with:
node-version: 14.x

- name: install packages
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed

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

- name: test
run: FOUNDRY_PROFILE=production forge build
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed

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

- name: lint
uses: borales/actions-yarn@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions contracts/AaveYieldSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ contract AaveYieldSource is Hyperdrive {
/// @param _linkerFactory The factory which is used to deploy the ERC20
/// linker contracts.
/// @param _baseToken The base token contract.
/// @param _positionDuration The time in seconds that elapses before bonds
/// can be redeemed one-to-one for base.
/// @param _checkpointDuration The time in seconds between share price
/// checkpoints. Position duration must be a multiple of checkpoint
/// duration.
Expand All @@ -43,7 +41,6 @@ contract AaveYieldSource is Hyperdrive {
bytes32 _linkerCodeHash,
address _linkerFactory,
IERC20 _baseToken,
uint256 _positionDuration,
uint256 _checkpointDuration,
uint256 _timeStretch,
IERC20 _aToken,
Expand Down
18 changes: 11 additions & 7 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ cache = true
# The cache directory if enabled
cache_path = 'forge-cache'
# Enables or disables the optimizer
optimizer = true
# The number of optimizer runs
optimizer_runs = 7500
# Whether or not to use the Yul intermediate representation compilation pipeline
via_ir = false

remappings = ['forge-std=lib/forge-std/src', '@openzeppelin/=node_modules/@openzeppelin']
# gas limit - max u64
gas_limit = "18446744073709551615"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config

[profile.production]
# strict warnings
deny_warnings = true
# optimizer settings
optimizer = true
optimizer_runs = 7500
# Enable via-ir
via_ir = true
# Enable gas-reporting for all contracts
gas_reports = ["*"]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"node": "^14"
},
"scripts": {
"build:prod": "FOUNDRY_PROFILE=production forge build",
"build:test": "FOUNDRY_PROFILE=production forge test --gas-report",
"build": "forge build",
"clean": "forge clean",
"lint": "yarn solhint && yarn style-check && yarn spell-check && echo \"done\"",
"lint": "yarn solhint && yarn style-check && yarn spell-check",
"prettier": "npx prettier --write .",
"test": "forge test -vvv",
"solhint": "npx solhint -f table contracts/*.sol contracts/**/*.sol",
Expand Down
Loading