Questions tagged [payable]

The payable modifier in Solidity can be used to make smart contract functions able to receive either, or to make Ether transfers to address variables possible.

Filter by
Sorted by
Tagged with
2
votes
2answers
2k views

Gas limit dangerously high

When I tried to send ether to my contract, I get this error. Even if try to change the value of Gas Limit and Gas Price the transaction still fails. What could be the possible reason? What I ...
9
votes
3answers
959 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 ...
0
votes
1answer
368 views

Crowdsale Contract, why I can't send ether to contract?

Ethereum wallet displays: It seems this transaction will fail. But why? Here is the code: function () payable { uint amount = 0; amount += msg.value; balanceOf[msg.sender] += amount; ...
1
vote
0answers
92 views

How to distribute credits between workers?

I have just started mining. I have a miner composed by 3 workers. Each worker belongs to a different person. When I'll finalise a block I will receive a payout. I would like to know how to distribite ...
2
votes
1answer
1k views

Is it possible to call payable functions of smart contract using web3j’s smart contract wrappers?

How do we call payable functions of smart contract using web3j? UPDATE: I'm going to change generated smart contract wrapper class manually. Now I have: public Future<TransactionReceipt&...
0
votes
2answers
366 views

Why transfer funds breaks contract?

My deployed contract called successfully only by "function invocation" through web3 or Remix. But it always failed when I sending funds to the contract. I thought that only requirement that contract ...
0
votes
3answers
190 views

Require: How to avoid users of my smart contract from losing their ether

I have a smart contract lottery that requires people to send exactly 0.2 ethers to its address in order to participate. In the constructor: ante = 0.2 ether; And in the payable function ...
3
votes
1answer
2k views

What denomination should I issue my ERC20 token by?

Following the "Create a cryptocurrency" tutorial on ethereum.org, I ended up with the following function (stripped down): function () payable { if (msg.value == 0) { return; } uint256 tokens =...
1
vote
1answer
103 views

Splitter contact: is payable modifier missing?

I am using the geth javascript console, trying to split pre-fork ETH using the ReplaySafeSplit v2 contract 0xaBbb6bEbFA05aA13e908EaA492Bd7a8343760477 (code here). I am doing this as follows: ...
3
votes
1answer
879 views

Send ether to a payable function from nethereum

I have created a payable function in a smart contract and deployed it in a private blockchain network. Now I am using Nethereum to make rpc calls to the geth node on which the network is running. But ...
2
votes
1answer
60 views

Are the functions in this code missing the payable modifier?

These functions are transferring ether between balances, so why aren't they modified with payable?
3
votes
2answers
490 views

Can a miner “cheat” my lottery smart contract?

I developed a smart contract that you: 1) Send 1 ether to an address, the contract saves your address 2) After 5 people have sent one ether, the contract chooses one address at random and sends the ...
4
votes
2answers
3k views

How can a smart contract run when receiving ether directly, not through a function?

I have a smart contract with a payable bet() function. When someone sends 1 ether to the bet function, the contract is executed. I'd like the contract to run the same code when someone sends ether to ...
2
votes
2answers
2k views

Payable: Sent - Hold amount - Sent_back mechanism (Refund)

[Q] When following transaction get called: Bank.pay({"from": eth.accounts[0], "value": 1});, who retrieves the money, does the owner of the contract? (Sorry I get lost who actually gains the money). ...
1
vote
1answer
34 views

Paying contract can't inherit?

I have two contracts. One inherits a function that gets the value to be paid by the second one. If I remove the 'is Reference' and replace the values from the external function, the code pays, ...
3
votes
0answers
1k views

Hi i am getting error msg.value non-payable [duplicate]

I had this function function enter() { if (msg.value >10 finney) { uint amount=msg.value; uint payout; but i am getting error: ballot.sol:56:9: Warning: "msg.value" used in non-payable ...
2
votes
1answer
155 views

If a function is called with a certain gas amount, will msg.value == amount of gas sent?

My function needs gas to fulfill a transaction, but I don't want people accidentally sending Ether to it.
4
votes
1answer
509 views

Will payable modifier throw if no ether is sent to it?

Should I add a check to make sure Ether was sent along with the transaction or is that redundant?
14
votes
1answer
1k views

Bad Jump Destination error

I wrote what I thought was a dead simple contract - a saving jar... you add value ("save") into the jar and when the balance of the contract reaches a certain amount ("target"), then I am able to ...

1 2 3