Skip to content
Open
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
18 changes: 9 additions & 9 deletions docs/src/detectors/Detector-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ contract Constant{
uint counter;
function get() public view returns(uint){
counter = counter +1;
return counter
return counter;
}
}
```
Expand Down Expand Up @@ -1529,7 +1529,7 @@ contract Constant{
uint counter;
function get() public view returns(uint){
counter = counter +1;
return counter
return counter;
}
}
```
Expand Down Expand Up @@ -1857,7 +1857,7 @@ Uninitialized local variables.
contract Uninitialized is Owner{
function withdraw() payable public onlyOwner{
address to;
to.transfer(this.balance)
to.transfer(this.balance);
}
}
```
Expand Down Expand Up @@ -1950,7 +1950,7 @@ If a modifier does not execute `_` or revert, the execution of the function will
### Exploit Scenario

```solidity
modidfier myModif(){
modifier myModif(){
if(..){
_;
}
Expand Down Expand Up @@ -2212,7 +2212,7 @@ If one of the destinations has a fallback function that reverts, `bad` will alwa

### Recommendation

Favor [pull over push](https://github.com/ethereum/wiki/wiki/Safety#favor-pull-over-push-for-external-calls) strategy for external calls.
Favor [pull over push](https://docs.soliditylang.org/en/latest/common-patterns.html#withdrawal-from-contracts) strategy for external calls.

## Missing events access control

Expand Down Expand Up @@ -2371,7 +2371,7 @@ Only report reentrancy that acts as a double call (see `reentrancy-eth`, `reentr
if( ! (msg.sender.call()() ) ){
throw;
}
counter += 1
counter += 1;
}
```

Expand Down Expand Up @@ -3035,11 +3035,11 @@ Functions that are not used.

```solidity
contract Contract{
function dead_code() internal() {}
function dead_code() internal {}
}
```

`dead_code` is not used in the contract, and make the code's review more difficult.
`dead_code` is not used in the contract, and makes the code's review more difficult.

### Recommendation

Expand All @@ -3062,7 +3062,7 @@ Only report reentrancy that is based on `transfer` or `send`.

```solidity
function callme(){
msg.sender.transfer(balances[msg.sender]):
msg.sender.transfer(balances[msg.sender]);
balances[msg.sender] = 0;
}
```
Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/attributes/const_functions_asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ConstantFunctionsAsm(AbstractDetector):
uint counter;
function get() public view returns(uint){
counter = counter +1;
return counter
return counter;
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/attributes/const_functions_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ConstantFunctionsState(AbstractDetector):
uint counter;
function get() public view returns(uint){
counter = counter +1;
return counter
return counter;
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions slither/detectors/functions/dead_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class DeadCode(AbstractDetector):
WIKI_EXPLOIT_SCENARIO = """
```solidity
contract Contract{
function dead_code() internal() {}
function dead_code() internal {}
}
```
`dead_code` is not used in the contract, and make the code's review more difficult."""
`dead_code` is not used in the contract, and makes the code's review more difficult."""
# endregion wiki_exploit_scenario

WIKI_RECOMMENDATION = "Remove unused functions."
Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/functions/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ModifierDefaultDetection(AbstractDetector):
# region wiki_exploit_scenario
WIKI_EXPLOIT_SCENARIO = """
```solidity
modidfier myModif(){
modifier myModif(){
if(..){
_;
}
Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/reentrancy/reentrancy_benign.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ReentrancyBenign(Reentrancy):
if( ! (msg.sender.call()() ) ){
throw;
}
counter += 1
counter += 1;
}
```

Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/reentrancy/reentrancy_no_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ReentrancyNoGas(Reentrancy):
WIKI_EXPLOIT_SCENARIO = """
```solidity
function callme(){
msg.sender.transfer(balances[msg.sender]):
msg.sender.transfer(balances[msg.sender]);
balances[msg.sender] = 0;
}
```
Expand Down
2 changes: 1 addition & 1 deletion slither/detectors/statements/calls_in_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MultipleCallsInLoop(AbstractDetector):
If one of the destinations has a fallback function that reverts, `bad` will always revert."""
# endregion wiki_exploit_scenario

WIKI_RECOMMENDATION = "Favor [pull over push](https://github.com/ethereum/wiki/wiki/Safety#favor-pull-over-push-for-external-calls) strategy for external calls."
WIKI_RECOMMENDATION = "Favor [pull over push](https://docs.soliditylang.org/en/latest/common-patterns.html#withdrawal-from-contracts) strategy for external calls."

def _detect(self) -> list[Output]:
""""""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UninitializedLocalVars(AbstractDetector):
contract Uninitialized is Owner{
function withdraw() payable public onlyOwner{
address to;
to.transfer(this.balance)
to.transfer(this.balance);
}
}
```
Expand Down