Smart contracts are immutable. Despite the many obvious benefits of such a characteristic, it also means any issues found after deploy may prove difficult or even impossible to solve without deploying contracts again, which imply a transition process that is, ideally, avoided. This page describes post-release disclosures all users of PaintSwap should be aware of.
The Art Gallery is responsible for holding 50% of staking/farming rewards for a period of 12 weeks, a major feature of our tokenomics. As it withholds funds, a very simple contract was made in order to reduce the likelihood of any breaking bugs. Users simply call a single
unlockmethod, which goes through all their lockups and releases the ones that have been locked for longer than 12 weeks.
A lock is made every time the user harvests or compounds their staking/farming rewards. An unlock can release multiple locks at once.
In this simplicity, there was an oversight: a transaction gas limit can prevent users from unlocking when they have a very large number of lockups ready to be unlocked. Ideally, the contract should have been made aware of the amount of gas being spent and stop before the limit is reached. But without this check, the transaction will revert due to going over gas limits. The Fantom network current gas limit puts the maximum number of simultaneous unlocks at around 600.
If this happens, you will be unable to perform any further unlocks of the art gallery; the locked rewards will be lost along with 50% of future rewards on the same account (those that go into the gallery). All other PaintSwap functionality will still work and it won't affect any funds in your wallet in any way.
Fortunately, the vast majority of users won't ever run into this limitation due to the large amount of harvesting and not unlocking required to trigger it. Even if a user harvests frequently, if after the 12 week lockup they unlock frequently, this will prevent encountering this limitation, because each lock takes 12 weeks to become unlockable. Here's what we recommend:
- 1.Be aware of the issue and try to limit the number of harvests to 5/day, across all pools and farms. This still allows a daily compound if desired.
- 2.Visit PaintSwap weekly and perform a gallery unlock when
unlockableCountbecomes larger than 50. If possible, do it earlier. The more frequently you harvest, the more frequently you should unlock as well to prevent accumulating unlockables. The PaintSwap website will warn you about unlocking when the time comes.
- 3.Never accumulate more than 500
unlockableCount. Reaching ~600 will mean a complete inability to unlock art gallery funds on your account.
Moreover, yield optimizers should take this limitation under consideration if they perform a high number of harvests.
- We have updated the UI to warn users when their
unlockableCountreaches a moderate value and recommend they perform an unlock.
- If a replacement BRUSH contract is released, to enhance the current one with additional features, the Art Gallery contract will be fixed and released again as well.