Skip to main content

Questions tagged [static-call]

Filter by
Sorted by
Tagged with
0 votes
0 answers
916 views

transaction error execution reverted

I hope someone can help. I bridged some ETH over to the TON network via dedust. I had issues claiming the transaction, which I have now managed to do. However, recipient’s address hasn't got funded. ...
gupeto's user avatar
  • 1
1 vote
2 answers
66 views

Call mutating function within view function

I would like to implement a process similar to what Nick Johnson wrote about some years ago. https://weka.medium.com/dividend-bearing-tokens-on-ethereum-42d01c710657 I'm using 0.8.19 and changing the ...
Rob Hitchens's user avatar
  • 55.6k
0 votes
2 answers
165 views

Can the EVM execute code from memory?

To my understanding address(addr).code and memory[...] are in different places and since code memory is read-only, a usual call doesn't seem to be able to achieve this, but is there any other way to e....
Zommuter's user avatar
  • 113
1 vote
2 answers
502 views

Do read-only and static calls have any gas limitations even though they don't charge gas fees?

I understand that read-only calls don't cost any gas fees. However, are there any limitations to these read-only calls and static calls that don't cost gas? For example: struct Person { string name,...
xenon's user avatar
  • 455
0 votes
1 answer
104 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 ...
Shift_that's user avatar
2 votes
1 answer
675 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
2 votes
1 answer
917 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, ...
Manpreet Singh's user avatar
3 votes
1 answer
556 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
0 answers
144 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 ...
UTF-8's user avatar
  • 518
1 vote
2 answers
1k 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 ...
General_Kenobi's user avatar
4 votes
2 answers
6k 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. ...
iOSonntag's user avatar
2 votes
0 answers
657 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: ...
Morten's user avatar
  • 6,082
0 votes
0 answers
1k 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 ...
Peter Prographo's user avatar
22 votes
2 answers
8k 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 ...
Jesbus's user avatar
  • 10.5k
3 votes
0 answers
2k 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). ...
goodvibration's user avatar
1 vote
1 answer
757 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=...
yiqi chen's user avatar
1 vote
1 answer
2k 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 ...
Cezary Stroczyński's user avatar