Commit 3fbad9ec by Francisco Giordano

add missing initializers

parent 6e901efa
pragma solidity ^0.5.0; pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
/* /*
* @dev Provides information about the current execution context, including the * @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available * sender of the transaction and its data. While these are generally available
...@@ -10,7 +12,7 @@ pragma solidity ^0.5.0; ...@@ -10,7 +12,7 @@ pragma solidity ^0.5.0;
* *
* This contract is only required for intermediate, library-like contracts. * This contract is only required for intermediate, library-like contracts.
*/ */
contract Context { contract Context is Initializable {
// Empty internal constructor, to prevent people from mistakenly deploying // Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance. // an instance of this contract, which should be used via inheritance.
constructor () internal { } constructor () internal { }
......
...@@ -33,7 +33,8 @@ contract GSNRecipientERC20Fee is Initializable, GSNRecipient { ...@@ -33,7 +33,8 @@ contract GSNRecipientERC20Fee is Initializable, GSNRecipient {
*/ */
function initialize(string memory name, string memory symbol) public initializer { function initialize(string memory name, string memory symbol) public initializer {
if (_token == __unstable__ERC20PrimaryAdmin(0)) { if (_token == __unstable__ERC20PrimaryAdmin(0)) {
_token = new __unstable__ERC20PrimaryAdmin(name, symbol, 18, address(this)); _token = new __unstable__ERC20PrimaryAdmin();
_token.initialize(name, symbol, 18, address(this));
} }
GSNRecipient.initialize(); GSNRecipient.initialize();
...@@ -116,10 +117,10 @@ contract GSNRecipientERC20Fee is Initializable, GSNRecipient { ...@@ -116,10 +117,10 @@ contract GSNRecipientERC20Fee is Initializable, GSNRecipient {
* outside of this context. * outside of this context.
*/ */
// solhint-disable-next-line contract-name-camelcase // solhint-disable-next-line contract-name-camelcase
contract __unstable__ERC20PrimaryAdmin is ERC20, ERC20Detailed, Secondary { contract __unstable__ERC20PrimaryAdmin is Initializable, ERC20, ERC20Detailed, Secondary {
uint256 private constant UINT256_MAX = 2**256 - 1; uint256 private constant UINT256_MAX = 2**256 - 1;
constructor(string memory name, string memory symbol, uint8 decimals, address sender) public { function initialize(string memory name, string memory symbol, uint8 decimals, address sender) public initializer {
ERC20Detailed.initialize(name, symbol, decimals); ERC20Detailed.initialize(name, symbol, decimals);
Secondary.initialize(sender); Secondary.initialize(sender);
} }
......
pragma solidity ^0.5.0; pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./IERC1820Implementer.sol"; import "./IERC1820Implementer.sol";
/** /**
...@@ -10,7 +12,7 @@ import "./IERC1820Implementer.sol"; ...@@ -10,7 +12,7 @@ import "./IERC1820Implementer.sol";
* {IERC1820Registry-setInterfaceImplementer} should then be called for the * {IERC1820Registry-setInterfaceImplementer} should then be called for the
* registration to be complete. * registration to be complete.
*/ */
contract ERC1820Implementer is IERC1820Implementer { contract ERC1820Implementer is Initializable, IERC1820Implementer {
bytes32 constant private ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC")); bytes32 constant private ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces; mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment