Giter Site home page Giter Site logo

Amounts for staking about flow-core-contracts HOT 4 CLOSED

onflow avatar onflow commented on June 27, 2024
Amounts for staking

from flow-core-contracts.

Comments (4)

joshuahannan avatar joshuahannan commented on June 27, 2024

@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.

from flow-core-contracts.

joshuahannan avatar joshuahannan commented on June 27, 2024

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.

from flow-core-contracts.

cybercent avatar cybercent commented on June 27, 2024

@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.

from flow-core-contracts.

psiemens avatar psiemens commented on June 27, 2024

@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

from flow-core-contracts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.