Questions tagged [proxy-contracts]
Contracts creating a transaction or call on behalf of another account
201 questions
0
votes
1
answer
29
views
Attempting to create a Proxy
I have to create a Proxy, first I created my own then I found out that is better to use TransparentUpgradeableProxy.sol
My initial logic implementation.
The upgraded implementation.
This is the proxy ...
1
vote
1
answer
23
views
Can a proxy constructor replace the initializer used in upgradeable contracts?
I was wondering if a regular constructor could be used in the proxy of a proxy-implementation upgradeable contract, instead of an initializer in the implementation contract. If not, please explain why....
0
votes
0
answers
11
views
Timelock for upgradeable contracts
Also asked in OZ forum
Use case - Adding time delay for upgrading a proxy.
Example - mETH protocol.
mETH protocol uses timelock as the ProxyAdmin, means they don't deploy the seperate ProxyAdmin ...
1
vote
0
answers
18
views
Can Intents Operate on Upgrades and Deployments?
Lets say you want to upgrade your smart contract using the proxy upgrade pattern.
Just like how intents can say "only do this tx if it meets this criteria"
Can we use intents to say "...
2
votes
0
answers
51
views
Why is only one of my proxy facets showing up on etherscan contract verification?
I deployed a diamond upgradeable contract on Sepolia with foundry --verify:
https://sepolia.etherscan.io/address/0xdCfB65CC9f69D78dDFA30f47eefD1594466fB47D
Only one of my facets shows up, but several ...
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 ...
0
votes
1
answer
28
views
Understanding SmallProxy Contract Behavior with ImplementationA
I'm currently doing some experiments with the SmallProxy contract. Below is the code for the SmallProxy and ImplementationA contracts:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import &...
0
votes
1
answer
71
views
`upgradeAndCall()` Reverting
I have a factory contract which deploys an upgradable token and I also want it to be able to upgrade it. It works fine when I callupgradeAndCall() with an empty data but when I try pass in an encoded ...
0
votes
1
answer
63
views
How to use Access Control in different facets if a Diamond Contract
I am looking to change the design of my contract into diamond proxy. For that i have split up my contract into 3 parts. the issue i am facing is while setting up access control. When i am using OZ ...
3
votes
1
answer
88
views
Is it possible to emit generic events using assembly?
I'm trying out a proxy / upgrade pattern where the deployed contract is an ERC-721 but it delegates as much functionality to a "controller" contract as possible. The storage is split between ...
0
votes
0
answers
17
views
Clone of a uups proxy contract is not working
i have a factory contract which is creating clones of an NFT contract.
if the NFT contract is not a proxy everything is ok and cloning works just fine.
but since i need to have a upgradable UUPS NFT ...
0
votes
0
answers
19
views
Is there any way to explicitly trigger the fallback's execution if the msg.data matches an external function present in the contract?
I'm wondering whether there's a way to somehow explicitly trigger the fallback method, if the msg.data (calldataload, calldatasize and calldatacopy commands in Yul) already matches one of the ...
3
votes
1
answer
30
views
What can be the workaround to work with the new `Initializable` contract?
If we are using the initializable contract before OZ 0.5.0 for our transparent Upgradeable proxy.
It had two variables in slot 0.
uint8 private _initialized;
bool private _initializing;
Now in OZ 0.5....
0
votes
1
answer
48
views
How do you implement diamond proxy fallback function?
According to the official EIP2535 in the fallback section:
It is missing the position slot:
// Find facet for function that is called and execute the
// function if a facet is found and return any ...
1
vote
1
answer
915
views
Deploy proxy upgrade pattern contract using hardhat ignition
I have a contract like this:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@...
0
votes
1
answer
89
views
Reading Events from Implementation contract
I own a proxy contract as well as an implementation contract. The implementation contract's function emits an event, but it does not emit the event when it is called from the proxy contract. Using the ...
0
votes
2
answers
55
views
What's the difference between upgradable and non upgradable Initializable contracts?
@openzeppelin/contracts/proxy/utils/Initializable.sol
vs
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
Why would anyone use proxies that do not support upgradable contracts? ...
0
votes
1
answer
67
views
Connected to a proxy function but getting an error when I call the transfer function of the implementation contract
I'm currently working on a project where I can transfer USDC from my account to another directly, provided I have my provider and private key, programmatic. So I connected to a proxy contract on the ...
0
votes
0
answers
30
views
EIP 1822 - Potential vulnerabilities in a proxiable contract example
I'm reading EIP-1822 UUPS. There's a reference, or sample, implementation of a proxy contract pattern for an ERC20 token contract, and I have some concerns about potential vulnerabilities. Here's the ...
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.
2
votes
2
answers
448
views
UUPS vs Beacon proxy pattern
I am delving into UUPS(Universal Upgradeable Proxy Standard) and Beacon proxy patterns.
I believe they serve distinct purposes, but I am unsure about the right use cases for each.
It seems that UUPS ...
3
votes
0
answers
100
views
How to get admin address while deploying transparent upgradeable proxy from OZ
After OZ version 5, the admin contract is deployed from within the constructor of the proxy.
And the admin address is emitted in the events of the deployment transaction. To get the admin address we ...
1
vote
1
answer
90
views
How does the proxy contract gets the storage variables of Implementation contract?
I understand that proxies use delegatecall to execute the logic contract's function with its own storage.
But what happens when we define any storage variables in the logic contract as well as ...
1
vote
0
answers
49
views
Proxy Smart Contracts
I am working on a KYC smart contract and I want to provide the upgradable feature so I can add more functions or add more fields to the struct in the future.
I have learned about proxies and the way I ...
1
vote
2
answers
113
views
Verification of a proxy contract not working because of constructor args
I am creating a smart contract verification service as a learning experiment and I am now able to verify most of contracts that I come across etherScan (in part doing so there is not only an option).
...
1
vote
1
answer
102
views
Proxy Contracts Initializing problems
Good afternoon. I’ll be brief - there is a Module in my ecosystem, the module is initialized by the proxy factory DeployProxy.sol and then the proxy contract address is entered into the Core contract ...
0
votes
1
answer
52
views
I sent ETH to an Opensea Ownable Delegate Proxy Contract, Is there anyway to retrieve it?
I accidentally sent ETH funds to the Ownable Delegate Proxy contract owned by my address. However, i am not a developer and have no know-how as to how i could obtain these funds back or if that is ...
0
votes
1
answer
22
views
How to put .opezeppelin folder at desired directory in hardhat?
I am using Openzeppelin upgradable with hardhat. By default the plugin store .openzeppelin folder at root but I have running multiple environments so would like to set .openzeppelin folder at the ...
1
vote
1
answer
28
views
How prevent of attack in Ethereum
I hope you are well. The topic of my thesis is to increase security in blockchain-based IoMT (Internet of Medical Things). I aim to present new ideas to reduce attacks in the blockchain, considering ...
2
votes
1
answer
361
views
OZ transparent upgradeable proxy admin reverts when trying upgrade an implementation
I have this transparent upgradeable proxy deployed on sepolia - 0x2dFC2A866eac363cAFF516b5ce7aCd6bae1F21C1
This is the admin contract - 0x6d429719f78b146892403d06df677afa6f968d91
When I try to call ...
1
vote
1
answer
615
views
Automatically getting implementation contract for eip 1967 proxy
Let's say I wanted to write code which looks at a smart contract, detects whether it is an upgradeable proxy, and then fetches the contract address.
Something like so:
const functionNames = abi.map((...
1
vote
1
answer
183
views
How to Implement a Proxy Contract to Fix an Existing Investment Smart Contract with Active Investments on BSC?
I'm currently facing a challenging issue with an investment smart contract deployed on the Binance Smart Chain (BSC). The contract already has active investments, but it contains a critical bug that ...
0
votes
2
answers
136
views
Can we override the private variable in base contract?
Background:
I'm using an opezeppellin Erc20 contract. but i want to use it for minimal proxy pattern(eip-1167).
so for that reason i cannot use constructor and have to use the initialize method. Now I'...
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 ...
1
vote
0
answers
235
views
Create3 deployment with proxy contract ownership?
I have deployed an upgradable proxy contract with create3factory from solmate.
In my contract i transfer ownership to an address. But still the owner ship is not on that address. Its a differant ...
2
votes
2
answers
147
views
Solidity Proxy: why using initialiser instead of a constructor?
Why proxies can't read from the constructor?
1
vote
1
answer
35
views
How to implement access control for arbitrary transaction data
Is there a contract that receives transactions, and forwards them to arbitrary other contracts, by inspecting the transaction data, i.e. target contract address, function signature, parameter values, ...
1
vote
1
answer
76
views
Fetching an implementation contract using ethersjs
I'm attempting to get the implementation contract for a proxy using ethers (and testing it using the recently published Paypal USD: https://etherscan.io/address/...
1
vote
1
answer
33
views
i have an upgradable smart contract with 3 mappings, i set only the first two in the initialize function
i have an upgradable smart contract with 3 mappings, i set only the first two in the initialize function .
pragma solidity ^0.8.0;
contract ContractA {
mapping(uint256 => address) public ...
1
vote
0
answers
368
views
how to write test for upgradeable smart contract in hardhat
I'm writing a Hardhat test for my contract.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import &...
1
vote
1
answer
495
views
Connecting a manually created Gnosis Safe to the Safe UI
I have a Safe at https://etherscan.io/address/0x000000000034065b3a94c2118cfe5b4c0067b615#readProxyContract, and I was having trouble connecting it to both the Safe Web and Safe Mobile apps. When ...
0
votes
2
answers
116
views
UUPS proxy and file level constants, enums and structs compatibility
If i use UUPS upgradeable pattern and i define a couple of constants, enums and structs at the contract level, will those values still be available after an upgrade?
I have 3 contracts and all 3 are ...
1
vote
1
answer
54
views
Using inherited constructors with a proxy factory
I am attempting to use Chainlink VRF along with OpenZeppelin's upgradable contracts to generate a random number. In order to use VRF, I must inherit the constructor from VRFV2WrapperConsumerBase. ...
1
vote
1
answer
693
views
How do I identify an ERC-1967 contract?
I understand both how to read the _IMPLEMENTATION_SLOT and how to get the implementation address of a proxy, provided I know the contract is a proxy.
What I'm wondering is: how do I determine if any ...
1
vote
1
answer
440
views
How do I access external view data through a proxy's implementation contract with web3.py if the data is stored in the proxy itself?
I want to use web3.py to access all sorts of view-data from smart contracts. In some cases, it's pretty simple. Take USDt:
You have the USDt contract on mainnet, ...
0
votes
1
answer
490
views
Is it possible to change a constant variable value when using upgradeable pattern and deploying a new version?
The title is pretty self explanatory.
Let's say I have a contract where I defined a constant variable and this contract is using some upgradeable pattern. When I deploy a new version of the contract, ...
1
vote
3
answers
416
views
OpenZippelin upgradeability pattern | How can both implementation and proxy contracts share the same storage tho they were implemented independently?
Please bear with me in this. I tried to understand it myself, but I couldn't.
I'm playing the Ethernaut challenges(a series of contracts hacking), and I'm solving the challenge 24 - Puzzle Wallet- ...
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/...
0
votes
1
answer
191
views
How to set the logic contract in proxy contract so that proxy contract can delegatecall to the logic contract?
i am making a upgradable contract, i am facing issue to set the proxy contract for implementation contract. I am usign openzeppelin-contracts-upgradable.
This is my deployscript :
pragma solidity ^0.8....
1
vote
1
answer
134
views
Help me to clear up my idea on Upgradable contract
This is my idea about an upgradable contract, i dont wanna use openzeppelin/hardhat-upgrades so i am sharing my understanding only based on openzeppelin-upgradable-contracts library. correct me i ...