Skip to content

Commit 8b4e122

Browse files
committed
Update Exercise 1 page to match files
1 parent eb6ea12 commit 8b4e122

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

program-analysis/echidna/exercises/Exercise-1.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ contract Token is Ownable, Pausable {
5151
mapping(address => uint256) public balances;
5252
5353
function transfer(address to, uint256 value) public whenNotPaused {
54-
balances[msg.sender] -= value;
55-
balances[to] += value;
54+
// unchecked to save gas
55+
unchecked {
56+
balances[msg.sender] -= value;
57+
balances[to] += value;
58+
}
5659
}
5760
}
5861
```
@@ -79,8 +82,8 @@ import "./token.sol";
7982
contract TestToken is Token {
8083
address echidna = tx.origin;
8184
82-
constructor() public {
83-
balances[echidna] = 10000;
85+
constructor() {
86+
balances[echidna] = 10_000;
8487
}
8588
8689
function echidna_test_balance() public view returns (bool) {

0 commit comments

Comments
 (0)