4 ms·
withdrawRewardFor ends up calling ManagedAccount#payOut which does _recipient.call.value(amount): function payOut(address _recipient, uint _amount) returns
by benmmurphy 10y ago
withdrawRewardFor ends up calling ManagedAccount#payOut which does _recipient.call.value(amount):
function payOut(address _recipient, uint _amount) returns (bool) {
if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))
throw;
if (_recipient.call.value(_amount)()) {
PayOut(_recipient, _amount);
return true;
} else {
return false;
}
}
so the 'vulnerable' code is calling a function in another contract and it is this function that is doing the external callback. this is why security is so hard. everytime you add an external callback you need trace all of your callers to check that they are correctly re-entrant or everytime you use another function you need to trace forward to make sure it doesn't have any external callbacks.