Last active
January 12, 2018 17:13
-
-
Save renexdev/a6325c0d1ec90a7bbd81898e05dbaf50 to your computer and use it in GitHub Desktop.
Issue 60 work in progress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following text, describe the details of the upgrading process... (in three steps) | |
//Following https://github.com/aragon/aragon-core/pull/169/commits/802561bb58b1a14f46bc187474f290f16d0d7778 | |
#1 Updating packtages... | |
@apps/finance | |
file: package-lock.json | |
//1.1- truffle version and solc dep in (3.4.11->4.0.4) | |
"truffle": { | |
"version": "3.4.11", | |
//1.2 solc version in (0.4.15 -> 0.4.18) | |
"solc": { | |
"version": "0.4.18", | |
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.18.tgz", | |
"integrity": "sha512-Kq+O3PNF9Pfq7fB+lDYAuoqRdghLmZyfngsg0h1Hj38NKAeVHeGPOGeZasn5KqdPeCzbMFvaGyTySxzGv6aXCg==", | |
//1.3 Not upgraded -> "solc" dep in "(still 0.4.15) | |
"web3-provider-engine": { | |
file: package.json | |
//1.4- truffle version | |
"truffle": "^4.0.4", | |
@apps/group | |
file: package-lock.json | |
//1.5 idem 1.1 | |
//1.6 idem 1.2 | |
//1.7 idem 1.3 | |
file: package.json | |
//1.8 idem 1.4 | |
@apps/token-manager | |
file: package-lock.json | |
//1.9 idem 1.1 | |
//1.10 idem 1.2 | |
//1.11 idem 1.3 | |
file: package.json | |
//1.12 idem 1.4 | |
@apps/vault | |
file: package-lock.json | |
//1.13 idem 1.1 | |
//1.14 idem 1.2 | |
//1.15 idem 1.3 | |
file: package.json | |
//1.16 idem 1.4 | |
@apps/voting | |
file: package-lock.json | |
//1.17 idem 1.1 | |
//1.18 idem 1.2 | |
//1.19 idem 1.3 | |
file: package.json | |
//1.20 idem 1.4 | |
@future-apps/fundraising | |
file: package-lock.json | |
//1.21 idem 1.1 | |
//1.22 idem 1.2 | |
//1.23 idem 1.3 | |
file: package.json | |
//1.24 idem 1.4 | |
#2 - Update pragma solidity versions | |
@apps/finance | |
files: [ | |
Finance.sol | |
/test/TestFinance.sol: | |
/test/mocks/ExecutionTarget.sol: | |
/test/mocks/FinanceMock.sol: | |
] | |
//2.1 set new solidity version to pagma | |
@apps/group | |
files:[ | |
Group.sol | |
/test/mocks/ExecutionTarget.sol: | |
] | |
//2.2 idem 2.1 | |
@apps/token-manager | |
files:[ | |
TokenManager.sol | |
/test/TestTokenManager.sol: | |
/test/mocks/ExecutionTarget.sol: | |
] | |
//2.3 idem 2.1 | |
@apps/vault | |
file: [ | |
Vault.sol | |
/test/TestVault.sol | |
] | |
//2.4 idem 2.1 | |
@apps/voting | |
files: [ | |
Voting.sol | |
/test/TestVoting.sol: | |
/test/mocks/ExecutionTarget.sol: | |
] | |
//2.5 idem 2.1 | |
@future-apps/fundraising | |
files:[ | |
Fundraising.sol | |
/test/TestFundraising.sol: | |
/test/mocks/FundraisingMock.sol: | |
] | |
//2.6 idem 2.1 | |
-------------------------------------------------------------------------------------------------------------- | |
//Time to check deps new version config (runTestBeforeRefactor.dat) | |
> npm run bootstrap | |
ok | |
> npm run test | |
I'got the following pragma incompatibilities in aragon-core module, solved manually | |
@apps/group | |
lerna ERR! Compiling @aragon/core/contracts/apps/App.sol... | |
lerna ERR! Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/EVMCallScript.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/IForwarder.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/Initializable.sol... | |
lerna ERR! Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
@apps/vault | |
lerna ERR! Compiling @aragon/core/contracts/apps/App.sol... | |
lerna ERR! Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/TokenController.sol... | |
lerna ERR! Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
@apps/Voting | |
lerna ERR! Compiling @aragon/core/contracts/apps/App.sol... | |
lerna ERR! Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/EVMCallScript.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/IForwarder.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/Initializable.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/TokenController.sol... | |
lerna ERR! Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
@apps/token-manager | |
lerna ERR! Compiling @aragon/core/contracts/apps/App.sol... | |
lerna ERR! Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/EVMCallScript.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/IForwarder.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/Initializable.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/TokenController.sol... | |
lerna ERR! Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
lerna ERR! Compiling @aragon/core/contracts/misc/Migrations.sol... | |
@finance | |
lerna ERR! Compiling @aragon/core/contracts/apps/App.sol... | |
lerna ERR! Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/EtherToken.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/Initializable.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/TokenController.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/erc677/ERC677Receiver.sol... | |
lerna ERR! Compiling @aragon/core/contracts/common/erc677/ERC677Token.sol... | |
lerna ERR! Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
-------------------------------------------------------------------------------------------------------------- | |
#3 - Transition constant -> view or pure | |
Definitions: | |
def1-View Functions: | |
Functions can be declared view in which case they promise not to modify the state. | |
Getter methods are marked view. | |
The following statements are considered modifying the state: | |
Writing to state variables. | |
Emitting events. | |
Creating other contracts. | |
Using selfdestruct. | |
Sending Ether via calls. | |
Calling any function not marked view or pure. | |
Using low-level calls. | |
Using inline assembly that contains certain opcodes. | |
def2- Pure Functions | |
Functions can be declared pure in which case they promise not to read from or modify the state. | |
The following are considered reading from the state: | |
Reading from state variables. | |
Accessing this.balance or <address>.balance. | |
Accessing any of the members of block, tx, msg (with the exception of msg.sig and msg.data). | |
Calling any function not marked pure. | |
Using inline assembly that contains certain opcodes. | |
References: https://solidity.readthedocs.io/en/develop/contracts.html | |
@apps/token-manager | |
file: TokenManager.sol | |
//def1 | |
function canForward(address _sender, bytes _evmCallScript) public view returns (bool) { | |
function allHolders() public view returns (address[]) { return holders; } | |
//def1 - a view function that calls another view fn (->transferrableBalance) | |
function onTransfer(address _from, address _to, uint _amount) public view returns (bool) { | |
//def1 | |
function tokenGrantsCount(address _holder) public view returns (uint256) { | |
//def1 - a view function that calls another view fn (->transferrableBalance) | |
function spendableBalanceOf(address _holder) public view returns (uint256) { | |
//def1 | |
function transferrableBalance(address _holder, uint256 _time) public view returns (uint256) { | |
//def1 (I thought as def1 but lenrna complains koz SafeMath) | |
function calculateNonVestedTokens( | |
uint256 tokens, | |
uint256 time, | |
uint256 start, | |
uint256 cliff, | |
uint256 vesting) private pure returns (uint256) | |
//> lerna Output | |
/* | |
lerna ERR! ,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:276:17: TypeError: Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". | |
lerna ERR! SafeMath.sub( | |
lerna ERR! ^ | |
lerna ERR! Spanning multiple lines. | |
lerna ERR! ,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:274:13: TypeError: Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". | |
lerna ERR! SafeMath.mul( | |
lerna ERR! ^ | |
lerna ERR! Spanning multiple lines. | |
lerna ERR! ,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:281:13: TypeError: Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". | |
lerna ERR! SafeMath.sub( | |
lerna ERR! ^ | |
lerna ERR! Spanning multiple lines. | |
lerna ERR! ,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:273:32: TypeError: Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". | |
lerna ERR! uint256 vestedTokens = SafeMath.div( | |
lerna ERR! ^ | |
lerna ERR! Spanning multiple lines. | |
*/ | |
//def1 (I thought as def1 but lenrna complains koz TokenController) | |
function onApprove(address _owner, address _spender, uint _amount) public view returns (bool) { | |
//> lerna Output | |
/* | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:335:5: TypeError: Overriding function changes state mutability from "view" to "pure". | |
function onApprove(address _owner, address _spender, uint _amount) public pure returns (bool) { | |
^ | |
Spanning multiple lines. | |
@aragon/core/contracts/common/TokenController.sol:24:5: Overriden function is here: | |
function onApprove(address _owner, address _spender, uint _amount) public constant returns(bool); | |
^-----------------------------------------------------------------------------------------------^ | |
*/ | |
@apps/vault | |
file: Vault.sol | |
// No modifications made | |
@apps/voting | |
file: Voting.sol | |
//def1 - a view function that calls another view fn (->canPerform) | |
function canForward(address _sender, bytes _evmCallScript) public view returns (bool) { | |
//def1 | |
function canVote(uint256 _voteId, address _voter) public view returns (bool) { | |
function canExecute(uint256 _voteId) public view returns (bool) { | |
function getVote(uint256 _voteId) public view returns (bool open, bool executed, address creator, uint64 startDate, uint256 snapshotBlock, uint256 minAcceptQuorum, uint256 yea, uint256 nay, uint256 totalVoters, bytes script, uint256 scriptActionsCount) { | |
function getVoteMetadata(uint256 _voteId) public view returns (string metadata) { | |
function getVoteScriptAction(uint256 _voteId, uint256 _scriptAction) public view returns (address, bytes) { | |
@future-apps/fundraising | |
file: Fundraising.sol | |
//def1 | |
function getSale(uint256 _saleId) public view returns (bool closed, address investor, address raisedToken, uint256 maxRaised, uint256 maxSold, uint256 minBuy, bool isInversePrice, uint64 saleStartTime, uint256 periodsCount, uint256 currentPeriod, uint256 raisedAmount, uint256 soldAmount) { | |
function getPeriod(uint256 _saleId, uint256 _salePeriod) public view returns (uint64 periodStarts, uint64 periodEnds, uint256 initialPrice, uint256 finalPrice) { | |
//def1 - a view function that calls another internal fn (->transitionSalePeriodIfNeeded) | |
//Q!: can modify state through transitionSalePeriodIfNeeded???? | |
function getCurrentPrice(uint256 _saleId) public view returns (uint256 price, bool isInversePrice, uint256 pricePrecision) { | |
//def1 | |
function calculatePrice(uint256 _saleId) internal view returns (uint256 price, bool isInversePrice, uint256 pricePrecision) { | |
//def2 - operations | |
function parseBuyData(bytes data) internal pure returns (bytes4 sig, uint256 saleId) { | |
//See sample given in View Functions at docs | |
function getTimestamp() internal view returns (uint256) { | |
@apps/finance | |
file: Finance.sol | |
//def1 | |
function getPayment(uint256 _paymentId) public view returns (ERC20 token, address receiver, uint256 amount, uint64 initialPaymentTime, uint64 interval, uint64 maxRepeats, string reference, bool disabled, uint256 repeats, address createdBy) { | |
function getTransaction(uint256 _transactionId) public view returns (uint256 periodId, uint256 amount, uint256 paymentId, ERC20 token, address entity, bool isIncoming, uint64 date, string reference) { | |
function getPeriod(uint256 _periodId) public view returns (bool isCurrent, uint64 startTime, uint64 endTime, uint256 firstTransactionId, uint256 lastTransactionId) { | |
function getPeriodTokenStatement(uint256 _periodId, address _token) public view returns (uint256 expenses, uint256 income) { | |
function nextPaymentTime(uint256 _paymentId) public view returns (uint64) { | |
function _getRemainingBudget(address _token) internal view returns (uint256) { | |
//See sample given in View Functions at docs | |
function getTimestamp() internal view returns (uint256) { return now; } | |
//def1 | |
function getPeriodDuration() public view returns (uint64 periodDuration) { | |
function getBudget(address _token) transitionsPeriod public view returns (uint256 budget, bool hasBudget, uint256 remainingBudget) { | |
function currentPeriodId() public view returns (uint256) { | |
-------------------------------------------------------------------------------------------------------------- | |
//Time to check deps new version config (runTestAfterRefactor.dat) | |
> npm run bootstrap | |
ok | |
> npm run test | |
//Detected Warnings | |
@apps/finance | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/contracts/Finance.sol:417:40: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
function getBudget(address _token) transitionsPeriod public view returns (uint256 budget, bool hasBudget, uint256 remainingBudget) { | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/contracts/Finance.sol:541:5: Warning: Function state mutability can be restricted to view | |
function _canMakePayment(ERC20 _token, uint256 _amount) internal returns (bool) { | |
^ | |
@apps/group | |
//no warnings | |
@apps/token-manager | |
//no warnings | |
@apps/vault | |
//no warnings | |
@apps/voting | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:133:42: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. | |
function canForward(address _sender, bytes _evmCallScript) public view returns (bool) { | |
^------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:140:16: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return _isVoteOpen(vote) && token.balanceOfAt(_voter, vote.snapshotBlock) > 0; | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:150:13: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
if (_isValuePct(vote.yea, vote.totalVoters, supportRequiredPct)) | |
^---------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:155:27: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool voteEnded = !_isVoteOpen(vote); | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:156:27: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool hasSupport = _isValuePct(vote.yea, totalVotes, supportRequiredPct); | |
^---------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:157:29: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool hasMinQuorum = _isValuePct(vote.yea, vote.totalVoters, vote.minAcceptQuorumPct); | |
^--------------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:165:16: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
open = _isVoteOpen(vote); | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:257:5: Warning: Function state mutability can be restricted to view | |
function _isVoteOpen(Vote storage vote) internal returns (bool) { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:264:5: Warning: Function state mutability can be restricted to pure | |
function _isValuePct(uint256 _value, uint256 _total, uint256 _pct) internal returns (bool) { | |
^ | |
@future-apps/fundraising | |
//No test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> @ test /home/mecom/workspace/ethBox/aragon/colaboration-bounties/aragon-apps-compilation | |
> lerna run --scope=@aragon/apps-* test | |
> @aragon/[email protected] test $LOCALWORKSPACE/aragon-apps/apps/vault | |
> truffle test | |
Compiling ./contracts/Vault.sol... | |
Compiling ./test/TestVault.sol... | |
Compiling @aragon/core/contracts/apps/App.sol... | |
Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
Compiling @aragon/core/contracts/common/MiniMeToken.sol... | |
Compiling @aragon/core/contracts/common/TokenController.sol... | |
Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
Compiling @aragon/core/contracts/misc/Migrations.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20Basic.sol... | |
Compilation warnings encountered: | |
@aragon/core/contracts/apps/App.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function canPerform(address _sender, bytes32 _role) constant returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/TokenController.sol:8:5: Warning: No visibility specified. Defaulting to "public". | |
function proxyPayment(address _owner) payable returns(bool); | |
^----------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:16:5: Warning: No visibility specified. Defaulting to "public". | |
function onTransfer(address _from, address _to, uint _amount) returns(bool); | |
^--------------------------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:24:5: Warning: No visibility specified. Defaulting to "public". | |
function onApprove(address _owner, address _spender, uint _amount) | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:155:5: Warning: No visibility specified. Defaulting to "public". | |
function transfer(address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:166:5: Warning: No visibility specified. Defaulting to "public". | |
function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:222:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOf(address _owner) constant returns (uint256 balance) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:232:5: Warning: No visibility specified. Defaulting to "public". | |
function approve(address _spender, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:257:5: Warning: No visibility specified. Defaulting to "public". | |
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:268:5: Warning: No visibility specified. Defaulting to "public". | |
function approveAndCall(address _spender, uint256 _amount, bytes _extraData) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:283:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupply() constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:296:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOfAt(address _owner, uint _blockNumber) constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:320:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupplyAt(uint _blockNumber) constant returns(uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:354:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:388:5: Warning: No visibility specified. Defaulting to "public". | |
function generateTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:404:5: Warning: No visibility specified. Defaulting to "public". | |
function destroyTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:556:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:305:56: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:329:50: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:489:5: Warning: Function state mutability can be restricted to pure | |
function min(uint a, uint b) internal returns (uint) { | |
^ | |
Spanning multiple lines. | |
[0m[0m | |
[0m Contract: Vault app[0m | |
[32m β[0m[90m can request allowance[0m[31m (924ms)[0m | |
[32m β[0m[90m can handle overriding an allowance[0m[31m (664ms)[0m | |
[32m β[0m[90m can handle requesting allowance with 0 amount[0m[31m (461ms)[0m | |
[32m β[0m[90m throws when wrong arguments count is passed to request allowances[0m[31m (626ms)[0m | |
[32m β[0m[90m can transfer tokens[0m[31m (759ms)[0m | |
[32m β[0m[90m throws when transfering more then owned[0m[31m (226ms)[0m | |
[32m β[0m[90m can handle token failures[0m[31m (324ms)[0m | |
[92m [0m[32m 7 passing[0m[90m (6s)[0m | |
> @aragon/[email protected] test $LOCALWORKSPACE/aragon-apps/apps/voting | |
> truffle test | |
Compiling ./contracts/Voting.sol... | |
Compiling ./test/TestVoting.sol... | |
Compiling ./test/mocks/ExecutionTarget.sol... | |
Compiling @aragon/core/contracts/apps/App.sol... | |
Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
Compiling @aragon/core/contracts/common/EVMCallScript.sol... | |
Compiling @aragon/core/contracts/common/IForwarder.sol... | |
Compiling @aragon/core/contracts/common/Initializable.sol... | |
Compiling @aragon/core/contracts/common/MiniMeToken.sol... | |
Compiling @aragon/core/contracts/common/TokenController.sol... | |
Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
Compiling @aragon/core/contracts/misc/Migrations.sol... | |
Compiling @aragon/core/contracts/zeppelin/math/SafeMath.sol... | |
Compilation warnings encountered: | |
@aragon/core/contracts/apps/App.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function canPerform(address _sender, bytes32 _role) constant returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/TokenController.sol:8:5: Warning: No visibility specified. Defaulting to "public". | |
function proxyPayment(address _owner) payable returns(bool); | |
^----------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:16:5: Warning: No visibility specified. Defaulting to "public". | |
function onTransfer(address _from, address _to, uint _amount) returns(bool); | |
^--------------------------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:24:5: Warning: No visibility specified. Defaulting to "public". | |
function onApprove(address _owner, address _spender, uint _amount) | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:155:5: Warning: No visibility specified. Defaulting to "public". | |
function transfer(address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:166:5: Warning: No visibility specified. Defaulting to "public". | |
function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:222:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOf(address _owner) constant returns (uint256 balance) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:232:5: Warning: No visibility specified. Defaulting to "public". | |
function approve(address _spender, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:257:5: Warning: No visibility specified. Defaulting to "public". | |
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:268:5: Warning: No visibility specified. Defaulting to "public". | |
function approveAndCall(address _spender, uint256 _amount, bytes _extraData) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:283:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupply() constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:296:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOfAt(address _owner, uint _blockNumber) constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:320:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupplyAt(uint _blockNumber) constant returns(uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:354:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:388:5: Warning: No visibility specified. Defaulting to "public". | |
function generateTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:404:5: Warning: No visibility specified. Defaulting to "public". | |
function destroyTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:556:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/IForwarder.sol:4:5: Warning: No visibility specified. Defaulting to "public". | |
function isForwarder() constant returns (bool) { return true; } | |
^-------------------------------------------------------------^ | |
,@aragon/core/contracts/common/IForwarder.sol:6:5: Warning: No visibility specified. Defaulting to "public". | |
function canForward(address _sender, bytes _evmCallScript) constant returns (bool); | |
^---------------------------------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/test/mocks/ExecutionTarget.sol:6:5: Warning: No visibility specified. Defaulting to "public". | |
function execute() { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/test/mocks/ExecutionTarget.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function setCounter(uint x) { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:133:42: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. | |
function canForward(address _sender, bytes _evmCallScript) public view returns (bool) { | |
^------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:140:16: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return _isVoteOpen(vote) && token.balanceOfAt(_voter, vote.snapshotBlock) > 0; | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:150:13: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
if (_isValuePct(vote.yea, vote.totalVoters, supportRequiredPct)) | |
^---------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:155:27: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool voteEnded = !_isVoteOpen(vote); | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:156:27: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool hasSupport = _isValuePct(vote.yea, totalVotes, supportRequiredPct); | |
^---------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:157:29: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool hasMinQuorum = _isValuePct(vote.yea, vote.totalVoters, vote.minAcceptQuorumPct); | |
^--------------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:165:16: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
open = _isVoteOpen(vote); | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:257:5: Warning: Function state mutability can be restricted to view | |
function _isVoteOpen(Vote storage vote) internal returns (bool) { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/voting/contracts/Voting.sol:264:5: Warning: Function state mutability can be restricted to pure | |
function _isValuePct(uint256 _value, uint256 _total, uint256 _pct) internal returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:23:5: Warning: Function state mutability can be restricted to pure | |
function uint256At(bytes data, uint256 location) internal returns (uint256 result) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:47:5: Warning: Function state mutability can be restricted to pure | |
function locationOf(bytes data, uint256 location) internal returns (uint256 result) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:58:48: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
location += (0x14 + 0x04 + uint256(uint32At(script, location + 0x14))); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:67:42: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
uint256 length = uint256(uint32At(script, location + 0x14)); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:68:32: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
address addr = addressAt(script, location); | |
^-------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:72:37: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
memcpy(calldataPtr, locationOf(script, location + 0x14 + 0x04), length); | |
^----------------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:72:17: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
memcpy(calldataPtr, locationOf(script, location + 0x14 + 0x04), length); | |
^---------------------------------------------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:76:48: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
location += (0x14 + 0x04 + uint256(uint32At(script, location + 0x14))); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:82:5: Warning: Function state mutability can be restricted to pure | |
function memcpy(uint dest, uint src, uint len) private { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/IForwarder.sol:4:5: Warning: Function state mutability can be restricted to pure | |
function isForwarder() constant returns (bool) { return true; } | |
^-------------------------------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:305:56: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:329:50: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:489:5: Warning: Function state mutability can be restricted to pure | |
function min(uint a, uint b) internal returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:9:3: Warning: Function state mutability can be restricted to pure | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:15:3: Warning: Function state mutability can be restricted to pure | |
function div(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:22:3: Warning: Function state mutability can be restricted to pure | |
function sub(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:27:3: Warning: Function state mutability can be restricted to pure | |
function add(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
[0m[0m | |
[0m Contract: Voting App[0m | |
[0m normal token supply[0m | |
[32m β[0m[90m fails on reinitialization[0m[31m (278ms)[0m | |
[32m β[0m[90m deciding voting is automatically executed[0m[31m (507ms)[0m | |
[32m β[0m[90m execution scripts can execute multiple actions[0m[31m (494ms)[0m | |
[32m β[0m[90m execution script can be empty[0m[31m (556ms)[0m | |
[32m β[0m[90m execution throws if any action on script throws[0m[31m (308ms)[0m | |
[32m β[0m[90m forwarding creates vote[0m[31m (324ms)[0m | |
[32m β[0m[90m can change minimum acceptance quorum[0m[31m (238ms)[0m | |
[0m creating vote[0m | |
[32m β[0m[90m has correct state[0m[31m (258ms)[0m | |
[32m β[0m[90m has correct script actions[0m[33m (75ms)[0m | |
[32m β[0m[90m changing min quorum doesnt affect vote min quorum[0m[31m (796ms)[0m | |
[32m β[0m[90m holder can vote[0m[31m (512ms)[0m | |
[32m β[0m[90m holder can modify vote[0m[31m (1612ms)[0m | |
[32m β[0m[90m token transfers dont affect voting[0m[31m (804ms)[0m | |
[32m β[0m[90m throws when non-holder votes[0m[31m (143ms)[0m | |
[32m β[0m[90m throws when voting after voting closes[0m[31m (129ms)[0m | |
[32m β[0m[90m can execute if vote is approved with support and quorum[0m[31m (942ms)[0m | |
[32m β[0m[90m cannot execute vote if not enough quorum met[0m[31m (515ms)[0m | |
[32m β[0m[90m vote can be executed automatically if decided[0m[31m (298ms)[0m | |
[32m β[0m[90m vote can be not executed automatically if decided[0m[31m (671ms)[0m | |
[32m β[0m[90m cannot re-execute vote[0m[31m (479ms)[0m | |
[32m β[0m[90m cannot vote on executed vote[0m[31m (458ms)[0m | |
[0m token supply = 1[0m | |
[32m β[0m[90m new vote cannot be executed before voting[0m[31m (681ms)[0m | |
[32m β[0m[90m creating vote as holder executes vote[0m[31m (565ms)[0m | |
[0m token supply = 3[0m | |
[32m β[0m[90m new vote cannot be executed before holder2 voting[0m[31m (1121ms)[0m | |
[32m β[0m[90m creating vote as holder2 executes vote[0m[31m (502ms)[0m | |
[92m [0m[32m 25 passing[0m[90m (50s)[0m | |
> @aragon/[email protected] test $LOCALWORKSPACE/aragon-apps/apps/token-manager | |
> truffle test | |
Compiling ./contracts/TokenManager.sol... | |
Compiling ./test/TestTokenManager.sol... | |
Compiling ./test/mocks/ExecutionTarget.sol... | |
Compiling @aragon/core/contracts/apps/App.sol... | |
Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
Compiling @aragon/core/contracts/common/EVMCallScript.sol... | |
Compiling @aragon/core/contracts/common/IForwarder.sol... | |
Compiling @aragon/core/contracts/common/Initializable.sol... | |
Compiling @aragon/core/contracts/common/MiniMeToken.sol... | |
Compiling @aragon/core/contracts/common/TokenController.sol... | |
Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
Compiling @aragon/core/contracts/misc/Migrations.sol... | |
Compiling @aragon/core/contracts/zeppelin/math/SafeMath.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20Basic.sol... | |
Compilation warnings encountered: | |
@aragon/core/contracts/apps/App.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function canPerform(address _sender, bytes32 _role) constant returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/TokenController.sol:8:5: Warning: No visibility specified. Defaulting to "public". | |
function proxyPayment(address _owner) payable returns(bool); | |
^----------------------------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:155:5: Warning: No visibility specified. Defaulting to "public". | |
function transfer(address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:166:5: Warning: No visibility specified. Defaulting to "public". | |
function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:222:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOf(address _owner) constant returns (uint256 balance) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:232:5: Warning: No visibility specified. Defaulting to "public". | |
function approve(address _spender, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:257:5: Warning: No visibility specified. Defaulting to "public". | |
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:268:5: Warning: No visibility specified. Defaulting to "public". | |
function approveAndCall(address _spender, uint256 _amount, bytes _extraData) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:283:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupply() constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:296:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOfAt(address _owner, uint _blockNumber) constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:320:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupplyAt(uint _blockNumber) constant returns(uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:354:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:388:5: Warning: No visibility specified. Defaulting to "public". | |
function generateTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:404:5: Warning: No visibility specified. Defaulting to "public". | |
function destroyTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:556:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/IForwarder.sol:4:5: Warning: No visibility specified. Defaulting to "public". | |
function isForwarder() constant returns (bool) { return true; } | |
^-------------------------------------------------------------^ | |
,@aragon/core/contracts/common/IForwarder.sol:6:5: Warning: No visibility specified. Defaulting to "public". | |
function canForward(address _sender, bytes _evmCallScript) constant returns (bool); | |
^---------------------------------------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/test/mocks/ExecutionTarget.sol:6:5: Warning: No visibility specified. Defaulting to "public". | |
function execute() { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/test/mocks/ExecutionTarget.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function setCounter(uint x) { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:208:33: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
bool toCanReceive = isBalanceIncreaseAllowed(_to, _amount); | |
^------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:214:9: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
_logHolderIfNeeded(_to); | |
^---------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/token-manager/contracts/TokenManager.sol:219:5: Warning: Function state mutability can be restricted to view | |
function isBalanceIncreaseAllowed(address _receiver, uint _inc) internal returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:23:5: Warning: Function state mutability can be restricted to pure | |
function uint256At(bytes data, uint256 location) internal returns (uint256 result) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:47:5: Warning: Function state mutability can be restricted to pure | |
function locationOf(bytes data, uint256 location) internal returns (uint256 result) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/EVMCallScript.sol:58:48: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
location += (0x14 + 0x04 + uint256(uint32At(script, location + 0x14))); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:67:42: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
uint256 length = uint256(uint32At(script, location + 0x14)); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:68:32: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
address addr = addressAt(script, location); | |
^-------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:72:37: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
memcpy(calldataPtr, locationOf(script, location + 0x14 + 0x04), length); | |
^----------------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:72:17: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
memcpy(calldataPtr, locationOf(script, location + 0x14 + 0x04), length); | |
^---------------------------------------------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:76:48: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
location += (0x14 + 0x04 + uint256(uint32At(script, location + 0x14))); | |
^-------------------------------^ | |
,@aragon/core/contracts/common/EVMCallScript.sol:82:5: Warning: Function state mutability can be restricted to pure | |
function memcpy(uint dest, uint src, uint len) private { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/IForwarder.sol:4:5: Warning: Function state mutability can be restricted to pure | |
function isForwarder() constant returns (bool) { return true; } | |
^-------------------------------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:305:56: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:329:50: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:489:5: Warning: Function state mutability can be restricted to pure | |
function min(uint a, uint b) internal returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:9:3: Warning: Function state mutability can be restricted to pure | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:15:3: Warning: Function state mutability can be restricted to pure | |
function div(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:22:3: Warning: Function state mutability can be restricted to pure | |
function sub(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:27:3: Warning: Function state mutability can be restricted to pure | |
function add(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
[0m[0m | |
[0m Contract: Token Manager[0m | |
[32m β[0m[90m fails when initializing without setting controller[0m[31m (443ms)[0m | |
[32m β[0m[90m fails when sending ether to token[0m[33m (74ms)[0m | |
[0m non-transferable token[0m | |
[32m β[0m[90m holders cannot transfer non-transferable tokens[0m[31m (503ms)[0m | |
[32m β[0m[90m can transfer to token manager[0m[31m (568ms)[0m | |
[32m β[0m[90m token manager can transfer[0m[31m (565ms)[0m | |
[32m β[0m[90m forwards actions to holder[0m[31m (751ms)[0m | |
[0m holder logging[0m | |
[32m β[0m[90m logs token manager on issue[0m[31m (365ms)[0m | |
[32m β[0m[90m logs on mints and transfers[0m[31m (1403ms)[0m | |
[0m maximum tokens per address limit[0m | |
[32m β[0m[90m can mint up to than limit[0m[31m (434ms)[0m | |
[32m β[0m[90m fails to mint more than limit[0m[31m (122ms)[0m | |
[32m β[0m[90m can issue unlimited tokens for manager[0m[31m (368ms)[0m | |
[32m β[0m[90m can assign up to limit[0m[31m (668ms)[0m | |
[32m β[0m[90m cannot assign more than limit[0m[31m (340ms)[0m | |
[0m for normal native tokens[0m | |
[32m β[0m[90m fails on reinitialization[0m[33m (70ms)[0m | |
[32m β[0m[90m can mint tokens[0m[31m (387ms)[0m | |
[32m β[0m[90m can issue tokens[0m[31m (293ms)[0m | |
[32m β[0m[90m can assign issued tokens[0m[31m (632ms)[0m | |
[32m β[0m[90m cannot assign more tokens than owned[0m[31m (522ms)[0m | |
[32m β[0m[90m forwards actions only to token holders[0m[31m (931ms)[0m | |
[32m β[0m[90m fails when assigning invalid vesting schedule[0m[31m (76ms)[0m | |
[0m assigning vested tokens[0m | |
[32m β[0m[90m can start transfering on cliff[0m[31m (592ms)[0m | |
[32m β[0m[90m can transfer all tokens after vesting[0m[31m (464ms)[0m | |
[32m β[0m[90m can transfer half mid vesting[0m[31m (516ms)[0m | |
[32m β[0m[90m cannot transfer non-vested tokens[0m[31m (283ms)[0m | |
[32m β[0m[90m can approve non-vested tokens but transferFrom fails[0m[31m (485ms)[0m | |
[32m β[0m[90m cannot transfer all tokens right before vesting[0m[31m (772ms)[0m | |
[32m β[0m[90m can be revoked and not vested tokens are transfered to token manager[0m[31m (973ms)[0m | |
[32m β[0m[90m cannot revoke non-revokable vestings[0m[31m (850ms)[0m | |
[32m β[0m[90m cannot have more than 50 vestings[0m[31m (15252ms)[0m | |
[92m [0m[32m 29 passing[0m[90m (57s)[0m | |
> @aragon/[email protected] test $LOCALWORKSPACE/aragon-apps/apps/finance | |
> truffle test | |
Compiling ./contracts/Finance.sol... | |
Compiling ./test/TestFinance.sol... | |
Compiling ./test/mocks/ExecutionTarget.sol... | |
Compiling ./test/mocks/FinanceMock.sol... | |
Compiling @aragon/apps-vault/contracts/Vault.sol... | |
Compiling @aragon/core/contracts/apps/App.sol... | |
Compiling @aragon/core/contracts/apps/AppStorage.sol... | |
Compiling @aragon/core/contracts/common/EtherToken.sol... | |
Compiling @aragon/core/contracts/common/Initializable.sol... | |
Compiling @aragon/core/contracts/common/MiniMeToken.sol... | |
Compiling @aragon/core/contracts/common/TokenController.sol... | |
Compiling @aragon/core/contracts/common/erc677/ERC677Receiver.sol... | |
Compiling @aragon/core/contracts/common/erc677/ERC677Token.sol... | |
Compiling @aragon/core/contracts/kernel/IKernel.sol... | |
Compiling @aragon/core/contracts/misc/Migrations.sol... | |
Compiling @aragon/core/contracts/zeppelin/math/SafeMath.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/BasicToken.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/ERC20Basic.sol... | |
Compiling @aragon/core/contracts/zeppelin/token/StandardToken.sol... | |
Compilation warnings encountered: | |
@aragon/core/contracts/apps/App.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function canPerform(address _sender, bytes32 _role) constant returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/erc677/ERC677Token.sol:7:5: Warning: No visibility specified. Defaulting to "public". | |
function transferAndCall(address receiver, uint amount, bytes data) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/TokenController.sol:8:5: Warning: No visibility specified. Defaulting to "public". | |
function proxyPayment(address _owner) payable returns(bool); | |
^----------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:16:5: Warning: No visibility specified. Defaulting to "public". | |
function onTransfer(address _from, address _to, uint _amount) returns(bool); | |
^--------------------------------------------------------------------------^ | |
,@aragon/core/contracts/common/TokenController.sol:24:5: Warning: No visibility specified. Defaulting to "public". | |
function onApprove(address _owner, address _spender, uint _amount) | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:155:5: Warning: No visibility specified. Defaulting to "public". | |
function transfer(address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:166:5: Warning: No visibility specified. Defaulting to "public". | |
function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:222:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOf(address _owner) constant returns (uint256 balance) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:232:5: Warning: No visibility specified. Defaulting to "public". | |
function approve(address _spender, uint256 _amount) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:257:5: Warning: No visibility specified. Defaulting to "public". | |
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:268:5: Warning: No visibility specified. Defaulting to "public". | |
function approveAndCall(address _spender, uint256 _amount, bytes _extraData) returns (bool success) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:283:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupply() constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:296:5: Warning: No visibility specified. Defaulting to "public". | |
function balanceOfAt(address _owner, uint _blockNumber) constant returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:320:5: Warning: No visibility specified. Defaulting to "public". | |
function totalSupplyAt(uint _blockNumber) constant returns(uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:354:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:388:5: Warning: No visibility specified. Defaulting to "public". | |
function generateTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:404:5: Warning: No visibility specified. Defaulting to "public". | |
function destroyTokens(address _owner, uint _amount) onlyController returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:556:5: Warning: No visibility specified. Defaulting to "public". | |
function createCloneToken( | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/test/mocks/ExecutionTarget.sol:6:5: Warning: No visibility specified. Defaulting to "public". | |
function execute() { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/test/mocks/ExecutionTarget.sol:11:5: Warning: No visibility specified. Defaulting to "public". | |
function setCounter(uint x) { | |
^ | |
Spanning multiple lines. | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/test/mocks/FinanceMock.sol:9:5: Warning: No visibility specified. Defaulting to "public". | |
function mock_setTimestamp(uint i) { _mockTime = i; } | |
^---------------------------------------------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/contracts/Finance.sol:417:40: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
function getBudget(address _token) transitionsPeriod public view returns (uint256 budget, bool hasBudget, uint256 remainingBudget) { | |
^---------------^ | |
,$LOCALWORKSPACE/aragon-apps/apps/finance/contracts/Finance.sol:541:5: Warning: Function state mutability can be restricted to view | |
function _canMakePayment(ERC20 _token, uint256 _amount) internal returns (bool) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/common/MiniMeToken.sol:305:56: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:329:50: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. | |
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); | |
^------------------------------------^ | |
,@aragon/core/contracts/common/MiniMeToken.sol:489:5: Warning: Function state mutability can be restricted to pure | |
function min(uint a, uint b) internal returns (uint) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:9:3: Warning: Function state mutability can be restricted to pure | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:15:3: Warning: Function state mutability can be restricted to pure | |
function div(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:22:3: Warning: Function state mutability can be restricted to pure | |
function sub(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
,@aragon/core/contracts/zeppelin/math/SafeMath.sol:27:3: Warning: Function state mutability can be restricted to pure | |
function add(uint256 a, uint256 b) internal constant returns (uint256) { | |
^ | |
Spanning multiple lines. | |
[0m[0m | |
[0m Contract: Finance App[0m | |
[32m β[0m[90m initialized first accounting period and settings[0m[33m (75ms)[0m | |
[32m β[0m[90m fails on reinitialization[0m[31m (232ms)[0m | |
[32m β[0m[90m adds new token to budget[0m[31m (76ms)[0m | |
[32m β[0m[90m records ERC20 deposits[0m[31m (377ms)[0m | |
[32m β[0m[90m records ERC20 approveAndCall deposits[0m[31m (346ms)[0m | |
[32m β[0m[90m records ERC677 deposits[0m[31m (225ms)[0m | |
[32m β[0m[90m can wrapAndCall with EtherToken[0m[31m (216ms)[0m | |
[32m β[0m[90m sends locked tokens to Vault[0m[31m (465ms)[0m | |
[32m β[0m[90m try to send locked tokens to Vault, but balance is 0[0m[33m (56ms)[0m | |
[32m β[0m[90m before setting budget allows unlimited spending[0m[31m (316ms)[0m | |
[32m β[0m[90m can change period duration[0m[31m (241ms)[0m | |
[0m setting budget[0m | |
[32m β[0m[90m records payment[0m[31m (429ms)[0m | |
[32m β[0m[90m can create single payment[0m[31m (271ms)[0m | |
[32m β[0m[90m can decrease budget after spending[0m[31m (320ms)[0m | |
[32m β[0m[90m removing budget allows unlimited spending[0m[31m (278ms)[0m | |
[32m β[0m[90m can create recurring payment[0m[31m (1077ms)[0m | |
[32m β[0m[90m can create recurring ether payment[0m[31m (936ms)[0m | |
[32m β[0m[90m doesnt record payment for one time past transaction[0m[31m (272ms)[0m | |
[32m β[0m[90m emits payment failure event when out of budget[0m[31m (150ms)[0m | |
[32m β[0m[90m emits payment failure event when out of balance[0m[31m (1166ms)[0m | |
[0m multitransaction period[0m | |
[32m β[0m[90m has correct token statements[0m[31m (84ms)[0m | |
[32m β[0m[90m finishes accounting period correctly[0m[31m (159ms)[0m | |
[0m many accounting period transitions[0m | |
[32m β[0m[90m fails when too many period transitions are needed[0m[31m (304ms)[0m | |
[32m β[0m[90m can transition periods externally to remove deadlock[0m[31m (734ms)[0m | |
[32m β[0m[90m non-activity accounting periods have no transactions[0m[31m (259ms)[0m | |
[0m creating payment[0m | |
[32m β[0m[90m only repeats payment until max repeats[0m[31m (1040ms)[0m | |
[32m β[0m[90m receiver can always execute a payment[0m[31m (394ms)[0m | |
[32m β[0m[90m fails when non-receiver attempts to execute a payment[0m[31m (118ms)[0m | |
[32m β[0m[90m fails executing a payment before time[0m[33m (65ms)[0m | |
[32m β[0m[90m fails executing a payment by receiver before time[0m[33m (57ms)[0m | |
[32m β[0m[90m fails executing disabled payment[0m[31m (202ms)[0m | |
[92m [0m[32m 31 passing[0m[90m (51s)[0m | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment