Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [address.transfer]

The tag has no usage guidance.

1
vote
1answer
16 views

How to add an address for which I have the corresponding private key into MEW?

I'm quite new to Ethereum, so, pls, forgive me if I say something wrong. How can I see the balance of one already existing address, for which I have the corresponding private key, in MyEthereumWallet?...
0
votes
0answers
42 views

Infinite gas cost when trying to use transfer()

I tested the contract using Remix Javascript VM, Injected Web3(Ropsten) and in-built Ganache client from Embark Framework(4.0). Always getting infinite gas usage. Can someone please help me? This is ...
0
votes
1answer
40 views

Cast contract to address payable

I am wondering if it is possible to cast a contract-reference to an address payable (in order to send to it money) or if it is possible to declare a contract-reference directly payable (with solidity >...
1
vote
1answer
83 views

Converting an address type variable to payable address type throws me error [duplicate]

I am trying to convert an address to payable address but I'm not able to do it. please find my code below: address a = destinationAddress; address dest = address(uint160(a)); dest.transfer(amount);
0
votes
1answer
21 views

How can I send ethers from my smart contract to another address using transfer?

recievers_address.transfer(address(this).balance); when I use this from one of the functions of my smart contract Member "transfer" not found or not visible after argument-dependent lookup in ...
0
votes
1answer
21 views

creating instance of contract trough a factory contract! Problems with balance!

hopefully someone can help me with my question. I have a factory to create an instance of a dealContract. Everything works except one thing. I cant send wei to the created instance, so lets see the ...
0
votes
2answers
34 views

Will 'x.send(amount)' revert if 'x' is a contract with a fallback function which reverts?

I know that x.transfer(amount) reverts if either one of the following two scenarios takes place: There is not enough ether in the calling contract, i.e., amount > address(this).balance Variable x ...
0
votes
2answers
106 views

How to transfer ERC20 tokes from Blockchain wallet to MyEtherWallet?

I got some token and by mistake sent them to my Blockchain ETH address. Now, what is the process of transferring them to MEW? They talk about exporting your private key, what does that mean and to ...
1
vote
1answer
67 views

ParserError: Expected identifier but got 'payable'

function getWinners() public onlyOwner { require (now > endQuiztime, 'Quiz did not end '); require (isReveal, "You didnt reveal Questions"); // calculate winner for each ques based on ...
0
votes
1answer
25 views

Problem with wallet.transfer in newer solidity compilers

I read the documentation of the changes on 0.5.0 but I do not know how to get this done with my code snippet. I tried to make the constructor payable but this does not work. Can someone help me. The ...
0
votes
0answers
98 views

Using transfer() method but don't see payment in Ganache or Metamask?

I'm using the .transfer() method in my smart contract to pay a particular address. I've checked the Ganache logs and the transaction does not revert and is auto-mined successfully. But I don't see a ...
0
votes
2answers
47 views

How can I build this list of addresses

An investment round ask new investors to put exactly 0.1 ether to enter the round. function invest() public payable { require(msg.value == 0.1 ether); } How can I save every new investor ...
0
votes
1answer
64 views

How to refund a wallet address from a contract with solidity and web3

I am building an app where I'd like a purchaser to be able to seek a refund from the contract. Essentially I am trying to transfer eth from a contract to a wallet. When I get to the point of issuing a ...
1
vote
2answers
691 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 ...
1
vote
2answers
11 views

Will a transfer go through on a testnet transaction on meta mask to luno

What if you sent your ETH on the Ropsten testnet via Metamask to an ETH platform gateway like Luno (https://www.luno.com) ? Will you receive your Ether and will it reflect on that account? I've done ...
1
vote
0answers
33 views

Is there a more elegant way to do an aggressive multi-send?

I understand there are many approaches to do multisend but for me timing is a priority and I do not want to stop the transaction if a address.send fails. function multiSend() internal isAdmin { ...
0
votes
1answer
50 views

Is there any gas cost when executing `msg.sender.transfer(0)`?

I have a function which looks more or less like this: function exchange(uint256 amount, bool specialCase) external returns (uint256) { let retVal; if (specialCase) { register(amount); ...
0
votes
2answers
54 views

Contract Address is not Showing and How to Send ETH from Contract Address to Contract Creator

Q-1: I,m new in Ethereum Bockchain,I have Created my new token that can be get by send from 0.01 to 1 ETH instant. When i did transaction in transaction hash Tokens Transferred From line showing ...
1
vote
1answer
116 views

Transfer X% of Eth. sent to smart contract, to contract owner on buy function call

I use this "buy" function in a smart contract, to receive Eth. for a token. I would like to extend the function, so if the Eth amount in a transaction is higher than X Eth. then send Y% to smart ...
2
votes
1answer
70 views

Why use returns(bool) in a transfer function?

function transfer(address _to, uint256 _value) public returns (bool) { require(balanceOf[msg.sender] >= _value); require(balanceOf[_to] + _value >= balanceOf[_to]); ...
1
vote
1answer
55 views

Not sent by ETN via transfer

I'm trying to make a lottery. pragma solidity ^0.4.23; contract Lottery { struct Ticket { uint id; address name; uint winCount; } uint public winFirstPercent = 60; uint public ...
0
votes
1answer
218 views

Transfer function not working in basic deposit and withdraw contract

I have this simple contract used with remix. pragma solidity^0.4.24; contract test{ mapping (address => uint) balances; function Deposit() public payable{ balances[msg.sender] += msg....
2
votes
1answer
107 views

Communicating between a Sidechain and a Mainchain

Side chains (see linked question ) can be seen as a blockchain attached to a "parent" blockchain using a "two way" peg. Smart contract addresses are generated deterministically(HD wallet style), but ...
0
votes
1answer
263 views

How to generate ERC-20/xxx token addresses?

How to generate ERC-20/xxx token addresses, from which I can receive/send corresponding tokens? How can I do this using web3j?
1
vote
2answers
48 views

Difference between transfer to ethereum account or to smart contract?

Is there a difference between sending ether to a user account or to a smart contract. E.g.: contract ThisIsAContract{ function() public payable {} } Now I call (pseudocode) ...
0
votes
1answer
225 views

Internal Token Transfer without ETH fee

Need to move all token from one address to another address(Internal) without fees. Could you please help me to solve this?
0
votes
1answer
31 views

Is it clear that for every “ether” transfering using “address.transfer(amount)” how much “fee” must be paid?

Is it clear that for every "ether" transfer using "address.transfer(amount)" how much "fee" must be paid? I mean how much is the cost of transferring ether by address.transfer(amount)? Is it a fix ...
0
votes
0answers
28 views

What happens if the “balance” of the address which sends “address.transfer(amount) is ” zero "?

Consider the balance of the address that sends address.transfer(amount); to receive the amount is zero. For example we have following address with balance of zero: web3.eth.getBalance('0x123').then(...
1
vote
1answer
67 views

How can I transfer half mining award to an address?

Creating a dapp, which requires half allocated mining fee should go to an address. I managed to cut down the mining as well as the block reward: consensus.go // Accumulate the rewards for the ...
1
vote
2answers
146 views

UPDATED : How to determine “payer address” in “address.transfer(amount)”?

Consider we a function as follows : address public recipient; function settlement(uint256 amount) public { recipient = msg.sender; recipient.transfer(amount); } Then the ...
0
votes
1answer
275 views

can not send ERC20 tokens because user have no ethereum

I have 1 wallet server but have many account address for each user, so when user want to transfer erc-20 token say OMG to another address(user) in the same wallet server, the system said can not ...
0
votes
1answer
63 views

How can I carry out the operation of “withdrawing eth from an ERC20 contract into a wallet” from the onchain (i.e., from another contract)?

In MainContract, I need to perform an atomic transaction which includes the following: Transfer eth from Contract1 (which is an ERC20 contract) into a given address Change a state variable in ...
0
votes
2answers
277 views

Help on transferFrom and Approve functions

We have a token contract A and an Escrow contract B. While transferring token from an address to contract B we are using transferFrom function which overridden from contract A. But in need to do the ...
0
votes
1answer
15 views

ethereum.org - buy/sell example unclear

From the buy/sell example on ethereum.org: function buy() payable returns (uint amount){ amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, ...
0
votes
0answers
211 views

How to automatically transfer ETH from my address to another

I want to format or configure my ETH wallet in a way that if any ETH comes into the address, it will automatically be sent to another address. I have the feeling that my private key is being ...
1
vote
2answers
448 views

Who pays transaction fee ? Payer or Recipient of the ETH?

When we call address.transfer() or address.send() to transfer ETH, who has to pay transaction fee ? Payer or Recipient of the ETH? And is there any option to choose payer of the fee or gas? Updating ...
1
vote
0answers
45 views

Why does address.transfer(amount) cost the same when sent to a new or used address?

In the Ethereum yellow-paper, it's specified that creating a new account costs 25000 gas (Appendix G, entry for Gnewaccount). We can see this if, for example, we call a function that makes a transfer:...
2
votes
1answer
54 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 ...
0
votes
1answer
18 views

.transfer question [duplicate]

How does the transfer function behave? Was looking at a function I created, and saw that we transfer ether out of the contract, before deleting the data which determines whether or not it is allowed ...
0
votes
1answer
157 views

adress.transfer fails in ganache

I am calling address.transfer() from the one of the deployed contract. While, this works fine with remix(JavaScript VM environment), the same fails if I deploy and run the same contract on 'ganache'. ...
0
votes
1answer
30 views

transfer ether from contract to another contract

Have code like this: pragma solidity ^0.4.21; contract Forwarder { address public owner; mapping(address => uint256) public stored; function Forwarder () public { owner = msg....
0
votes
1answer
273 views

address.transfer(value) is throwing error in solidity contract.

I am building an approval contract in Remix and have been stuck on this issue. When I try to transfer wei using address.transfer(value), it throws an error. I have marked it in the code below. ...
0
votes
0answers
94 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 : ...
0
votes
1answer
69 views

Understanding the Address and its members

I am new to ethereum blockchain and solidity. I am trying to understand "Address" and its member from the link . In the below example The "transfer" will transfer from which address to which address ?
0
votes
1answer
103 views

Does an ERC721 contract have to rely on an external agent to be the approved spender?

I am creating a dApp that services a game. The "house" in the game is my game server that creates the smart contract using Web3.js. It also owns all the non-fungible assets at the start of the game, ...
0
votes
0answers
55 views

Out-of-gas error on very simple contract function with lots of gas sent along

My intention is to make a contract with a single function that takes a list of addresses van amounts and then transfers the amounts to the addresses. I wanted to start simple and (using Remix) I have ...
1
vote
0answers
83 views

Why is this not a vulnerability in localethereum contract?

I am looking through localethereum smart contract: https://etherscan.io/address/0x09678741bd50c3e74301f38fbd0136307099ae5d#code and I have trouble understanding why what I am seeing is not a ...
2
votes
1answer
170 views

Transfer function gives infinite gas warning in remix

If I use this simple payout contract in remix, it gives me a warning that the gas costs is infinite. Is this an intended behaviour? contract Payout { function payout() public { msg.sender....
0
votes
0answers
88 views

Problem with invoking a function

I have a function as follows i.e. transfer. function transfer(address _to, uint256 ENvalue, uint256 PWvalue) public returns (bool) { require(_to != address(0)); balances[_to].bEN = balances[_to]....
1
vote
1answer
111 views

Simple transfer from contract not working

this is very basic but i just want to test the transfer function. I load the contract with the constructor with 1 eth, then when i click the transfer function 0 wei is transferred. I understand this ...