Skip to content

Conversation

@doutv
Copy link
Collaborator

@doutv doutv commented Dec 2, 2025

Adapt StakedTokenV1 and ExchangeRateUpdater from cbETH

Differences with cbETH https://github.com/coinbase/wrapped-tokens-os/tree/5697a90f4c47e8d801cedce81444a8464019fe08:

StakedTokenV1.sol

  • Solidity version 0.6.12 -> 0.8.24
  • Inherit FiatTokenV2_1 -> Token

ExchangeRateUpdater.sol, ExchangeRateUtil.sol, RateLimit.sol

  • Solidity version 0.8.6 -> 0.8.24
  • OpenZeppelin 4.2.0 -> 5.4.0
    • Ownable now requires an initialOwner parameter in its constructor Address
    • library functionCall and functionStaticCall signatures changed - the error message is now optional

Adapt xToken from xBTC, make it more general for other xAssets

  • set max supply when initialize
  • separate admin and deny lister when initialize
  • remove decimals() = 8

doutv added 30 commits December 1, 2025 17:24
1. solidity version 0.6.12 -> 0.8.24
2. based on FiatTokenV2_1 -> xbtc
3. onlyOwner -> onlyRole(DEFAULT_ADMIN_ROLE)
…to reflect changes in initialization parameters and contract references.
1. solidity version 0.8.6 -> 0.8.24
2. OZ 4.x -> 5.x. Ownable now requires an initialOwner parameter in its constructor
Address library functionCall and functionStaticCall signatures changed - the error message is now optional
…ntracts

- Introduced ExchangeRateUpdaterTest with tests for initialization, exchange rate updates, and ownership management.
- Added ExchangeRateUpdaterE2ETest for end-to-end testing of the exchange rate update flow.
- Created RateLimitTest covering caller management, allowance replenishment, and edge cases.
- Implemented RateLimitHarness for testing internal functions of the RateLimit contract.
…umentation and implementation. default decimals = 18
…integration tests for StakedTokenV1 and ExchangeRateUpdater, including scenarios for daily rate updates, multiple callers, and emergency updates.
…al implementations and enhance code consistency
…h author and repository details, and remove package-lock.json to streamline dependency management.
…e token details, and enhance documentation on architecture, features, and project structure.
…ript, ensuring it is both ProxyAdmin owner and has DEFAULT_ADMIN_ROLE in Token contract.
doutv added 4 commits December 5, 2025 12:01
…update verification methods for initialization values across tests.
…ipts to use abi.encodeCall for improved type safety and clarity.
…inbase" to "org.okx" for consistency with new naming conventions.
…ation

- Introduced .env.forge.example for environment variable setup.
- Created DeployXETH script to deploy xETH token with proxy, including role assignments and initialization logic.
@doutv doutv force-pushed the xbeth-evm branch 2 times, most recently from f56e87d to e8a0b80 Compare December 8, 2025 02:14
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.

2 participants