Questions tagged [address.transfer]

The tag has no usage guidance.

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

What is the "bytes memory" in (bool success, bytes memory) = some_address.call{value: some_amount}("")

I understand that the success tells if the receive/fallback methods returned successfully but what does the memory give?
0
votes
0answers
27 views

Remix: Test Failed and the Message is " Transaction is reverted"

I am sending ETher from the test contract and then checking the balance but I am getting the message, Test Failed and Transaction is reverted. My contracts are: //pragma solidity >=0.4.22 <0.9.0;...
1
vote
1answer
9 views

Converting to address payable not working

address payable constant public pillowInc = address(uint160(0x4B38016118FDE970e2371740F849840aEc745c7B)); address payable constant public pillowInc = 0x4B38016118FDE970e2371740F849840aEc745c7B; ...
0
votes
0answers
23 views

How do I "reclaim" an ENS domain after I lost access to the account it was linked to?

Bit of a newbie here. Ques: How can I change the Eth address of an ENS domain? I originally pointed my ENS to an account but lost access to the account. The Registrant and the Controller shows the ...
0
votes
3answers
21 views

Did my tokens land in an exchange walllet... or in a black hole?

About a month ago I misread a blog on Binance.us which stated that they now support Polygon (Matic). I assumed that meant I could send any token on the Polygon network to my binance account. So... I ...
0
votes
0answers
41 views

Binance Smart Chain - address.transfer runs out of gas - locked forever?

I'm having quite a troubling situation on the Binance Smartchain Mainnet. I have a contract that I created and it owns some BNB. I wrote a onlyOwner function to transfer the BNB over to another ...
0
votes
0answers
63 views

Transfer or swap?

I'm newbie in crypto, and I think I made a "mistake"... I mine a coin who haven't got any exchange or swap ! Is there a way to use smart contract to help me ? Like a function tranfer or swap ...
0
votes
0answers
36 views

how to create script of this Site Ronin wallet

I want to create auto transfer script on to my ronin wallet to take all asset to send to another wallet all incoming asset to my account was transfer to another account but i dont know to create ...
0
votes
0answers
68 views

Ronin wallets being compromised

I want to format or configure my ronin 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
0answers
23 views

Ronin wallets auto send asset to another ronin wallet

i have axie infinity team with 5 scholar now i want to all my my scholar ronin wallets to automatic transfer to my main ronin wallet everytime they claimed the assets anyone here how to use javascript....
0
votes
0answers
29 views

Transfer to multiple addresses without a Loop

I an in search way to send tokens from a contract to a list of all addresses (an array or mapping) without using a loop(as I know gas fees for this can become a huge issue). I have a contract, that ...
0
votes
1answer
34 views

Issue with assigning arbitrary values to .call{value: msg.value}

Just learning Solidity here. I am trying to pass an receiving address, and an arbitrary amount (other than msg.value) to my transfer function, but it is just not working for me. This is the code: ...
0
votes
0answers
30 views

How to write a function to swap tokens?

The function receives an amount, confirm if msg.sender has that amount of the token (oldcake) in his wallet, and if it has them transfer those tokens to another wallet and mint to his wallet the same ...
0
votes
0answers
7 views

How to create Ethereum address [duplicate]

I'm newbie in Ethereum, so I don't know how to create address which I can tranfer token to it. Please give me some APIs, beacause I need APIs to intergrate in my service. Thank you very much.
0
votes
1answer
272 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
22 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
0answers
38 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
40 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 ...
0
votes
1answer
31 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
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
0answers
83 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
520 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: //...
1
vote
1answer
172 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
693 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
54 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
98 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
265 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
2k 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
156 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....
1
vote
1answer
91 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 ...
0
votes
0answers
130 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, ...
7
votes
1answer
979 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
1answer
96 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
42 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
347 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
1answer
1k 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
179 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
1answer
413 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
97 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 ...
1
vote
0answers
285 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
154 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 //...
4
votes
3answers
137 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. ...
9
votes
2answers
5k 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(....
0
votes
0answers
51 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
33 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 ...
1
vote
2answers
70 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
1answer
58 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
99 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
183 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 ...
0
votes
2answers
2k views

Transfer ether from one account to another using smart contract

I`m trying to transfer ether from account A to a smart contract and from the smart contract to account B. I wrote some code that approximately works on Remix IDE, but I completely got lost with the ...