Skip to content

Remove Mento dependencies, repoint stable tokens to IERC20CeloTokens#777

Draft
martinvol wants to merge 2 commits into
masterfrom
martinvol/removeMentoDependencies
Draft

Remove Mento dependencies, repoint stable tokens to IERC20CeloTokens#777
martinvol wants to merge 2 commits into
masterfrom
martinvol/removeMentoDependencies

Conversation

@martinvol
Copy link
Copy Markdown
Contributor

@martinvol martinvol commented May 26, 2026

Summary

Removes ContractKit's dependency on the Mento web3 ABIs (Reserve, StableToken), which are no longer generated by the monorepo @celo/abis package, and repoints the Celo stable tokens onto the new consolidated IERC20CeloTokens ABI.

Changes

  • Remove Reserve support. Deletes the ReserveWrapper and every reference to it (contract-cache, kit, proxy, and the CeloContract.Reserve enum in base).
  • Repoint stable tokens to IERC20CeloTokens. The StableToken / StableTokenBRL / StableTokenEUR factories (web3-contract-cache, mini-contract-cache), the StableTokenWrapper contract type, and the proxy ABI (proxy.ts) now import from @celo/abis/web3/IERC20CeloTokens instead 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 IERC20CeloTokens interface and stops generating the Mento ABIs in @celo/abis. This PR cannot be merged until that lands and a new @celo/abis version containing IERC20CeloTokens is published and pinned here.

Kept as a draft until the monorepo change is merged and released.


PR-Codex overview

This PR primarily removes the Reserve contract and its references throughout the codebase while updating imports and configurations related to the StableToken contract.

Detailed summary

  • Deleted Reserve.ts and Reserve.test.ts files.
  • Removed Reserve references from package.json, kit.ts, and various wrappers.
  • Updated StableToken import to use IERC20CeloTokens.
  • Adjusted ABI and contract factory references for StableToken.
  • Modified snapshots and test files to exclude Reserve data.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Drop ContractKit's dependency on the Mento web3 ABIs (Reserve, StableToken)
which are no longer generated by the monorepo abis package.

- Remove the Reserve wrapper and all its references (contract-cache, kit,
  proxy, base CeloContract enum).
- Repoint the StableToken / StableTokenBRL / StableTokenEUR factories, the
  StableTokenWrapper contract type, and the proxy ABI to the new
  @celo/abis/web3/IERC20CeloTokens generated artifacts.
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 26, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
33192604 Triggered Generic High Entropy Secret e35180a packages/sdk/contractkit/src/mini-contract-cache.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 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-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

⚠️ No Changeset found

Latest commit: f16e99f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread package.json
"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",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

- packages-to-be/stable-tokens.ts: repoint USD/EUR/BRL factories from the
  removed stableToken*ABI exports to ierc20CeloTokensABI (matches the
  contractkit repoint in e35180a; all three stables share the same type).
- transfer-stable-base.ts: drop now-unused @ts-expect-error suppression
  (the repoint makes the types align, so the directive errors with TS2578).
- commands/releasecelo/authorize.ts: revert accidentally-committed debug
  leftovers (re-enable await checker.runChecks(), drop console.log(sig)).
- commands/network/{parameters,contracts}: update the inline + .snap
  snapshots to drop the Reserve block now that the contract is gone.
- contractkit: remove the orphaned Reserve.test.ts left over from the
  Reserve wrapper deletion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant