Unverified Commit 96d6103e by Nicolás Venturo Committed by GitHub

Made some inherit-only contracts internal. (#1433)

* Made some inherit-only contracts internal.

* Added OwnableMock.
parent df3c1137
...@@ -10,7 +10,7 @@ contract CapperRole { ...@@ -10,7 +10,7 @@ contract CapperRole {
Roles.Role private cappers; Roles.Role private cappers;
constructor() public { constructor() internal {
_addCapper(msg.sender); _addCapper(msg.sender);
} }
......
...@@ -10,7 +10,7 @@ contract MinterRole { ...@@ -10,7 +10,7 @@ contract MinterRole {
Roles.Role private minters; Roles.Role private minters;
constructor() public { constructor() internal {
_addMinter(msg.sender); _addMinter(msg.sender);
} }
......
...@@ -10,7 +10,7 @@ contract PauserRole { ...@@ -10,7 +10,7 @@ contract PauserRole {
Roles.Role private pausers; Roles.Role private pausers;
constructor() public { constructor() internal {
_addPauser(msg.sender); _addPauser(msg.sender);
} }
......
...@@ -10,7 +10,7 @@ contract SignerRole { ...@@ -10,7 +10,7 @@ contract SignerRole {
Roles.Role private signers; Roles.Role private signers;
constructor() public { constructor() internal {
_addSigner(msg.sender); _addSigner(msg.sender);
} }
......
...@@ -36,6 +36,8 @@ contract SignatureBouncer is SignerRole { ...@@ -36,6 +36,8 @@ contract SignatureBouncer is SignerRole {
// Signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes // Signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes
uint256 private constant _SIGNATURE_SIZE = 96; uint256 private constant _SIGNATURE_SIZE = 96;
constructor() internal {}
/** /**
* @dev requires that a valid signature of a signer was provided * @dev requires that a valid signature of a signer was provided
*/ */
......
...@@ -25,7 +25,7 @@ contract ERC165 is IERC165 { ...@@ -25,7 +25,7 @@ contract ERC165 is IERC165 {
* implement ERC165 itself * implement ERC165 itself
*/ */
constructor() constructor()
public internal
{ {
_registerInterface(_InterfaceId_ERC165); _registerInterface(_InterfaceId_ERC165);
} }
......
...@@ -12,7 +12,7 @@ contract Pausable is PauserRole { ...@@ -12,7 +12,7 @@ contract Pausable is PauserRole {
bool private _paused; bool private _paused;
constructor() public { constructor() internal {
_paused = false; _paused = false;
} }
......
pragma solidity ^0.4.24;
import "../ownership/Ownable.sol";
contract OwnableMock is Ownable {
}
...@@ -17,7 +17,7 @@ contract Ownable { ...@@ -17,7 +17,7 @@ contract Ownable {
* @dev The Ownable constructor sets the original `owner` of the contract to the sender * @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. * account.
*/ */
constructor() public { constructor() internal {
_owner = msg.sender; _owner = msg.sender;
emit OwnershipTransferred(address(0), _owner); emit OwnershipTransferred(address(0), _owner);
} }
......
...@@ -10,7 +10,7 @@ contract Secondary { ...@@ -10,7 +10,7 @@ contract Secondary {
/** /**
* @dev Sets the primary account to the one that is creating the Secondary contract. * @dev Sets the primary account to the one that is creating the Secondary contract.
*/ */
constructor() public { constructor() internal {
_primary = msg.sender; _primary = msg.sender;
} }
......
...@@ -10,7 +10,7 @@ import "./escrow/Escrow.sol"; ...@@ -10,7 +10,7 @@ import "./escrow/Escrow.sol";
contract PullPayment { contract PullPayment {
Escrow private _escrow; Escrow private _escrow;
constructor() public { constructor() internal {
_escrow = new Escrow(); _escrow = new Escrow();
} }
......
...@@ -11,7 +11,7 @@ contract ReentrancyGuard { ...@@ -11,7 +11,7 @@ contract ReentrancyGuard {
/// @dev counter to allow mutex lock with only one SSTORE operation /// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter; uint256 private _guardCounter;
constructor() public { constructor() internal {
// The counter starts at one to prevent changing it from zero to a non-zero // The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation. // value, which is a more expensive operation.
_guardCounter = 1; _guardCounter = 1;
......
const { shouldBehaveLikeOwnable } = require('./Ownable.behavior'); const { shouldBehaveLikeOwnable } = require('./Ownable.behavior');
const Ownable = artifacts.require('Ownable'); const Ownable = artifacts.require('OwnableMock');
contract('Ownable', function ([_, owner, ...otherAccounts]) { contract('Ownable', function ([_, owner, ...otherAccounts]) {
beforeEach(async function () { beforeEach(async function () {
......
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