-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add revert reasons to proxies #495
Conversation
Closes #490.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
apps/vault/contracts/Vault.sol
Outdated
@@ -50,12 +58,12 @@ contract Vault is EtherTokenConstant, AragonApp, DepositableStorage { | |||
external | |||
authP(TRANSFER_ROLE, arr(_token, _to, _value)) | |||
{ | |||
require(_value > 0); | |||
require(_value > 0, ERROR_TRANSFER_VALUE_ZERO); | |||
|
|||
if (_token == ETH) { | |||
_to.transfer(_value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should use a require(_to.send(_value))
here so we can customize the error message.
apps/vault/contracts/Vault.sol
Outdated
string private constant ERROR_TRANSFER_VALUE_ZERO = "VAULT_TRANSFER_VALUE_ZERO"; | ||
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH"; | ||
string private constant TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT"; | ||
string private constant TOKEN_TRANSFER_REVERTED = "VAULT_TOKEN_TRANSFER_REVERTED"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These last two should have the ERROR_
prefix :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not using the prefix when it's a _REVERT
, but I'll add it.
@@ -176,7 +186,7 @@ contract Voting is IForwarder, AragonApp { | |||
* @param _evmScript Start vote with script | |||
*/ | |||
function forward(bytes _evmScript) public { | |||
require(canForward(msg.sender, _evmScript)); | |||
require(canForward(msg.sender, _evmScript), ERROR_CAN_NOT_FORWARD); | |||
_newVote(_evmScript, "", true, true); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't comment far enough down, but there should be a message for the require(vote_.totalVoters > 0)
later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed that one when merging master
, thanks!
apps/voting/contracts/Voting.sol
Outdated
@@ -162,7 +172,7 @@ contract Voting is IForwarder, AragonApp { | |||
* @param _voteId Id for vote | |||
*/ | |||
function executeVote(uint256 _voteId) external voteExists(_voteId) { | |||
require(canExecute(_voteId)); | |||
require(canExecute(_voteId), ERROR_CAN_NOT_EXCUTE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXECUTE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏅 👏
Address PR #495 comments.
* Add revert reasons to proxies Closes aragon#490. * Add revert reasons to proxies Address PR aragon#495 comments. * Fix
* Add revert reasons to proxies Closes aragon#490. * Add revert reasons to proxies Address PR aragon#495 comments. * Fix
Closes #490.