You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: program-analysis/slither/exercise1.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
The goal is to create a script that performs a feature that was not present in previous version of Solidity: function overriding protection.
4
4
5
-
[exercises/exercise1/coin.sol](exercises/exercise1/coin.sol) contains a function that must never be overridden:
5
+
[exercises/exercise1/coin.sol](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise1/coin.sol) contains a function that must never be overridden:
6
6
7
7
```solidity
8
8
_mint(address dst, uint256 val)
9
9
```
10
10
11
11
Use Slither to ensure that no contract inheriting Coin overrides this function.
12
12
13
-
Use `solc-select install 0.5.0 && solc-select use 0.5.0` to switch to solc 0.5.0
13
+
Use `solc-select install 0.5.0 && solc-select use 0.5.0` to switch to solc 0.5.0
14
14
15
15
## Proposed Algorithm
16
16
@@ -30,4 +30,4 @@ Get the Coin contract
30
30
31
31
## Solution
32
32
33
-
See [exercises/exercise1/solution.py](exercises/exercise1/solution.py).
33
+
See [exercises/exercise1/solution.py](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise1/solution.py).
Copy file name to clipboardExpand all lines: program-analysis/slither/exercise2.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Exercise 2: Access Control
2
2
3
-
The [exercises/exercise2/coin.sol](exercises/exercise2/coin.sol) file contains an access control implementation with the `onlyOwner` modifier. A common mistake is forgetting to add the modifier to a crucial function. In this exercise, we will use Slither to implement a conservative access control approach.
3
+
The [exercises/exercise2/coin.sol](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise2/coin.sol) file contains an access control implementation with the `onlyOwner` modifier. A common mistake is forgetting to add the modifier to a crucial function. In this exercise, we will use Slither to implement a conservative access control approach.
4
4
5
5
Our goal is to create a script that ensures all public and external functions call `onlyOwner`, except for the functions on the whitelist.
6
6
@@ -18,4 +18,4 @@ Explore all the functions
18
18
19
19
## Solution
20
20
21
-
Refer to [exercises/exercise2/solution.py](exercises/exercise2/solution.py) for the solution.
21
+
Refer to [exercises/exercise2/solution.py](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise2/solution.py) for the solution.
# Exercise 3: Find function that use a given variable in a condition
2
2
3
-
The [exercises/exercise3/find.sol](exercises/exercise3/find.sol) file contains a contract that use `my_variable` variable in multiple locations.
3
+
The [exercises/exercise3/find.sol](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise3/find.sol) file contains a contract that use `my_variable` variable in multiple locations.
4
4
5
5
Our goal is to create a script that list all the functions that use `my_variable` in a conditional or require statement.
6
6
7
7
## Proposed Approach
8
8
9
9
Explore all the helpers provided by [`Function`](https://github.com/crytic/slither/blob/master/slither/core/declarations/function.py) object to find an easy way to reach the goal
10
10
11
-
12
11
## Solution
13
12
14
-
Refer to [exercises/exercise3/solution.py](exercises/exercise3/solution.py) for the solution.
13
+
Refer to [exercises/exercise3/solution.py](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/slither/exercises/exercise3/solution.py) for the solution.
0 commit comments