Questions tagged []

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

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

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

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{}(abi.encodeWithSignature()) in solidity returns boolean and what other parameters?

I learned from this documentation and this discussion How to use{}() in solidity about abi.encodeWithSignature() . I have question ...
keylogger's user avatar
  • 115
0 votes
1 answer

address.transfer() fails, while{}() 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

Why is the 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

What is returned from{value: amount}("");?

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

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

How to transfer ether within contracts?

When I use the{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

"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

Calling a function of a deployed smartcontract by my smartcontract fails, while calling it using 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

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

setting value using 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