Closed friedger closed 4 years ago
On first glance I think that this isn't a bug with the Clarity VM and that the stacks-transactions-js
library is just neglecting to include the u
when converting uints to strings. Currently diving deeper and trying to test this hypothesis...
Yup, this appears to be what's happening. Will put up a PR in stacks-transactions-js
with this change soon.
@timstackblock is this a bug bounty bug?
Yes it is @friedger, @jdbender66 will contact you with more info in discord, thank you for the submission.
Describe the bug
The return value of
ft-get-balance
is an int instead of an uint, e.g. something like(ok 20)
when called as read-onlySteps To Reproduce
balance-of
ST398K1WZTBVY6FE2YEHM6HP20VSNVSSPJTW0D53M(ok 20)
Expected behavior
result should be
(ok u20)
Environment
using https://testnet-explorer.blockstack.org/sandbox?tab=contract-call
Additional context
Unit tests in clarity VM pass and handle uint values.
If you think this is eligible for a bug bounty, please check the relevant boxes below:
Critical, Launch Blocking Bugs
Consensus critical bugs
State corruption
Stolen funds
contract-call?
Take control and/or bring network to a halt
Major, Launch Blocking Bugs
Major bugs
Minor, Non-launch blocking bugs
Minor bugs