Questions tagged [address.transfer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Passing transaction origin address from one contract to another without use of tx.origin Solidity

I am currently working on a project that the user will buy/sell Contract A and receive another token from Contract B. Contract B is a crowdsale contract of a 0 value ERC20 token used as proof of ...
user avatar
0 votes
0 answers
16 views

My contract is not getting paid with TETHER. (Cannot transfer)

I am creating a Smart contract that produces X Coins. If they send 1 USDT to the contract, I want to give 1 X Coin, which they can withdraw whenever they want. The reason why I want to use ...
user avatar
  • 1
0 votes
1 answer
27 views

Solidity: Neither address.send nor address.transfer nor address.call is working

Problem Whenever I call the paytest function (please see code snippet below) from javascript (please see code snippet below) i receive the below posted error message. Whether i use address.send, ...
user avatar
0 votes
1 answer
23 views

address.transfer() fails, while address.call{}() works fine in reentrancy attack. Why?

I was trying to learn reentrancy attacks and how to save the contracts against them. I previously user address.transfer() to withdraw the amount, but the function reverted when performing the attack. ...
user avatar
0 votes
0 answers
12 views

How can I transfer this ROI value inside RateOI function value to the contract itself and the contract Balance gets updated

contract RATE { function contractBalance() public returns(uint){ return address(this).balance ; // store = address(this).balance; // console.log(store); // store =...
user avatar
1 vote
1 answer
38 views

How to send ether to a contract (even if the contract doesn't implement receive or fallback functions)? [duplicate]

If the contract doesn't implement the receive or fallback function as payable, it can't receive funds?
user avatar
0 votes
1 answer
28 views

Send ether from one address to another every month (like EMI payment)

I want to send some amount of ether(let say 0.1 ether) on every 1st of month to another address. I have a smart contract to send ethers from one address to another but it's a manual process. For every ...
user avatar
1 vote
3 answers
49 views

Transfer function reverts

I just started learning solidity and i am stuck with address.transfer() Reverts when using send(). Works fine if i use msg.value but reverts when using uint256 amount to address.transfer(). // SPDX-...
user avatar
0 votes
0 answers
23 views

Why huge difference between number of address transfers and token transactions on etherscan?

I am trying to use the etherscan API to get the list the most traded tokens in a day.I came accross this endpoint, but as shown above, it does not contain all the token transactions (as shown in the ...
user avatar
  • 103
0 votes
1 answer
26 views

auto generated functions by solidity

send and transfer are automatically generated function to send ether(wei) to some address. I tried to search a list of such functions in solidity documentation but to no avail, can someone help here? ...
user avatar
2 votes
2 answers
513 views

Cannot tranfer() ETH to Gnosis Safe

I'm praying to the blockchain gods that somebody answers us.   I'm with a NFT collection. We ran our pre-sale the last 2 days and collected 56.925 ETH. The smart contract address with the withdraw ...
user avatar
  • 131
0 votes
1 answer
60 views

How do I split the Eth received from the minting of a ERC20 token

I have an ERC20 token with a mint function that looks like this: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ...
user avatar
0 votes
0 answers
19 views

Transfer condition modification

I am trying to add a condition that when the token is sold, change the fees to 7, in case it is a purchase, leave it at 1. Would the code shown be correct? In any case, what would be the best practice?...
user avatar
0 votes
1 answer
154 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?
user avatar
0 votes
0 answers
101 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;...
user avatar
  • 1,215
1 vote
1 answer
30 views

Converting to address payable not working

address payable constant public pillowInc = address(uint160(0x4B38016118FDE970e2371740F849840aEc745c7B)); address payable constant public pillowInc = 0x4B38016118FDE970e2371740F849840aEc745c7B; ...
user avatar
  • 41
0 votes
0 answers
51 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 ...
user avatar
  • 1
0 votes
3 answers
36 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 ...
user avatar
0 votes
0 answers
83 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 ...
user avatar
0 votes
0 answers
85 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 ...
user avatar
  • 1
0 votes
0 answers
66 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 ...
user avatar
0 votes
0 answers
73 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 ...
user avatar
0 votes
0 answers
32 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....
user avatar
0 votes
1 answer
113 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 ...
user avatar
0 votes
1 answer
57 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: ...
user avatar
0 votes
0 answers
50 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 ...
user avatar
0 votes
0 answers
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.
user avatar
0 votes
1 answer
515 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 ...
user avatar
0 votes
2 answers
27 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 ...
user avatar
  • 636
1 vote
0 answers
49 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 ...
user avatar
  • 11
0 votes
1 answer
120 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
user avatar
  • 558
0 votes
0 answers
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 ...
user avatar
0 votes
0 answers
84 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 ...
user avatar
3 votes
0 answers
658 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: //...
user avatar
1 vote
1 answer
282 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 ...
user avatar
  • 1,215
0 votes
1 answer
833 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 ...
user avatar
  • 636
0 votes
1 answer
72 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 ...
user avatar
0 votes
1 answer
137 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!
user avatar
  • 387
1 vote
1 answer
507 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, ...
user avatar
  • 925
1 vote
1 answer
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 ...
user avatar
0 votes
1 answer
240 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....
user avatar
  • 115
1 vote
1 answer
122 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 ...
user avatar
  • 87
0 votes
0 answers
296 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, ...
user avatar
  • 190
7 votes
1 answer
1k 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 ...
user avatar
  • 171
0 votes
1 answer
168 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() ...
user avatar
  • 111
-2 votes
1 answer
46 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'; ...
user avatar
0 votes
1 answer
580 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 ...
user avatar
0 votes
1 answer
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 ...
user avatar
0 votes
1 answer
273 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 ...
user avatar
0 votes
1 answer
585 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 ...
user avatar
  • 23