Skip to content

Commit 9aad6a2

Browse files
committed
Fix mistakes in slither exercise
1 parent 5c156b9 commit 9aad6a2

File tree

1 file changed

+4
-3
lines changed
  • program-analysis/slither/exercises/exercise2

1 file changed

+4
-3
lines changed

program-analysis/slither/exercises/exercise2/coin.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ contract Owned {
1515
}
1616

1717
contract Coin is Owned {
18+
uint256 decimals = 18;
19+
1820
mapping(address => uint256) balances;
19-
uint256 decimals = 1 ** 18;
2021

2122
event Mint(address indexed destination, uint256 amount);
2223

@@ -45,7 +46,7 @@ contract Coin is Owned {
4546

4647
/// @notice Return the user's balance
4748
/// @param dst User address
48-
function balanceOf(address dst) public returns (uint256) {
49-
return balances[msg.sender];
49+
function balanceOf(address dst) public view returns (uint256) {
50+
return balances[dst];
5051
}
5152
}

0 commit comments

Comments
 (0)