I'm working through the Ethernaut game and levels 6 - Delegation and 10 - Re-entrancy respectively contain:
fallback() external {
(bool result,) = address(delegate).delegatecall(msg.data);
if (result) {
this;
}
}
and
function withdraw(uint _amount) public {
if(balances[msg.sender] >= _amount) {
(bool result,) = msg.sender.call{value:_amount}("");
if(result) {
_amount;
}
balances[msg.sender] -= _amount;
}
}
Can someone explain what is the purpose of the if(result) check? I don't understand what "this;" and "_amount;" do without calling any methods or otherwise getting or setting any info.
Thanks!