FungibleToken.adminContract: Either suffixing the name of a constructor function with “Constructor" or using a capital first letter makes its intended usage more clear.
FungibleToken.deploy(): Note that the initial deployment is signature-authorized, not proof-authorized. Consequently, none of the type invariants may be trusted in the initial deployment. As such, admin may be an invalid PublicKey (aka isOdd may be non-boolean), and decimals may be larger than a UInt8.
Luckily, whenever the states are used, they are witnessed (either explicitly or inside of state.get()), which adds constraints for the type-invariants.
It still may aid users and app developers to document that the deployed token contract may have invalid decimals to ensure no off-chain code makes assumptions about the decimal-value based on the verification-key alone.
FungibleToken.approveBase(): Consider documenting that forests are limited in size by MAX_ACCOUNT_UPDATES defined in token-contracts.ts.
General Documentation: Consider noting the following facts for developers:
Mint, Burn, and Transfer events may be triggered with amounts equal to 0. Off-chain listeners should be sure to take this into account. For example, maintaining a list of depositors into by tracking Mint events requires filtering to non-zero amounts.
FungibleToken.adminContract
: Either suffixing the name of a constructor function with “Constructor
" or using a capital first letter makes its intended usage more clear.FungibleToken.deploy()
: Note that the initial deployment is signature-authorized, not proof-authorized. Consequently, none of the type invariants may be trusted in the initial deployment. As such,admin
may be an invalidPublicKey
(akaisOdd
may be non-boolean), anddecimals
may be larger than aUInt8
. Luckily, whenever the states are used, they arewitness
ed (either explicitly or inside ofstate.get()
), which adds constraints for the type-invariants. It still may aid users and app developers to document that the deployed token contract may have invaliddecimal
s to ensure no off-chain code makes assumptions about thedecimal
-value based on the verification-key alone.FungibleToken.approveBase()
: Consider documenting that forests are limited in size byMAX_ACCOUNT_UPDATES
defined intoken-contracts.ts
.Mint
,Burn
, andTransfer
events may be triggered with amounts equal to0
. Off-chain listeners should be sure to take this into account. For example, maintaining a list of depositors into by trackingMint
events requires filtering to non-zero amounts.