Questions tagged [address.call]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
26 views

Low-level function call to other contract is causing revert with correct function selector

I have 2 contracts, FloorInfo and Elevator. I want to call the goTo(uint) in the Elevator contract from the FloorInfo contract using a low-level call, this happens in the go() function inside the ...
nostonksafrica's user avatar
1 vote
1 answer
28 views

Using .call to send funds to Smart Contract Wallet account

I have the following function in my smart contract which fails to send funds to a Smart Contract Wallet (SCW). It works fine with standard accounts. I explicitly set gas to 0 because this is an ...
Kogelet's user avatar
  • 176
1 vote
1 answer
623 views

How to transfer USDT with .call

I need to transfer USDT Token (Not ETH) using .call with solidity. ¿Some idea? Thanks.
Maurice's user avatar
  • 11
0 votes
2 answers
3k views

address.call{}(abi.encodeWithSignature()) in solidity returns boolean and what other parameters?

I learned from this documentation https://docs.soliditylang.org/en/v0.8.15/contracts.html and this discussion How to use address.call{}() in solidity about abi.encodeWithSignature() . I have question ...
keylogger's user avatar
  • 115
0 votes
1 answer
225 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. ...
Shubham Sharma's user avatar
1 vote
3 answers
1k views

Why is the address.call function failing?

Im trying to run the following solidity-by-example on remix: // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; contract Payable { // Payable address can receive Ether address payable public ...
Nicolás Guasca Santamaría's user avatar
0 votes
1 answer
1k views

What is returned from msg.sender.call{value: amount}("");?

I am working through some sample contracts online and ran across the lines below: (bool sent, ) = msg.sender.call{value: amount}(""); require(sent, "Failed to send ETH."); I ...
Chundice's user avatar
1 vote
1 answer
834 views

How to set the receiver of ETH in a contract to send ETH from one address to another with solidity usign call() in remix IDE

I'm starting to learn solidity, and I'm trying to build a sendEther contract where some address sends an amount of ether to another address. I'm building it on remix, and I'm having trouble while ...
Lorenzo Battistela's user avatar
1 vote
1 answer
41 views

How to transfer ether within contracts?

When I use the toAddress.call{value: amt}(""); code, it works fine to transfer ether to EOA account but comes back false if its sent to contract. Why is that?
Hoi Nam's user avatar
  • 13
1 vote
1 answer
1k views

"Error: Provider not set or invalid" When accessing contract methods

I have write a contract and deployed it through remix-ethereum IDE. That process goes alright. While accessing functions of contract through web3 in javascript I get following error Error: Provider ...
Mohsin Ullah's user avatar
0 votes
0 answers
73 views

Calling a function of a deployed smartcontract by my smartcontract fails, while calling it using web3.py with the same bytedata succeeds

I want to call a function of an external smartcontract using my smartcontract. I wrote the following solidity code: contract main { address public toCall = theAddressToCall; function ...
jacksino's user avatar
0 votes
1 answer
770 views

Transfer ether between two addressrd using call

I have this code: function regAgent(uint[] memory _preferences) notOwner onlyBeforeEnd public { require(msg.sender.balance - fee >= 0, "You can't pay the fee."); require(!...
Joncarre's user avatar
  • 281
1 vote
1 answer
331 views

setting value using address.call() doesn't works

I am trying to run a setter function (testCallBar) in Caller contract which should run setVal() of Receiver contract using call method. But it does not works. testCallFoo() works as expected but ...
Abhishek Sinha's user avatar