Stack Exchange Network

Stack Exchange network consists of 174 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.

-2
votes
0answers
38 views

Contract Creator has been HACKED, How to recover my token [on hold]

I made a token with solidity as below: pragma solidity ^0.4.22; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || ...
0
votes
1answer
13 views

bad address migration 1 [on hold]

During the token migration ERC20 TRON, I have the wrong sending address for the migration, Bittrex address instead of Binance . is there a way to reroute my TRX tokens to my myetherwallet address
1
vote
1answer
14 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. ...
1
vote
1answer
6 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 Meta Mask to an ETH platform gateway like Luno (https://www.luno.com) ? Will you receive your ETher and will it reflect in that account? I've done ...
1
vote
0answers
27 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
0answers
9 views

Get transaction hash of address.transfer(amount) [duplicate]

I'm new to etherum as well as solidity and having trouble getting transaction hash of actual address.transfer(amount) transaction I have following solidity function function sendWinnerMoney() public ...
0
votes
0answers
19 views

Send funds to an address within a contract

I am, using "pragma solidity^0.4.22;", attempting to send a balance to an address within the function. I'd think this should be a very simple transaction or send function, however when I test this ...
0
votes
1answer
18 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
39 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
59 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
53 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
49 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
0answers
42 views

Trying to send money to account from contract -> transaction reverts

I am trying to execute a contract which after storing a certain amount on the contract sends 20 Wei to an account. So far I can add the money to the contract but trying to transfer money to an account ...
0
votes
1answer
70 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....
1
vote
1answer
72 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
123 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?
0
votes
2answers
31 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
125 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
25 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
27 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
50 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
128 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
144 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
39 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
1answer
193 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
14 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
162 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 ...
0
votes
2answers
177 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
36 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:...
1
vote
1answer
42 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
16 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
80 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
27 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
119 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
77 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
0answers
149 views

How to call transfer tokens methods from current contract in web3.js

How to call methods: contract.token.transfer contract.token.buy payable contract.token.sell from web3 web3.setProvider( new Web3.providers.HttpProvider("http://localhost:8545") ) let ...
0
votes
1answer
36 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
85 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
47 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
72 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 ...
1
vote
1answer
116 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
56 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
73 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 ...
3
votes
4answers
349 views

Can't transfer value from mapping inside mapping

The title of this issue might seem strange because I can't figure out exactly what the problem is. But here is what is happening: pragma solidity ^0.4.13; contract Escrow { address public owner; ...
1
vote
1answer
55 views

tx.origin for factory

I want to use a factory so that people can create a standardized contract. People should be able to transfer money directly by this creation which led me to the problem of the msg.sender during the ...
0
votes
1answer
456 views

How to send Ether to a contract successfully?

New to Solidity... I am studying how to deposit Ether into a smart contract by setting a parameter in a function. Based on the value the function receives, the msg.sender is able to send a ...
0
votes
1answer
90 views

How can Ether be withdrawn from a contract successfully using transfer?

New to Solidity... I am studying how to withdraw Ether from a smart contract by setting a parameter in a function. Based on the value the function receives, an amount of Ether is sent to a contract ...
3
votes
2answers
187 views

Can a fee in Ether be added to ERC20 Token transfers

New to Solidity... Is it possible to have a fee for transfers of an ERC20 Token in Ether? The fee would be 0.000001 Ether per transfer. Each time the ERC20 Token is sent to another user, the fee in ...
1
vote
0answers
46 views

Out of gas while using transfer function

I simply want the transaction to occur in integral ethers. I wish to refund the balance amount. I am using the following function in my contract for that. I am getting out of gas while running this ...
1
vote
0answers
214 views

withdraw eth from contract

I have contract and function which accepts ether. How can I transfer ether from contract to any other wallet? I'm using ganache-cli. Function work, and I spent 10 eth on contract(private network). ...