Closed pscott closed 3 months ago
Hey @pscott, thanks for the detail report. To answer your questions:
Are those two functions really supposed to be part of the interface?
They should be optional and not part of the ABI as they currently are since they are not exposed in any embeddable implementation.
Is there another way of implementing them rather than manually implementing them on the contract?
There's not.
Is the Checkpoint struct exported elsewhere?
Not but it should, that is an issue of the latest release, and should be fixed. The idea was to make StorageArray private, since the intention is to wait for the cairo native one. We should make Checkpoint public again.
Am I misunderstanding the interface?
The interface represents the interface of a preset that was removed (which included those two methods). It should be fixed.
I created this PR and we should be releasing a fix soon. Thanks again.
I am trying to implement an ERC20 Votes token using the ERC20Votes extension. It worked fine on 0.13.0, but it's not working since 0.14.0.
📝 Details
The ERC20Votes interface mentions the presence of
num_checkpoints()
andcheckpoint()
. Those functions are not part of the ERC20VotesImpl, so my understanding is they were supposed to be defined by the implementor (me).I did it with 0.13.0 (see code). Ever since 0.14.0 (this commit),
Checkpoint
is apub(crate)
which means it's only accessible to the crate.This means that trying to
use openzeppelin::utils::structs::checkpoints::Checkpoint;
will error. But it's a type required in the function signature ofcheckpoints
, which means it's impossible for the implementor to implement it.But if I don't implement it, then the contract will be just fine; however i won't respect the ERC20VotesABI interface.
So the question is:
Checkpoint
struct exported elsewhere?interface
?🔢 Code to reproduce bug
Token contract: