You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your smart contract generates a warning in Remix about using call here:
function withdraw() {
if (tokens[0][msg.sender] < amount) throw;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
if (!msg.sender.call.value(amount)()) throw;
Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
}
Shouldn't this have been written like:
function withdraw() {
if (tokens[0][msg.sender] < amount) throw;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
if (!msg.sender.send(amount)) throw;
Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
}
Thoughts?
Or perhaps using transfer if you have a need to modify the gas amount. See here: ethereum/solidity#610
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: