-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: custom gas token #17320
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
Closed
hexshire
wants to merge
12
commits into
ethereum-optimism:feat/cgt
from
defi-wonderland:sc-feat/custom-gas-token
Closed
feat: custom gas token #17320
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
98be88f
feat(cgt): custom gas token
hexshire d959e7d
feat: add gasPayingTokenName and gasPayingTokenSymbol on json config …
0xniha 4fbfc62
fix: contracts semver
0xniha c6c4c6b
fix: remove system config bool
ashitakah 0243f15
test: add OptimismPortal2CGT tests
0xniha 4aca92b
chore(cgt): set cgt flag l1block & fixes
0xniha 848a36b
Merge branch 'develop' into chore/cgt-sync-develop
hexshire 1026df6
Merge pull request #527 from defi-wonderland/chore/cgt-sync-develop
agusduha 5a86ab6
fix(linter): resolve goimports formatting issue
hexshire f83b8f2
feat: add separate l2 contracts for cgt (#530)
0xniha 4590fa8
test(cgt): fix failing tests (#529)
hexshire 6aa8a12
fix(cgt): revert weth
hexshire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,6 +157,9 @@ func (c *Intent) validateStandardValues() error { | |
| if len(chain.AdditionalDisputeGames) > 0 { | ||
| return fmt.Errorf("%w: chainId=%s additionalDisputeGames must be nil", ErrNonStandardValue, chain.ID) | ||
| } | ||
| if chain.CustomGasToken != nil && (chain.CustomGasToken.Enabled != standard.CustomGasTokenEnabled) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something that we may need to revisit |
||
| return fmt.Errorf("%w: chainId=%s custom gas token not allowed in standard configuration", ErrNonStandardValue, chain.ID) | ||
| } | ||
| } | ||
|
|
||
| challenger, _ := standard.ChallengerAddressFor(c.L1ChainID) | ||
|
|
@@ -298,6 +301,11 @@ func NewIntentCustom(l1ChainId uint64, l2ChainIds []common.Hash) (Intent, error) | |
| intent.Chains = append(intent.Chains, &ChainIntent{ | ||
| ID: l2ChainID, | ||
| GasLimit: standard.GasLimit, | ||
| CustomGasToken: &CustomGasToken{ | ||
| Enabled: standard.CustomGasTokenEnabled, | ||
| Name: standard.CustomGasTokenName, | ||
| Symbol: standard.CustomGasTokenSymbol, | ||
| }, | ||
| }) | ||
| } | ||
| return intent, nil | ||
|
|
@@ -342,6 +350,11 @@ func NewIntentStandard(l1ChainId uint64, l2ChainIds []common.Hash) (Intent, erro | |
| L1ProxyAdminOwner: l1ProxyAdminOwner, | ||
| L2ProxyAdminOwner: l2ProxyAdminOwner, | ||
| }, | ||
| CustomGasToken: &CustomGasToken{ | ||
| Enabled: standard.CustomGasTokenEnabled, | ||
| Name: standard.CustomGasTokenName, | ||
| Symbol: standard.CustomGasTokenSymbol, | ||
| }, | ||
| }) | ||
| } | ||
| return intent, nil | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name/Symbolshould be empty sinceEnabledis false?