3 ms·
function withdrawTips() public { // The owner can only withdraw the tips tips = 0; owner.transfer(tips); } I don't use Etherium, bu
by Matheus28 9y ago
function withdrawTips() public {
// The owner can only withdraw the tips
tips = 0;
owner.transfer(tips);
}
I don't use Etherium, but that looks incorrect. Is the value of the variable only updated at the end of the run?
- Tepix 9y agoThe code has now been changed (by switching to a new contract): function withdrawTips() public { // The owner can only withdraw the tips uint pendingTips = tips; tips = 0; owner.transfer(pendingTips); }