Questions tagged [static-call]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Is "msg.sender.token1().gas(msg.gas)" too low-level call?

Context : I decompiled this contract(https://bscscan.com/address/0x5cb11ce550a2e6c24ebfc8df86c5757b596e69c1#code) which is the attacker's smartcontract that hacked MEV-bot. You can check the ...
0 votes
0 answers
90 views

Lit-protocol and Metamask, Uncaught (in promise) Error: ws does not work in the browser. Browser clients must use the native WebSocket object

I am using lit protocol. It's something that in a decentralized way, allows you to authenticate via Metamask. It's really cool but I'm beginning to think it doesn't work with a static website. This is ...
0 votes
0 answers
55 views

Calling a contract function statically via ethers reverts

I am trying to call the quote function on this contract using ethers' callStatic and the call keeps on reverting with the following error: call revert exception [ See: https://links.ethers.org/v5-...
1 vote
1 answer
84 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 ...
2 votes
1 answer
211 views

what is need to use staticcall and encodeWithSelector for fetching the balance?

This is the contract https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3Pool.sol What is going on in this function balance0() private view returns (uint256) { (bool success, ...
0 votes
1 answer
82 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
31 views

Determining what event will be emitted

I want to call a contract function f() using ethers, but before I do so, I want to make sure that it executes in the desired way. I can learn whether f() executes in the desired way by looking at the ...
  • 396
0 votes
0 answers
18 views

"STATICCALL" to address "0x0000000000000000000000000000000000000001", what does it mean? [duplicate]

The "Geth debug Trace_2" of this transaction shows it STATICCALL to "0x0000000000000000000000000000000000000001": "calls": [ { "type": &...
  • 231
0 votes
1 answer
422 views

How can I read the unclaimed fees by Uniswap V3 liquidity providing through another smart contract?

I need to get a precise reading of the fees generated by a liquidity providing position I opened on Uniswap V3, and I need to get it on another smart contract (not on a frontend, so no use in ...
3 votes
2 answers
3k views

Is it possible to make a static call to a non-static function from within a smart contract without changing blockchain state?

Ive seen that the web interface from Uniswap is making a "fake" call to the contract holding the liquidity positions, and claims all fees (.collect(..)) without actually claiming them. ...
2 votes
0 answers
440 views

High gas consumption when using `staticcall` on a non-view/pure function

Even though functions called with staticcall cannot modify the state, I ran into an issue when (accidentally) calling a non-view/pure function using staticcall. For example, using this contract: ...
  • 5,552
0 votes
0 answers
843 views

staticcall - what does this code do?

I'm lost, does anyone understand this code? assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas ...
17 votes
2 answers
5k views

What is the difference between the STATICCALL and CALL EVM opcodes?

Besides the regular and very common CALL, the Ethereum Virtual Machine has the STATICCALL opcode. In which ways does it differ from the regular CALL? Edit: This is not a duplicate because this ...
  • 9,800
3 votes
0 answers
1k views

The gas-cost of a static-call of a pure function

A pure function doesn't cost anything when called from an off-chain script (or from some other constant function). But it does cost when called from a transaction (i.e., from a non-constant function). ...
1 vote
1 answer
565 views

gasCost of opcode "STATICCALL" in Geth VM Trace

{ "pc": 4765, "op": "STATICCALL", "gas": 222711, "gasCost": 219243, "depth": 1, ... } As above, Geth VM Trace (https://etherscan.io/vmtrace?txhash=...
1 vote
1 answer
1k views

Staticcall on external function works only, when there is one function's argument

I'm trying to call external function in contract B from contract A using staticcall. Here is code for contract A: contract A { address public addr; bool public success; bytes public ...