Merge pull request #673 from Shrugs/feat/solium
Solium Integration, Linting Refactorpull/677/head^2
commit
ec2f7ba8d1
@ -1,22 +1,12 @@ |
||||
{ |
||||
"custom-rules-filename": null, |
||||
"extends": "solium:all", |
||||
"plugins": ["security"], |
||||
"rules": { |
||||
"imports-on-top": true, |
||||
"variable-declarations": true, |
||||
"array-declarations": true, |
||||
"operator-whitespace": true, |
||||
"lbrace": true, |
||||
"mixedcase": false, |
||||
"camelcase": true, |
||||
"uppercase": true, |
||||
"no-with": true, |
||||
"no-empty-blocks": true, |
||||
"no-unused-vars": true, |
||||
"double-quotes": true, |
||||
"blank-lines": true, |
||||
"indentation": true, |
||||
"whitespace": true, |
||||
"deprecated-suicide": true, |
||||
"pragma-on-top": true |
||||
"quotes": ["error", "double"], |
||||
"indentation": ["error", 2], |
||||
"arg-overflow": ["warning", 3], |
||||
"security/enforce-explicit-visibility": ["error"], |
||||
"security/no-block-members": ["warning"], |
||||
"security/no-inline-assembly": ["warning"] |
||||
} |
||||
} |
||||
|
@ -1,69 +1,69 @@ |
||||
pragma solidity ^0.4.8; |
||||
|
||||
import '../ownership/rbac/RBAC.sol'; |
||||
import "../ownership/rbac/RBAC.sol"; |
||||
|
||||
|
||||
contract RBACMock is RBAC { |
||||
|
||||
string constant ROLE_ADVISOR = "advisor"; |
||||
string constant ROLE_ADVISOR = "advisor"; |
||||
|
||||
modifier onlyAdminOrAdvisor() |
||||
{ |
||||
require( |
||||
hasRole(msg.sender, ROLE_ADMIN) || |
||||
hasRole(msg.sender, ROLE_ADVISOR) |
||||
); |
||||
_; |
||||
} |
||||
modifier onlyAdminOrAdvisor() |
||||
{ |
||||
require( |
||||
hasRole(msg.sender, ROLE_ADMIN) || |
||||
hasRole(msg.sender, ROLE_ADVISOR) |
||||
); |
||||
_; |
||||
} |
||||
|
||||
function RBACMock(address[] _advisors) |
||||
public |
||||
{ |
||||
addRole(msg.sender, ROLE_ADVISOR); |
||||
function RBACMock(address[] _advisors) |
||||
public |
||||
{ |
||||
addRole(msg.sender, ROLE_ADVISOR); |
||||
|
||||
for (uint256 i = 0; i < _advisors.length; i++) { |
||||
addRole(_advisors[i], ROLE_ADVISOR); |
||||
} |
||||
for (uint256 i = 0; i < _advisors.length; i++) { |
||||
addRole(_advisors[i], ROLE_ADVISOR); |
||||
} |
||||
} |
||||
|
||||
function onlyAdminsCanDoThis() |
||||
onlyAdmin |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
function onlyAdminsCanDoThis() |
||||
onlyAdmin |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
|
||||
function onlyAdvisorsCanDoThis() |
||||
onlyRole(ROLE_ADVISOR) |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
function onlyAdvisorsCanDoThis() |
||||
onlyRole(ROLE_ADVISOR) |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
|
||||
function eitherAdminOrAdvisorCanDoThis() |
||||
onlyAdminOrAdvisor |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
function eitherAdminOrAdvisorCanDoThis() |
||||
onlyAdminOrAdvisor |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
|
||||
function nobodyCanDoThis() |
||||
onlyRole("unknown") |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
function nobodyCanDoThis() |
||||
onlyRole("unknown") |
||||
view |
||||
external |
||||
{ |
||||
} |
||||
|
||||
// admins can remove advisor's role |
||||
function removeAdvisor(address _addr) |
||||
onlyAdmin |
||||
public |
||||
{ |
||||
// revert if the user isn't an advisor |
||||
// (perhaps you want to soft-fail here instead?) |
||||
checkRole(_addr, ROLE_ADVISOR); |
||||
// admins can remove advisor's role |
||||
function removeAdvisor(address _addr) |
||||
onlyAdmin |
||||
public |
||||
{ |
||||
// revert if the user isn't an advisor |
||||
// (perhaps you want to soft-fail here instead?) |
||||
checkRole(_addr, ROLE_ADVISOR); |
||||
|
||||
// remove the advisor's role |
||||
removeRole(_addr, ROLE_ADVISOR); |
||||
} |
||||
// remove the advisor's role |
||||
removeRole(_addr, ROLE_ADVISOR); |
||||
} |
||||
} |
||||
|
@ -1,21 +1,22 @@ |
||||
pragma solidity ^0.4.18; |
||||
|
||||
import './Ownable.sol'; |
||||
import "./Ownable.sol"; |
||||
|
||||
|
||||
/** |
||||
* @title Contactable token |
||||
* @dev Basic version of a contactable contract, allowing the owner to provide a string with their |
||||
* contact information. |
||||
*/ |
||||
contract Contactable is Ownable{ |
||||
contract Contactable is Ownable { |
||||
|
||||
string public contactInformation; |
||||
string public contactInformation; |
||||
|
||||
/** |
||||
* @dev Allows the owner to set a string with their contact information. |
||||
* @param info The contact information to attach to the contract. |
||||
*/ |
||||
function setContactInformation(string info) onlyOwner public { |
||||
contactInformation = info; |
||||
} |
||||
/** |
||||
* @dev Allows the owner to set a string with their contact information. |
||||
* @param info The contact information to attach to the contract. |
||||
*/ |
||||
function setContactInformation(string info) onlyOwner public { |
||||
contactInformation = info; |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue