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
26d48677
Commit
26d48677
authored
Sep 05, 2019
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make erc777 upgradeable
parent
93e8cdf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
ERC777Mock.sol
contracts/mocks/ERC777Mock.sol
+3
-1
ERC777.sol
contracts/token/ERC777/ERC777.sol
+8
-4
No files found.
contracts/mocks/ERC777Mock.sol
View file @
26d48677
...
...
@@ -9,7 +9,9 @@ contract ERC777Mock is ERC777 {
string memory name,
string memory symbol,
address[] memory defaultOperators
) public ERC777(name, symbol, defaultOperators) {
) public {
ERC777.initialize(name, symbol, defaultOperators);
_mint(msg.sender, initialHolder, initialBalance, "", "");
}
...
...
contracts/token/ERC777/ERC777.sol
View file @
26d48677
pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./IERC777.sol";
import "./IERC777Recipient.sol";
import "./IERC777Sender.sol";
...
...
@@ -23,11 +25,11 @@ import "../../introspection/IERC1820Registry.sol";
* are no special restrictions in the amount of tokens that created, moved, or
* destroyed. This makes integration with ERC20 applications seamless.
*/
contract ERC777 is IERC777, IERC20 {
contract ERC777 is I
nitializable, I
ERC777, IERC20 {
using SafeMath for uint256;
using Address for address;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
IERC1820Registry
constant
private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
mapping(address => uint256) private _balances;
...
...
@@ -63,11 +65,11 @@ contract ERC777 is IERC777, IERC20 {
/**
* @dev `defaultOperators` may be an empty array.
*/
constructor
(
function initialize
(
string memory name,
string memory symbol,
address[] memory defaultOperators
) public {
) public
initializer
{
_name = name;
_symbol = symbol;
...
...
@@ -471,4 +473,6 @@ contract ERC777 is IERC777, IERC20 {
require(!to.isContract(), "ERC777: token recipient contract has no implementer for ERC777TokensRecipient");
}
}
uint256[50] private ______gap;
}
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