From c6bfa8d865d431a01d5c6f41c79fc4b4b1e8843e Mon Sep 17 00:00:00 2001 From: thatkawaiiguy Date: Tue, 9 Oct 2018 02:21:38 -0400 Subject: [PATCH 1/4] Renames setPaymentDisabled to setPaymentStatus Also changes constant to view app-wide --- apps/finance/artifact.json | 12 +++---- apps/finance/contracts/Finance.sol | 22 ++++++------ apps/finance/test/finance.js | 4 +-- apps/survey/contracts/test/mocks/BadToken.sol | 2 +- shared/minime/contracts/MiniMeToken.sol | 34 ++++++++++--------- 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/apps/finance/artifact.json b/apps/finance/artifact.json index 0d21d0e63d..62a74dade0 100644 --- a/apps/finance/artifact.json +++ b/apps/finance/artifact.json @@ -206,7 +206,7 @@ "type": "string" }, { - "name": "disabled", + "name": "inactive", "type": "bool" }, { @@ -683,11 +683,11 @@ "type": "uint256" }, { - "name": "_disabled", + "name": "_active", "type": "bool" } ], - "name": "setPaymentDisabled", + "name": "setPaymentStatus", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -890,7 +890,7 @@ }, { "indexed": false, - "name": "disabled", + "name": "inactive", "type": "bool" } ], @@ -984,11 +984,11 @@ "notice": "Execute pending payment #`_paymentId`" }, { - "sig": "setPaymentDisabled(uint256,bool)", + "sig": "setPaymentStatus(uint256,bool)", "roles": [ "DISABLE_PAYMENTS_ROLE" ], - "notice": "`_disabled ? 'Disable' : 'Enable'` payment `_paymentId`" + "notice": "`_active ? 'Active' : 'Inactive'` payment `_paymentId`" }, { "sig": "depositToVault(address)", diff --git a/apps/finance/contracts/Finance.sol b/apps/finance/contracts/Finance.sol index e222555b69..b928aa7746 100644 --- a/apps/finance/contracts/Finance.sol +++ b/apps/finance/contracts/Finance.sol @@ -37,7 +37,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { address token; address receiver; address createdBy; - bool disabled; + bool inactive; uint256 amount; uint64 initialPaymentTime; uint64 interval; @@ -98,7 +98,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { event SetBudget(address indexed token, uint256 amount, bool hasBudget); event NewPayment(uint256 indexed paymentId, address indexed recipient, uint64 maxRepeats); event NewTransaction(uint256 indexed transactionId, bool incoming, address indexed entity, uint256 amount); - event ChangePaymentState(uint256 indexed paymentId, bool disabled); + event ChangePaymentState(uint256 indexed paymentId, bool inactive); event ChangePeriodDuration(uint64 newDuration); event PaymentFailure(uint256 paymentId); @@ -155,7 +155,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { settings.periodDuration = _periodDuration; // Reserve the first recurring payment index as an unused index for transactions not linked to a payment - payments[0].disabled = true; + payments[0].inactive = true; paymentsNextIndex = 1; // Reserve the first transaction index as an unused index for periods with no transactions @@ -319,17 +319,17 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { } /** - * @notice `_disabled ? 'Disable' : 'Enable'` payment `_paymentId` + * @notice `_active ? 'Active' : 'Inactive'` payment `_paymentId` * @param _paymentId Identifier for payment - * @param _disabled Whether it will be disabled or enabled + * @param _active Whether it will be active or inactive */ - function setPaymentDisabled(uint256 _paymentId, bool _disabled) + function setPaymentStatus(uint256 _paymentId, bool _active) external authP(DISABLE_PAYMENTS_ROLE, arr(_paymentId)) paymentExists(_paymentId) { - payments[_paymentId].disabled = _disabled; - emit ChangePaymentState(_paymentId, _disabled); + payments[_paymentId].inactive = !_active; + emit ChangePaymentState(_paymentId, _active); } /** @@ -388,7 +388,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { uint64 interval, uint64 maxRepeats, string reference, - bool disabled, + bool inactive, uint64 repeats, address createdBy ) @@ -402,7 +402,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { interval = payment.interval; maxRepeats = payment.maxRepeats; repeats = payment.repeats; - disabled = payment.disabled; + inactive = payment.inactive; reference = payment.reference; createdBy = payment.createdBy; } @@ -560,7 +560,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { function _executePayment(uint256 _paymentId) internal { Payment storage payment = payments[_paymentId]; - require(!payment.disabled); + require(!payment.inactive); uint64 payed = 0; while (nextPaymentTime(_paymentId) <= getTimestamp64() && payed < MAX_PAYMENTS_PER_TX) { diff --git a/apps/finance/test/finance.js b/apps/finance/test/finance.js index 684d853664..d3989b7789 100644 --- a/apps/finance/test/finance.js +++ b/apps/finance/test/finance.js @@ -667,8 +667,8 @@ contract('Finance App', accounts => { }) }) - it('fails executing disabled payment', async () => { - await finance.setPaymentDisabled(1, true) + it('fails executing inactive payment', async () => { + await finance.setPaymentStatus(1, false) await finance.mock_setTimestamp(time + 1) return assertRevert(async () => { diff --git a/apps/survey/contracts/test/mocks/BadToken.sol b/apps/survey/contracts/test/mocks/BadToken.sol index 5495f92faf..3542b0b24d 100644 --- a/apps/survey/contracts/test/mocks/BadToken.sol +++ b/apps/survey/contracts/test/mocks/BadToken.sol @@ -20,7 +20,7 @@ contract BadToken is MiniMeToken { } // should be changed to view when MiniMe is updated - function totalSupplyAt(uint) public constant returns(uint) { + function totalSupplyAt(uint) public view returns(uint) { return 1; } } diff --git a/shared/minime/contracts/MiniMeToken.sol b/shared/minime/contracts/MiniMeToken.sol index 4e6b900370..2a72f3bdee 100644 --- a/shared/minime/contracts/MiniMeToken.sol +++ b/shared/minime/contracts/MiniMeToken.sol @@ -192,7 +192,7 @@ contract MiniMeToken is Controlled { require((_to != 0) && (_to != address(this))); // If the amount being transfered is more than the balance of the // account the transfer returns false - var previousBalanceFrom = balanceOfAt(_from, block.number); + uint256 previousBalanceFrom = balanceOfAt(_from, block.number); if (previousBalanceFrom < _amount) { return false; } @@ -206,7 +206,7 @@ contract MiniMeToken is Controlled { updateValueAtNow(balances[_from], previousBalanceFrom - _amount); // Then update the balance array with the new value for the address // receiving the tokens - var previousBalanceTo = balanceOfAt(_to, block.number); + uint256 previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount); // An event to make the transfer easy to find on the blockchain @@ -216,7 +216,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that's balance is being requested /// @return The balance of `_owner` at the current block - function balanceOf(address _owner) public constant returns (uint256 balance) { + function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOfAt(_owner, block.number); } @@ -251,7 +251,7 @@ contract MiniMeToken is Controlled { /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens of _owner that _spender is allowed /// to spend - function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { + function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } @@ -277,7 +277,7 @@ contract MiniMeToken is Controlled { /// @dev This function makes it easy to get the total number of tokens /// @return The total number of tokens - function totalSupply() public constant returns (uint) { + function totalSupply() public view returns (uint) { return totalSupplyAt(block.number); } @@ -290,7 +290,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address from which the balance will be retrieved /// @param _blockNumber The block number when the balance is queried /// @return The balance at `_blockNumber` - function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { + function balanceOfAt(address _owner, uint _blockNumber) public view returns (uint256) { // These next few lines are used when the balance of the token is // requested before a check point was ever created for this token, it @@ -314,7 +314,7 @@ contract MiniMeToken is Controlled { /// @notice Total amount of tokens at a specific `_blockNumber`. /// @param _blockNumber The block number when the totalSupply is queried /// @return The total amount of tokens at `_blockNumber` - function totalSupplyAt(uint _blockNumber) public constant returns(uint) { + function totalSupplyAt(uint _blockNumber) public view returns(uint) { // These next few lines are used when the totalSupply of the token is // requested before a check point was ever created for this token, it @@ -382,7 +382,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly - function generateTokens(address _owner, uint _amount) onlyController public returns (bool) { + function generateTokens(address _owner, uint _amount) public onlyController returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); @@ -398,7 +398,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly - function destroyTokens(address _owner, uint _amount) onlyController public returns (bool) { + function destroyTokens(address _owner, uint _amount) public onlyController returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply >= _amount); uint previousBalanceFrom = balanceOf(_owner); @@ -416,7 +416,7 @@ contract MiniMeToken is Controlled { /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone - function enableTransfers(bool _transfersEnabled) onlyController public { + function enableTransfers(bool _transfersEnabled) public onlyController { transfersEnabled = _transfersEnabled; } @@ -428,7 +428,7 @@ contract MiniMeToken is Controlled { /// @param checkpoints The history of values being queried /// @param _block The block number to retrieve the value at /// @return The number of tokens being queried - function getValueAt(Checkpoint[] storage checkpoints, uint _block) constant internal returns (uint) { + function getValueAt(Checkpoint[] storage checkpoints, uint _block) internal view returns (uint) { if (checkpoints.length == 0) return 0; @@ -470,7 +470,7 @@ contract MiniMeToken is Controlled { /// @dev Internal function to determine if an address is a contract /// @param _addr The address being queried /// @return True if `_addr` is a contract - function isContract(address _addr) constant internal returns(bool) { + function isContract(address _addr) internal view returns(bool) { uint size; if (_addr == 0) return false; @@ -483,7 +483,7 @@ contract MiniMeToken is Controlled { } /// @dev Helper function to return a min betwen the two uints - function min(uint a, uint b) pure internal returns (uint) { + function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } @@ -504,7 +504,7 @@ contract MiniMeToken is Controlled { /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. - function claimTokens(address _token) onlyController public { + function claimTokens(address _token) public onlyController { if (_token == 0x0) { controller.transfer(this.balance); return; @@ -526,7 +526,7 @@ contract MiniMeToken is Controlled { address indexed _owner, address indexed _spender, uint256 _amount - ); + ); } @@ -557,7 +557,9 @@ contract MiniMeTokenFactory { uint8 _decimalUnits, string _tokenSymbol, bool _transfersEnabled - ) public returns (MiniMeToken) + ) + public + returns (MiniMeToken) { MiniMeToken newToken = new MiniMeToken( this, From 221f4f816d3ae632b90028a61f743b7382d6f1f0 Mon Sep 17 00:00:00 2001 From: thatkawaiiguy Date: Thu, 11 Oct 2018 08:52:55 -0400 Subject: [PATCH 2/4] Rename bytes32 and add extra test for status --- apps/finance/arapp.json | 15 ++++----------- apps/finance/contracts/Finance.sol | 4 ++-- apps/finance/test/finance.js | 13 ++++++++++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/finance/arapp.json b/apps/finance/arapp.json index ce806ee56e..49d5045ba4 100644 --- a/apps/finance/arapp.json +++ b/apps/finance/arapp.json @@ -30,10 +30,7 @@ { "name": "Change period duration", "id": "CHANGE_PERIOD_ROLE", - "params": [ - "New period duration", - "Old period duration" - ] + "params": ["New period duration", "Old period duration"] }, { "name": "Change budgets", @@ -48,16 +45,12 @@ { "name": "Execute payments", "id": "EXECUTE_PAYMENTS_ROLE", - "params": [ - "Payment ID" - ] + "params": ["Payment ID"] }, { "name": "Disable payments", - "id": "DISABLE_PAYMENTS_ROLE", - "params": [ - "Payment ID" - ] + "id": "MANAGE_PAYMENTS_ROLE", + "params": ["Payment ID"] } ], "path": "contracts/Finance.sol" diff --git a/apps/finance/contracts/Finance.sol b/apps/finance/contracts/Finance.sol index b928aa7746..cb04f12ede 100644 --- a/apps/finance/contracts/Finance.sol +++ b/apps/finance/contracts/Finance.sol @@ -23,7 +23,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { bytes32 public constant CHANGE_PERIOD_ROLE = keccak256("CHANGE_PERIOD_ROLE"); bytes32 public constant CHANGE_BUDGETS_ROLE = keccak256("CHANGE_BUDGETS_ROLE"); bytes32 public constant EXECUTE_PAYMENTS_ROLE = keccak256("EXECUTE_PAYMENTS_ROLE"); - bytes32 public constant DISABLE_PAYMENTS_ROLE = keccak256("DISABLE_PAYMENTS_ROLE"); + bytes32 public constant MANAGE_PAYMENTS_ROLE = keccak256("MANAGE_PAYMENTS_ROLE"); uint64 public constant MAX_PAYMENTS_PER_TX = 20; @@ -325,7 +325,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { */ function setPaymentStatus(uint256 _paymentId, bool _active) external - authP(DISABLE_PAYMENTS_ROLE, arr(_paymentId)) + authP(MANAGE_PAYMENTS_ROLE, arr(_paymentId)) paymentExists(_paymentId) { payments[_paymentId].inactive = !_active; diff --git a/apps/finance/test/finance.js b/apps/finance/test/finance.js index d3989b7789..003a0c5080 100644 --- a/apps/finance/test/finance.js +++ b/apps/finance/test/finance.js @@ -11,7 +11,7 @@ contract('Finance App', accounts => { let daoFact, financeBase, finance, vaultBase, vault, token1, token2, executionTarget, etherToken = {} let ETH, MAX_UINT64, ANY_ENTITY, APP_MANAGER_ROLE - let CREATE_PAYMENTS_ROLE, CHANGE_PERIOD_ROLE, CHANGE_BUDGETS_ROLE, EXECUTE_PAYMENTS_ROLE, DISABLE_PAYMENTS_ROLE + let CREATE_PAYMENTS_ROLE, CHANGE_PERIOD_ROLE, CHANGE_BUDGETS_ROLE, EXECUTE_PAYMENTS_ROLE, MANAGE_PAYMENTS_ROLE let TRANSFER_ROLE const root = accounts[0] @@ -39,7 +39,7 @@ contract('Finance App', accounts => { CHANGE_PERIOD_ROLE = await financeBase.CHANGE_PERIOD_ROLE() CHANGE_BUDGETS_ROLE = await financeBase.CHANGE_BUDGETS_ROLE() EXECUTE_PAYMENTS_ROLE = await financeBase.EXECUTE_PAYMENTS_ROLE() - DISABLE_PAYMENTS_ROLE = await financeBase.DISABLE_PAYMENTS_ROLE() + MANAGE_PAYMENTS_ROLE = await financeBase.MANAGE_PAYMENTS_ROLE() TRANSFER_ROLE = await vaultBase.TRANSFER_ROLE() }) @@ -70,7 +70,7 @@ contract('Finance App', accounts => { await acl.createPermission(ANY_ENTITY, financeApp.address, CHANGE_PERIOD_ROLE, root, { from: root }) await acl.createPermission(ANY_ENTITY, financeApp.address, CHANGE_BUDGETS_ROLE, root, { from: root }) await acl.createPermission(ANY_ENTITY, financeApp.address, EXECUTE_PAYMENTS_ROLE, root, { from: root }) - await acl.createPermission(ANY_ENTITY, financeApp.address, DISABLE_PAYMENTS_ROLE, root, { from: root }) + await acl.createPermission(ANY_ENTITY, financeApp.address, MANAGE_PAYMENTS_ROLE, root, { from: root }) const recoveryVault = await setupRecoveryVault(dao) @@ -675,6 +675,13 @@ contract('Finance App', accounts => { await finance.executePayment(1, { from: recipient }) }) }) + + it('succeeds payment after setting payment status to active', async () => { + await finance.setPaymentStatus(1, true) + await finance.mock_setTimestamp(time + 1) + + await finance.executePayment(1, { from: recipient }) + }) }) const assertPaymentFailure = receipt => { From 271b89f467d3faccf3e717896aec7683f3ff65c0 Mon Sep 17 00:00:00 2001 From: thatkawaiiguy Date: Thu, 11 Oct 2018 09:41:05 -0400 Subject: [PATCH 3/4] Revert MiniMe to previous state --- shared/minime/contracts/MiniMeToken.sol | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/shared/minime/contracts/MiniMeToken.sol b/shared/minime/contracts/MiniMeToken.sol index 2a72f3bdee..8cf82be523 100644 --- a/shared/minime/contracts/MiniMeToken.sol +++ b/shared/minime/contracts/MiniMeToken.sol @@ -192,7 +192,7 @@ contract MiniMeToken is Controlled { require((_to != 0) && (_to != address(this))); // If the amount being transfered is more than the balance of the // account the transfer returns false - uint256 previousBalanceFrom = balanceOfAt(_from, block.number); + var previousBalanceFrom = balanceOfAt(_from, block.number); if (previousBalanceFrom < _amount) { return false; } @@ -206,7 +206,7 @@ contract MiniMeToken is Controlled { updateValueAtNow(balances[_from], previousBalanceFrom - _amount); // Then update the balance array with the new value for the address // receiving the tokens - uint256 previousBalanceTo = balanceOfAt(_to, block.number); + var previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount); // An event to make the transfer easy to find on the blockchain @@ -216,7 +216,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that's balance is being requested /// @return The balance of `_owner` at the current block - function balanceOf(address _owner) public view returns (uint256 balance) { + function balanceOf(address _owner) public constant returns (uint256 balance) { return balanceOfAt(_owner, block.number); } @@ -251,7 +251,7 @@ contract MiniMeToken is Controlled { /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens of _owner that _spender is allowed /// to spend - function allowance(address _owner, address _spender) public view returns (uint256 remaining) { + function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } @@ -277,7 +277,7 @@ contract MiniMeToken is Controlled { /// @dev This function makes it easy to get the total number of tokens /// @return The total number of tokens - function totalSupply() public view returns (uint) { + function totalSupply() public constant returns (uint) { return totalSupplyAt(block.number); } @@ -290,7 +290,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address from which the balance will be retrieved /// @param _blockNumber The block number when the balance is queried /// @return The balance at `_blockNumber` - function balanceOfAt(address _owner, uint _blockNumber) public view returns (uint256) { + function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { // These next few lines are used when the balance of the token is // requested before a check point was ever created for this token, it @@ -314,7 +314,7 @@ contract MiniMeToken is Controlled { /// @notice Total amount of tokens at a specific `_blockNumber`. /// @param _blockNumber The block number when the totalSupply is queried /// @return The total amount of tokens at `_blockNumber` - function totalSupplyAt(uint _blockNumber) public view returns(uint) { + function totalSupplyAt(uint _blockNumber) public constant returns(uint) { // These next few lines are used when the totalSupply of the token is // requested before a check point was ever created for this token, it @@ -382,7 +382,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly - function generateTokens(address _owner, uint _amount) public onlyController returns (bool) { + function generateTokens(address _owner, uint _amount) onlyController public returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); @@ -398,7 +398,7 @@ contract MiniMeToken is Controlled { /// @param _owner The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly - function destroyTokens(address _owner, uint _amount) public onlyController returns (bool) { + function destroyTokens(address _owner, uint _amount) onlyController public returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply >= _amount); uint previousBalanceFrom = balanceOf(_owner); @@ -416,7 +416,7 @@ contract MiniMeToken is Controlled { /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone - function enableTransfers(bool _transfersEnabled) public onlyController { + function enableTransfers(bool _transfersEnabled) onlyController public { transfersEnabled = _transfersEnabled; } @@ -428,7 +428,7 @@ contract MiniMeToken is Controlled { /// @param checkpoints The history of values being queried /// @param _block The block number to retrieve the value at /// @return The number of tokens being queried - function getValueAt(Checkpoint[] storage checkpoints, uint _block) internal view returns (uint) { + function getValueAt(Checkpoint[] storage checkpoints, uint _block) constant internal returns (uint) { if (checkpoints.length == 0) return 0; @@ -470,7 +470,7 @@ contract MiniMeToken is Controlled { /// @dev Internal function to determine if an address is a contract /// @param _addr The address being queried /// @return True if `_addr` is a contract - function isContract(address _addr) internal view returns(bool) { + function isContract(address _addr) constant internal returns(bool) { uint size; if (_addr == 0) return false; @@ -483,7 +483,7 @@ contract MiniMeToken is Controlled { } /// @dev Helper function to return a min betwen the two uints - function min(uint a, uint b) internal pure returns (uint) { + function min(uint a, uint b) pure internal returns (uint) { return a < b ? a : b; } @@ -504,7 +504,7 @@ contract MiniMeToken is Controlled { /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. - function claimTokens(address _token) public onlyController { + function claimTokens(address _token) onlyController public { if (_token == 0x0) { controller.transfer(this.balance); return; @@ -526,7 +526,7 @@ contract MiniMeToken is Controlled { address indexed _owner, address indexed _spender, uint256 _amount - ); + ); } @@ -557,9 +557,7 @@ contract MiniMeTokenFactory { uint8 _decimalUnits, string _tokenSymbol, bool _transfersEnabled - ) - public - returns (MiniMeToken) + ) public returns (MiniMeToken) { MiniMeToken newToken = new MiniMeToken( this, @@ -574,4 +572,4 @@ contract MiniMeTokenFactory { newToken.changeController(msg.sender); return newToken; } -} +} \ No newline at end of file From 51539caa7c1c4ee07584452ae51191b010f018a3 Mon Sep 17 00:00:00 2001 From: Jorge Izquierdo Date: Tue, 16 Oct 2018 22:47:13 +0200 Subject: [PATCH 4/4] Add active boolean as a param to MANAGE_PAYMENTS_ROLE --- apps/finance/arapp.json | 2 +- apps/finance/contracts/Finance.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/finance/arapp.json b/apps/finance/arapp.json index 49d5045ba4..26094e7040 100644 --- a/apps/finance/arapp.json +++ b/apps/finance/arapp.json @@ -50,7 +50,7 @@ { "name": "Disable payments", "id": "MANAGE_PAYMENTS_ROLE", - "params": ["Payment ID"] + "params": ["Payment ID", "Payment active"] } ], "path": "contracts/Finance.sol" diff --git a/apps/finance/contracts/Finance.sol b/apps/finance/contracts/Finance.sol index cb04f12ede..0ede145cca 100644 --- a/apps/finance/contracts/Finance.sol +++ b/apps/finance/contracts/Finance.sol @@ -325,7 +325,7 @@ contract Finance is EtherTokenConstant, IsContract, AragonApp { */ function setPaymentStatus(uint256 _paymentId, bool _active) external - authP(MANAGE_PAYMENTS_ROLE, arr(_paymentId)) + authP(MANAGE_PAYMENTS_ROLE, arr(_paymentId, uint256(_active))) paymentExists(_paymentId) { payments[_paymentId].inactive = !_active;