Questions tagged [address.transfer]

The tag has no usage guidance.

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

Solidity: ERC-20 TransferFrom reverts after approval

i am trying to code a smart contract which takes the tokens of the player who enters. function enterToken(address token, uint amount) public { uint _amount = amount * 10 ** 18; IERC20 ...
0
votes
2answers
998 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
13 views

Calling a function[A] that in turn calls a function[B] from another Contract

I have two Contracts, Domain and Serial deployed separately. NOTE: Most of the code is ommited for simplicity. contract Serial { Domain DOMAIN; //Domain contract is imported and set by ...
0
votes
1answer
734 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
20 views

I want to forward any received ethereum, to another different ethereum address

For instance, i received 0.09 eth in address A I want to automatically send it to address B in mini seconds. Somebody help How can i achieve this please? I need the lines of codes for this. Thank you
1
vote
0answers
24 views

Issue executing function transferOwnership(address newOwner) for ERC-20 token contract

I'm trying to execute the function transferOwnership(address newOwner), to change the owner of an ERC-20 token contract to a new owner address (I have access to the current owner address & the ...
56
votes
4answers
43k 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 ...
0
votes
1answer
16 views

How can I view with web3.js all the ETH transfers to an ethereum address? [duplicate]

How could I list with Web3.js all the ETH transactions to an address? Thank you
0
votes
1answer
187 views

Sending ETH from contract to EOA

OK, I'm baffled guys. maybe it's the amount of gas the function is using up that is causing this not to work. when I call the function: I get the following in response but no movement of Eth from my ...
0
votes
0answers
250 views

trying to transfer HEX token from my mobile(android) metamask wallet to my laptop(chrome) metamask wallet

Didn't comprehend what a headache MetaMask (android) was going to be. Long story short, gave up trying to stake HEX tokens from my mobile device. I went to my laptop and discovered the android/chrome ...
0
votes
2answers
985 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 ...
4
votes
3answers
102 views

Regular address turns into a contract after receiving a transfer?

To accept payments in ether myself, I first tried how others have implemented it. So I bought an item in a store that uses Coinbase Commerce to accept crypto payments and paid for my item with ether. ...
0
votes
1answer
62 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 ...
1
vote
1answer
134 views

What are options re: transferring ETH and ERC-20 tokens out of Mist without having to synch?

I have some ETH and many custom tokens sitting in a Mist wallet that will take many days to synch. I assume I can use the 'transfer from' function to move these tokens from this wallet without having ...
0
votes
0answers
13 views

Need help identifying where coin transfer is and how to get it back [duplicate]

I Transferred some ENJ coins from my DeFI wallet to what I thought was my Trading account wallet. Long story short the address it I was sent too was off by one number. About 3/4 of the way into the ...
0
votes
1answer
72 views

Where's Submit button to register .ETH domain?

When I attempt to register a .ETH domain at https://registrar.ens.domains, there is no button for me to submit my request. Right below the message "I understand how the process works and my risks and ...
0
votes
1answer
243 views

Transfer a fixed value of ether

pragma solidity ^0.4.19; contract Test { address one; function Test(address _one) public { one = _one; } function send1() public payable { one.transfer(10); } function send2() public ...
0
votes
0answers
66 views

What's the difference between Binance ERC20 and Coinbase ERC20 …?

As a newbie I made a mistake whilst transferring btc to from Binance and Coinbase. My mistake was I didn't check the receive address with Coinbase and it defaults to eth and I wanted to send btc to ...
3
votes
0answers
177 views

Safe implementation on Solidity 0.8.0 of a withdrawal and a refund

I'm here for asking of a SECURE way to implement on solidity 0.8.0 two functions: 1-Withdrawal() which sends all the ether of the smart contract to the owner address. My current implementation is: //...
3
votes
1answer
264 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 ...
1
vote
1answer
45 views

How to calculate the gas cost of Solidity's 'transfer'?

I have read that the gas cost of transfer function is 2300Ether. I have got the following contract having a function, testFunc(…), only containing transfer method as shown below, because I want to ...
0
votes
1answer
252 views

How to transfer any ERC20 token trough a function with Metamask?

I'm developing a function that accepts any kind of ERC20 token, and transfer it to the provided address. The idea is to execute the function connecting Metamask address, and transferring the desired ...
0
votes
1answer
37 views

Trying first transfer contract in solidity

So i´ve been experimenting with Solidity and Remix and i wanted to and a simple while loop to the .transfer and .balance method. While being able to deploy the contract, I can´t seem to be able to ...
0
votes
1answer
45 views

Sending a transaction to a non-existent address

What happens if you initiate a transaction to a non-existent address in geth? Is there any way to determine if an account exists as a legal address? Hope you can give me some help, thanks!
0
votes
1answer
38 views

How to pass msg.value as an argument?

I am trying to implement deposit functionality in my contract in the sense whoever calls the function below needs to deposit some ether. For example: Contract A calls the function below and again, ...
1
vote
1answer
541 views

How to deposit to WETH in Solidity 0.6 and above?

Solidity 0.6.0 introduced a breaking change in how ETH transfers are performed. The following doesn't work anymore: weth.deposit.value(amount)(); What is the latest syntax for depositing ETH into the ...
0
votes
1answer
87 views

refund function in smart contract [closed]

I am looking to add a Refund function in my smart contract. Like If User A deposited 1 ETH in the contract, and uses refund function, he gets 1 ETH - Gas Fee back. I can do the transfer(address....
0
votes
3answers
2k 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(...
1
vote
1answer
47 views

Request a transaction amount in a function

I'm trying to have a function generate a request such that it pops up a Metamask request. I know I can do: require(msg.value == amount); to require the function call has a certain value. But this ...
6
votes
2answers
2k 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(....
4
votes
1answer
355 views

safeTransferFrom is undefined in buidler test

I have started using buidler for testing/compiling my contracts. In one test i have setup a scenario that a owner attempts to transfer a token to another wallet address. My contract is inheriting from ...
0
votes
0answers
56 views

Failing to send() 1 wei from one contract to another

The following code is supposed to send 1 wei from the current contract to a newly created contract. The recipient contract gets created successfully and the sending contract has a positive balance, ...
0
votes
1answer
40 views

Understanding addresses of contracts (when they deployed twice)

I just have a quick question about addresses of contracts. If I want to make a contract to transfere tokens, how do I get the correct addresses of the token I want? For Exsample: function transfer() ...
-2
votes
1answer
36 views

Depriving Address of my own wallet created? [closed]

I want to derive Address of my own wallet developed using web3 frameworks without looking onto etherscan for the Address. var Web3 = require("web3"); var url = 'https://ropsten.infura.io'; ...
0
votes
1answer
133 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 ...
0
votes
0answers
77 views

Move Ethereum from my contract to a new wallet on Ledger S (using MyCrypto?)

A few years ago, I bought 10 ETH and had it set up on a laptop using the standard software at the time, which I think was Mist. I then moved 1 ETH to a new contract that I set up within Mist, not ...
1
vote
0answers
140 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
847 views

How to forward tokens without paying a gas [closed]

I'm working on a project and I need to know if this statement is possible: I have 10 registered users. Each user has an erc20 wallet. It is possible that when user A, C, E, or whoever deposit their ...
0
votes
1answer
113 views

Transfer money between contracts

I'm quite new at smart contracts/Solidity, which I'm learning for a postgraduate course. In one of the assignments, we have to implement a little competitive game (something like the game of Seven ...
0
votes
0answers
40 views

'VM Exception while processing transaction: revert\n' Error Processing transaction

I have read in various posts that this error occurs when there is a problem with executing function. So I'm asking about this error in regards to the code I have written. Please see below: contract ...
0
votes
0answers
173 views

Remix contract balance transfers Failing (Metamask / JS VM)

There is an issue with my smart contract not transferring any funds to any other address on the connected ganache instance. Regardless if I choose "JavaScript VM" or connect to my Remix, the ...
1
vote
0answers
107 views

WWarning! Error encountered during contract execution [Bad instruction]

When I invoke toll function, it encountered "Error encountered during contract execution [Bad instruction] " warning. Who knows why? thx pragma solidity ^0.4.24; /// 使用0.4.24是为了moac链 - www.moac.io //...
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 ...
0
votes
0answers
49 views

No transfer of ether

My Code below ( Following an Online Course, absolute beginner here ^_^) pragma solidity >=0.4.17 <0.7.0; contract CampaignFactory{ Campaign[] public deployedCampaigns; function ...
0
votes
0answers
20 views

get statistics by event filters or normal blockchain traversal

I want to ask what's the better approach among the following two: Filter events using address.eventFilter function or traversing the local blockchain block by block and getting events statistics. I ...
0
votes
1answer
32 views

using .call(): contradictory recommendations

Solidity documentation: You should avoid using .call() whenever possible when executing another contract function as it bypasses type checking, function existence check, and argument packing. ...
1
vote
2answers
2k 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?
1
vote
1answer
51 views

tracing new address on new wallet in Ethereum [closed]

I am just wondering how the new addresses are anonymous in Ethereum. Suppose that I have a wallet A including many addresses on it. Then I have a new wallet, say wallet B, and opening new address on ...
1
vote
0answers
62 views

transfer(amount) failed even when it is not a contract

address payable receiver; receiver.transfer(amount); The receiver is NOT an contract, and the amount is only 0.4 ether, the contract is holding sufficient ether in its balance. I understood that ...
2
votes
2answers
144 views

Instantiating a contract with ether

I have a factory contract that I need to be able to deploy with some ETH. I'm getting an error TypeError: Member "transfer" not found or not visible after argument-dependent lookup in address. I ...