Skip to content

Commit

Permalink
Updated code style to 4 space indentation and 120 characters per line. (
Browse files Browse the repository at this point in the history
#1508)

* Updated code style to 4 spaces and 120 max characters per line.

* Update contracts/token/ERC721/ERC721Pausable.sol

Co-Authored-By: nventuro <nicolas.venturo@gmail.com>

* Update contracts/token/ERC721/IERC721.sol

Co-Authored-By: nventuro <nicolas.venturo@gmail.com>
  • Loading branch information
nventuro committed Nov 22, 2018
1 parent 2813384 commit 5471fc8
Show file tree
Hide file tree
Showing 109 changed files with 3,014 additions and 3,726 deletions.
5 changes: 3 additions & 2 deletions .soliumrc.json
Expand Up @@ -2,12 +2,13 @@
"extends": "solium:all",
"plugins": ["security"],
"rules": {
"arg-overflow": "off",
"blank-lines": "off",
"error-reason": "off",
"indentation": ["error", 2],
"indentation": ["error", 4],
"lbrace": "off",
"linebreak-style": ["error", "unix"],
"max-len": ["error", 79],
"max-len": ["error", 120],
"no-constant": ["error"],
"no-empty-blocks": "off",
"quotes": ["error", "double"],
Expand Down
58 changes: 27 additions & 31 deletions contracts/access/Roles.sol
Expand Up @@ -5,40 +5,36 @@ pragma solidity ^0.4.24;
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
struct Role {
mapping (address => bool) bearer;
}

/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));

role.bearer[account] = true;
}
role.bearer[account] = true;
}

/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));

role.bearer[account] = false;
}
role.bearer[account] = false;
}

/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0));
return role.bearer[account];
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
56 changes: 28 additions & 28 deletions contracts/access/roles/CapperRole.sol
Expand Up @@ -3,41 +3,41 @@ pragma solidity ^0.4.24;
import "../Roles.sol";

contract CapperRole {
using Roles for Roles.Role;
using Roles for Roles.Role;

event CapperAdded(address indexed account);
event CapperRemoved(address indexed account);
event CapperAdded(address indexed account);
event CapperRemoved(address indexed account);

Roles.Role private _cappers;
Roles.Role private _cappers;

constructor() internal {
_addCapper(msg.sender);
}
constructor () internal {
_addCapper(msg.sender);
}

modifier onlyCapper() {
require(isCapper(msg.sender));
_;
}
modifier onlyCapper() {
require(isCapper(msg.sender));
_;
}

function isCapper(address account) public view returns (bool) {
return _cappers.has(account);
}
function isCapper(address account) public view returns (bool) {
return _cappers.has(account);
}

function addCapper(address account) public onlyCapper {
_addCapper(account);
}
function addCapper(address account) public onlyCapper {
_addCapper(account);
}

function renounceCapper() public {
_removeCapper(msg.sender);
}
function renounceCapper() public {
_removeCapper(msg.sender);
}

function _addCapper(address account) internal {
_cappers.add(account);
emit CapperAdded(account);
}
function _addCapper(address account) internal {
_cappers.add(account);
emit CapperAdded(account);
}

function _removeCapper(address account) internal {
_cappers.remove(account);
emit CapperRemoved(account);
}
function _removeCapper(address account) internal {
_cappers.remove(account);
emit CapperRemoved(account);
}
}
56 changes: 28 additions & 28 deletions contracts/access/roles/MinterRole.sol
Expand Up @@ -3,41 +3,41 @@ pragma solidity ^0.4.24;
import "../Roles.sol";

contract MinterRole {
using Roles for Roles.Role;
using Roles for Roles.Role;

event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);

Roles.Role private _minters;
Roles.Role private _minters;

constructor() internal {
_addMinter(msg.sender);
}
constructor () internal {
_addMinter(msg.sender);
}

modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}

function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}

function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}

function renounceMinter() public {
_removeMinter(msg.sender);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}

function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}

function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
56 changes: 28 additions & 28 deletions contracts/access/roles/PauserRole.sol
Expand Up @@ -3,41 +3,41 @@ pragma solidity ^0.4.24;
import "../Roles.sol";

contract PauserRole {
using Roles for Roles.Role;
using Roles for Roles.Role;

event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);

Roles.Role private _pausers;
Roles.Role private _pausers;

constructor() internal {
_addPauser(msg.sender);
}
constructor () internal {
_addPauser(msg.sender);
}

modifier onlyPauser() {
require(isPauser(msg.sender));
_;
}
modifier onlyPauser() {
require(isPauser(msg.sender));
_;
}

function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}

function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}

function renouncePauser() public {
_removePauser(msg.sender);
}
function renouncePauser() public {
_removePauser(msg.sender);
}

function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}

function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
56 changes: 28 additions & 28 deletions contracts/access/roles/SignerRole.sol
Expand Up @@ -3,41 +3,41 @@ pragma solidity ^0.4.24;
import "../Roles.sol";

contract SignerRole {
using Roles for Roles.Role;
using Roles for Roles.Role;

event SignerAdded(address indexed account);
event SignerRemoved(address indexed account);
event SignerAdded(address indexed account);
event SignerRemoved(address indexed account);

Roles.Role private _signers;
Roles.Role private _signers;

constructor() internal {
_addSigner(msg.sender);
}
constructor () internal {
_addSigner(msg.sender);
}

modifier onlySigner() {
require(isSigner(msg.sender));
_;
}
modifier onlySigner() {
require(isSigner(msg.sender));
_;
}

function isSigner(address account) public view returns (bool) {
return _signers.has(account);
}
function isSigner(address account) public view returns (bool) {
return _signers.has(account);
}

function addSigner(address account) public onlySigner {
_addSigner(account);
}
function addSigner(address account) public onlySigner {
_addSigner(account);
}

function renounceSigner() public {
_removeSigner(msg.sender);
}
function renounceSigner() public {
_removeSigner(msg.sender);
}

function _addSigner(address account) internal {
_signers.add(account);
emit SignerAdded(account);
}
function _addSigner(address account) internal {
_signers.add(account);
emit SignerAdded(account);
}

function _removeSigner(address account) internal {
_signers.remove(account);
emit SignerRemoved(account);
}
function _removeSigner(address account) internal {
_signers.remove(account);
emit SignerRemoved(account);
}
}

0 comments on commit 5471fc8

Please sign in to comment.