Skip to main content

All Questions

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

Delegatecall failing 'could not coalesce error'

I'm trying to set a message to my Contract setmsg through a proxy contract using delegatecall.Using hardhat. getting this error: error: { code: -32603, message: "Error: VM Exception ...
Loputocharlio's user avatar
0 votes
1 answer
39 views

How to build a 3 contract structure with delegatecall

I'm looking for help to build an intermediate contract using delegatecall. My challenge would be with 3 contracts. I need contract A to be the owner of Contract B, and contract B to have a ...
Leandro Loures's user avatar
1 vote
1 answer
191 views

Does delegatecall also works for calling other contract's constructor?

I want to call other contract's constructor, but I'm not sure if the delegatecall function will work for that case. I have no way to test it out on Remix, because my Remix seem to not work with even ...
caiosa's user avatar
  • 23
0 votes
1 answer
85 views

How call() function works in solidity?

Learning call() function in Solidity, I read that we use call() only when we don't know the ABI of the called contract and we don't know its source code. Below I have an example, but it seems we DO ...
Nick's user avatar
  • 75
0 votes
0 answers
244 views

EOA delegating call authority to a contract to interact with another contract

Actually, I want my contract (say A) to interact with a project's contract (say B). But, contract B's author has restricted calls by any contract. So with this, only one option is left i.e. an EOA ...
abhi3700's user avatar
  • 219
0 votes
1 answer
835 views

delegateCall in Solidity understanding case

pragma solidity ^0.8.10; /* HackMe is a contract that uses delegatecall to execute code. It it is not obvious that the owner of HackMe can be changed since there is no function inside HackMe to do so....
ege126's user avatar
  • 3
0 votes
2 answers
65 views

Wrong address rertun when I call ownerof with delegatecall

I am trying to call the function "ownerof" of a contract but it return me something like that : ...
user97483's user avatar
1 vote
0 answers
223 views

How to manually generate calldata

Here's my code snippet: function getCalldata(string calldata _func, string calldata _param1, uint256 _param2) public pure returns (bytes memory) { return abi.encodeWithSignature(_func, _param1,...
ATRUES's user avatar
  • 31
0 votes
0 answers
265 views

How does DELEGATECALL behave when calling other contracts?

I am trying to make a Parent-Contract which has a function which spends ERC-20 Tokens. I want to call this function from different Child-Contracts (which are deployed independently) using Delegatecall....
RPanic's user avatar
  • 35
0 votes
0 answers
46 views

Does delegatecall() use only the calling function?

Let me explain with the code: contract A { function f() public { [...] g(); } function g() private { [...] } } contract B { A a; function delegateA() public { (bool success, ) = address(...
slimad's user avatar
  • 1
2 votes
1 answer
41 views

Am I locked to one solc version for upgradeable smart contracts?

I want to use delegatecall to make my contracts upgradeable. Is it true that variable layout may break if I change the solc version and therefore I should use the same Solidity version for all future ...
porton's user avatar
  • 1,854
1 vote
0 answers
94 views

How dangerous is this: number of contracts contain a function like "approveandcall" which lets anyone call any contract (some thoughts?)

The most common implementation is as follows: function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(...
Robert Ggg's user avatar
12 votes
2 answers
2k views

Pros and Cons of smart contract upgradable patterns

There have been quite many arguments around how to achieve smart contract updates like Upgradeable smart contracts. I feel Proxycontract with Delegate-call is currently the most famous one. But aside ...
kohshiba's user avatar
  • 467
3 votes
0 answers
705 views

Anything like a static delegatecall from a view function?

let's say there are two contracts A and B, where A calls methods in B. I understand that A can modify and read storage in B with B.call() and B.staticcall(), ie. A can execute B's methods in the ...
hellopeach's user avatar
0 votes
2 answers
967 views

How to use Role-Based Access Control via Proxy?

I have a PermissionsManager contract that uses OpenZeppelin's Role-Based Access Control (RBAC) template as a base. Currently function modifiers in my app call PermissionsManager directly to check for ...
Mike's user avatar
  • 113
2 votes
1 answer
237 views

How does a contract know which library to query or know the library address?

How does a contract know which library to query? For Example in the code below (The code is from solidity docs: https://solidity.readthedocs.io/en/v0.4.24/contracts.html?highlight=library#libraries ...
YulePale's user avatar
  • 1,853
3 votes
2 answers
2k views

Double delegate call doesn't work

To create an upgradeable contract I have to use multiple proxies. The contract applies to Proxy A, then Proxy A applies to Proxy B. But delegatecall doesn't work in this case. The simplified code of ...
Mikky Snowman's user avatar
1 vote
1 answer
1k views

Solidity - selfdestruct

I'm just wondering what would happen if I don't put a selfdestrut() method in my smart contract. As I read from the Solidity documentation (Self-destruct): Even if a contract’s code does not ...
Louisio95's user avatar
  • 101
2 votes
2 answers
3k views

Warning: The use of low level "call" should be avoided whenever possible

I am writing my own smart contract and I want to call a function from a contract that has already been deployed. The fragment of my code: function myFunc(address _contractAddress, address _user, uint ...
EtherPaul's user avatar
  • 256
3 votes
2 answers
2k views

Is it possible to copy the internal storage of a smart contract to a new contract?

Assume that I want to implement my own version of a suicide contract function with extended functionality. More specifically, I want to copy the internal storage state of the contract to a new ...
Mike B's user avatar
  • 131
5 votes
2 answers
1k views

How to make function call through relay / entry level contract

I am trying to create an entry level contract (one that is the entry point): Relay.sol pragma solidity ^0.4.8; contract Relay { address public currentVersion; address public owner; ...
SwapnilKumbhar's user avatar
3 votes
2 answers
350 views

Get return value of Contract using CALL method

I have a contract which has such field: mapping (address => int) balance; It will hold the balance of account for coins. Let's assume that I've deployed this contract, but I want to disable ...
user8297's user avatar
2 votes
0 answers
471 views

Simpler examples of contract versioning [closed]

I want to have an upgradable contract so that I can have additional functionalities in upgraded contract. I know there are numerous of questions around it, most of them pointing towards Upgradable ...
Prashant Prabhakar Singh's user avatar
1 vote
1 answer
137 views

Help me debug this delegatecall Serpent demo I'm working on?

https://gist.github.com/ChrisCalderon/2818e6ba0214c25962b16c02e761dc26 Whenever I try to run it, I get "Transaction Failed". What it's supposed to do is call it's own functions double and half using ...
Broseph's user avatar
  • 695