-
Notifications
You must be signed in to change notification settings - Fork 94
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
Feat: Whitelist tokenfactory hooks #587
Merged
Merged
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e855c8f
basic whitelist logic
jcompagni10 2251fdd
Fix tests
jcompagni10 c07f823
Add note on weird TF code
jcompagni10 209c6b3
Block adding non-whitelisted hooks
jcompagni10 1b2cdec
Refactor + add more tests
jcompagni10 5469b79
add migration
jcompagni10 448149e
lint
jcompagni10 09af904
Merge remote-tracking branch 'origin/main' into feat/whitelist-tf-hooks
jcompagni10 5b971b1
add migration to remove non-whitelisted tf hooks
jcompagni10 d4b551c
lint
jcompagni10 71ee07e
misc review fixes
jcompagni10 a6eae66
regen swagger
jcompagni10 b5d02d4
PR review fixes
jcompagni10 fff1228
Merge remote-tracking branch 'origin/main' into feat/whitelist-tf-hooks
jcompagni10 01622b6
small migration fixes
jcompagni10 33b2846
fix: dont write during iterations
jcompagni10 024ce3d
lint
jcompagni10 36fd28a
Add error logging for skipped hooks
jcompagni10 2c7fb7d
Add whitelisted astroport contracts to TF migration
jcompagni10 01c1923
Add missing comma in init-neutrond.sh
jcompagni10 a097ad9
better comments on TF params.proto
jcompagni10 db7c03d
Merge branch 'main' into feat/whitelist-tf-hooks
pr0n00gler daf306d
make errors clearer
jcompagni10 9077e49
fixes to tokenfactory query cli
jcompagni10 32bf31b
update code_ids for astroport contract whitelisting
jcompagni10 3e26ebb
do not use a separate event manager for sudo calls in tokenfactory
pr0n00gler 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 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 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,40 @@ | ||
syntax = "proto3"; | ||
package osmosis.tokenfactory; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; | ||
|
||
message WhitelistedHook { | ||
uint64 code_id = 1 [(gogoproto.customname) = "CodeID"]; | ||
string denom_creator = 2; | ||
} | ||
|
||
// Params defines the parameters for the tokenfactory module. | ||
message Params { | ||
// DenomCreationFee defines the fee to be charged on the creation of a new | ||
// denom. The fee is drawn from the MsgCreateDenom's sender account, and | ||
// transferred to the community pool. | ||
repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", | ||
(gogoproto.moretags) = "yaml:\"denom_creation_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
// DenomCreationGasConsume defines the gas cost for creating a new denom. | ||
// This is intended as a spam deterrence mechanism. | ||
// | ||
// See: https://github.com/CosmWasm/token-factory/issues/11 | ||
uint64 denom_creation_gas_consume = 2 [ | ||
(gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", | ||
(gogoproto.nullable) = true | ||
]; | ||
|
||
// FeeCollectorAddress is the address where fees collected from denom creation | ||
// are sent to | ||
string fee_collector_address = 3; | ||
// HookWhitelist is the list of hooks which are allowed to be added and executed | ||
repeated WhitelistedHook whitelisted_hooks = 4; | ||
} |
This file contains 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 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 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 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 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 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 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 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 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.
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.
might be missing something, but why do we have
whitelisted_hooks
as the key here andHookWhitelist
as the value?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.
ah need to regen swagger