Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [eth-call]

Either the RPC method eth_call, or calls invoked from code, such as using call in Solidity, the formatting of data for calls, and data returned by making calls. For the latter, also see [tag:contract-invocation].

Filter by
Sorted by
Tagged with
1 vote
0 answers
15 views

Web3.js returning out-of-gas on local node with high --rpc.gascap

I have a local Fantom API node (lachesis) that I start with a really high --rpc.gascap (over 5 billion), which should not be hit in theory. However, when I make an eth_call using Web3.js, it always ...
tim's user avatar
  • 21
0 votes
0 answers
49 views

Verifying eth_call Results with Cryptographic Proofs for L1s and L2s

I'm interested in enhancing the reliability of static call requests (eth_call) to Ethereum smart contracts. Currently, the returned data is only as trustworthy as the node or service providing it. ...
MShakeG's user avatar
  • 1,693
0 votes
0 answers
34 views

eth_call swapExactTokensForETH simulation error

I can do swapExactEthForTokens with no issue but when I try to do the reverse, swapExactTokensForETH, I run into this error: { "name": "ContractLogicError", "message&...
user132647's user avatar
2 votes
0 answers
41 views

Calling Curve smart contracts with eth_call gives unexpected results

I came across a strange response of eth_call. I made a request to Curve pool smart contract calling get_dy(int128,int128,uint256) function: curl your endpoint -X POST -H "Content-Type: ...
Nikita's user avatar
  • 21
0 votes
2 answers
156 views

How to find the slot number for state variable overrides in eth_call, eth_estimateGas

The state override set allows you to deploy contracts and/or change the state of any contracts on demand while using eth_call. An example is given here - https://www.libevm.com/2022/01/12/advance-geth-...
Ovia Seshadri's user avatar
0 votes
2 answers
35 views

How to optimally display over 500k EOA wallets' daily balances spanning three years back?

I would like to display over 500k EOA wallets' daily balances spanning three years back and wonder if there is a more efficient method than using eth_call and balanceOf 500k times per day for three ...
littlewatermeloncat's user avatar
0 votes
1 answer
28 views

Can require() be used to revert low level call() that were made before it?

CODE: (success, ) = contract.call(); // low level call if (success) { // do something } // instead of below check, can I just use require(condition)? if (!condition) { revert(); } Instead of ...
aste123's user avatar
  • 233
0 votes
0 answers
89 views

Can eth_estimateGas estimate gas for past blocks?

In my understanding, the eth_estimateGas json rpc method can currently only be used to estimate how much gas would be needed for a transaction based on the current/latest state of the blockchain. ...
MShakeG's user avatar
  • 1,693
1 vote
1 answer
42 views

Do interface functions revert on failure?

I was wondering if interface functions automatically revert the whole transaction on failure or not? Let's say I want to call the sync() function of a liquidityPair, which usually returns no boolean: ...
Andy's user avatar
  • 185
0 votes
0 answers
275 views

State override with geth

I'm working on a generalized sniping bot, which spots liquidity additions on uniswap v2. I need to know if the token i want to buy is a scam or not, so i would need to do some checks using eth_call() ...
Newly Sama's user avatar
0 votes
1 answer
26 views

Does a blank space matter? - (bool sent,)

In terms of sending ETH from a contract, if only the boolean is needed and the data gets omitted, I always see two different versions. Some people write it with a blank space (bool sent, ) and some ...
Andy's user avatar
  • 185
0 votes
0 answers
425 views

Get ERC20 token buy/sell tax

I am trying to implement a method for calculating token buy/sell tax. The one that devs implement it in the transfer() function. I've done some research and there are 2 options. eth_call - simulate a ...
kakakakakakakk's user avatar
1 vote
1 answer
125 views

Recommended way to remove ETH balance from a contract?

There are multiple methods to withdraw the ETH balance of a contract to the owners' wallet: function withdrawal() external { payable(owner).transfer(address(this).balance); } function withdrawal()...
Andy's user avatar
  • 185
2 votes
3 answers
897 views

The block number argument in ETH JSON-RPC function calls

Multiple JSON-RPC API functions take an optional block number argument: eth_getBalance eth_getCode eth_getTransactionCount eth_getStorageAt eth_call My questions is this: for historical blocks, is ...
kfx's user avatar
  • 1,630
2 votes
2 answers
1k views

Hardhat localhost issue "Calling an account which is not a contract" with read functions only?

I need your help! I run a hardhat testnet on localhost in a fork goerli mode and would like to test a simple Ether to WETH wrap and unwrap. I use WETH contract address ...
matsmakeshift's user avatar
0 votes
1 answer
237 views

Disadvantages of using `call` function

Hey guys, I was reading about low-level methods of calling other contract functions and I found the following description of call method: This is the recommended method to use when you're just ...
Nurnberg_Meistersinger's user avatar
3 votes
2 answers
2k views

How to decode the output of an eth_call that returns a Tuple[]

I am developing a low-level library that interacts with RPC nodes directly. There is a requirement to call the AaveV2 getAllReserveTokens function, and I want to decode the output data. The particular ...
pestopasta's user avatar
2 votes
3 answers
1k views

What are the best online tools to easily make json rpc calls?

What are the best tools to make any of the Ethereum json rpc method requests online in addition to easily interacting with smart contracts?
MShakeG's user avatar
  • 1,693
0 votes
0 answers
88 views

Error at eth_estimateGas & eth_call geth local testnet

Here I am asking for help for my problem, namely to eth_call and eth_estimateGas. So I created LocalTestnet with the aim of making a Swap Testnet, but when I run it an error appears like the one I ...
Ekacitta Wibisono's user avatar
1 vote
0 answers
19 views

Safety of writing fund transfer and NFT transfer code in an externally linked library

If suppose there is a main contract A that is linked to an external library L, would it be safe to move all the fund transfer and NFT transfer calls from the main contract into the library to reduce ...
Sheeshco's user avatar
2 votes
2 answers
3k views

How this honeypot token is able to fool the checkers? How does it figure out how the transfer function is called - via mined or simulated transaction?

I'm developing a scanner/checker for honeypot tokens and I was using it for a few days now to scan the BSC network. While using it I keep stumbling on one particular design many times a day, which is ...
Vladimir's user avatar
6 votes
3 answers
3k views

Trying to understand the difference between trace_call and debug_traceCall methods

can someone help me understand the difference between trace_call and debug_traceCall? From what I've read, trace_call is to see the opcodes executed and the gas used for a transaction. debug_traceCall ...
Devin Jackson's user avatar
2 votes
1 answer
572 views

The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent

According to the official Solidity documentation: The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of ...
Liron Achdut's user avatar
1 vote
1 answer
214 views

Able to call swap function with interface, but not with .call(

SwapByInterface works, swapByCall doesn't. Edit: have changed code to require success of internal call, previously both calls succeeding because errors not bubbling up, made the question more ...
Maxwell Singer's user avatar
1 vote
1 answer
252 views

convert json RPC request to byte array

I am new to json RPC and Ethereum. I am trying to query 2 JSON RPC methods eth_sendTransaction method { "jsonrpc":"2.0", "method":"eth_sendTransaction", ...
nunam's user avatar
  • 11
1 vote
1 answer
357 views

What do the retOffset and retSize parameters of the CALL opcode do?

When reading the data returned by CALLing another contract, RETURNDATASIZE and RETURNDATACOPY opcodes are used. They allow moving the data from an otherwise unreachable context to the memory, so it ...
CodeSandwich's user avatar
1 vote
1 answer
133 views

Out of gas ethernaut lvl 10 - reentrance

I'm trying to solve Ethernaut level 10 reentrancy task, but I'm getting "out of gas" error. https://ethernaut.openzeppelin.com/level/0xe6BA07257a9321e755184FB2F995e0600E78c16D This is my ...
GiorgiSh's user avatar
  • 119
0 votes
1 answer
972 views

Extract transaction details from uniswap eth_call event

I am attempting to programmatically infer information about transactions being submitted by uniswap. Say I go to uniswap and try to exchange 0.1 ETH for WBTC. I then inspect the network tab of my ...
Abraham P's user avatar
  • 103
3 votes
1 answer
502 views

Call another contract with huff?

How do I call another contract with huff? And then bonus points... Return the data from the call. Let's say I have a solidity-style contract with a function as such: NumberGetter.sol uint256 myNumber =...
Patrick Collins's user avatar
0 votes
2 answers
439 views

calling transfer of ERC20 token using call function is not working

I tried to make token transfer contract like this, contract TokenSender { function transferToken(address token1Address, address to, uint256 amount) external { (bool check, ) = ...
Lion.k's user avatar
  • 105
0 votes
1 answer
971 views

eth_call to call a function in my solidity contract fails with "execution reverted"

UPDATE: I figured it out though is doesn't entirely make sense. When abi-encoding an "address" as an argument, you use "address" in the hash of the function signature, however you ...
Dave Chura's user avatar
0 votes
1 answer
32 views

Compiler warning when sending Ether using the 'call' keyword

The documentation recommends sending Ether from a smart contract using the call keyword: function sendETH(address payable to, uint256 amount) public nonReentrant { require(address(this).balance &...
forhas's user avatar
  • 785
0 votes
0 answers
75 views

Calling a function takes forever and then times out with error

I wrote this example smart contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract TestContract { function foo() public pure returns (string memory) { string memory ...
AlexXelaAlexXela's user avatar
0 votes
1 answer
240 views

Race conditions in brownie, how to guarantee this will execute in order?

Let's say I have a contract like this: contract Test{ uint8 test = 0; // getter and setter } and I want to issue it using some python code like: initial = contract.getTest() contract.setTest(1, {&...
user avatar
0 votes
0 answers
156 views

Calling a non-payable function that mutates state? (web3)

With web3, you can call read-only functions using 'call()' (eg, balanceOf), and functions that mutate state with 'send({from: adr, value: 10})' I'm able to call payable and non-payable functions fine, ...
greentriangles1's user avatar
1 vote
0 answers
132 views

eth_call for nameExpires(uint256 id)

Can someone please explain how I can build the eth_call data param for Registrar nameExpires(uint256 id) the signature is this: 0xd6e4fa86 The function takes id of label, the namehash. BUT i dont ...
Andriy Lysak's user avatar
0 votes
1 answer
782 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

Custom bytecode logs data but doesn't return it on eth_call, why not?

I'm creating custom bytecode for a project 0x4160005260206000a0 // OP-Codes // COINBASE // PUSH1 0x00 // MSTORE // PUSH1 0x20 // PUSH1 0x20 // LOG0 when the above is created, the transaction receipt ...
Alita's user avatar
  • 113
0 votes
1 answer
276 views

Call function from deployed contract

I have a deployed contract (contract A) which should act as a storage (let's say 0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B). Now from my ERC20 Token contract (contract B), I am calling approve to the ...
4NDR34's user avatar
  • 61
3 votes
1 answer
205 views

call opcode gas consumption on a non EOA address depends if the addres is "new" or not

I have the following contract, reduced to the minimum for testing reasons: pragma solidity ^0.6.11; contract PackedMultiplexer { function multiTransfer(address _address1, uint _amount1, address ...
coinwalletdev's user avatar
2 votes
0 answers
2k views

`web3.eth.abi.decodeParameters()` not returning correct values

I call to a method that returns two contract addresses, like this, where method is the method object taken from the ABI (triple-checked that already): web3.eth.call( { from: account, ...
FabioB's user avatar
  • 43
9 votes
4 answers
19k views

How to get reason revert using web3.eth.call

I have a smart contract with required message and pretend to use the required/validation message in front end. require(bytes(hashAlreadyRegistered[hash]).length == 0, "Hash already registered&...
RAFAEL DA SILVA's user avatar
2 votes
2 answers
888 views

Why field `data` in `eth_call` optional?

Based on https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call The data is optional, but it also says it contains hash of the method signature. In what scenario you can send a eth_call without ...
Kabie's user avatar
  • 123
0 votes
1 answer
715 views

linking form submission to smart contract

I have a smart contract that sends x ether to an address. I have an html page that has a form for the address, and the amount to be sent. Theoretically it should interface with the smart contract. ...
rubecuber's user avatar
0 votes
1 answer
267 views

got response data to nonsencical eth_call request. What is that response?

When I call a seemingly nonsensical transaction on mainnet and rinkeby. ethereum.send('eth_call', [{'from':'0x0000000000000000000000000000000000000000', 'to':'...
Sharas's user avatar
  • 157
3 votes
1 answer
3k views

How can I tell if a node I am using is a full archive node?

What is the best way to tell if the node I am is using a full archive node? One way I know if is to call a contract from the context of an old block, but this requires an RPC call and is not explicit ...
Shane Fontaine's user avatar
1 vote
2 answers
1k views

Infura Json RPC: how to call a function passing parameters?

IMPORTANT My final goal is receive data via api on a php server and use Infura to call my contract to save the data Test Situation having this test contract on rinkeby contract test008 { ...
realtebo's user avatar
  • 343
0 votes
1 answer
838 views

What is the data field in eth_call commands for USDT?

I'm trying to use eth_call to send USDT (TetherToken) from one account to another (Although I know that eth_call just simiulate such transaction). Everything is clear in this regard, just the data ...
Mohammad Saberi's user avatar
0 votes
1 answer
1k views

What is the ethersjs equivalent of `web3.eth.call` in web3js?

web3.js has the ability to call a transaction and get return data without sending a transaction: web3.eth.call(callObject [, defaultBlock] [, callback]) ethersjs apparently does not have this ...
python_crypto_questions's user avatar
0 votes
1 answer
72 views

call: Alternative transfer at the byte code level

I am reading the following stuff from the research paper at: Restricted Transfer We define a property that guarantees that ether transfers (via call) cannot be invoked by any user a. Violation of ...
zak100's user avatar
  • 1,406