Why didn't Filip use SafeMath in line number 40?

In https://github.com/filipmartinsson/solidity-201/blob/master/safemath_assignment/bank_done.sol

At line number 40 :

        assert(balance[msg.sender] == previousSenderBalance - amount);

Why didn’t Filip write it as :

        assert(balance[msg.sender] == previousSenderBalance.sub(amount));

Looking forward to the answer. Thank you!

Hey @jo_male

I’ve answered this one in the SafeMath thread.
You have correctly used safemath in the assert statement, that is indeed the correct way to go.

Good catch,
Dani

2 Likes