Questions tagged [address.transfer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
57
votes
4answers
44k views

<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 ...
3
votes
2answers
3k views

address payable type - store address and send later using Solidity 0.5.0

Solidity 0.5.0 has separated the "address" type into two types: address payable and address. Only address payable have the address.transfer method. I don't want to use the withdrawal mechanism. When ...
7
votes
2answers
3k views

Using “.value(…)” is deprecated. Use “{value: …}” instead

This works fine in Remix but when trying to work in VSCode (for compiling purposes; DApp course, trying to build .json through compile.js ) it throws the error Using ".value(....
3
votes
1answer
2k views

How to monitor all your addresses and send payments out immediately to a main address

Say I have separate addresses for ethereum that are getting regular payments through different channels. How do I monitor these and immediately send balances to the main account and leave all the ...
0
votes
0answers
144 views

token transfer fails

I copied the GNT, ZIL, GTO token code from mainnet and deployed each token to rinkeby. GNT token contract : 0x861783a4B946026e3180FCA173261d937aa2fabF ZIL token contract : ...
5
votes
2answers
7k views

Solidity: “send” and “transfer” are only available for objects of type “address payable”, not “address” [duplicate]

I'm trying to compile my smart contract with the solidity version 0.5.0. with the code below: function unbond(address wallet, bytes32 specifier, uint quantity) internal { bondage = ...
2
votes
1answer
818 views

0x0000000000000000000000000000000000000000 address behaviour

I have a question about the possibly strange behaviours of address: 0x0000000000000000000000000000000000000000 We know that: ETH + ERC20 tokens sent there are burnt Upon creation of a new smart ...
2
votes
1answer
571 views

Cannot transfer ERC20 token, “Bad instruction” error

I'm trying to transfer an ERC20 token from account A to account B. Account A deployed the contract and owns all tokens. Looks like I'm missing something very obvious. Every time I try to transfer ...
2
votes
1answer
134 views

Gas cost tests: Sending a transaction to a new address is more expensive?

A friend and I were thinking about transaction costs, is there any attached cost to send a transfer to a new address that has not been stored on chain before? So we started digging. First off we ...
1
vote
2answers
2k views

Questions about some details on Ethereum transfers and Gwei

I read up about Gas and Gwei but there are some things in practice that i don't understand / know what to do. I just started learning about Ethereum (received my first ETH coins today and started ...
1
vote
1answer
4k views

Transaction revert in Remix

Here is my contract pragma solidity ^0.4.14; contract Sample { address private receiver; uint public amount; function pay(address _receiver, uint _amount) payable public returns (bool) { ...
1
vote
2answers
372 views

Three tokens transfer between each other

I would like to write three token contracts A, B and C that can interact with each other. A is the main token, B and C are the sub-tokens. A buyer can buy the main token(token A) and use them to buy ...
0
votes
1answer
175 views

How can a Smart Contract pull an amount of Ether equal to its own balance from an External Account?

I'm writing a 2 Player Game. Rules: Player 1 must place a bet (and send some ether to the contract). Then, Player 2 must match the bet placed by Player 1, and send the same exact amount of ether to ...