-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTokenProxy.sol
37 lines (32 loc) · 1.06 KB
/
TokenProxy.sol
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
26
27
28
29
30
31
32
33
34
35
36
37
pragma solidity >=0.4.21 <0.6.0;
import "./TokenStorage.sol";
import "./UpgradeabilityProxy.sol";
import './Ownable.sol';
/**
* @author Arvind Kalra (github.com/arvindkalra) and Pranav Singhal (github.com/pranav-singhal)
* @title TokenProxy
* @notice A proxy contract that serves the latest implementation of TokenProxy.
*/
contract TokenProxy is UpgradeabilityProxy, Ownable {
TokenStorage private dataStore;
constructor(address _implementation, address storageAddress)
UpgradeabilityProxy(_implementation)
public {
_owner = msg.sender;
dataStore = TokenStorage(storageAddress);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) public onlyOwner {
_upgradeTo(newImplementation);
}
/**
* @return The address of the implementation.
*/
function implementation() public view returns (address) {
return _implementation();
}
}