Skip to content

OKB Adapter: add whitelist and owner#70

Merged
doutv merged 7 commits intoreview/cgt-contractfrom
fix/okb-adapter
Oct 17, 2025
Merged

OKB Adapter: add whitelist and owner#70
doutv merged 7 commits intoreview/cgt-contractfrom
fix/okb-adapter

Conversation

@doutv
Copy link

@doutv doutv commented Oct 16, 2025

No description provided.

doutv added 7 commits October 16, 2025 14:13
- Removed the OKBBurner implementation and its related functionality from DepositedOKBAdapter, simplifying the contract.
- Added a new ERC20Rescuer contract to handle the rescue of ERC20 tokens, enhancing token management.
- Updated DepositedOKBAdapter to utilize the new rescuer address for transferring any mistakenly sent OKB tokens.
- Cleaned up unnecessary events and errors related to the burner functionality, improving code clarity and maintainability.
…ntrol

- Introduced Ownable inheritance to manage ownership and access control.
- Added a whitelist mechanism allowing only approved addresses to deposit OKB.
- Implemented batch functions for adding and removing addresses from the whitelist.
- Updated deposit logic to enforce whitelisting and added error handling for zero addresses.
- Removed the ERC20Rescuer contract, consolidating rescue functionality within DepositedOKBAdapter.
- Cleaned up unnecessary errors and improved overall contract clarity and maintainability.
- Introduced a new error for transfer failures to improve error handling.
- Updated the constructor to transfer ownership to the specified owner after minting.
- Modified transfer functions to check for successful token transfers, reverting on failure.
- Improved overall contract robustness and clarity by handling potential transfer issues.
- Simplified the TransferNotAllowed error by removing parameters, enhancing clarity.
- Updated transfer functions to always revert with the new error format, ensuring consistent error handling.
- Improved code maintainability by reducing complexity in transfer logic.
- Introduced a new test suite for DepositedOKBAdapter, covering constructor validation, whitelist management, deposit functionality, transfer restrictions, and ERC20 rescue operations.
- Implemented mock contracts for testing, including MockOKB and MockOptimismPortal2, to simulate interactions and validate behavior.
- Enhanced test coverage to ensure robust error handling and correct functionality across various scenarios, including deposits by whitelisted users and handling of edge cases.
- Improved overall test structure for better maintainability and clarity.
- Eliminated the OKBBurner contract from the SetupCustomGasToken script, simplifying the deployment process.
- Updated the DepositedOKBAdapter deployment to handle OKB burning internally and added the deployer address to the whitelist.
- Enhanced configuration checks to verify adapter ownership and whitelist status, ensuring robust contract setup.
@doutv doutv merged commit b676c86 into review/cgt-contract Oct 17, 2025
@doutv doutv deleted the fix/okb-adapter branch October 17, 2025 03:32
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