The supply limit limits issue, not supply
Description
In the state for the token contract, for each token symbol, the Issued
property tracks the total tokens issued, which does not decrease when tokens are burned. On the other hand, the Supply
property tracks the total circulating supply, which does decrease when tokens are burned.
The TotalSupply
constant property is, based on its name, supposed to be a limit to the amount of supply that can be outstanding. However, see the Issue
function:
public override Empty Issue(IssueInput input)
{
// [...]
tokenInfo.Issued = tokenInfo.Issued.Add(input.Amount);
tokenInfo.Supply = tokenInfo.Supply.Add(input.Amount);
Assert(tokenInfo.Issued <= tokenInfo.TotalSupply, "Total supply exceeded.");
// [...]
}
Instead of being a limit on total supply, it is implemented as a limit on the total amount issued. This means that burned tokens do not move the contract away from this limit.
Impact
Ultimately, this means that the LP tokens will eventually not be mintable due to the total issued token count hitting the supply cap from normal minting and burning.
Recommendations
Compare Supply
against TotalSupply
instead of Issued
.
Alternatively, if this is meant to be a cap on total issued quantity, the property should be renamed to TotalIssued
and logic should be added to increase this constant once the limit is reached.
Remediation
Awaken Finance has chosen to disable enforcement of these limits in .