Questions tagged [proxy-contracts]
Contracts creating a transaction or call on behalf of another account
201 questions
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;
...
0
votes
1
answer
276
views
Truffle testing proxy contracts and delegation
I have a proxy contract ( Openzeppelin proxy ) and a custom Logic contract.
the logic contract has a method
function asd() public pure returns(uint256){
return 5;
}
since the proxy has a ...
2
votes
2
answers
3k
views
Understanding ERC1967Proxy internals
I have a logic contract (Box.sol) that can store/retrieve a value and I want to interact with it via a ERC1967Proxy
Problem:
after updating once the box value directly, retrieving the value via the ...
1
vote
1
answer
5k
views
Finding the address of the proxied to address of a proxy
This smart contract (https://etherscan.io/address/0x4fabb145d64652a948d72533023f6e7a623c7c53#code) is a proxy. You can tell this by clicking on 'Read as Proxy'.
However, when one looks at the 'Read ...
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 ...
2
votes
3
answers
944
views
Ethereum Solidity Contracts w/ Fiat Money
Is there anyway to fix a price for a ERC20 token? It seems like a major problem with blockchain and crypto is all of the volatility, which is why I am hesitant to use it for applications even though ...
0
votes
1
answer
390
views
Staking Contracts
Is there an ERC token which can provide staking functions?
I have a use case where as a crypto trader I desire to create tokens for issuance in a pool. The members of the pool will purchase the tokens ...
0
votes
1
answer
1k
views
Failed to call delegatecall()
I'm trying to set up a simple Proxy contract with delegatecall but it keeps failing, and I don't know where the problem might be.
Proxy.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.6;
...
2
votes
0
answers
80
views
Forwarding signed transactions as if they were sent by key owners
Can a contract act as a postal worker for a human user / key owner? The idea is the key owner would sign two transactions. The first transaction is for any call to any address. The second transaction ...
4
votes
2
answers
762
views
will I change the ABI when using a Proxy pattern?
I would like to ask you a question about the Proxy Patterns. Suppose I published an erc20 token contract(version1) and also I am using Proxy contract. If I change or add a new function the this logic ...
2
votes
1
answer
408
views
How does a Proxy contract communicate with the underlying Implementation?
When a user interacts with a proxy contract, they send a transaction signed by themselves to that proxy. My question is, how is that transaction communicated to the underlying implementation contract? ...
4
votes
1
answer
4k
views
How can I use a proxy contract with ethers.js?
I'm trying to test a contract via a proxy, but I don't know how to create an instance of a the contract proxy to call the delegate functions.
I'm using typescript, ethers.js with hardhat
The contract ...
0
votes
1
answer
1k
views
web3.js Proxy Contract Error Handling
I have been working on error handling recently using the event emitter. If I call a function directly from a contract (using contract.methods.myMethod().send{from: Ganache supplied account}) with an ...
3
votes
0
answers
1k
views
Failed to decode output: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.0.7)
When I try to call some of the unset getters through Proxy, I get this error in Remix
Failed to decode output: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.0.7)
...
4
votes
1
answer
2k
views
How to make Solidity Contracts Upgradable with a mapping and state variables?
While making a contract upgradable, I am facing issues with the approach where we split up the code implementation and storage.
As of this approach, I have created storage slots for every state ...
1
vote
1
answer
242
views
How to get address of an upgradeable smart contract in another smart contract
I have the following two contracts
contract MyNFT is ERC721Upgradeable, OwnableUpgradeable {
function initialize() initializer public {
__ERC721_init_unchained("My NFT", "MNF"...
3
votes
0
answers
3k
views
Something wrong with contract ABI and decoding input data using web3.py
I'm trying to decode some input data for this contract 0x24b22b031ae1b5a6b09f9a0fd33613a40e0d70e6, from this tx 0x30e2451138e443bcf69f59858df52eff647710dfa244d9b0e84c79504bb72fa5 (though the problem ...
0
votes
1
answer
87
views
How do I create an index of other contracts and their methods?
I want to create a proxy / router contract that stores
addresses of other contracts
function names of other contracts functionality and
accepted parameters in these contracts.
ID for each contract
...
1
vote
1
answer
568
views
Calling onlyowner functions using owner's private key
I need to call a function with onlyOwner modifier in my smart contract via web3.js.
I want a user of my site to be able to send their information to a white list, but it sends the transaction from ...
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'...
0
votes
1
answer
430
views
Deploy basic proxy with arguments
https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol#L32 contains a code to deploy a basic proxy.
This code misses a way to pass data to the proxied contract to init it.
...
1
vote
1
answer
455
views
When upgrading contracts can you change the logic inside functions?
I am trying to wrap my head around all this and am looking for someone to help clarify.
Lets say I have the following:
contract Test {
public c = 3;
function A(uint a) returns(uint){
...
1
vote
1
answer
430
views
Different proxy code to upgrade smart contract and reentrancy attacks
I am trying to upgrade smart contract in ethereum. I found that proxy pattern can help me with this. In the openzeppelin docs, I should add the following code in fallback function in my contract:
...
1
vote
1
answer
1k
views
Easiest way to call an implementation function from a proxy contract in Remix
I have the following code in my remix.ethereum.org project:
pragma solidity ^0.6.10;
// SPDX-License-Identifier: Unlicensed
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/...
2
votes
0
answers
165
views
How i can calculate deterministic address from contract clone (create2) [duplicate]
Is there any way to calculate the deterministic address of a contract cloned by a Factory through create2?
I have this contract Factory
contract ForwarderFactory {
function cloneForwarder(address ...
0
votes
1
answer
257
views
How to deploy kyber network proxy locally and test with truffle?
I am trying to deploy a proxy from Kyber Network for local development. So far I have pulled down the workshop repo and I have successfully deployed all the contracts successfully. I have the ...
0
votes
1
answer
622
views
Proxy calls are all reverting in test suite despite implementation being set and initialised
I am currently writing an upgradable contract using the unstructured data proxy model and an ERC20 token implementation (similar to USDC).
This means the traditional approach of sending a transaction ...
0
votes
1
answer
221
views
Call Result Returning Wrong from Proxy Contract [closed]
I published my proxy (AdminUpgradeabilityProxy) and logic contract to Ropsten Test network.
But my call result is returning wrong value through the my proxy contract. For example I call to ...
0
votes
1
answer
969
views
Verifying Proxy contracts on EtherScan
How one can verify a proxy contract, like OpenZeppelin Upgrade Proxy, on EtherScan?
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 ...
3
votes
2
answers
2k
views
How do Proxy Upgraded Logic Contracts Share Data
I have been looking at how to make my contracts upgradeable and looking through the Zeppelin docs and source code to try to wrap my head around this.
One thing I cannot work out is:
How do new logic ...
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 ...
1
vote
1
answer
499
views
Help me Understand the flow of this smart contract
I have 2 smart contract, below is the implementatin of them :
1)
import "./MaintainableUpgradeabilityProxy.sol";
function _createProxy(address implementation, address serviceRegistry) internal ...
0
votes
0
answers
49
views
VM Exception on variable assignment
I'm encountering a problem related to the gas (I guess).
Please note that I'm using the proxy pattern for upgradeable smart contracts: CODE EXAMPLE HERE - Explanation from Openzeppelin
I'm trying to ...
2
votes
1
answer
10k
views
getting error nonce too low , but nonce is proper stuck since one day
I am working with web3.js since sometime now , but now i am stuck with nonce too low error , the nonce is proper also i have checked private key and other addresses , they also seem to proper , ...
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 ...
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 ...
1
vote
1
answer
342
views
Zepplin Proxy Code Pattern
I am trying to understand the Zepplin proxy code pattern so i deployed two contracts using remix
Token.sol (logic contract - basic ERC20 contract)
AdminUpgradeabilityProxy.sol (From zepplin)
https://...
0
votes
1
answer
171
views
How "factory" codes are used in proxy contracts?
What is this factory_ exactly in the following piece of code?
constructor(DSProxyFactory factory_) public {
factory = factory_;
}
https://gist.github.com/Sowmayjain/...
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: ...
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 ...
9
votes
1
answer
822
views
Difference between "specific" and "generic" proxy functions and how/when to use them
Hello I am trying to build a proxy contract and I've seen two approaches:
1- "Specific" proxy function, where the proxy function can only call a specific function of the other contract.
Ex: (taken ...
2
votes
1
answer
817
views
Truffle react with Proxy Contract of OpenZeppelin
Is it possible to create a react app with truffle framework using the Proxy Contract of OpenZeppelin for upgradable contract?
What I understood is that one should send a transaction at Proxy ...
1
vote
1
answer
163
views
Creating new proxy using Zeppelin OS always use the same amount of gas
I'm building upgradeable infrastructure for the project and noticed that creation of proxy using Zeppelin OS always uses the same amount of gas.
How I understand, during the setting implementation ...
1
vote
0
answers
129
views
ZeppelinOS: zos push --network mainnet returns nonce too low
Im trying to deploy a set of contracts.
These are the steps I've followed (the same steps work fine in infura v3 ropsten):
zos add
Result:
{
"name": "0.1.0",
"version": "0.1.3",
"contracts"...
5
votes
1
answer
2k
views
Modify Struct on Upgradeable Smart Contracts
I have reviewed some techniques around Upgradeable smart contracts from starting point(Elena Dimitrova's Eternal Storage) to zeppelinOS's Unstructured Storage pattern. As I understood from posts that ...
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
...
1
vote
1
answer
597
views
On the unstructured storage upgrade pattern, why do we have to follow the structure of the previous contract?
ZeppelinOS has adopted the unstructured storage proxy pattern to upgrade contracts.
In the blog post that introduces this pattern, they say:
"The only thing you will have to care about is that ...
0
votes
1
answer
159
views
What happens with the balance of a contract after it is upgraded using ZeppelinOS?
ZeppelinOS implements upgradeability of smart contracts through the use of a proxy and unstructured storage.
If the contract holds some ether, what happens with that ether after it is upgraded?
4
votes
1
answer
475
views
Calling a function on an existing contract
I'm trying to create a very simple proxy contract that forwards my transaction/call and nothing else.
So User A > transaction to P(roxy)C > Call to Contract (msg.sender = user A)
i've tried two ...