-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProxy.sol
More file actions
25 lines (19 loc) · 811 Bytes
/
Proxy.sol
File metadata and controls
25 lines (19 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pragma solidity 0.5.1;
import "./Storage.sol";
contract ProxyDog is Storage {
address public currentAddress;
constructor(address _currentAddress) public {
currentAddress = _currentAddress;
}
function upgrade(address _currentAddress) public {
currentAddress = _currentAddress;
}
function getNumberOfDogs() public returns (bool, bytes memory){
(bool res, bytes memory data) = currentAddress.delegatecall(abi.encodePacked(bytes4(keccak256("getNumberOfDogs()"))));
return (res, data);
}
function setNumberOfDogs(uint256 _number) public returns (bool, bytes memory){
(bool res, bytes memory data) = currentAddress.delegatecall(abi.encodePacked(bytes4(keccak256("setNumberOfDogs(uint256)")), _number));
return (res, data);
}
}