diff --git a/.soliumignore b/.soliumignore new file mode 100644 index 0000000..119df09 --- /dev/null +++ b/.soliumignore @@ -0,0 +1,3 @@ +node_modules +examples/simple/node_modules +examples/complex/node_modules diff --git a/.soliumrc.json b/.soliumrc.json new file mode 100644 index 0000000..38eb8a1 --- /dev/null +++ b/.soliumrc.json @@ -0,0 +1,25 @@ +{ + "extends": "solium:all", + "plugins": ["security"], + "rules": { + "imports-on-top": "warning", + "variable-declarations": "warning", + "array-declarations": "warning", + "operator-whitespace": "warning", + "lbrace": "warning", + "function-whitespace": "warning", + "semicolon-whitespace": "warning", + "comma-whitespace": "warning", + "conditionals-whitespace": "warning", + "quotes": ["warning", "double"], + "no-empty-blocks": "off", + "indentation": ["warning", 2], + "max-len": ["warning", 120], + "arg-overflow": ["warning", 3], + "no-constant": "error", + "security/enforce-explicit-visibility": "error", + "security/no-block-members": "warning", + "security/no-inline-assembly": "warning", + "arg-overflow": ["off"] + } +} diff --git a/.travis.yml b/.travis.yml index 6b38cfb..9ccaadf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,31 @@ language: node_js node_js: - '8' + cache: directories: - node_modules -env: - - - - SOLIDITY_COVERAGE=true -matrix: + +jobs: + # XXX fast_finish doesn't work with stages yet. See + # https://github.com/travis-ci/travis-ci/issues/8425 + # --elopio - 20180531 fast_finish: true allow_failures: - env: SOLIDITY_COVERAGE=true -script: - - npm test + include: + # Run the unit test suite three times in parallel. + # The first one gets results faster and is the only one required to pass. + # The second one generates the coverage report. + - stage: unit + script: npm test + - stage: unit + script: npm run test + env: SOLIDITY_COVERAGE=true + # solidity and javascript style tests. + - stage: static + script: npm run lint:sol + notifications: slack: rooms: diff --git a/contracts/application/AppDirectory.sol b/contracts/application/AppDirectory.sol index 5048013..61b1096 100644 --- a/contracts/application/AppDirectory.sol +++ b/contracts/application/AppDirectory.sol @@ -4,6 +4,7 @@ import "./versioning/ImplementationProvider.sol"; import "./versioning/ImplementationDirectory.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; + /** * @title AppDirectory * @dev Implementation directory with a standard library as a fallback provider. @@ -40,8 +41,10 @@ contract AppDirectory is ImplementationDirectory { */ function getImplementation(string contractName) public view returns (address) { address implementation = super.getImplementation(contractName); - if(implementation != address(0)) return implementation; - if(stdlib != address(0)) return stdlib.getImplementation(contractName); + if (implementation != address(0)) + return implementation; + if (stdlib != address(0)) + return stdlib.getImplementation(contractName); return address(0); } diff --git a/contracts/application/BaseApp.sol b/contracts/application/BaseApp.sol index 7c1c62f..1cf593a 100644 --- a/contracts/application/BaseApp.sol +++ b/contracts/application/BaseApp.sol @@ -5,6 +5,7 @@ import "../upgradeability/AdminUpgradeabilityProxy.sol"; import "../upgradeability/UpgradeabilityProxyFactory.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; + /** * @title BaseApp * @dev Abstract base contract for upgradeable applications. @@ -23,12 +24,6 @@ contract BaseApp is Ownable { factory = _factory; } - /** - * @dev Abstract function to return the implementation provider. - * @return The implementation provider. - */ - function getProvider() internal view returns (ImplementationProvider); - /** * @dev Returns the implementation address for a given contract name, provided by the `ImplementationProvider`. * @param contractName Name of the contract. @@ -58,7 +53,7 @@ contract BaseApp is Ownable { * https://solidity.readthedocs.io/en/develop/abi-spec.html#function-selector-and-argument-encoding. * @return Address of the new proxy. */ - function createAndCall(string contractName, bytes data) payable public returns (AdminUpgradeabilityProxy) { + function createAndCall(string contractName, bytes data) payable public returns (AdminUpgradeabilityProxy) { address implementation = getImplementation(contractName); return factory.createProxyAndCall.value(msg.value)(this, implementation, data); } @@ -105,4 +100,11 @@ contract BaseApp is Ownable { function getProxyAdmin(AdminUpgradeabilityProxy proxy) public view returns (address) { return proxy.admin(); } + + /** + * @dev Abstract function to return the implementation provider. + * @return The implementation provider. + */ + function getProvider() internal view returns (ImplementationProvider); + } diff --git a/contracts/application/PackagedApp.sol b/contracts/application/PackagedApp.sol index dc4b0ee..b03fcaa 100644 --- a/contracts/application/PackagedApp.sol +++ b/contracts/application/PackagedApp.sol @@ -4,6 +4,7 @@ import "./BaseApp.sol"; import "./versioning/Package.sol"; import "../upgradeability/UpgradeabilityProxyFactory.sol"; + /** * @title PackagedApp * @dev App for an upgradeable project that can use different versions. diff --git a/contracts/application/UnversionedApp.sol b/contracts/application/UnversionedApp.sol index 5c77de3..fd1056b 100644 --- a/contracts/application/UnversionedApp.sol +++ b/contracts/application/UnversionedApp.sol @@ -4,6 +4,7 @@ import "./BaseApp.sol"; import "./versioning/ImplementationProvider.sol"; import "../upgradeability/UpgradeabilityProxyFactory.sol"; + /** * @title UnversionedApp * @dev Basic implementation of an upgradable app with no versioning. @@ -26,14 +27,6 @@ contract UnversionedApp is BaseApp { setProvider(_provider); } - /** - * @dev Returns the provider used by the app. - * @return The provider. - */ - function getProvider() internal view returns (ImplementationProvider) { - return provider; - } - /** * @dev Sets a new implementation provider. * @param _provider New implementation provider @@ -42,4 +35,13 @@ contract UnversionedApp is BaseApp { require(address(_provider) != address(0)); provider = _provider; } + + /** + * @dev Returns the provider used by the app. + * @return The provider. + */ + function getProvider() internal view returns (ImplementationProvider) { + return provider; + } + } diff --git a/contracts/application/versioning/FreezableImplementationDirectory.sol b/contracts/application/versioning/FreezableImplementationDirectory.sol index 09fe32e..5886c22 100644 --- a/contracts/application/versioning/FreezableImplementationDirectory.sol +++ b/contracts/application/versioning/FreezableImplementationDirectory.sol @@ -2,11 +2,12 @@ pragma solidity ^0.4.21; import "./ImplementationDirectory.sol"; + /** * @title FreezableImplementationDirectory * @dev Implementation directory which can be made irreversibly immutable by the owner. */ - contract FreezableImplementationDirectory is ImplementationDirectory { +contract FreezableImplementationDirectory is ImplementationDirectory { /// @dev Mutability state of the directory. bool public frozen; diff --git a/contracts/application/versioning/ImplementationDirectory.sol b/contracts/application/versioning/ImplementationDirectory.sol index 81e941d..5c92ca5 100644 --- a/contracts/application/versioning/ImplementationDirectory.sol +++ b/contracts/application/versioning/ImplementationDirectory.sol @@ -2,7 +2,8 @@ pragma solidity ^0.4.21; import "./ImplementationProvider.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; -import 'openzeppelin-solidity/contracts/AddressUtils.sol'; +import "openzeppelin-solidity/contracts/AddressUtils.sol"; + /** * @title ImplementationDirectory diff --git a/contracts/application/versioning/Package.sol b/contracts/application/versioning/Package.sol index a9541bf..38db8ca 100644 --- a/contracts/application/versioning/Package.sol +++ b/contracts/application/versioning/Package.sol @@ -3,6 +3,7 @@ pragma solidity ^0.4.21; import "./ImplementationProvider.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; + /** * @title Package * @dev Collection of contracts grouped into versions. diff --git a/contracts/application/versioning/Release.sol b/contracts/application/versioning/Release.sol index b54239b..fc0465c 100644 --- a/contracts/application/versioning/Release.sol +++ b/contracts/application/versioning/Release.sol @@ -2,6 +2,7 @@ pragma solidity ^0.4.21; import "./FreezableImplementationDirectory.sol"; + /** * @title Release * @dev This contract represents a particular standard library version from a developer. diff --git a/contracts/lifecycle/Migrations.sol b/contracts/lifecycle/Migrations.sol index 27598ad..218efd6 100644 --- a/contracts/lifecycle/Migrations.sol +++ b/contracts/lifecycle/Migrations.sol @@ -1,11 +1,13 @@ pragma solidity ^0.4.21; + contract Migrations { address public owner; - uint public last_completed_migration; + uint public lastCompletedMigration; modifier restricted() { - if (msg.sender == owner) _; + if (msg.sender == owner) + _; } function Migrations() public { @@ -13,11 +15,11 @@ contract Migrations { } function setCompleted(uint completed) public restricted { - last_completed_migration = completed; + lastCompletedMigration = completed; } - function upgrade(address new_address) public restricted { - Migrations upgraded = Migrations(new_address); - upgraded.setCompleted(last_completed_migration); + function upgrade(address newAddress) public restricted { + Migrations upgraded = Migrations(newAddress); + upgraded.setCompleted(lastCompletedMigration); } } diff --git a/contracts/mocks/DummyImplementation.sol b/contracts/mocks/DummyImplementation.sol index c546dbd..0c713d4 100644 --- a/contracts/mocks/DummyImplementation.sol +++ b/contracts/mocks/DummyImplementation.sol @@ -1,9 +1,11 @@ pragma solidity ^0.4.21; + contract Impl { - function version() public pure returns (string); + function version() public pure returns (string); } + contract DummyImplementation { uint256 public value; string public text; @@ -28,6 +30,7 @@ contract DummyImplementation { } } + contract DummyImplementationV2 is DummyImplementation { function migrate(uint256 newVal) public { value = newVal; diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index b750752..e5f8ce9 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -2,6 +2,7 @@ pragma solidity ^0.4.21; import "../migrations/Initializable.sol"; + /** * @title InitializableMock * @dev This contract is a mock to test initializable functionality diff --git a/contracts/mocks/MigratableMock.sol b/contracts/mocks/MigratableMock.sol index a15c86c..7fdbda8 100644 --- a/contracts/mocks/MigratableMock.sol +++ b/contracts/mocks/MigratableMock.sol @@ -2,6 +2,7 @@ pragma solidity ^0.4.21; import "../migrations/Migratable.sol"; + /** * @title MigratableMock * @dev This contract is a mock to test upgradeability functionality diff --git a/contracts/mocks/MultipleInheritanceMigratableMocks.sol b/contracts/mocks/MultipleInheritanceMigratableMocks.sol index cc101ec..bffb2bd 100644 --- a/contracts/mocks/MultipleInheritanceMigratableMocks.sol +++ b/contracts/mocks/MultipleInheritanceMigratableMocks.sol @@ -1,10 +1,10 @@ pragma solidity ^0.4.21; -import '../migrations/Migratable.sol'; +import "../migrations/Migratable.sol"; // Sample contracts showing upgradeability and migrations with multiple inheritance // Child contract inherits from Father and Mother contracts, and Father extends from Gramps -// +// // Gramps // | // Mother Father @@ -12,6 +12,7 @@ import '../migrations/Migratable.sol'; // -- Child -- // + /** * Sample base migratable contract that defines a field mother */ @@ -23,6 +24,7 @@ contract SampleMotherV1 is Migratable { } } + /** * V2 for base mother contract */ @@ -32,6 +34,7 @@ contract SampleMotherV2 is SampleMotherV1 { } } + /** * Sample base migratable contract that defines a field gramps */ @@ -43,6 +46,7 @@ contract SampleGrampsV1 is Migratable { } } + /** * V2 for base gramps contract */ @@ -52,6 +56,7 @@ contract SampleGrampsV2 is SampleGrampsV1 { } } + /** * Sample base migratable contract that defines a field father and extends from gramps */ @@ -64,6 +69,7 @@ contract SampleFatherV1 is SampleGrampsV1 { } } + /** * V2 for base father contract, which extends from grampsV2 */ @@ -74,19 +80,23 @@ contract SampleFatherV2 is SampleFatherV1, SampleGrampsV2 { } } + /** * ChildV1 extends from motherV1, fatherV1 (grampsV1) */ contract SampleChildV1 is Migratable, SampleMotherV1, SampleFatherV1 { uint256 public child; - function initialize(uint256 _mother, uint256 _gramps, uint256 _father, uint256 _child) isInitializer("Child", "migration_1") public { + function initialize(uint256 _mother, uint256 _gramps, uint256 _father, uint256 _child) + isInitializer("Child", "migration_1") public + { SampleMotherV1.initialize(_mother); SampleFatherV1.initialize(_gramps, _father); child = _child; } } + /** * ChildV2 extends from motherV1, fatherV1 (grampsV1) */ @@ -96,31 +106,38 @@ contract SampleChildV2 is SampleChildV1 { } } + /** * ChildV3 extends from motherV2, fatherV1 (grampsV1) */ -contract SampleChildV3 is SampleChildV2, SampleMotherV2 { +contract SampleChildV3 is SampleChildV2, SampleMotherV2 { function migrate(uint256 _mother, uint256 _child) isMigration("Child", "migration_2", "migration_3") public { SampleMotherV2.migrate(_mother); child = _child; } } + /** * ChildV4 extends from motherV2, fatherV2 (grampsV2) */ -contract SampleChildV4 is SampleChildV3, SampleFatherV2 { - function migrate(uint256 _gramps, uint256 _father, uint256 _child) isMigration("Child", "migration_3", "migration_4") public { +contract SampleChildV4 is SampleChildV3, SampleFatherV2 { + function migrate(uint256 _gramps, uint256 _father, uint256 _child) + isMigration("Child", "migration_3", "migration_4") public + { SampleFatherV2.migrate(_gramps, _father); child = _child; } } + /** * ChildV5 extends from motherV2, fatherV2 (grampsV2), has the same signature in migrate than V1, and allows to be initialized directly as well or from V3 */ contract SampleChildV5 is SampleChildV4 { - function initialize(uint256 _mother, uint256 _gramps, uint256 _father, uint256 _child) isInitializer("Child", "migration_5") public { + function initialize(uint256 _mother, uint256 _gramps, uint256 _father, uint256 _child) + isInitializer("Child", "migration_5") public + { SampleMotherV1.initialize(_mother); SampleMotherV2.migrate(_mother); SampleFatherV1.initialize(_gramps, _father); @@ -128,7 +145,9 @@ contract SampleChildV5 is SampleChildV4 { child = _child; } - function migrateFromV3(uint256 _gramps, uint256 _father, uint256 _child) isMigration("Child", "migration_3", "migration_5") public { + function migrateFromV3(uint256 _gramps, uint256 _father, uint256 _child) + isMigration("Child", "migration_3", "migration_5") public + { SampleChildV4.migrate(_gramps, _father, _child); } diff --git a/contracts/mocks/SingleInheritanceMigratableMocks.sol b/contracts/mocks/SingleInheritanceMigratableMocks.sol index 480ff16..ef9e95a 100644 --- a/contracts/mocks/SingleInheritanceMigratableMocks.sol +++ b/contracts/mocks/SingleInheritanceMigratableMocks.sol @@ -1,6 +1,7 @@ pragma solidity ^0.4.21; -import '../migrations/Migratable.sol'; +import "../migrations/Migratable.sol"; + /** * @title MigratableMockV1 @@ -14,6 +15,7 @@ contract MigratableMockV1 is Migratable { } } + /** * @title MigratableMockV2 * @dev This contract is a mock to test migratable functionality with params @@ -21,12 +23,15 @@ contract MigratableMockV1 is Migratable { contract MigratableMockV2 is MigratableMockV1 { uint256 public y; - function migrate(uint256 value, uint256 anotherValue) isMigration("MigratableMock", "migration_1", "migration_2") public payable { + function migrate(uint256 value, uint256 anotherValue) + isMigration("MigratableMock", "migration_1", "migration_2") public payable + { x = value; y = anotherValue; } } + /** * @title MigratableMockV3 * @dev This contract is a mock to test migratable functionality without params diff --git a/contracts/upgradeability/AdminUpgradeabilityProxy.sol b/contracts/upgradeability/AdminUpgradeabilityProxy.sol index 0309bff..6926780 100644 --- a/contracts/upgradeability/AdminUpgradeabilityProxy.sol +++ b/contracts/upgradeability/AdminUpgradeabilityProxy.sol @@ -1,6 +1,7 @@ pragma solidity ^0.4.21; -import './UpgradeabilityProxy.sol'; +import "./UpgradeabilityProxy.sol"; + /** * @title AdminUpgradeabilityProxy @@ -95,6 +96,7 @@ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { */ function upgradeToAndCall(address implementation, bytes data) payable external ifAdmin { _upgradeTo(implementation); + // solium-disable-next-line security/no-call-value require(address(this).call.value(msg.value)(data)); } @@ -103,6 +105,7 @@ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { */ function _admin() internal returns (address admin) { bytes32 slot = ADMIN_SLOT; + // solium-disable-next-line security/no-inline-assembly assembly { admin := sload(slot) } @@ -115,6 +118,7 @@ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; + // solium-disable-next-line security/no-inline-assembly assembly { sstore(slot, newAdmin) } diff --git a/contracts/upgradeability/Proxy.sol b/contracts/upgradeability/Proxy.sol index f30cb27..c546e1c 100644 --- a/contracts/upgradeability/Proxy.sol +++ b/contracts/upgradeability/Proxy.sol @@ -1,5 +1,6 @@ pragma solidity ^0.4.21; + /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper @@ -28,6 +29,7 @@ contract Proxy { * @param implementation Address to delegate. */ function _delegate(address implementation) internal { + // solium-disable-next-line security/no-inline-assembly assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the diff --git a/contracts/upgradeability/UpgradeabilityProxy.sol b/contracts/upgradeability/UpgradeabilityProxy.sol index a0bf94f..fdb0ae6 100644 --- a/contracts/upgradeability/UpgradeabilityProxy.sol +++ b/contracts/upgradeability/UpgradeabilityProxy.sol @@ -1,7 +1,8 @@ pragma solidity ^0.4.21; -import './Proxy.sol'; -import 'openzeppelin-solidity/contracts/AddressUtils.sol'; +import "./Proxy.sol"; +import "openzeppelin-solidity/contracts/AddressUtils.sol"; + /** * @title UpgradeabilityProxy @@ -39,6 +40,7 @@ contract UpgradeabilityProxy is Proxy { */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; + // solium-disable-next-line security/no-inline-assembly assembly { impl := sload(slot) } @@ -62,6 +64,7 @@ contract UpgradeabilityProxy is Proxy { bytes32 slot = IMPLEMENTATION_SLOT; + // solium-disable-next-line security/no-inline-assembly assembly { sstore(slot, newImplementation) } diff --git a/contracts/upgradeability/UpgradeabilityProxyFactory.sol b/contracts/upgradeability/UpgradeabilityProxyFactory.sol index 25b10b9..7e609dc 100644 --- a/contracts/upgradeability/UpgradeabilityProxyFactory.sol +++ b/contracts/upgradeability/UpgradeabilityProxyFactory.sol @@ -1,6 +1,7 @@ pragma solidity ^0.4.21; -import './AdminUpgradeabilityProxy.sol'; +import "./AdminUpgradeabilityProxy.sol"; + /** * @title UpgradeabilityProxyFactory @@ -36,9 +37,12 @@ contract UpgradeabilityProxyFactory { * https://solidity.readthedocs.io/en/develop/abi-spec.html#function-selector-and-argument-encoding. * @return Address of the new proxy. */ - function createProxyAndCall(address owner, address implementation, bytes data) public payable returns (AdminUpgradeabilityProxy) { + function createProxyAndCall(address owner, address implementation, bytes data) + public payable returns (AdminUpgradeabilityProxy) + { AdminUpgradeabilityProxy proxy = _createProxy(implementation); proxy.changeAdmin(owner); + // solium-disable-next-line security/no-call-value require(address(proxy).call.value(msg.value)(data)); return proxy; } diff --git a/examples/complex/contracts/DonationsV1.sol b/examples/complex/contracts/DonationsV1.sol index 09be107..dde703d 100644 --- a/examples/complex/contracts/DonationsV1.sol +++ b/examples/complex/contracts/DonationsV1.sol @@ -3,6 +3,7 @@ pragma solidity ^0.4.21; import "openzeppelin-zos/contracts/ownership/Ownable.sol"; import "openzeppelin-zos/contracts/math/SafeMath.sol"; + contract DonationsV1 is Ownable { using SafeMath for uint256; @@ -20,7 +21,7 @@ contract DonationsV1 is Ownable { return donorBalances[_donor]; } - function withdraw(address _wallet) onlyOwner { + function withdraw(address _wallet) public onlyOwner { // Withdraw all donated funds. _wallet.transfer(this.balance); diff --git a/examples/complex/contracts/DonationsV2.sol b/examples/complex/contracts/DonationsV2.sol index 0e78a4f..3140c23 100644 --- a/examples/complex/contracts/DonationsV2.sol +++ b/examples/complex/contracts/DonationsV2.sol @@ -3,6 +3,7 @@ pragma solidity ^0.4.21; import "./DonationsV1.sol"; import "openzeppelin-zos/contracts/token/ERC721/MintableERC721Token.sol"; + contract DonationsV2 is DonationsV1 { using SafeMath for uint256; diff --git a/examples/simple/contracts/Migrations.sol b/examples/simple/contracts/Migrations.sol index 7e7fe8d..92df077 100644 --- a/examples/simple/contracts/Migrations.sol +++ b/examples/simple/contracts/Migrations.sol @@ -1,23 +1,25 @@ pragma solidity ^0.4.4; + contract Migrations { address public owner; - uint public last_completed_migration; + uint public lastCompletedMigration; modifier restricted() { - if (msg.sender == owner) _; + if (msg.sender == owner) + _; } - function Migrations() { + function Migrations() public { owner = msg.sender; } - function setCompleted(uint completed) restricted { - last_completed_migration = completed; + function setCompleted(uint completed) public restricted { + lastCompletedMigration = completed; } - function upgrade(address new_address) restricted { - Migrations upgraded = Migrations(new_address); - upgraded.setCompleted(last_completed_migration); + function upgrade(address newAddress) public restricted { + Migrations upgraded = Migrations(newAddress); + upgraded.setCompleted(lastCompletedMigration); } } diff --git a/examples/simple/contracts/MyContract_v0.sol b/examples/simple/contracts/MyContractV0.sol similarity index 81% rename from examples/simple/contracts/MyContract_v0.sol rename to examples/simple/contracts/MyContractV0.sol index 0f0e7a6..2339bb9 100644 --- a/examples/simple/contracts/MyContract_v0.sol +++ b/examples/simple/contracts/MyContractV0.sol @@ -4,12 +4,11 @@ pragma solidity ^0.4.21; import "zos-lib/contracts/migrations/Initializable.sol"; -contract MyContract_v0 is Initializable { +contract MyContractV0 is Initializable { uint256 public value; - + function initialize(uint256 _value) isInitializer public { value = _value; } } - diff --git a/examples/simple/contracts/MyContract_v1.sol b/examples/simple/contracts/MyContractV1.sol similarity index 85% rename from examples/simple/contracts/MyContract_v1.sol rename to examples/simple/contracts/MyContractV1.sol index d28e24f..cfbc7c6 100644 --- a/examples/simple/contracts/MyContract_v1.sol +++ b/examples/simple/contracts/MyContractV1.sol @@ -4,16 +4,14 @@ pragma solidity ^0.4.21; import "zos-lib/contracts/migrations/Initializable.sol"; -contract MyContract_v1 is Initializable { +contract MyContractV1 is Initializable { uint256 public x; - + function initialize(uint256 _value) isInitializer public { value = _value; } - function add(uint256 _value) public { value = value + _value; } } - diff --git a/examples/simple/index.js b/examples/simple/index.js index 0e1dee4..78893c5 100644 --- a/examples/simple/index.js +++ b/examples/simple/index.js @@ -1,29 +1,29 @@ 'use strict'; const { Contracts } = require('zos-lib') -const MyContract_v0 = Contracts.getFromLocal('MyContract_v0'); -const MyContract_v1 = Contracts.getFromLocal('MyContract_v1'); +const MyContractV0 = Contracts.getFromLocal('MyContractV0'); +const MyContractV1 = Contracts.getFromLocal('MyContractV1'); const AdminUpgradeabilityProxy = Contracts.getFromNodeModules('zos-lib', 'AdminUpgradeabilityProxy'); module.exports = async function() { console.log('Deploying MyContract v0...'); - const myContract_v0 = await MyContract_v0.new(); + const myContractV0 = await MyContractV0.new(); console.log('Deploying a proxy pointing to v0...'); - const proxy = await AdminUpgradeabilityProxy.new(myContract_v0.address); + const proxy = await AdminUpgradeabilityProxy.new(myContractV0.address); console.log('Calling initialize(42) on proxy...'); - let myContract = await MyContract_v0.at(proxy.address); + let myContract = await MyContractV0.at(proxy.address); const value = 42; await myContract.initialize(value); console.log('Proxy\'s storage value: ' + (await myContract.value()).toString()); console.log('Deploying MyContract v1...'); - const myContract_v1 = await MyContract_v1.new(); + const myContractV1 = await MyContractV1.new(); console.log('Upgrading proxy to v1...'); - await proxy.upgradeTo(myContract_v1.address); - myContract = await MyContract_v1.at(proxy.address); + await proxy.upgradeTo(myContractV1.address); + myContract = await MyContractV1.at(proxy.address); await myContract.add(1); console.log('Proxy\'s storage new value: ' + (await myContract.value()).toString()); diff --git a/package-lock.json b/package-lock.json index a36da13..b7b6bc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,7 +92,6 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, - "optional": true, "requires": { "micromatch": "^2.1.5", "normalize-path": "^2.0.0" @@ -201,8 +200,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true, - "optional": true + "dev": true }, "asynckit": { "version": "0.4.0", @@ -1313,8 +1311,7 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true, - "optional": true + "dev": true }, "binaryextensions": { "version": "2.1.1", @@ -1580,7 +1577,6 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, - "optional": true, "requires": { "anymatch": "^1.3.0", "async-each": "^1.0.0", @@ -1780,10 +1776,13 @@ } }, "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": ">= 1.0.0" + } }, "commondir": { "version": "1.0.1", @@ -2069,9 +2068,9 @@ } }, "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, "dir-glob": { @@ -3703,6 +3702,12 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, "grouped-queue": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/grouped-queue/-/grouped-queue-0.3.3.tgz", @@ -4112,7 +4117,6 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, - "optional": true, "requires": { "binary-extensions": "^1.0.0" } @@ -4480,6 +4484,12 @@ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=" }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -4561,6 +4571,12 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", @@ -4923,12 +4939,80 @@ "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", "dev": true }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", "dev": true }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "^3.0.0", + "lodash._basecreate": "^3.0.0", + "lodash._isiterateecall": "^3.0.0" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + } + }, "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", @@ -5275,66 +5359,33 @@ } }, "mocha": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", - "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", "dev": true, "requires": { "browser-stdout": "1.3.0", - "commander": "2.11.0", - "debug": "3.1.0", - "diff": "3.3.1", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.3", + "glob": "7.1.1", + "growl": "1.9.2", "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", "mkdirp": "0.5.1", - "supports-color": "4.4.0" + "supports-color": "3.1.2" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", "dev": true, "requires": { "ms": "2.0.0" } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "growl": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true, - "requires": { - "has-flag": "^2.0.0" - } } } }, @@ -5343,784 +5394,125 @@ "dev": true, "requires": { "truffle": "^4.1.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", + "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==" + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, - "camelcase": { - "version": "3.0.0", - "bundled": true, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "cliui": { - "version": "3.2.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true - }, - "commander": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-readlink": "1.0.1" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, + } + } + }, + "neo-async": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", + "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", + "dev": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, + "node-dir": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.8.tgz", + "integrity": "sha1-VfuN62mQcHB/tn+RpGDwRIKUx30=", + "dev": true + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "dev": true, + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", "dev": true }, - "debug": { - "version": "2.6.8", - "bundled": true, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", "dev": true, "requires": { - "ms": "2.0.0" + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" } }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "diff": { - "version": "3.2.0", - "bundled": true, - "dev": true - }, - "error-ex": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "fs-extra": { - "version": "0.30.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.1", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "graceful-readlink": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "growl": { - "version": "1.9.2", - "bundled": true, - "dev": true - }, - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "he": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "hosted-git-info": { - "version": "2.6.0", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "1.1.1" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-utf8": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "json3": { - "version": "3.3.2", - "bundled": true, - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - } - }, - "klaw": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - } - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - } - }, - "lodash._baseassign": { - "version": "3.2.0", - "bundled": true, - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "bundled": true, - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "bundled": true, - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "bundled": true, - "dev": true - }, - "lodash.assign": { - "version": "4.2.0", - "bundled": true, - "dev": true - }, - "lodash.create": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "requires": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "bundled": true, - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "bundled": true, - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "memorystream": { - "version": "0.3.1", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "3.5.3", - "bundled": true, - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.8", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "he": "1.1.1", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "normalize-package-data": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "original-require": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "lcid": "1.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "1.3.1" - } - }, - "path-exists": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "pify": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "pinkie": "2.0.4" - } - }, - "read-pkg": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-from-string": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.1" - } - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "solc": { - "version": "0.4.23", - "bundled": true, - "dev": true, - "requires": { - "fs-extra": "0.30.0", - "memorystream": "0.3.1", - "require-from-string": "1.2.1", - "semver": "5.5.0", - "yargs": "4.8.1" - } - }, - "spdx-correct": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "supports-color": { - "version": "3.1.2", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - }, - "truffle": { - "version": "4.1.8", - "bundled": true, - "dev": true, - "requires": { - "mocha": "3.5.3", - "original-require": "1.0.1", - "solc": "0.4.23" - } - }, - "validate-npm-package-license": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "window-size": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "y18n": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "4.8.1", - "bundled": true, - "dev": true, - "requires": { - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.2", - "lodash.assign": "4.2.0", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "window-size": "0.2.0", - "y18n": "3.2.1", - "yargs-parser": "2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "3.0.0", - "lodash.assign": "4.2.0" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "nan": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", - "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==" - }, - "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "neo-async": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", - "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", - "dev": true - }, - "nice-try": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", - "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", - "dev": true - }, - "node-dir": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.8.tgz", - "integrity": "sha1-VfuN62mQcHB/tn+RpGDwRIKUx30=", - "dev": true - }, - "nomnom": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", - "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", - "dev": true, - "requires": { - "chalk": "~0.4.0", - "underscore": "~1.6.0" - }, - "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", - "dev": true - }, - "chalk": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", - "dev": true, - "requires": { - "ansi-styles": "~1.0.0", - "has-color": "~0.1.0", - "strip-ansi": "~0.1.0" - } - }, - "strip-ansi": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", - "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", "dev": true } } @@ -6813,7 +6205,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "dev": true, - "optional": true, "requires": { "graceful-fs": "^4.1.2", "minimatch": "^3.0.2", @@ -7190,8 +6581,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true, - "optional": true + "dev": true }, "set-value": { "version": "2.0.0", @@ -7419,6 +6809,12 @@ "hoek": "4.x.x" } }, + "sol-digger": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/sol-digger/-/sol-digger-0.0.2.tgz", + "integrity": "sha1-QGxKnTHiaef4jrHC6hATGOXgkCU=", + "dev": true + }, "sol-explore": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.2.tgz", @@ -7426,9 +6822,9 @@ "dev": true }, "solc": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz", - "integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==", + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.21.tgz", + "integrity": "sha512-8lJmimVjOG9AJOQRWS2ph4rSctPMsPGZ4H360HLs5iI+euUlt7iAvUxSLeFZZzwk0kas4Qta7HmlMXNU3yYwhw==", "dev": true, "requires": { "fs-extra": "^0.30.0", @@ -7551,6 +6947,229 @@ } } }, + "solium": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/solium/-/solium-1.1.7.tgz", + "integrity": "sha512-yYbalsrzJCU+QJ0HZvxAT4IQIqI1e6KPW2vop0NaHwdijqhQC9fJkVioCrL18NbO2Z8rdcnx8Y0JpvYJWrIjRg==", + "dev": true, + "requires": { + "ajv": "^5.2.2", + "chokidar": "^1.6.0", + "colors": "^1.1.2", + "commander": "^2.9.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.14.2", + "sol-digger": "0.0.2", + "sol-explore": "1.6.1", + "solium-plugin-security": "0.1.1", + "solparse": "2.2.5", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + } + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "sol-explore": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.1.tgz", + "integrity": "sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs=", + "dev": true + }, + "solparse": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/solparse/-/solparse-2.2.5.tgz", + "integrity": "sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA==", + "dev": true, + "requires": { + "mocha": "^4.0.1", + "pegjs": "^0.10.0", + "yargs": "^10.0.3" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", + "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.1.0" + } + }, + "yargs-parser": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "solium-plugin-security": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz", + "integrity": "sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ==", + "dev": true + }, "sort-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", @@ -7919,14 +7538,14 @@ "dev": true }, "truffle": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.11.tgz", - "integrity": "sha512-VNhc6jexZeM92sNJJr4U8ln3uJ/mJEQO/0y9ZLYc4pccyIskPtl+3r4mzymgGM/Mq5v6MpoQVD6NZgHUVKX+Dw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.5.tgz", + "integrity": "sha512-6sOVFQ0xNbb52MMWf0nHxv0FiXWPTV+OIbq1B0+I5F3sIS8JJ7pM1+o7chbs+oO/CLqbbC6ggXJqFWzIWaiaQg==", "dev": true, "requires": { - "mocha": "^4.1.0", + "mocha": "^3.4.2", "original-require": "^1.0.1", - "solc": "0.4.24" + "solc": "0.4.21" } }, "truffle-blockchain-utils": { @@ -7984,7 +7603,7 @@ "dependencies": { "bignumber.js": { "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", - "from": "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" + "from": "git+https://github.com/frozeman/bignumber.js-nolookahead.git" } } } @@ -8359,7 +7978,7 @@ "dependencies": { "bignumber.js": { "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + "from": "bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" } } }, diff --git a/package.json b/package.json index f10874b..e07826e 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "description": "ZeppelinOS library", "scripts": { "test": "NODE_ENV=test scripts/test.sh", + "lint:sol": "solium -d .", + "lint:sol:fix": "solium -d . --fix", "prepack": "truffle compile && babel src --out-dir lib" }, "repository": { @@ -47,6 +49,7 @@ "coveralls": "^3.0.0", "mock-dependency": "file:test/mocks/mock-dependency", "solidity-coverage": "^0.4.15", + "solium": "^1.1.7", "tmp": "^0.0.33", "truffle": "^4.1.5" }, diff --git a/test/mocks/mock-dependency/contracts/Greeter.sol b/test/mocks/mock-dependency/contracts/Greeter.sol index 7db6c8c..1187ad2 100644 --- a/test/mocks/mock-dependency/contracts/Greeter.sol +++ b/test/mocks/mock-dependency/contracts/Greeter.sol @@ -1,5 +1,6 @@ pragma solidity ^0.4.21; + contract Greeter { event Greeting(string greeting);