We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb6ea12 commit 8b4e122Copy full SHA for 8b4e122
program-analysis/echidna/exercises/Exercise-1.md
@@ -51,8 +51,11 @@ contract Token is Ownable, Pausable {
51
mapping(address => uint256) public balances;
52
53
function transfer(address to, uint256 value) public whenNotPaused {
54
- balances[msg.sender] -= value;
55
- balances[to] += value;
+ // unchecked to save gas
+ unchecked {
56
+ balances[msg.sender] -= value;
57
+ balances[to] += value;
58
+ }
59
}
60
61
```
@@ -79,8 +82,8 @@ import "./token.sol";
79
82
contract TestToken is Token {
80
83
address echidna = tx.origin;
81
84
- constructor() public {
- balances[echidna] = 10000;
85
+ constructor() {
86
+ balances[echidna] = 10_000;
87
88
89
function echidna_test_balance() public view returns (bool) {
0 commit comments