Skip to content

Commit

Permalink
Move all dependencies to lib directory and make interface contracts i…
Browse files Browse the repository at this point in the history
…nterface types (#193)

* Move all dependencies to new lib directory that is skipped from coverage metrics

* Make interface contracts interface types

* Update solidity-coverage to 0.3.8
  • Loading branch information
izqui authored and sohkai committed Jan 16, 2018
1 parent 391142a commit c09d0e5
Show file tree
Hide file tree
Showing 28 changed files with 1,527 additions and 1,711 deletions.
5 changes: 4 additions & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const files = require('glob').sync('contracts/lib/**/*.sol').map(n => n.replace('contracts/', ''))

module.exports = {
norpc: true,
compileCommand: '../node_modules/.bin/truffle compile',
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage',
skipFiles: ['zeppelin/math/Math.sol', 'zeppelin/math/SafeMath.sol', 'misc/Migrations.sol', 'ens/*ENS.sol', 'ens/PublicResolver.sol'],
skipFiles: ['common/IForwarder.sol', 'kernel/IKernel.sol'].concat(files),
copyNodeModules: true,
}
4 changes: 1 addition & 3 deletions .soliumignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
contracts/zeppelin
contracts/factories/BaseFactory.sol
contracts/kernel/IKernel.sol
contracts/lib
2 changes: 1 addition & 1 deletion contracts/apm/APMRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity 0.4.18;

import "../kernel/Kernel.sol";
import "../ens/AbstractENS.sol";
import "../lib/ens/AbstractENS.sol";
import "../ens/ENSSubdomainRegistrar.sol";
import "../apps/AppProxyFactory.sol";
import "../apps/AragonApp.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/EtherToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity 0.4.18;

import "./erc677/ERC677Token.sol";
import "../lib/erc677/ERC677Token.sol";


contract EtherToken is ERC677Token {
Expand Down
5 changes: 2 additions & 3 deletions contracts/common/IForwarder.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
pragma solidity ^0.4.18;


contract IForwarder {
function isForwarder() public pure returns (bool) { return true; }

interface IForwarder {
function isForwarder() public pure returns (bool);
function canForward(address _sender, bytes _evmCallScript) public view returns (bool);
function forward(bytes _evmCallScript) public;
}
4 changes: 2 additions & 2 deletions contracts/ens/ENSSubdomainRegistrar.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity 0.4.18;

import "./AbstractENS.sol";
import "./PublicResolver.sol";
import "../lib/ens/AbstractENS.sol";
import "../lib/ens/PublicResolver.sol";
import "./ENSConstants.sol";

import "../apps/AragonApp.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/factory/ENSFactory.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pragma solidity 0.4.18;

import "../ens/ENS.sol";
import "../lib/ens/ENS.sol";
import "../lib/ens/PublicResolver.sol";
import "../ens/ENSSubdomainRegistrar.sol";
import "../ens/PublicResolver.sol";


contract ENSFactory is ENSConstants {
Expand Down
2 changes: 1 addition & 1 deletion contracts/kernel/IKernel.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.4.18;


contract IKernel {
interface IKernel {
event SetPermission(address indexed entity, address indexed app, bytes32 indexed role, bool allowed);
event ChangePermissionManager(address indexed app, bytes32 indexed role, address indexed manager);
event UpgradeKernel(address indexed newKernel);
Expand Down
1 change: 0 additions & 1 deletion contracts/kernel/Kernel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity 0.4.18;
import "./IKernel.sol";
import "./KernelStorage.sol";
import "../common/Initializable.sol";
import "../zeppelin/math/SafeMath.sol";


contract Kernel is IKernel, KernelStorage, Initializable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pragma solidity ^0.4.15;

/* solium-disable */

contract AbstractENS {
interface AbstractENS {
function owner(bytes32 _node) constant returns (address);
function resolver(bytes32 _node) constant returns (address);
function ttl(bytes32 _node) constant returns (uint64);
Expand Down
1 change: 0 additions & 1 deletion contracts/ens/ENS.sol → contracts/lib/ens/ENS.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pragma solidity ^0.4.0;

/* solium-disable */

import './AbstractENS.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pragma solidity ^0.4.0;

/* solium-disable */

import './AbstractENS.sol';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pragma solidity 0.4.18;

/* solium-disable */

contract ERC677Receiver {
function tokenFallback(address from, uint256 amount, bytes data) external returns (bool success);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
pragma solidity 0.4.18;

/* solium-disable */

import "./ERC677Receiver.sol";
import "../../zeppelin/token/StandardToken.sol";
import "../zeppelin/token/StandardToken.sol";

contract ERC677Token is StandardToken {
function transferAndCall(address receiver, uint amount, bytes data) public returns (bool success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.4.18;
/// @dev The token controller contract must implement these functions


contract TokenController {
interface ITokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pragma solidity ^0.4.6;

/* solium-disable */

/*
Copyright 2016, Jordi Baylina
Expand All @@ -27,7 +25,7 @@ pragma solidity ^0.4.6;
/// affecting the original token
/// @dev It is ERC20 compliant, but still needs to under go further testing.

import "./TokenController.sol";
import "./ITokenController.sol";

contract Controlled {
/// @notice The address of the controller is the only address that can call
Expand Down Expand Up @@ -204,7 +202,7 @@ contract MiniMeToken is Controlled {
// Alerts the token controller of the transfer
if (isContract(controller)) {
// Adding the ` == true` makes the linter shut up so...
require(TokenController(controller).onTransfer(_from, _to, _amount) == true);
require(ITokenController(controller).onTransfer(_from, _to, _amount) == true);
}
// First update the balance array with the new value for the address
// sending the tokens
Expand Down Expand Up @@ -243,7 +241,7 @@ contract MiniMeToken is Controlled {
// Alerts the token controller of the approve function call
if (isContract(controller)) {
// Adding the ` == true` makes the linter shut up so...
require(TokenController(controller).onApprove(msg.sender, _spender, _amount) == true);
require(ITokenController(controller).onApprove(msg.sender, _spender, _amount) == true);
}

allowed[msg.sender][_spender] = _amount;
Expand Down Expand Up @@ -498,7 +496,7 @@ contract MiniMeToken is Controlled {
function () payable public {
require(isContract(controller));
// Adding the ` == true` makes the linter shut up so...
require(TokenController(controller).proxyPayment.value(msg.value)(msg.sender) == true);
require(ITokenController(controller).proxyPayment.value(msg.value)(msg.sender) == true);
}

//////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pragma solidity ^0.4.2;

/* solium-disable */


contract Migrations {
address public owner;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c09d0e5

Please sign in to comment.