5

ETH + ERC20 tokens sent there are burnt Effectively. Unless someone generates the private key, in which case they'll take ownership of those funds. Note that you could pick any other unused address as a burn address, it's just people seem to have used 0x0 (and various others) as Schelling points. That there should be no owner of the private key of that ...


2

EDIT Dec 2019: call.value()() should now be used for transferring ether. (Do not use send or transfer.) See: Is transfer() still safe after the Istanbul update?


2

Without seeing your code, this is just a guess, but maybe you're using Solidity 0.5.x and recievers_address is declared as an address rather than an address payable?


2

This works. pragma solidity 0.5.1; contract A { function() external payable { // fallback logic goes here ... } } contract B { constructor() payable public { A a = new A(); address payable receiver = address(a); // cast goes here receiver.transfer(msg.value); } } Hope it helps.


2

Transfer may fail because there is not enough ether on sender contract's balance, or because recipient is a smart contract that does not accept payments, or needs more than 2300 gas in order to process incoming ether transfers. Assuming that part1 + part2 + ... + part6 ≤ 100 I would guess, that at least one of your destination addresses is a smart contract ...


2

You need to define the function as: function unbond(address payable wallet, bytes32 specifier, uint quantity) internal


1

The error means you are trying to use a function transfer() which does not apply to the type address. It can only be used on an address payable.


1

You made your constructor payable, but that only means you can attach funds to the contract creation expression: NewContract myNewContract = (new NewContract).value(msg.value)(); To make it possible to transfer ETH to a contract add a payable fallback function: function () external payable { } You can only use .transfer(..) on a value of type address ...


1

If you are sending the money to a contract, and not an account address, then the recipient contract must have a "fallback" function to be able to receive ETH. Fallback functions tend to look as follows: function() external payable {} though you can add logic within the fallback function if you wish. Using recipient.transfer(...) limits the transfer ...


1

tokenAddress.ownerOf() probably returns an address, not address payable. See this thread for a way to do that: Convert contract to payable address


1

The code you posted looks similar to an ERC20 token transfer, not an ether transfer. These two types of transfers are handled differently in solidity. To transfer ETH, you need to use the send() transfer() function (see smarx's comment for strikethrough clarification). When using this function, the appropriate amount of ETH must already live in the contract ...


1

I don't know how common it is, but it's certainly possible that retrying an ether transfer would work. For example, here's a silly contract that can only receive ether half the time (on even-numbered seconds): contract ReceiveOnEvenSeconds { function() external payable { require(now % 2 == 0, "I only receive ether on even seconds."); } }


1

Solution found. Thanks if someone was trying to do it. The thing we need to do here is, after calling a.deposit() here in the foster contract we need to transfer the ethers to v. I've added the following in the action() function. It does the required thing. a.deposit(address(v)); address(v).send(msg.value); The problem was that the ethers were first ...


1

Since your contract does: msg.sender.transfer(1); It would be good form to first: require(address(this).balance >=1, "Contract underfunded"); It's possible your sends were failing due to insufficient funds and the contract was ignoring the fail case and just carrying on - precisely what transfer is meant to address. It's also possible something is ...


1

There are basically tree ways to send transaction to another address in Solidity: address.call.gas(gasLimit).value(amount)(data): sends transaction to another account with given gas limit, ether amount and data, though .gas(gasLimit) and .value(amount) parts are optional. address.send(amount): equivalent to address.call.gas(2300).value(amount)("") address....


1

Ether that came along with transaction is deposited at smart contract's balance before byte code is executed, and it will stay there unless byte code execution will revert the transaction, or unless it will send this ether further.


1

Let me explain you a bit but first of all when a contract calls any function of another contract the msg.sender will be the address of the calling function. Now let me explain the follow. When a buyer wants to buy tokens he will call: function buyTokens(uint256 _numberOfTokens) public payable { require(msg.value == multiply(_numberOfTokens, ...


1

You must be using solidity 0.5 or above compiler, just declare destinationAddress as payable : address payable destinationAddress, then you can directly use destinationAddress.transfer(amount);. Also check this for more breaking changes.


1

I cannot understand why the user would need or want to send ETH along when requesting a refund. This also means your resell function should not be payable. Now, to answer the question (even though it is very old, might still help someone), there are several possible causes to this reject, from the code your showed: You should not convert the wei amount to ...


Only top voted, non community-wiki answers of a minimum length are eligible