Skip to content

Commit

Permalink
build: update configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Apr 10, 2024
1 parent 1391fe9 commit 83f6683
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 33 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Run `cp .env.example .env` command to create your .env file
export API_KEY_INFURA="YOUR_API_KEY_INFURA"
export EOA="YOUR_EOA_ADDRESS"
export FOUNDRY_PROFILE="lite"
Expand Down
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# directories
artifacts
broadcast
cache
coverage
deployments
docs
node_modules
out
out-optimized
out-svg

# files
*.env
*.env.deployment
*.log
.DS_Store
.pnp.*
lcov.info
package-lock.json
pnpm-lock.yaml
yarn.lock

# broadcasts
!broadcast
broadcast/*
broadcast/*/31337/
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ broadcast
cache
coverage
docs
lib
node_modules
out
out-optimized
Expand Down
11 changes: 7 additions & 4 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"extends": "solhint:recommended",
"rules": {
"avoid-low-level-calls": "off",
"code-complexity": ["error", 8],
"code-complexity": ["error", 9],
"compiler-version": ["error", ">=0.8.22"],
"contract-name-camelcase": "off",
"const-name-snakecase": "off",
"func-name-mixedcase": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 123],
"gas-custom-errors": "off",
"max-line-length": ["error", 124],
"named-parameters-mapping": "warn",
"no-console": "off",
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off"
"one-contract-per-file": "off",
"var-name-mixedcase": "off"
}
}
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
".gas-snapshot": "julia"
},
"editor.formatOnSave": true,
"npm.exclude": "**/lib/**",
"prettier.documentSelectors": ["**/*.svg"],
"search.exclude": {
"**/node_modules": true,
"lib": true
"**/node_modules": true
},
"solidity.formatter": "forge"
}
Binary file modified bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
codecov:
require_ci_to_pass: false
comment: false
coverage:
status:
patch: off
ignore:
- "precompiles"
- "script"
- "test"
36 changes: 26 additions & 10 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
# Full reference https://github.com/foundry-rs/foundry/tree/master/crates/config

[profile.default]
auto_detect_solc = false
block_timestamp = 1_698_796_800 # November 1, 2023 at 00:00 GMT
bytecode_hash = "none"
evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
fuzz = { runs = 10_000 }
evm_version = "paris"
gas_reports = ["*"]
optimizer = true
optimizer_runs = 10_000
optimizer_runs = 1000
out = "out"
script = "script"
solc = "0.8.23"
src = "src"
test = "test"

[profile.default.fuzz]
max_test_rejects = 1_000_000 # Number of times `vm.assume` can fail
runs = 50

[profile.default.invariant]
call_override = false # Override unsafe external calls to perform reentrancy checks
depth = 20 # Number of calls executed in one run
fail_on_revert = true
runs = 20

[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 4

# Speed up compilation and tests during development
[profile.lite]
optimizer = false

# Compile only the production code and the test mocks with via IR
[profile.optimized]
out = "out-optimized"
test = "test/mocks"
via_ir = true

# Test the optimized contracts without re-compiling them
[profile.test-optimized]
ffi = true
src = "test"

[doc]
ignore = ["**/*.t.sol"]
out = "docs"
repository = "https://github.com/sablier-labs/v2-open-ended"

[fmt]
bracket_spacing = true
Expand Down
46 changes: 39 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,71 @@
{
"name": "@sablier/v2-open-ended",
"description": "Open ended smart contracts of the Sablier V2 token streaming protocol",
"license": "BUSL-1.1",
"version": "1.0.0",
"author": {
"name": "Sablier Labs Ltd",
"url": "https://sablier.com"
},
"bugs": {
"url": "https://github.com/sablier-labs/v2-open-ended/issues"
},
"dependencies": {
"@openzeppelin/contracts": "5.0.2",
"@prb/math": "github:PaulRBerg/prb-math#a111d11"
"@prb/math": "github:PaulRBerg/prb-math#16419e5"
},
"devDependencies": {
"forge-std": "github:foundry-rs/forge-std#v1.8.1",
"prettier": "3.0.0",
"solhint": "^4.0.0"
},
"files": [
"artifacts",
"precompiles",
"src",
"LICENSE-GPL.md"
],
"keywords": [
"asset-distribution",
"asset-streaming",
"blockchain",
"cryptoasset-streaming",
"ethereum",
"forge",
"foundry",
"money-streaming",
"real-time-finance",
"payroll",
"sablier",
"smart-contracts",
"solidity",
"template"
"token-distribution",
"token-streaming",
"web3"
],
"peerDependencies": {
"@prb/math": "4.0.x"
},
"private": true,
"publishConfig": {
"access": "restricted"
},
"scripts": {
"clean": "rm -rf cache out",
"build": "forge build",
"build:optimized": "FOUNDRY_PROFILE=optimized forge build",
"clean": "rm -rf artifacts broadcast cache docs out out-optimized out-svg",
"gas:report": "forge test --gas-report --mp \"./test/integration/**/*.sol\" --nmt \"test(Fuzz)?_RevertWhen_\\w{1,}?\"",
"gas:snapshot": "forge snapshot --mp \"./test/integration/**/*.sol\" --nmt \"test(Fuzz)?_RevertWhen_\\w{1,}?\"",
"gas:snapshot:optimized": "bun run build:optimized && FOUNDRY_PROFILE=test-optimized forge snapshot --mp \"./test/integration/**/*.sol\" --nmt \"test(Fork)?(Fuzz)?_RevertWhen_\\w{1,}?\"",
"lint": "bun run lint:sol && bun run prettier:check",
"lint:sol": "forge fmt --check && bun solhint {script,src,test}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"lint:sol": "forge fmt --check && bun solhint \"{precompiles,script,src,test}/**/*.sol\"",
"prepack": "bun install && bash ./shell/prepare-artifacts.sh",
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml}\"",
"test": "forge test",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage",
"test:lite": "FOUNDRY_PROFILE=lite forge test",
"test:optimized": "bun run build:optimized && FOUNDRY_PROFILE=test-optimized forge test"
}
}
9 changes: 9 additions & 0 deletions slither.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"detectors_to_exclude": "naming-convention,reentrancy-events,solc-version,timestamp",
"filter_paths": "(node_modules/,test/)",
"solc_remaps": [
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@prb/math/=node_modules/@prb-math/",
"forge-std/=node_modules/forge-std/"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract WithdrawableAmountOf_Integration_Test is Integration_Test {
openEnded.withdrawableAmountOf(defaultStreamId);
}

function test_WithdrawableAmountOf_BalanceZero() external givenNotNull givenNotCanceled {
function test_WithdrawableAmountOf_BalanceZero() external view givenNotNull givenNotCanceled {
uint128 withdrawableAmount = openEnded.withdrawableAmountOf(defaultStreamId);
assertEq(withdrawableAmount, 0, "withdrawable amount");
}
Expand Down

0 comments on commit 83f6683

Please sign in to comment.