forked from evmos/ethermint
-
Notifications
You must be signed in to change notification settings - Fork 53
feat: support preinstalls #728
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
Merged
thomas-nguy
merged 26 commits into
crypto-org-chain:develop
from
thomas-nguy:thomas/support-preinstall
Oct 2, 2025
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c9d6bf5
support preinstall
thomas-nguy 8855857
fix proto
thomas-nguy cb462f6
fix build
thomas-nguy 981a9d8
fix lint
thomas-nguy e7ffc4a
fix test
thomas-nguy 1a85c76
change from error to log
thomas-nguy 867e292
remove unecessary name
thomas-nguy 18d0fcd
register msg
thomas-nguy 1a16725
register msg
thomas-nguy 179da76
add dummy log
thomas-nguy d3aef17
add dummy log
thomas-nguy 7579146
add log
thomas-nguy c862336
debug
thomas-nguy 72d3c5e
cleanup
thomas-nguy de8d34f
some fixes
thomas-nguy d6cb7f9
somecleanup
thomas-nguy 4ff6094
move set account
thomas-nguy a017854
add test
thomas-nguy d9ffd83
fix logic
thomas-nguy 828d652
add Changelog
thomas-nguy 638000c
update deps
thomas-nguy 4b372bb
remove dead code
thomas-nguy 2cdbb7d
fix comments
thomas-nguy 202679e
add check precompile
thomas-nguy cec8dcf
add validate basic for MsgRegisterPreinstalls
thomas-nguy 88ece54
add more info in error
thomas-nguy 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package evmd | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
|
|
||
| evmtypes "github.com/evmos/ethermint/x/evm/types" | ||
| ) | ||
|
|
||
| // GenesisState of the blockchain is represented here as a map of raw json | ||
| // messages key'd by an identifier string. | ||
| // The identifier is used to determine which module genesis information belongs | ||
| // to so it may be appropriately routed during init chain. | ||
| // Within this application default genesis information is retrieved from | ||
| // the ModuleBasicManager which populates json from each BasicModule | ||
| // object provided to it during init. | ||
| type GenesisState map[string]json.RawMessage | ||
|
|
||
| // NewEVMGenesisState returns the default genesis state for the EVM module. | ||
| // | ||
| // NOTE: for the example chain implementation we need to set the default EVM denomination, | ||
| // enable ALL precompiles, and include default preinstalls. | ||
| func NewEVMGenesisState() *evmtypes.GenesisState { | ||
| evmGenState := evmtypes.DefaultGenesisState() | ||
| evmGenState.Preinstalls = evmtypes.DefaultPreinstalls | ||
|
|
||
| return evmGenState | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
| package ethermint.evm.v1; | ||
|
|
||
| option go_package = "github.com/evmos/ethermint/x/evm/types"; | ||
|
|
||
| // Preinstall defines a contract that is preinstalled on-chain with a specific | ||
| // contract address and bytecode | ||
| message Preinstall { | ||
| // name of the preinstall contract | ||
| string name = 1; | ||
| // address in hex format of the preinstall contract | ||
| string address = 2; | ||
| // code in hex format for the preinstall contract | ||
| string code = 3; | ||
| } |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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.