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.

0
votes
1answer
11 views

3 level ether transfer

contract foster{ vulnerable v = new vulnerable(); attacker a = new attacker(address(v)); constructor() public payable{ // a.deposit(address(v)); // transferring 3 ethers to ...
0
votes
0answers
7 views

Transfer function not working properly with calculations

function payWorker1(address schoolId) public payable returns(bool){ require(Schools[schoolId].moneySent == false); require(Schools[schoolId].verified == true); Schools[schoolId]...
0
votes
1answer
28 views

.transfer fails

Trying to call .transfer() within a function makes it fail. I am aware that the difference between .send() and .transfer() is that .send dont throw. The function works properly when using .send(), but ...
1
vote
1answer
27 views

6 transfer functions result to out of gas

I have a function that in first call just counts values and in next calls transfer some amount of ETH. It's like: function() public { ... if (val !=0) { address1.transfer(val.mul(part1).div(...
1
vote
1answer
55 views

Why can't we use Transfer() to get a fallback from a contract?

Does this discussion imply that we cannot call transfer() to some contract and call its fallback function and can only do the same by using call() and setting gas?
0
votes
1answer
17 views

Which `EVM` bytecode is actually used to “deposit” the transferred Ether?

A quick question. Which EVM opcode is actually used to "deposit" the transferred Ether into the contract? From the EVM opcode list, there are only two opcodes related to the fund transfer: balance and ...
0
votes
1answer
28 views

buytoken function with erc20 interface

I was following a tutorial that can buy erc20 tokens and I'm now stuck with transferring tokens to a buyer account which I need more clarification. So basically, a buyer account is trying to purchase ...
1
vote
2answers
53 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
62 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
80 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
126 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
92 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
27 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
38 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
244 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
144 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
40 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
135 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
63 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
87 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
912 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
14 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
39 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
75 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
56 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
128 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
75 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
57 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
240 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
116 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
295 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
60 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) ...
1
vote
1answer
254 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
35 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
29 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
71 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
156 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
344 views

Cannot send ERC20 tokens because user has 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
69 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
315 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
254 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
528 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
48 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
59 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
19 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
199 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
32 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
314 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
99 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 : ...