-
Notifications
You must be signed in to change notification settings - Fork 79
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: Onboarding IBC middleware #103
feat: Onboarding IBC middleware #103
Conversation
(cherry picked from commit 4b2176a)
@zscole Please review the PR. Thanks. |
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.
Some changes required regarding module versioning. Canto is currently on v5, and the next state-breaking upgrade should be v6.
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.
Approved!
reference github issue: code-423n4/2023-06-canto-findings#36
reference github issue: code-423n4/2023-06-canto-findings#71
With the recent v6 upgrade, there are conflicts that need to be resolved in the onboarding PR. #106
Once we have confirmation of the above, we will modify the upgrade handler to the version that will include onboarding. |
Let's go with option 1, remove modules in v7 + onboarding merge. I'll merge #106, then we can go ahead with resolving conflicts for onboarding PR. |
…re-conflict-resolve # Conflicts: # app/app.go # app/upgrades/v6/upgrades.go
…resolve Onboarding middleware conflict resolve
We will resolve the conflicts once this PR is merged. |
…leware-conflict-resolve # Conflicts: # app/app.go # x/recovery/keeper/ibc_callbacks.go # x/recovery/keeper/ibc_callbacks_integration_suite_test.go (cherry picked from commit 4d45df7)
…re-conflict-resolve # Conflicts: # app/app.go # app/app_test.go # app/test_helpers.go (cherry picked from commit ec76588)
(cherry picked from commit 5ac28de)
(cherry picked from commit ca2307f)
(cherry picked from commit ba5685f)
…ng-middleware-conflict-resolve * commit 'd780d52648475e8887cacce73acec93ae59fb34b': chore: add branches rule for workflow fix: simulation seed randomness was removed to make the ci/cd result deterministic fix: remove recovery from storeKeysPrefixes add placeholder for ICS4wrapper in transferKeeper init remove recovery imports in app.go remove recovery proto remove x/recovery fix: update simulation target modules, refactor duplicated struct fix: removing unused keeper from handler options fix: simulation workflow, update sims.yml, add GOPATH on makefile fix: simulation errors fix: seperate antehandler for simulation feat: add workflow to build, test, codecov for ci/cd # Conflicts: # app/app.go # app/test_helpers.go # proto/canto/onboarding/v1/query.proto # x/onboarding/client/cli/query.go # x/onboarding/genesis.go # x/onboarding/genesis_test.go # x/onboarding/ibc_middleware.go # x/onboarding/keeper/grpc_query.go # x/onboarding/keeper/grpc_query_test.go # x/onboarding/keeper/keeper.go # x/onboarding/keeper/keeper_test.go # x/onboarding/keeper/params.go # x/onboarding/keeper/utils_test.go # x/onboarding/module.go # x/onboarding/types/errors.go # x/onboarding/types/genesis.go # x/onboarding/types/genesis.pb.go # x/onboarding/types/genesis_test.go # x/onboarding/types/keys.go # x/onboarding/types/params_test.go # x/onboarding/types/query.pb.go # x/onboarding/types/query.pb.gw.go
…resolve Onboarding middleware conflict resolve
The update related to swagger will be carried out after the #112 is reviewed/merged or will be updated together on the PR depending on the merge order |
* commit '3ea39d93546596c018f88d1802e91fbc8645ff76': docs: update swagger, statik fix: re-generate proto pb.go files chore: formatting proto files build: fix proto gen, swagger script docs: remove deprecated module's on swagger config chore: remove deprecated fee, vesting module's proto files
LGTM |
Description
IBC
onboarding
middleware for Canto Onboarding UX ImprovementWhen users transfer assets to the Canto network through Gravity Bridge, the IBC transfer automatically triggers swap and conversion to Canto ERC20 via IBC middleware. Auto swap is triggered based on the recipient's Canto balance, and the remaining transferred balance is converted to Canto ERC20. The conversion process is independent of the result of the swap. It attempts to convert all assets transferred via IBC to ERC20 tokens, provided that the transferred asset is registered in the ERC20 token pairs. This applies even if the swap fails or is not triggered.
onboarding
middleware always returns original ACK from previous middleware stack meaning that even if the swap or conversion fails, it does not revert IBC transfer and the asset transferred to the Canto network will still remain in the Canto networkFor auto swap function,
Coinswap
module is also added.This module is a forked modification of IRISNET's Coinswap module v1.6. Several modifications have been made to ensure that the liquidity pools are only used for onboarding. The modifications are as follows:
IBC Testing package issue
There have been issues with onboarding middleware testing due to the low version of IBC-go currently used in Canto. When using
ibc-go/testing
, there were cases where EVM configuration loading failed because the proposer was not set in the block header, or the EVM call failed due to gas shortage caused by a lowDefaultGenTxGas
value. To resolve these issues, a custom version ofibc-go/testing
is implemented inibc/testing
and used.Tasks
onboarding
modulecoinswap
moduleAfter this pull request is merged, a follow-up pull request will be created to change the package name from v6 to v7.
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Resolving Security Audit Findings
All security audit findings are resolved in this PR.
swappedAmount
in case of swap error code-423n4/2023-06-canto-findings#71 is resolved in 2aafb8e