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

Improve Fuzz Coverage #18

Merged
merged 13 commits into from
Jun 28, 2024
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ jobs:
# to include coverage in all directories, comment out this step. Note that because this
# filtering applies to the lcov file, the summary table generated in the previous step will
# still include all files and directories.
# Disable branch coverage temporarily due to https://github.com/foundry-rs/foundry/issues/8279
# The `--rc lcov_branch_coverage=1` part keeps branch info in the filtered report, since lcov
# defaults to removing branch info.
- name: Filter directories
run: |
sudo apt update && sudo apt install -y lcov
lcov --remove lcov.info 'test/*' 'script/*' --output-file lcov.info --rc lcov_branch_coverage=1
lcov --remove lcov.info 'test/*' 'script/*' --output-file lcov.info

# This step posts a detailed coverage report as a comment and deletes previous comments on
# each push. The below step is used to fail coverage if the specified coverage threshold is
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ out/

node_modules/

lcov.info
lcov.info
coverage
5 changes: 2 additions & 3 deletions .solhintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"compiler-version": ["error", ">=0.8.0"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"named-parameters-mapping": "warn",
"no-console": "off",
"one-contract-per-file": "off",
"no-inline-assembly": "off",
"no-empty-blocks": "off",
"var-name-mixedcase": "off",
"no-global-import": "off"
"no-global-import": "off",
gas-custom-errors": "off",
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ The contracts are designed to be customizable, with adjustable parameters such a
1. The total amount of SHU tokens staked in the contract must be equal to the
total amount of SHU tokens staked by each keyper: `totalStaked = sum(stakes[keyper].amount)`.
2. On unstake, `keyperStake.timestamp + lockPeriod <= block.timestamp` if global `lockPeriod` is greater or equal to the stake lock period, otherwise `keyperStake.timestamp + keyperStake.lockPeriod <= block.timestamp`.
3. If `some(keyperStakes(keyper).length()) > 0` then `nextStakeId` != 0;
2 changes: 1 addition & 1 deletion docs/staking-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## Immutable Variables

- `STAKING_TOKEN`: the SHU token address
- `stakingToken`: the SHU token address

The staking token must be immutable. If the DAO changes the staking token, the
keypers will not be able to withdrawn their old stakes.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prettier": "prettier --ignore-path .prettierignore --list-different './**/*'",
"prettier:write": "prettier --ignore-path .prettierignore --write './**/*'",
"test": "forge test",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
"test:coverage": "forge coverage --ir-minimum",
"test:coverage:report": "forge coverage --ir-minimum --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
}
}
Loading
Loading