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

Amounts for staking #13

Closed
cybercent opened this issue Sep 26, 2020 · 4 comments
Closed

Amounts for staking #13

cybercent opened this issue Sep 26, 2020 · 4 comments

Comments

@cybercent
Copy link

A balance of 10K Flow looks like this: balance: 1000000000000

Just checking that the minimums are right here:

self.minimumStakeRequired = {UInt8(1): 250000.0, UInt8(2): 500000.0, UInt8(3): 1250000.0, UInt8(4): 135000.0, UInt8(5): 0.0}

@joshuahannan
Copy link
Member

@cybercent Are you sure you aren't getting this mixed up with how ETH is represented in Solidity? In Cadence we use UFix64 to represent Flow tokens, so we can have 10k FLOW represented as 10000.0.

@joshuahannan
Copy link
Member

The number still has precision up to 8 decimal places, but it is only represented as an integer under the hood. We can represent it as a decimal number in Cadence.

@cybercent
Copy link
Author

@joshuahannan thanks for the explanation.
The confusion came from when I queried an account's balance via gRPC.
I see the amount like this: 1000000000000 not like this 10000.0, probably because there is no UFix64 in Go.

I opened the issue just to check that there was no mistake there. Good to know the amounts are correct.

@psiemens
Copy link
Contributor

@cybercent Was just going to ask if that number is reported by the Go SDK. Are you calling GetAccount? I think we can update the Go SDK to use cadence.UFix64 to represent the balance field

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