Skip to main content

All Questions

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

Reason for Checking `msg.sender == _msgSender()` in OpenZeppelin's MulticallUpgradeable Contract

In the OpenZeppelin::MulticallUpgradeable contract, there's a validation that checks msg.sender == _msgSender(). Considering that msg.sender and _msgSender() typically return the same value, why is ...
Coinymous's user avatar
0 votes
0 answers
14 views

Can a contract call a proxy via delegatecall in a function?

I suppose this is not possible as the proxy contract code would try to retrieve the implementation code from the original contract storage.
alain's user avatar
  • 41
0 votes
1 answer
109 views

Determining if a smart contract is using delegatecall

Let's say that I have the bytecode of a smart contract deployed on ethereum (which I got with a call to eth_getCode). How can I programmatically determine if this smart contract uses delegatecall ...
galpo's user avatar
  • 155
2 votes
2 answers
147 views

Solidity Proxy: why using initialiser instead of a constructor?

Why proxies can't read from the constructor?
Dakata's user avatar
  • 255
2 votes
0 answers
558 views

How to interact with proxy contract with ethers and wagmi

I have an upgradable proxy contract that points to a specific contract. This is the contract in mumbai polygonscan => https://mumbai.polygonscan.com/address/...
Murat's user avatar
  • 21
2 votes
4 answers
1k views

How can I create a Factory of TransparentUpgradeableProxy?

I have the following code for a Factory that creates instances of a contract that is Upgradeable. I understand that, in order to achieve this, one of the options I have is to use ...
Falcon Stakepool's user avatar
3 votes
1 answer
390 views

Delegatecall not working

I have deployed the following smart contract: 0x016d87b8c98e6ad0991d128CddA435FAfbC06792 //SPDX-License-Identifier: MIT pragma solidity 0.8.15; contract Proxy { uint256 public count; address ...
Javier Marchetti's user avatar
1 vote
2 answers
2k views

Fastest way to find the function in a contract from it's selector?

Let's say I have a function selector: 0xa9059cbb And I have a contract as such: // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; contract CallAnything { function balanceOf(address ...
Patrick Collins's user avatar
1 vote
1 answer
382 views

Contract A delegatecall function in contract B which calls function in contract c. msg.sender for function in contract c?

If Function in contract A delegatecall function in contract B which calls function in contract C. What will be the msg.sender for function in contract C?
user99015's user avatar
1 vote
2 answers
3k views

How to use Proxies in Ethers?

I'm trying to use Proxies in Ethers. My Solidity file: //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy....
antoniopgs's user avatar
1 vote
1 answer
1k views

Delegatecall failing

I have this second-layer delegatecall (delegatecall on a contract that already did delegatecall) that continues to fail even after checking all the main reasons why it could fail (storage layout, uint ...
dNyrM's user avatar
  • 948
1 vote
0 answers
654 views

Does a proxy contract need to declare state variables?

There is no variable declaration in the proxy contract. Does the returned data from the delegate call auto-generate the variables for the proxy contract? contract Logic { uint256 varA; ...
stanftf's user avatar
  • 11
2 votes
1 answer
715 views

Struct on delegatecall

Is it possible to pass a struct as an argument to delegatecall ? I have this function that calls delegatecall and takes a struct (a 0x quote) as an argument which is later used on the function ...
dNyrM's user avatar
  • 948
3 votes
2 answers
846 views

Call fallback function from eth-brownie from proxy

I have a contract that has a fallback function to delegatecall all function calls to a different contract. I can't seem to use my typical API to interact with the contract it delegates a call to. I ...
Patrick Collins's user avatar
2 votes
1 answer
182 views

Preserve msg.sender but not storage

In this particular scheme, we pass the address of the Attacker contract in Victim.foo. By using delegatecall, we maintain the msg.sender field, but we are not using the storage of Storage but Attacker'...
Elisha Drion's user avatar
  • 2,641
10 votes
2 answers
3k views

What is the value of "address(this)" when delegate calling?

Suppose that you have an upgradeable proxy "Foo" that calls an implementation contract "Bar" via DELEGATECALL. In "Bar", there is a function that uses the Solidity syntax ...
Paul Razvan Berg's user avatar
1 vote
1 answer
845 views

Dynamic Delegate Proxy contract

I'm familiar with proxy contracts in solidity using the 'delegatecall' to separate out the proxy contract from the logic contract. Is there a simple way to choose the logic contract based on an ...
LampShade's user avatar
  • 640
0 votes
1 answer
209 views

Upgradable contract proxy pattern: Get the invoked method name in the fallback function

I have a proxy smart contract and I would like to get the name of the called method in the fallback function. Is there a way? For example, if I call the function getName() (stored in the logic ...
Dan's user avatar
  • 187
0 votes
1 answer
150 views

How do you pause a Proxy-Logic pattern?

Suppose we have a Proxy contract that forwards to call to a Logic contract by using delegatecall. If we pause the Proxy, users will still be able to directly interact with the Logic contract. While ...
pan1994's user avatar
  • 169
0 votes
1 answer
155 views

Unstructured storage proxies. Variables not being overwritten?

When using delegate call I was under the impression that storage slots declared in the proxy will be overwritten by the implementation. Unstructured storage implementations declare bytes32 variables ...
arete's user avatar
  • 609
2 votes
0 answers
564 views

Proxy contract DELEGATECALL to pass a DYNAMIC array to a function in the target contract

I'm trying to get a Proxy contract to correctly do a delegatecall to a function in another 'target' contract. The problem is, that I need to pass a dynamic array as the parameter to this function. Q: ...
Michael Connor's user avatar
0 votes
1 answer
451 views

Proxy Contract Not Updating Store Data

I want to setup a proxy contract that my users can interact with. The proxy contract is a store contract with stores the user's age for now. When I call writeData to update my age, I expect it to call ...
Huy's user avatar
  • 135
0 votes
1 answer
534 views

Upradeable proxy library throws on any function, how to connect proxy and maincontract

I'm trying to implement a proxy library through the techniques researched by openZeppelin using proxies. I have 4 contracts 1. Library with logic 2. Library containing the interface for the logic ...
Nico Vergauwen's user avatar