forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
Add GasStation predeploy #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sledro
wants to merge
17
commits into
op-contracts/v3.0.0-lightlink
Choose a base branch
from
feature/gasless-system
base: op-contracts/v3.0.0-lightlink
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Changed Solidity version to 0.8.25. - Added interfaces for ERC20 and burnable ERC20 tokens. - Introduced a new storage structure for GasStation. - Enhanced contract registration with admin management and credit packages. - Implemented functions for credit management, including purchasing, adding, and removing credits. - Added modifiers for access control and validation. - Included events for better tracking of contract activities. - Improved error handling with custom errors for gas efficiency.
- Added support for single-use gasless transactions, including a new state variable and mapping to track used addresses. - Introduced functions to check if an address has used gasless transactions and to configure single-use mode for contracts. - Implemented an event to signal changes in single-use status. - Updated existing functions to accommodate the new single-use feature.
…redeploys library - Added GasStation address and related functionality to the Predeploys library. - Updated L2Genesis contract to handle GasStation separately for proxy management. - Implemented a dedicated method for setting the GasStation predeploy in the initialization process.
- Updated the notProxied function in the Predeploys library to exclude the GasStation address from the check, streamlining the proxy management process for predeploys.
- Updated the isPredeployNamespace function to include a special case for the GasStation address, ensuring it is correctly recognized as part of the predeploy namespace. This change enhances the proxy management for the GasStation predeploy.
- Integrated ReentrancyGuard into the GasStation contract to prevent reentrant calls on critical functions. - Applied the nonReentrant modifier to purchaseCredits, withdrawETH, and other relevant functions to improve security.
- Updated the withdrawTokens function to improve clarity and efficiency by removing redundant checks for ETH withdrawal. - Enhanced error handling by introducing a revert for zero address cases. - Maintained functionality for ERC20 token withdrawals while ensuring proper balance checks and transfer handling.
…urchase - Updated the registerContract function to require a credit package purchase during registration, ensuring contracts are registered only after successful credit acquisition. - Introduced an internal _purchaseCredits function to handle credit validation and payment processing. - Emitted CreditsPurchased events to track credit transactions associated with contract registrations.
- Introduced a new test file for the GasStation contract, covering various functionalities including contract registration, credit management, and admin configuration. - Implemented tests for constructor behavior, credit package management, and event emissions to ensure contract integrity. - Enhanced coverage with edge case scenarios and reentrancy protection checks to validate contract security and performance.
…tionality - Modified event signatures in the GasStation contract to include additional parameters for better tracking of actions, such as the user initiating the action. - Updated the test suite to reflect changes in event emissions, ensuring comprehensive coverage of new event signatures. - Enhanced clarity in event logging for contract management, credit transactions, and administrative actions.
- Modified test functions in GasStationTest to include the view modifier for better clarity and to reflect their read-only nature. - Ensured that the tests maintain their functionality while adhering to best practices for Solidity function visibility.
- Changed the test_constructor_setsDAO function in GasStationTest to include the view modifier, clarifying its read-only nature. - Ensured the test continues to validate the correct initialization of the DAO and package ID.
…tructor - Added the GasStation contract import to L2Genesis and modified the setGasStation function to initialize the GasStation instance with the DAO address. - Updated the GasStation contract to use an initializer instead of a constructor, enhancing its proxy compatibility. - Adjusted the GasStationTest to deploy the GasStation via a proxy and validate the initialization process, ensuring proper handling of zero address cases.
…age reference - Changed the GAS_STATION_STORAGE_LOCATION constant in the GasStation contract to ensure accurate storage location for gas station data. - This update is crucial for maintaining the integrity of the contract's storage layout and ensuring proper functionality.
- Simplified the initialize function in the GasStation contract by removing the validAddress modifier, as the address is now directly set in storage. - This change streamlines the initialization process while maintaining the integrity of the contract's functionality.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
op-contracts/v3.0.0GasStation.solforge buildthe artifacts and pointop-deployerto them