All Questions
Tagged with payable fallback-function
7 questions
0
votes
1
answer
183
views
Unable to deposit ether inside contract using receive function
Code is :
contract sendEther{
//to send ether, we need to deposit some ether first in this contract
//We can do it by declaring constructor as payable which enables us to deposit some ether ...
0
votes
1
answer
270
views
Sending ether to a contract without data throws an error
I'm trying to deploy a smart contract that allows users to buy tokens that can be used to pay fees on its platform.
In case someone is going to send ETH directly to the contract address without ...
0
votes
0
answers
471
views
Failing to send() 1 wei from one contract to another
The following code is supposed to send 1 wei from the current contract to a newly created contract. The recipient contract gets created successfully and the sending contract has a positive balance, ...
1
vote
1
answer
196
views
Fallback function fails when ethers sent from metamask
This is my code snippet for fallback function, If I use it by explicity using "fallback" function on Remix, then equivalent no of tokens do come in my wallet but if I send ethers via metamask directly ...
1
vote
1
answer
267
views
Can a smart contract be set up so that a function to forward funds sends a set percentage of the Ether received to 2 or more contracts?
For example the the openzeppelin crowdsale contract has a function that sends ether to a wallet address. Could this method include logic to send 60% of the funds received to Alice's wallet and 40% to ...
2
votes
3
answers
308
views
why don't popular tokens have payable fallback
I'm referring to the source of of the most popular tokens on etherscan.
It looks like they don't have any payable functions.
How do they accept ether and transfer the tokens automatically when ...
9
votes
3
answers
1k
views
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 ...