Questions tagged [eth-call]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
24 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 ...
1 vote
1 answer
32 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", ...
  • 11
1 vote
1 answer
8 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 ...
1 vote
1 answer
54 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 ...
  • 107
0 votes
0 answers
8 views

Does the QUANTITY|TAG parameter in eth_call include state changes from the block in question?

When using eth_call and supplying block number 12345 as QUANTITY|TAG parameter, are the state changes from block 12345 included during execution? I.e., is the eth_call theoretically executed at the ...
  • 325
0 votes
1 answer
116 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 ...
0 votes
1 answer
47 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 =...
0 votes
0 answers
10 views

Changing msg.value

Is there any way to change msg.value between calls (or delegatecalls)? For example: A --delegatecalls(msg.value=0)--> B -->delegatecall(msg.value=1) --> C where some logic would happen in B ...
  • 369
0 votes
2 answers
64 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, ) = ...
0 votes
0 answers
23 views

Is a `CALL` with a non-zero value always an "internal transfer"?

I'm playing with transaction debugs and encountered a transaction I cannot understand, specifically https://etherscan.io/tx/0x3494b6a2f62a558c46660691f68e4e2a47694e0b02fad1969e1f0dc725fc9ee5 In the ...
  • 101
0 votes
0 answers
61 views

Getting 0x when retrieving total supply for older block numbers

I am trying to access Binance smart chain supply information for BUSD stable coin by using https://bsc-dataseed.binance.org/ RPC endpoint with the body: { "jsonrpc": "2.0", ...
  • 101
0 votes
1 answer
287 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 ...
0 votes
1 answer
22 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 &...
  • 543
0 votes
0 answers
36 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 ...
0 votes
1 answer
164 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, {&...
0 votes
0 answers
107 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, ...
1 vote
0 answers
104 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 ...
0 votes
1 answer
420 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(!...
  • 151
1 vote
1 answer
224 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 ...
  • 113
0 votes
1 answer
229 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 ...
  • 61
3 votes
1 answer
154 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 ...
2 votes
0 answers
1k 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, ...
  • 43
7 votes
2 answers
13k 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&...
2 votes
2 answers
606 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 ...
  • 123
0 votes
1 answer
493 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. ...
0 votes
1 answer
185 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':'...
  • 157
1 vote
1 answer
2k 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 ...
1 vote
2 answers
953 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 { ...
  • 293
0 votes
1 answer
507 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 ...
0 votes
1 answer
913 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 ...
0 votes
1 answer
58 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 ...
  • 1,285
2 votes
1 answer
2k views

web3py - Function Call when Sender Must Be Certain Address

I have a contract on Ropsten, and when I do this is python, I get a result: result = contract.functions.getLastUpdateTime(0).call() So I know the ABI is there, the address, etc. There's another ...
4 votes
1 answer
50 views

Why does the `DoCall` function use the first account by default?

In this line, // Set sender address or use a default if none specified var addr common.Address if args.From == nil { if wallets := b.AccountManager().Wallets(); len(wallets) > ...
0 votes
0 answers
701 views

Get Array from a call in Web3j

I have a solidity function that returns an array. I'm trying to read the values inside this array from web3j but it gives me stage results. My solidity function function getAllSubTokenByTokenID(...
0 votes
1 answer
157 views

How to understand from web3py if I need a transaction or a call

I have a contract with a function in which only if a certain condition is true, it changes the state of the blockchain otherwise it emits an event and returns: address[] public global_state; function ...
  • 103
3 votes
2 answers
697 views

Call a view function of an Ethereum Smart Contract using a program written in C

my attempt is to call a view function to reatrieve some data from a contract on the Blockchain using a C program. I do have the interface of the contract. I think i need to performe two things in ...
  • 131
2 votes
2 answers
4k views

Can I get the return value of a .call from a contract from the Blockchain?

I know that if I use call from a contract, that I cannot get the return value. I get a true or a false. Is it possible for me to inspect the blockchain afterwords to get the return value? For ...
2 votes
1 answer
2k views

Why does this throw a stack underflow error?

Simple contract, one function. function getSha256(uint32 nonce) returns (bytes32 hash) { return sha256(nonce); } > contractInstance.getSha256.call(1); Error: Error: VM Exception while ...
2 votes
1 answer
1k views

What happens when you use multiple "call" arguments?

I have a piece of code like so: address x=0x01234..; x.call(data1, data2, data3); Will this do what I expect and call the contract at address x while passing the data in concatenated like data1+...
  • 451
2 votes
0 answers
1k views

eth_call using INFURA

I've developed a very simple smart contract and I'm trying to invoke a function using eth_call. The contract is deployed on the revived Ropsten testnet. If I invoke the function getSTR() sending the ...
  • 340