Questions tagged [address.transfer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
38 views

Sending entire contract balance to address

I am trying to establish a basic reversed auction in solidity using the Remix IDE. In the last function i want to pay back the whole contract balance to a certain address. My approach with .transfer(...
0
votes
1answer
24 views

How to transfer ether to wallet addresses in an array?

address[] emp = [address1,address2]; amount = total/emp.length; for(uint256 i=0;i<employees.length;i++) { wallet = emp[i]; wallet.transfer(amount); } So This is the error I get. TypeError:...
0
votes
1answer
35 views

address payable type error

Just upgraded truffle to version 5 and having a problem with this new address payable type. contract Test { ERC721Full public tokenAddress; constructor(address _address) public { ...
2
votes
1answer
90 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 ...
1
vote
1answer
34 views

How can I send ether [duplicate]

Hey guys I am a beginer on Solidity. I write a function and try to send ether on remix accounts and check balances this accounts. But I can't connect accounts I think because when I check balance of ...
0
votes
0answers
16 views

Finding methods executing a transfer

How can we find all the function which executes a .transfer to transfer ether even by parsing the contract or going through opcodes? One can also put their views related to it. Thanks!
1
vote
1answer
41 views

How can I verify that two specific wallet addresses were involved in a transaction?

Given I have and know WalletAddress A (sender), WalletAddress B (receiver), the Transaction Hash and the amount ETH sent. How can I verify that those values were indeed involved in the given ...
1
vote
1answer
56 views

Is it possible for send() in Solidity to fail if value is sent to a valid external account?

I want to use something like the following as a fallback for failed transfers: if (!recipientAddress.send(amount)) { ownerBalance += amount; } After reading about using transfer versus send, it ...
0
votes
1answer
26 views

Web3 event listener - timing issue when immediately retrieving contract values

I'd like to be able to immediately get a struct value from a mapping after calling a function that updates the struct, however, when testing with Ganache, sometimes the event arrives to the listener ...
0
votes
2answers
225 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 = ...
0
votes
1answer
30 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
10 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
62 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
34 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
81 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
37 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
52 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
437 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?...
1
vote
0answers
99 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
171 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
169 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
260 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
30 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
51 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
603 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
222 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
58 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
157 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
101 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
2answers
111 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
1k 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
22 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
44 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
99 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
71 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
147 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
79 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
58 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
296 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
139 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
356 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
87 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
319 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
40 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
31 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
72 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
167 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
462 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
91 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
384 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 ...