-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoOffset fails if the target pool's balance of the lowest scored TCO2 is zero #31
Comments
tagging @lazaralex98 to triage |
This test case first creates the state described in the ticket as a setup step, ie, that the lowest scored TCO2 is not present in the NCT pool. Then it tests that autoRetire works, even if the lowest scored TCO2 is not in the pool.
Thanks Philipp, please see #32. |
Indeed Regardless of that, it seems to me like And, indeed if we look at the EDIT: Obviously it's not efficient or good if it attempts to retire |
I looked at this in more detail and tried to explain why the txn gets reverted here: ToucanProtocol/contracts/issues/5. |
Since 0x7f91...604c in block 31487844 (Aug-03-2022 10:11:10 PM +UTC), the lowest scored TCO2 in the NCT pool (TCO2-VCS-1052-2012) has balance zero. This state was previously created on Jul-11-2022 08:11:25 PM +UTC in 0xb402...7573 but subsequently reverted. These transactions, with the subsequent deposit of the TCO2 to the BCT pool, are listed here.
If the array of
scoredTCO2s
in the NCT storage has not been (manually) updated to reflect the fact that the NCT pool's balance of the lowest scored TCO2 is zero theautoOffset*
functions in the OffsetHelper fail:autoRedeem()
returns arrays of TCO2 addresses and amounts that were redeemed as returned byautoRedeem2()
. These arrays contain entries corresponding to the TCO2 with the lowest score fromscoredTCO2s
(even though the lowest scored TCO2 is not present in the NCT pool).autoRetire()
then tries to retire tokens from the lowest scored TCO2, even though the amount redeemed was zero, and the transaction is reverted.The text was updated successfully, but these errors were encountered: