Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: solium errors - indentation only
  • Loading branch information
shrugs committed Jan 15, 2018
commit b2e2d9ab1cd96967a49de514a67dfd628c8b7cf5
102 changes: 51 additions & 51 deletions contracts/mocks/RBACMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@ 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);
}
}
16 changes: 8 additions & 8 deletions contracts/ownership/Contactable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import "./Ownable.sol";
*/
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;
}
}
Loading