sugar
sugar copied to clipboard
[Bug]: Sugar doesn't resolve Token decimal places
Issue description
- Input 3,000,000 BONK for token payment guard config
- Deploy Candy Machine
- Mint cost is 30 BONK instead of 3M as expected
It seems like Sugar doesn't resolve decimal places for token payments the same way it does for SOL. Ideally the handling should be same.
Relevant log output
No response
Priority this issue should have
Low (slightly annoying)
This is actually a really annoying refactor as it requires passing a Program
object from the main function processing guards through multiple levels of nesting to the TokenPayment
to_guard_format
implementation. Or we have to know in that function which cluster we're on so we can build a RPC client and a make a network call to find out the number of decimal places in the mint.
The SOL implementation works because we know SOL always has nine decimal places.