Closed
Description
This is a minor issue that impacts developers working directly with the Toucan core contracts.
- The pool functions (e.g. in NCT.sol)
redeemAuto()
andredeemAuto2()
return arrays of TCO2 addresses and corresponding amounts that were redeemed in exchange for the pool token. These arrays contain entries corresponding to the TCO2s with the lowest scores fromscoredTCO2s
. In particular, if the lowest scored TCO2 is not present in the NCT pool (i.e., the pool has balance 0) then these functions still return the TCO2 address with a corresponding entry of 0 in theamounts
array. - The TCO2
retire()
function (from ToucanCarbonOffsets.sol) takes a uint256 specifying theamount
to retire. If this value is zero the transaction gets reverted, as_retire()
then callsregisterEvent()
fromRetirementCertifiates.sol
which understandably requires that amount to be non-zero, see:
.
A user would intuitively expect to be able to loop over the outputs of redeemAuto()
and provide them to retire()
as inputs, which is currently the case in the OffsetHelper
, see example-implementations/blob/d5e6...94cf8/contracts/OffsetHelper.sol#L494.
Perhaps it would be better to remove TCO2 addresses with corresponding amount 0 from the output of the redeemAuto functions?
The background that led to this observation is described in ToucanProtocol/example-implementations#31.
Metadata
Metadata
Assignees
Labels
No labels