Linked Questions

80 votes
4 answers

<address>.send vs <address>.transfer best practice usage?

I noticed that address's offer two member functions that perform the transfer of ether to the specified address. send returns false upon failure and transfer raises an exception. In the Solidity ...
Michael's user avatar
  • 1,075
50 votes
3 answers

What is a recursive calling vulnerability?

What is a recursive calling vulnerability exactly? When creating smart contracts, DAOs or DAPPs, what measures can I take to ensure I am not vulnerable?
user36100's user avatar
  • 603
21 votes
2 answers

Is transfer() still safe after the Istanbul update?

In other words, is using transfer() safe? function transfer(address contractB) public { contractB.transfer(1000); //balances[msg.sender] -= 1000; } How about using call.gas? function ...
Robert Ggg's user avatar
22 votes
3 answers

TheDAO hack FAQ: How did the attack happen on 17 June 2016?

Can anyone explain that how the DAO attack happened? Vitalik Buterin explained here that it was performed by splitting a DAO from the main DAO but calling the split function recursively. We know that ...
13 votes
2 answers

Why does an empty message still invoke the code of the contract?

An empty message still invokes the code of the contract and is the mechanism that allows Solidity to implement a feature of a fallback function per contract. But when is empty, why does ...
eth's user avatar
  • 86k
4 votes
1 answer

Can I send ethereum to a contract outside of its constructor?

How do I fund Solidity contracts with Ether? The example in the Solidity FAQ,, funds a contract via ...
glowkeeper's user avatar
8 votes
1 answer

Callstack attack

If my contract has a payout function like this address bossAddress; address employeeAddress; uint256 bossSalary; uint256 employeeSalary; function payout (){ if (msg.sender==bossAddress){ ...
shiso's user avatar
  • 1,036
6 votes
2 answers

Understanding"register", "MyName") style call between contracts

Here's an example from solidity docs on Address type methods(call method specifically): address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2;"register", "MyName&...
manidos's user avatar
  • 4,298
14 votes
1 answer

What does `call.value` mean and how did it allow the attack to The DAO?

I'm trying to get some sense from the hysteria around the attack performed to The DAO smart contract. I understand the high level explanations, but I'd like to grasp how this attack was performed. I'...
Henrique Barcelos's user avatar
9 votes
3 answers

Why is there more than one payable function in a solidity contract?

When someone transfers ether to a contract address the payable callback (without name) function is called automatically. What I don't understand is why are there many examples with multiple payable ...
Dany D's user avatar
  • 145
1 vote
2 answers

Calling a smart-contract fallback function from another contract

contract A { function one() public { //transfer to B to call its fallback function B(addressB).transfer(value); } contract B { function() external payable { someaddress....
Aleksandr's user avatar
  • 149
5 votes
1 answer

How do you get a string value from in the fallback function?

Im trying to do what The DAO did and do something when a sender sent money to my contract address. But im not sure how to. The something I want to do is to just create a new user in a mapping with the ...
vonGohren's user avatar
  • 211
6 votes
1 answer

Accessing the last function parameter from

I have a fallback (unnamed) function in my contract and I know that the last parameter (or first, does not matter) passed is always an uint. Is it possible to somehow access it though the
md2312's user avatar
  • 193
6 votes
1 answer

Is address.send() not vulnerable for the recursive call attack?

If my dapp sends ether to another address via the send() method is it not vulnerable for the recursive call attack due to the limited amount of gas of 21000? Or should I still take precautions?
Mick de Graaf's user avatar
3 votes
1 answer

value transfer did not complete most likely as a result of a revert opcode

When i want to send some eth to an erc20 contract i receive the following error: "value transfer did not complete most likely as a result of a revert opcode". I modified the fallback function in ...
alle.manfredi's user avatar

15 30 50 per page