Skip to content

Commit

Permalink
chore(protocol): fix lint issue and ignore some complier errors for t…
Browse files Browse the repository at this point in the history
…est/script files (#15891)

Co-authored-by: maskpp <[email protected]>
  • Loading branch information
dantaik and mask-pp authored Feb 17, 2024
1 parent a48b9c0 commit 3c4d763
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
23 changes: 13 additions & 10 deletions packages/protocol/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
[profile.default]
solc-version = "0.8.24"
src = 'contracts'
out = 'out'
test = 'test'
libs = ['lib']
src = "contracts"
out = "out"
test = "test"
script = "script"
libs = ["lib"]
gas_price = 10000000000 # gas price is 10 Gwei
optimizer = true
optimizer_runs = 200
ffi = true
gas_limit = '18446744073709551615'
gas_limit = "18446744073709551615"
memory_limit = 2073741824
evm_version = 'cancun'
evm_version = "cancun"

# Do not change the block_gas_limit value, TaikoL2.t.sol depends on it.
block_gas_limit = 80000000 #80M
Expand All @@ -26,7 +27,9 @@ fs_permissions = [
]

# 2394: transient storage warning
ignored_error_codes = [2394]
# 3860: Contract initcode size is xxx bytes and exceeds 49152 bytes
# 5574: Contract code size is xxx bytes and exceeds 24576 byte
ignored_error_codes = [ 2394, 3860, 5574]

fuzz = { runs = 200 }

Expand All @@ -38,9 +41,9 @@ seed = 13623721389213
[fmt]
bracket_spacing = true
line_length = 100
multiline_func_header = 'all'
number_underscore = 'thousands'
multiline_func_header = "all"
number_underscore = "thousands"
wrap_comments = true

[profile.genesis]
test = 'genesis'
test = "genesis"
6 changes: 3 additions & 3 deletions packages/protocol/test/libs/LibFixedPointMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ contract LibFixedPointMathTest is TaikoTest {
assertEq(LibFixedPointMath.exp(-1e18), 367_879_441_171_442_321);
}

function testExpSmallest() public view {
function testExpSmallest() public pure {
int256 y = LibFixedPointMath.exp(-42_139_678_854_452_767_550);

console2.log("LibFixedPointMath.exp(-42139678854452767550)=", uint256(y));
}

function testExpLargest() public view {
function testExpLargest() public pure {
int256 y = LibFixedPointMath.exp(int256(uint256(LibFixedPointMath.MAX_EXP_INPUT)));
console2.log("LibFixedPointMath.exp(135305999368893231588)=", uint256(y));
}

function testExpSome() public view {
function testExpSome() public pure {
int256 y = LibFixedPointMath.exp(5e18);
console2.log("LibFixedPointMath.exp(5e18)=", uint256(y));
}
Expand Down

0 comments on commit 3c4d763

Please sign in to comment.