Skip to content
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 26 commits into from
Jun 23, 2024
Merged

Conversation

jcompagni10
Copy link
Contributor

@jcompagni10 jcompagni10 commented Jun 18, 2024

Add explicit whitelist of codeID & denomCreator pairs to tokenfactory params. Only allow beforeSend hooks to be called for denoms where the denomCreator and codeID of hook are whitelisted.

This also adds a migration for the tokefactory params that includes hooks that we want to whitelist (NFA and astroport)

related PRs:
neutron-org/neutron-integration-tests#316 --test fixes for this PR to pass

neutron dao changes:
neutron-org/neutron-dao#107
neutron-org/neutron-sdk#150
neutron-org/neutronjsplus#43
neutron-org/neutron-integration-tests#314

proto/osmosis/tokenfactory/params.proto Outdated Show resolved Hide resolved
proto/osmosis/tokenfactory/params.proto Outdated Show resolved Hide resolved
proto/osmosis/tokenfactory/params.proto Outdated Show resolved Hide resolved
x/tokenfactory/module.go Outdated Show resolved Hide resolved
x/tokenfactory/keeper/before_send.go Outdated Show resolved Hide resolved
x/tokenfactory/types/params.go Outdated Show resolved Hide resolved
@jcompagni10
Copy link
Contributor Author

x/tokenfactory/migrations/v2/store.go Outdated Show resolved Hide resolved
x/tokenfactory/keeper/params.go Outdated Show resolved Hide resolved
type: string
type: object
title: >-
HookWhitelist is the list of hooks which are allowed to be added
Copy link
Collaborator

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 and HookWhitelist as the value?

Copy link
Contributor Author

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

@jcompagni10
Copy link
Contributor Author

jcompagni10 commented Jun 21, 2024

x/tokenfactory/migrations/v2/store.go Outdated Show resolved Hide resolved
x/tokenfactory/keeper/before_send.go Outdated Show resolved Hide resolved
x/tokenfactory/migrations/v2/store.go Outdated Show resolved Hide resolved
x/tokenfactory/types/params.go Outdated Show resolved Hide resolved
pr0n00gler and others added 4 commits June 21, 2024 14:27
1. Add missing GetCmdBeforeSendHook query
2. Correctly parse denoms with slashes in subdenom
3. fix typo hiik => hook
@jcompagni10
Copy link
Contributor Author

Testrun with just neutron changes:https://github.com/neutron-org/neutron-tests/actions/runs/9608462857

@zavgorodnii zavgorodnii merged commit dfd5274 into main Jun 23, 2024
12 checks passed
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.

4 participants