Skip to content

Commit

Permalink
Fix vault issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
willjgriff committed May 29, 2020
1 parent 06d2d2e commit dab591f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions contracts/TokenRequest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,11 @@ contract TokenRequest is AragonApp {
return tokenManager.token();
}

/**
* @dev Disable recovery escape hatch, as it could be used
* maliciously to transfer funds away from TokenRequest
*/
function allowRecoverability(address token) public view returns (bool) {
return false;
}
}
10 changes: 9 additions & 1 deletion test/TokenRequestTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ contract('TokenRequest', ([rootAccount, ...accounts]) => {
})
})

describe('refundTokenRequest(uint256 _tokenRequestId) ', () => {
describe('refundTokenRequest(uint256 _tokenRequestId)', () => {
const refundEthAccount = accounts[2]
it('refund token (ERC20)', async () => {
const refundAmount = 100
Expand Down Expand Up @@ -567,5 +567,13 @@ contract('TokenRequest', ([rootAccount, ...accounts]) => {
await assertRevert(tokenRequest.refundTokenRequest(1, { from: refundEthAccount }), 'TOKEN_REQUEST_NO_REQUEST')
})
})

describe('transferToVault(address _token)', () => {
it('reverts', async () => {
await assertRevert(
tokenRequest.transferToVault(mockErc20.address),
'RECOVER_DISALLOWED')
})
})
})
})

0 comments on commit dab591f

Please sign in to comment.