Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
3fbad9ec
Commit
3fbad9ec
authored
Nov 01, 2019
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing initializers
parent
6e901efa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
Context.sol
contracts/GSN/Context.sol
+3
-1
GSNRecipientERC20Fee.sol
contracts/GSN/GSNRecipientERC20Fee.sol
+4
-3
ERC1820Implementer.sol
contracts/introspection/ERC1820Implementer.sol
+3
-1
No files found.
contracts/GSN/Context.sol
View file @
3fbad9ec
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 { }
...
...
contracts/GSN/GSNRecipientERC20Fee.sol
View file @
3fbad9ec
...
@@ -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);
}
}
...
...
contracts/introspection/ERC1820Implementer.sol
View file @
3fbad9ec
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 I
nitializable, I
ERC1820Implementer {
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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment