Skip to content
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

Merged
merged 4 commits into from
Oct 16, 2018
Merged

Add revert reasons to proxies #495

merged 4 commits into from
Oct 16, 2018

Conversation

bingen
Copy link
Contributor

@bingen bingen commented Oct 16, 2018

Closes #490.

Copy link
Contributor

@izqui izqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -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);
Copy link
Contributor

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.

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";
Copy link
Contributor

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 :).

Copy link
Contributor Author

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);
}

Copy link
Contributor

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.

Copy link
Contributor Author

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!

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXECUTE

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏅 👏

@izqui izqui merged commit cdaee27 into master Oct 16, 2018
@izqui izqui deleted the issue490 branch October 16, 2018 21:55
MickdeGraaf pushed a commit to MickdeGraaf/aragon-apps that referenced this pull request Jan 28, 2020
* Add revert reasons to proxies

Closes aragon#490.

* Add revert reasons to proxies

Address PR aragon#495 comments.

* Fix
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
* Add revert reasons to proxies

Closes aragon#490.

* Add revert reasons to proxies

Address PR aragon#495 comments.

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants