Comments (2)
Sorry @TomAFrench just getting to this. Just want to double check, do you mean the linkedToken
property on the zkAsset?
If so, that is really an address, which you'll have to call to get information specific to the ERC20 (like the name of the token, if any). For the total amount of public value of a token stored within Aztec, you want the totalSupply
property on the NoteRegistry associated with the zkAsset, which can be had by calling getRegistry()
on ACE
and giving it the address of the deployed zkAsset
.
from aztec-v1.
Hey, no worries.
When I create a zkAsset, I get not only a linkedToken
property but a token
property as shown below.
I'm coming at this from the perspective of (starting from only having the address of the zkAsset) printing the private and public balances for a particular user both in terms of the ERC20 value (i.e. accounting for the scaling factor) with the correct number of decimals. I can scale the private balance to be in terms of wei using the sdk but as you mention, getting the proper number of decimals to scale this by would require instantiating a contract object and making another call to get this information before the balances could be displayed.
As this would be a common task for building with zkAssets I thought it would be worth automatically caching this data within the token
object. I'd preferably like to avoid having the instantiate another contract object and make an another call to get this information if possible as I would likely have to do it whenever I interacted with a zkAsset.
from aztec-v1.
Related Issues (20)
- The automated release is failing 🚨 HOT 1
- Generation of proof approval signatures HOT 1
- ACE contract does not use IACE interface
- Unused parameter in JoinSplitProof65793.encodeABI
- note.fromEventLog failing from missing /node_modules/aztec.js/dist/mcl_c.wasm file HOT 2
- Note.derive not setting owner HOT 4
- Dependabot couldn't authenticate with registry.npmjs.org
- RaidGuild Request: indexed.wtf doc edits and additions
- zk.money does not work with MetaMask + local node
- Feature request: Add fees paid per tx to the tx history
- Support batched payments
- Speed up wallet sync (without compromising on security or privacy)
- Project Depreciated Warning HOT 2
- AztecSDK with NextJS: Compile Error HOT 2
- Increase the signer.signPermit support for more Tokens
- How to integrate the Mainnet<>Aztec bridge in solidity
- Migration error
- Importing Aztec into Remix Ethereum IDE
- [delete]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aztec-v1.