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

Change note value unit in solidity contract #24

Closed
AntoineRondelet opened this issue Apr 29, 2019 · 1 comment
Closed

Change note value unit in solidity contract #24

AntoineRondelet opened this issue Apr 29, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers solidity Task related to the Solidity part of the code base

Comments

@AntoineRondelet
Copy link
Contributor

AntoineRondelet commented Apr 29, 2019

We might need to use the Szabo as a unit for the payments.

In fact, note values are represented (in the prover/circuit) by hexadecimal strings encoded on 64bits. As a consequence, the maximum value for a note is: 0xFFFFFFFFFFFFFFFF which corresponds to: 18446744073709551615 in decimal.

Now, if we use this number as Wei, this represents: 18.446744073709551615 ETH. However, we might not need such a long mantissa. Moreover, we would like to be able to do payments of more than 18ETH.
If we change the unit from Wei to Szabo, the number 18446744073709551615 becomes equal to 18 446 744 073 709.551615 ETH which presents a sufficiently high upper bound for note values and which contains 6 digits in the mantissa.

See: https://solidity.readthedocs.io/en/v0.5.0/units-and-global-variables.html#ether-units for some infos on how to change the units.

@AntoineRondelet AntoineRondelet added enhancement New feature or request good first issue Good for newcomers solidity Task related to the Solidity part of the code base labels Apr 29, 2019
AntoineRondelet added a commit that referenced this issue Nov 4, 2019
@AntoineRondelet
Copy link
Contributor Author

Closing this issue as the corresponding PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers solidity Task related to the Solidity part of the code base
Projects
None yet
Development

No branches or pull requests

2 participants