Conversation
sprtd
left a comment
There was a problem hiding this comment.
The assertion error you got is pretty correct. Conventionally in an accounting system, you deposit before you withdraw. From your assertion:
expect(Number(addr1BalanceBeforeWithdrawal)).to.eq(5)
you expect addr1BalanceBeforeWithdrawal to equal 5 and this won't work because:
- you haven't deposited yet
- in the test, you are instantiating the wrong contract
I have updated the this file with the correct reference to the vulnerable contract ColabBankV2. Please note that in your test, you're expect to pass in ETH while calling deposit function. Make sure to use ethers.utils.parseEther. Refer to this.
You can also checkout ethers library documentation for details
sprtd
left a comment
There was a problem hiding this comment.
overall, nice attempt. You're doing great.
I noticed you haven't tested ColabBank contract's withdraw function. Try it out. Please note that there are 2 versions. The first one is the the one we tried out yesterday while V2 refers to the buggy contract.
Keep it up. You're doing well
|
thanks. |
GETTING THIS OUTPUT,
I guess I am not getting something right, help resolve.