commit
d060d29912
@ -0,0 +1 @@ |
||||
*.sol linguist-language=Solidity |
@ -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
@ -0,0 +1,25 @@ |
||||
var MathMock = artifacts.require('./mocks/MathMock.sol'); |
||||
|
||||
contract('Math', function (accounts) { |
||||
let math; |
||||
|
||||
before(async function () { |
||||
math = await MathMock.new(); |
||||
}); |
||||
|
||||
it('returns max correctly', async function () { |
||||
let a = 5678; |
||||
let b = 1234; |
||||
await math.max64(a, b); |
||||
let result = await math.result(); |
||||
assert.equal(result, a); |
||||
}); |
||||
|
||||
it('returns min correctly', async function () { |
||||
let a = 5678; |
||||
let b = 1234; |
||||
await math.min64(a, b); |
||||
let result = await math.result(); |
||||
assert.equal(result, b); |
||||
}); |
||||
}); |
@ -1,8 +1,8 @@ |
||||
import ether from './helpers/ether'; |
||||
import { advanceBlock } from './helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from './helpers/increaseTime'; |
||||
import latestTime from './helpers/latestTime'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import ether from '../helpers/ether'; |
||||
import { advanceBlock } from '../helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from '../helpers/increaseTime'; |
||||
import latestTime from '../helpers/latestTime'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,8 +1,8 @@ |
||||
import ether from './helpers/ether'; |
||||
import { advanceBlock } from './helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from './helpers/increaseTime'; |
||||
import latestTime from './helpers/latestTime'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import ether from '../helpers/ether'; |
||||
import { advanceBlock } from '../helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from '../helpers/increaseTime'; |
||||
import latestTime from '../helpers/latestTime'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,7 +1,7 @@ |
||||
import { advanceBlock } from './helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from './helpers/increaseTime'; |
||||
import latestTime from './helpers/latestTime'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import { advanceBlock } from '../helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from '../helpers/increaseTime'; |
||||
import latestTime from '../helpers/latestTime'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,5 +1,5 @@ |
||||
import ether from './helpers/ether'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import ether from '../helpers/ether'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,8 +1,8 @@ |
||||
import ether from './helpers/ether'; |
||||
import { advanceBlock } from './helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from './helpers/increaseTime'; |
||||
import latestTime from './helpers/latestTime'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import ether from '../helpers/ether'; |
||||
import { advanceBlock } from '../helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from '../helpers/increaseTime'; |
||||
import latestTime from '../helpers/latestTime'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,8 +1,8 @@ |
||||
import ether from './helpers/ether'; |
||||
import { advanceBlock } from './helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from './helpers/increaseTime'; |
||||
import latestTime from './helpers/latestTime'; |
||||
import EVMRevert from './helpers/EVMRevert'; |
||||
import ether from '../helpers/ether'; |
||||
import { advanceBlock } from '../helpers/advanceToBlock'; |
||||
import { increaseTimeTo, duration } from '../helpers/increaseTime'; |
||||
import latestTime from '../helpers/latestTime'; |
||||
import EVMRevert from '../helpers/EVMRevert'; |
||||
|
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,6 +1,6 @@ |
||||
|
||||
var Destructible = artifacts.require('../contracts/lifecycle/Destructible.sol'); |
||||
require('./helpers/transactionMined.js'); |
||||
require('../helpers/transactionMined.js'); |
||||
|
||||
contract('Destructible', function (accounts) { |
||||
it('should send balance to owner after destruction', async function () { |
@ -1,5 +1,5 @@ |
||||
|
||||
import assertRevert from './helpers/assertRevert'; |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
const PausableMock = artifacts.require('mocks/PausableMock.sol'); |
||||
|
||||
contract('Pausable', function (accounts) { |
@ -1,7 +1,7 @@ |
||||
|
||||
var TokenDestructible = artifacts.require('../contracts/lifecycle/TokenDestructible.sol'); |
||||
var StandardTokenMock = artifacts.require('mocks/StandardTokenMock.sol'); |
||||
require('./helpers/transactionMined.js'); |
||||
require('../helpers/transactionMined.js'); |
||||
|
||||
contract('TokenDestructible', function (accounts) { |
||||
let destructible; |
@ -1,5 +1,5 @@ |
||||
import assertRevert from './helpers/assertRevert'; |
||||
const assertJump = require('./helpers/assertJump'); |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
const assertJump = require('../helpers/assertJump'); |
||||
var SafeMathMock = artifacts.require('mocks/SafeMathMock.sol'); |
||||
|
||||
contract('SafeMath', function (accounts) { |
@ -0,0 +1,17 @@ |
||||
pragma solidity ^0.4.18; |
||||
|
||||
|
||||
import "../../contracts/math/Math.sol"; |
||||
|
||||
|
||||
contract MathMock { |
||||
uint64 public result; |
||||
|
||||
function max64(uint64 a, uint64 b) public { |
||||
result = Math.max64(a, b); |
||||
} |
||||
|
||||
function min64(uint64 a, uint64 b) public { |
||||
result = Math.min64(a, b); |
||||
} |
||||
} |
@ -1,5 +1,5 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
|
||||
const CanReclaimToken = artifacts.require('../contracts/ownership/CanReclaimToken.sol'); |
||||
const BasicTokenMock = artifacts.require('mocks/BasicTokenMock.sol'); |
@ -1,5 +1,5 @@ |
||||
|
||||
import assertRevert from './helpers/assertRevert'; |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
|
||||
var Claimable = artifacts.require('../contracts/ownership/Claimable.sol'); |
||||
|
@ -1,5 +1,5 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
|
||||
const Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); |
||||
const HasNoContracts = artifacts.require( |
@ -1,6 +1,6 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import toPromise from './helpers/toPromise'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
import toPromise from '../helpers/toPromise'; |
||||
const HasNoEtherTest = artifacts.require('../mocks/HasNoEtherTest.sol'); |
||||
const ForceEther = artifacts.require('../mocks/ForceEther.sol'); |
||||
|
@ -1,5 +1,5 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
|
||||
const HasNoTokens = artifacts.require('../contracts/lifecycle/HasNoTokens.sol'); |
||||
const ERC23TokenMock = artifacts.require('mocks/ERC23TokenMock.sol'); |
@ -1,5 +1,5 @@ |
||||
|
||||
import assertRevert from './helpers/assertRevert'; |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
|
||||
var Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); |
||||
|
@ -1,4 +1,4 @@ |
||||
import assertRevert from './helpers/assertRevert'; |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
|
||||
var BasicTokenMock = artifacts.require('mocks/BasicTokenMock.sol'); |
||||
|
@ -1,5 +1,5 @@ |
||||
|
||||
const EVMRevert = require('./helpers/EVMRevert.js'); |
||||
const EVMRevert = require('../helpers/EVMRevert.js'); |
||||
const BurnableTokenMock = artifacts.require('mocks/BurnableTokenMock.sol'); |
||||
const BigNumber = web3.BigNumber; |
||||
|
@ -1,6 +1,6 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import ether from './helpers/ether'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
import ether from '../helpers/ether'; |
||||
|
||||
var CappedToken = artifacts.require('../contracts/Tokens/CappedToken.sol'); |
||||
|
@ -1,5 +1,5 @@ |
||||
|
||||
import expectThrow from './helpers/expectThrow'; |
||||
import expectThrow from '../helpers/expectThrow'; |
||||
var MintableToken = artifacts.require('../contracts/Tokens/MintableToken.sol'); |
||||
|
||||
contract('Mintable', function (accounts) { |
@ -1,6 +1,6 @@ |
||||
'user strict'; |
||||
|
||||
import assertRevert from './helpers/assertRevert'; |
||||
import assertRevert from '../helpers/assertRevert'; |
||||
var PausableTokenMock = artifacts.require('./mocks/PausableTokenMock.sol'); |
||||
|
||||
contract('PausableToken', function (accounts) { |
@ -1,4 +1,4 @@ |
||||
import EVMThrow from './helpers/EVMThrow'; |
||||
import EVMThrow from '../helpers/EVMThrow'; |
||||
|
||||
require('chai') |
||||
.use(require('chai-as-promised')) |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue