Add Proxies from OpenZeppelin SDK (#2335)

This commit is contained in:
Francisco Giordano
2020-08-27 21:02:42 -03:00
committed by GitHub
parent 0b489f4d79
commit cb791a1b21
17 changed files with 1618 additions and 0 deletions

View File

@ -0,0 +1,66 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "../proxy/Initializable.sol";
contract Implementation1 is Initializable {
uint internal _value;
function initialize() public initializer {
}
function setValue(uint _number) public {
_value = _number;
}
}
contract Implementation2 is Initializable {
uint internal _value;
function initialize() public initializer {
}
function setValue(uint _number) public {
_value = _number;
}
function getValue() public view returns (uint) {
return _value;
}
}
contract Implementation3 is Initializable {
uint internal _value;
function initialize() public initializer {
}
function setValue(uint _number) public {
_value = _number;
}
function getValue(uint _number) public view returns (uint) {
return _value + _number;
}
}
contract Implementation4 is Initializable {
uint internal _value;
function initialize() public initializer {
}
function setValue(uint _number) public {
_value = _number;
}
function getValue() public view returns (uint) {
return _value;
}
// solhint-disable-next-line payable-fallback
fallback() external {
_value = 1;
}
}