Skip to content

Commit

Permalink
CI will fail if a Controlled contract is not Extractable
Browse files Browse the repository at this point in the history
  • Loading branch information
nuevoalex committed Jan 8, 2018
1 parent 4ba798f commit f5d6878
Show file tree
Hide file tree
Showing 6 changed files with 293 additions and 70 deletions.
7 changes: 6 additions & 1 deletion source/contracts/reporting/FeeToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import 'reporting/IFeeToken.sol';
import 'reporting/IFeeWindow.sol';
import 'libraries/DelegationTarget.sol';
import 'libraries/token/VariableSupplyToken.sol';
import 'libraries/Extractable.sol';


contract FeeToken is DelegationTarget, VariableSupplyToken, IFeeToken {
contract FeeToken is DelegationTarget, Extractable, VariableSupplyToken, IFeeToken {
IFeeWindow private feeWindow;

function initialize(IFeeWindow _feeWindow) public beforeInitialized returns (bool) {
Expand Down Expand Up @@ -45,4 +46,8 @@ contract FeeToken is DelegationTarget, VariableSupplyToken, IFeeToken {
controller.getAugur().logFeeTokenBurned(feeWindow.getUniverse(), _target, _amount);
return true;
}

function getProtectedTokens() internal returns (address[] memory) {
return new address[](0);
}
}
11 changes: 10 additions & 1 deletion source/contracts/reporting/Mailbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import 'libraries/token/ERC20Basic.sol';
import 'libraries/Initializable.sol';
import 'reporting/IMailbox.sol';
import 'trading/ICash.sol';
import 'libraries/Extractable.sol';


contract Mailbox is DelegationTarget, Ownable, Initializable, IMailbox {
contract Mailbox is DelegationTarget, Extractable, Ownable, Initializable, IMailbox {
function initialize(address _owner) public onlyInGoodTimes beforeInitialized returns (bool) {
endInitialization();
owner = _owner;
Expand Down Expand Up @@ -39,4 +40,12 @@ contract Mailbox is DelegationTarget, Ownable, Initializable, IMailbox {
require(_token.transfer(owner, _balance));
return true;
}

function getProtectedTokens() internal returns (address[] memory) {
address[] memory _protectedTokens = new address[](2);
// address(1) is the sentinel value for Ether extraction
_protectedTokens[0] = address(1);
_protectedTokens[1] = ICash(controller.lookup("Cash"));
return _protectedTokens;
}
}
Loading

0 comments on commit f5d6878

Please sign in to comment.