Skip to content

Commit e9b013e

Browse files
Inconsistency in token variable naming (#138)
Some code samples refer to the ERC20 token as `t` and in other instances as `token`; this inconsistency may cause confusion. Suggestion: use `token`
1 parent 92536aa commit e9b013e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

program-analysis/echidna/property-creation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In this example, users can deposit tokens using `depositShares`, mint shares usi
3434
```solidity
3535
contract Test {
3636
DeFi c;
37-
ERC20 t;
37+
ERC20 token;
3838
3939
constructor() {
4040
c = DeFi(..);
@@ -120,7 +120,7 @@ Avoiding reverts doesn't mean that the contract is in a valid state. Let's add s
120120
function withdrawShares_never_reverts(uint256 val) public {
121121
if (c.getShares(address(this)) >= val) {
122122
try c.withdrawShares(val) { /* not reverted */ } catch { assert(false); }
123-
assert(t.balanceOf(address(this)) > 0);
123+
assert(token.balanceOf(address(this)) > 0);
124124
}
125125
}
126126
...
@@ -143,7 +143,7 @@ In this generic example, it is unclear if there is a way to calculate how many s
143143
uint256 shares = c.getShares(address(this);
144144
assert(shares > 0);
145145
try c.withdrawShares(shares) { /* not reverted */ } catch { assert(false); }
146-
assert(t.balanceOf(address(this)) == original_balance);
146+
assert(token.balanceOf(address(this)) == original_balance);
147147
}
148148
}
149149
...

0 commit comments

Comments
 (0)