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

dao exec for vote method in voting app always voting yes #982

Closed
Bumangues opened this issue Dec 4, 2019 · 4 comments
Closed

dao exec for vote method in voting app always voting yes #982

Bumangues opened this issue Dec 4, 2019 · 4 comments
Assignees

Comments

@Bumangues
Copy link

Bumangues commented Dec 4, 2019

🐛 Bug Report

I am trying to call the vote method from the voting app in an organization I've created in the Rinkeby testnet. I am able to call the method, but regardless of wether I pass '0' or '1' in the second argument, the transaction is "Successfully executed: "Vote yes in vote #"".

for example:

dao --environment aragon:rinkeby exec 0xd781d3Ab8e963caB04202993986721B20fC853dF 0xb3dca023cef5d2182b222a7b91b78723f60347ea vote "13" "0" "0" --debug yields

❯ aragonCLI version: 6.4.1
❯ argv: ["/Users/daniel/.nvm/versions/node/v10.15.3/bin/node","/Users/daniel/.nvm/versions/node/v10.15.3/bin/aragon","dao","--environment","aragon:rinkeby","exec","0xd781d3Ab8e963caB04202993986721B20fC853dF","0xb3dca023cef5d2182b222a7b91b78723f60347ea","vote","13","0","0","--debug"]
❯ Could not find 'arapp.json'. Using the default configuration to connect to rinkeby.
✔ Check IPFS
✔ Check IPFS
✔ Generating transaction
✔ Sending transaction
✔ Successfully executed: "Vote yes in vote #13"`

I find this interesting because based on the logs, it is parsed correctly, but the transaction is not executed in the manner that I expected when passing 0 in the second param of the vote method.

I attempted to vote 'no' through the browser GUI in chrome and was successful in voting no.

When I looked at the transaction through the rinkeby block explorer, I saw the input data for the transaction done through the browser and saw that the second parameter was indeed 0:

Function: vote(uint256 _voteId, bool _supports, bool _executesIfDecided) **
MethodID: 0xdf133bca
[0]: 0000000000000000000000000000000000000000000000000000000000000008
[1]: 0000000000000000000000000000000000000000000000000000000000000000
[2]: 0000000000000000000000000000000000000000000000000000000000000001

However, the input data for the transaction done through Aragon CLI had a 1 in the second parameter:

Function: vote(uint256 _voteId, bool _supports, bool _executesIfDecided) ***
MethodID: 0xdf133bca
[0]: 000000000000000000000000000000000000000000000000000000000000000d
[1]: 0000000000000000000000000000000000000000000000000000000000000001
[2]: 0000000000000000000000000000000000000000000000000000000000000001

Have you read the Contributing Guidelines on issues?

Yes

Context

Mainnet or testnet?

Rinkeby

Organization

danieltest.aragonid.eth

Environment

  • MacOS 10.14.6
  • Browser and browser version: Chrome 78.0.3904.108

To Reproduce

(Write your steps here:)

  1. Create an org with a Membership Template in the Rinkeby Testnet
  2. Create 6 votes in the voting app, two to test the voting mechanism through the browser and four to test the four possible combinations of params through Aragon CLI.
  3. In the browser, vote YES for Vote #0
  4. In the browser, vote NO for Vote Move handlers into own files #1
  5. In the terminal, vote withdao --debug --environment aragon:rinkeby exec <dao-addr> <app-proxy-addr> vote 2 1 1
  6. In the terminal, vote withdao --debug --environment aragon:rinkeby exec <dao-addr> <app-proxy-addr> vote 3 0 1
  7. In the terminal, vote withdao --debug --environment aragon:rinkeby exec <dao-addr> <app-proxy-addr> vote 4 0 0
  8. In the terminal, vote withdao --debug --environment aragon:rinkeby exec <dao-addr> <app-proxy-addr> vote 5 1 0

Expected behavior

In step 3, the vote is yes
In step 4, the vote is no
In step 5, the vote is yes
In step 6, the vote is no
In step 7, the vote is no
In step 8, the vote is yes

Actual Behavior

In step 3, the vote is yes
In step 4, the vote is no
In step 5, the vote is yes
In step 6, the vote is yes
In step 7, the vote is yes
In step 8, the vote is yes

You can observe this behavior through the browser and through a block explorer

@welcome
Copy link

welcome bot commented Dec 4, 2019

Thanks for opening your first issue in aragonCLI! Someone will circle back soon ⚡

@0xGabi
Copy link
Contributor

0xGabi commented Dec 4, 2019

@Bumangues thanks for reporting this issue and the super clear explanation. We will look at it and let you know when we fix it.

@macor161 macor161 self-assigned this Dec 4, 2019
@macor161 macor161 added the 🐛 bug An unexpected behavior of the API label Dec 4, 2019
@0xGabi 0xGabi mentioned this issue Dec 4, 2019
1 task
@macor161
Copy link
Contributor

macor161 commented Dec 4, 2019

Hi @Bumangues, thank you very much for reporting this. We currently doesn't support conversion of int to boolean types. As you can see here: https://github.com/aragon/aragon-apps/blob/master/apps/voting/contracts/Voting.sol#L154 the last two parameters are boolean so the command should be

dao --environment aragon:rinkeby exec 0xd781d3Ab8e963caB04202993986721B20fC853dF 0xb3dca023cef5d2182b222a7b91b78723f60347ea vote "13" "false" "false" --debug

Hopefully in the future we can support type conversion.

@macor161 macor161 removed the 🐛 bug An unexpected behavior of the API label Dec 4, 2019
@Bumangues
Copy link
Author

Ah, thank you for the clarification!

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

No branches or pull requests

3 participants