u
u
upgradable
Search…
Proxy with Inheritance

Task 5

  • Implement a basic Proxy contract which has the following code in its fallback function
1
assembly {
2
let ptr := mload(0x40)
3
calldatacopy(ptr, 0, calldatasize)
4
let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
5
let size := returndatasize
6
returndatacopy(ptr, 0, size)
7
8
switch result
9
case 0 { revert(ptr, size) }
10
default { return(ptr, size) }
11
}
12
13
*https://blog.zeppelinos.org/proxy-patterns/
Copied!
  • Add functions to Proxy for setting the delegated address and getting the delegated address
  • Implement the Score contract as before and use the Proxy contract with remix
  • Implement ScoreV2 and change the proxy address to point to that
Safe approach
Last modified 2yr ago
Copy link