Remove Mento dependencies, repoint stable tokens to IERC20CeloTokens#777
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
🦋 Changeset detectedLatest commit: 3a094d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| "typescript": "5.3.3" | ||
| }, | ||
| "resolutions": { | ||
| "@celo/abis": "file:/Users/martinvol/celo/celo-monorepo/packages/protocol/abis/celo-abis-13.0.0-post-audit.0.tgz", |
There was a problem hiding this comment.
This will not work in the CI, this has to be reverted once the new version ABI's are published after celo-org/celo-monorepo#11745 gets merged
…t stables to viem erc20 + ICeloToken Removes ContractKit's dependency on the Mento Reserve and StableToken ABIs without waiting on a new @celo/abis that exposes a consolidated interface. - Add stable-token-abi.ts: stableTokenViemAbi = viem erc20Abi + transferWithComment (ICeloToken) + StableToken owner/mint/burn/increase|decreaseAllowance/initialize, inlined verbatim from the generated ABI. Self-contained, no Mento import. - Repoint StableToken/StableTokenEUR/StableTokenBRL (contract-factory-cache, mini-contract-cache), StableTokenWrapper, the proxy init map, and the CLI stable-tokens helpers onto stableTokenViemAbi. - Remove ReserveWrapper, CeloContract.Reserve, getReserve(), NetworkConfig.reserve, and the ReserveProxy init entry; delete Reserve.ts/Reserve.test.ts. - Drop the now-unused @ts-expect-error in transfer-stable-base and the Reserve blocks from the network:parameters/contracts snapshots. Supersedes the IERC20CeloTokens approach in #777 (that interface is not published in any @celo/abis version).
f16e99f to
3a094d2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a094d2d53
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // (which @celo/abis is dropping). transferWithComment comes from ICeloToken; | ||
| // owner/mint/burn/increase|decreaseAllowance/initialize are the StableToken | ||
| // admin + proxy-init methods, inlined verbatim from the generated ABI. | ||
| const celoStableExtrasAbi = [ |
There was a problem hiding this comment.
Add TransferComment to stable token ABI
When callers read comments from stable-token transfers via StableTokenWrapper.getPastEvents('TransferComment', ...) or viem getContractEvents, this composed ABI no longer contains the Celo TransferComment event, so those calls now throw or cannot decode the logs even though transferWithComment is still exposed. The previous StableToken ABI included the ICeloToken event; add it to celoStableExtrasAbi alongside the function so commented stable transfers remain observable.
Useful? React with 👍 / 👎.
size-limit report 📦
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #777 +/- ##
==========================================
- Coverage 68.99% 68.34% -0.65%
==========================================
Files 97 152 +55
Lines 4438 8824 +4386
Branches 973 1712 +739
==========================================
+ Hits 3062 6031 +2969
- Misses 1307 2721 +1414
- Partials 69 72 +3
🚀 New features to boost your workflow:
|
Summary
Removes ContractKit's dependency on the Mento web3 ABIs (
Reserve,StableToken), which are no longer generated by the monorepo@celo/abispackage, and repoints the Celo stable tokens onto the new consolidatedIERC20CeloTokensABI.Changes
ReserveWrapperand every reference to it (contract-cache,kit,proxy, and theCeloContract.Reserveenum inbase).IERC20CeloTokens. TheStableToken/StableTokenBRL/StableTokenEURfactories (web3-contract-cache,mini-contract-cache), theStableTokenWrappercontract type, and the proxy ABI (proxy.ts) now import from@celo/abis/web3/IERC20CeloTokensinstead of the removed@celo/abis/web3/mento/*paths.Dependency on celo-monorepo
This PR depends on celo-org/celo-monorepo#11745, which introduces the new
IERC20CeloTokensinterface and stops generating the Mento ABIs in@celo/abis. This PR cannot be merged until that lands and a new@celo/abisversion containingIERC20CeloTokensis published and pinned here.Kept as a draft until the monorepo change is merged and released.
PR-Codex overview
This PR removes the dependency on the
ReserveandStableTokenABIs from the ContractKit, replacing them with a newstableTokenViemAbi. It simplifies the architecture by eliminating theReserveWrapperand related components, streamlining the stable token contracts.Detailed summary
Reserve.ts,Reserve.test.ts, andReserveWrapper.CeloContract.Reserveand related configurations.stableTokenViemAbi, combiningerc20Abiwith Celo-specific methods.stableTokenViemAbi.Reserveand adjustments to stable token references.