Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. pragma solidity >=0.4.0 <0.7.0;
  2.  
  3. contract AddOne {
  4. uint public value;
  5.  
  6. function increment() public {
  7. value = value + 1;
  8. }
  9. }
  10.  
  11. contract AddTwo {
  12. uint public value;
  13.  
  14. function increment() public {
  15. value = value + 2;
  16. }
  17. }
  18.  
  19. contract Proxy {
  20. uint public result;
  21. address logicContract;
  22.  
  23. function upgrade(address _newLogicContract) public {
  24. logicContract = _newLogicContract;
  25. }
  26.  
  27. function () external {
  28. (bool success, ) = logicContract.delegatecall(msg.data);
  29. require(success);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement