Skip to content

Commit

Permalink
Do not make base token ownable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacques Dafflon committed Jul 13, 2018
1 parent b056150 commit dccafe7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
3 changes: 1 addition & 2 deletions contracts/ERC777BaseToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
pragma solidity 0.4.21;

import { ERC820Implementer } from "eip820/contracts/ERC820Implementer.sol";
import { Ownable } from "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol";
import { ERC777Token } from "./ERC777Token.sol";
import { ERC777TokensSender } from "./ERC777TokensSender.sol";
import { ERC777TokensRecipient } from "./ERC777TokensRecipient.sol";


contract ERC777BaseToken is Ownable, ERC777Token, ERC820Implementer {
contract ERC777BaseToken is ERC777Token, ERC820Implementer {
using SafeMath for uint256;

string internal mName;
Expand Down
14 changes: 0 additions & 14 deletions contracts/ERC777ERC20BaseToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ contract ERC777ERC20BaseToken is ERC20Token, ERC777BaseToken {
_;
}

/// @notice Disables the ERC20 interface. This function can only be called
/// by the owner.
function disableERC20() public onlyOwner {
mErc20compatible = false;
setInterfaceImplementation("ERC20Token", 0x0);
}

/// @notice Re enables the ERC20 interface. This function can only be called
/// by the owner.
function enableERC20() public onlyOwner {
mErc20compatible = true;
setInterfaceImplementation("ERC20Token", this);
}

/// @notice For Backwards compatibility
/// @return The decimls of the token. Forced to 18 in ERC777.
function decimals() public erc20 constant returns (uint8) { return uint8(18); }
Expand Down
17 changes: 16 additions & 1 deletion contracts/examples/ReferenceToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ pragma solidity 0.4.21;


import { ERC777ERC20BaseToken } from "../ERC777ERC20BaseToken.sol";
import { Ownable } from "openzeppelin-solidity/contracts/ownership/Ownable.sol";


contract ReferenceToken is ERC777ERC20BaseToken {
contract ReferenceToken is ERC777ERC20BaseToken, Ownable {

function ReferenceToken(
string _name,
Expand All @@ -25,6 +26,20 @@ contract ReferenceToken is ERC777ERC20BaseToken {
// insert custom constructor code
}

/// @notice Disables the ERC20 interface. This function can only be called
/// by the owner.
function disableERC20() public onlyOwner {
mErc20compatible = false;
setInterfaceImplementation("ERC20Token", 0x0);
}

/// @notice Re enables the ERC20 interface. This function can only be called
/// by the owner.
function enableERC20() public onlyOwner {
mErc20compatible = true;
setInterfaceImplementation("ERC20Token", this);
}

/* -- Mint And Burn Functions (not part of the ERC777 standard, only the Events/tokensReceived call are) -- */
//
/// @notice Generates `_amount` tokens to be assigned to `_tokenHolder`
Expand Down

0 comments on commit dccafe7

Please sign in to comment.