Skip to content

Commit e182c04

Browse files
authored
Merge pull request #15 from 6boris/dev
fix: resolve all forge lint and fmt issues across the codebase
2 parents 0a3ec54 + 0ecbae8 commit e182c04

59 files changed

Lines changed: 128 additions & 104 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.solhint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "solhint:recommended",
33
"rules": {
4+
"use-natspec": "off",
45
"code-complexity": ["warn", 10],
56
"compiler-version": ["error", ">=0.8.0"],
67
"func-name-mixedcase": "off",

.solhintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
foundry/lib
22
dependencies
33
node_modules
4+
contracts/CTF/Damn-Vulnerable-DeFi
5+
contracts/CTF/ONLYPWNER
6+
foundry/test/CTF/Damn-Vulnerable-DeFi
7+
foundry/test/CTF/ONLYPWNER
8+
foundry/script/CTF/ONLYPWNER

contracts/CTF/Damn-Vulnerable-DeFi/01.Unstoppable.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

contracts/CTF/Damn-Vulnerable-DeFi/02.Naive-Receiver.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

contracts/CTF/Damn-Vulnerable-DeFi/03.Truster.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

contracts/CTF/Damn-Vulnerable-DeFi/04.Side-Entrance.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

contracts/CTF/Damn-Vulnerable-DeFi/05.The-Rewarder.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

@@ -178,10 +179,8 @@ contract TheRewarderPool {
178179
}
179180

180181
function _hasRetrievedReward(address account) private view returns (bool) {
181-
return (
182-
lastRewardTimestamps[account] >= lastRecordedSnapshotTimestamp
183-
&& lastRewardTimestamps[account] <= lastRecordedSnapshotTimestamp + REWARDS_ROUND_MIN_DURATION
184-
);
182+
return (lastRewardTimestamps[account] >= lastRecordedSnapshotTimestamp
183+
&& lastRewardTimestamps[account] <= lastRecordedSnapshotTimestamp + REWARDS_ROUND_MIN_DURATION);
185184
}
186185

187186
function isNewRewardsRound() public view returns (bool) {

contracts/CTF/Damn-Vulnerable-DeFi/06.Selfie.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

@@ -132,11 +133,7 @@ contract SimpleGovernance is ISimpleGovernance {
132133
actionId = _actionCounter;
133134

134135
_actions[actionId] = GovernanceAction({
135-
target: target,
136-
value: value,
137-
proposedAt: uint64(block.timestamp),
138-
executedAt: 0,
139-
data: data
136+
target: target, value: value, proposedAt: uint64(block.timestamp), executedAt: 0, data: data
140137
});
141138

142139
unchecked {

contracts/CTF/Damn-Vulnerable-DeFi/07.Compromised.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

contracts/CTF/Damn-Vulnerable-DeFi/08.Puppet.sol

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// forge-lint: disable-start
12
// SPDX-License-Identifier: MIT
23
pragma solidity ^0.8.0;
34

@@ -38,13 +39,7 @@ interface IUniswapV1Exchange {
3839
function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought);
3940
function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256 tokens_sold);
4041
// Trade ETH to ERC20
41-
function ethToTokenSwapInput(
42-
uint256 min_tokens,
43-
uint256 deadline
44-
)
45-
external
46-
payable
47-
returns (uint256 tokens_bought);
42+
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought);
4843
function ethToTokenTransferInput(
4944
uint256 min_tokens,
5045
uint256 deadline,
@@ -53,13 +48,7 @@ interface IUniswapV1Exchange {
5348
external
5449
payable
5550
returns (uint256 tokens_bought);
56-
function ethToTokenSwapOutput(
57-
uint256 tokens_bought,
58-
uint256 deadline
59-
)
60-
external
61-
payable
62-
returns (uint256 eth_sold);
51+
function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256 eth_sold);
6352
function ethToTokenTransferOutput(
6453
uint256 tokens_bought,
6554
uint256 deadline,

0 commit comments

Comments
 (0)