Skip to content

Feat/relayer fee #11

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
merged 28 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c23780e
fixed migrate failed config no fee receiver
ducphamle2 Jun 8, 2023
15264e9
removed forward transfer logic since we are not using it
ducphamle2 Jul 25, 2023
d898441
refactored get_follow_up_msgs
ducphamle2 Jul 25, 2023
fd3b2cf
validate destination denom for cw20 token
ducphamle2 Jul 26, 2023
8b822ab
refactored router contract actions to use router controller
ducphamle2 Jul 26, 2023
9e2d3ed
refactored code to reduce / increase channel balance in reply & ack
ducphamle2 Jul 26, 2023
ed6bcd0
added relayer fee logic
ducphamle2 Jul 26, 2023
25c49eb
reverted channel balance handling
ducphamle2 Jul 26, 2023
e602a50
passed all test cases for relayer fees
ducphamle2 Jul 26, 2023
d227bf9
splitted convert to evm prefix to function
ducphamle2 Jul 27, 2023
6e2f83a
optimized handle_ibc_packet_receive_native_remote_chain
ducphamle2 Jul 27, 2023
517f59c
refactored build ibc send packet
ducphamle2 Jul 27, 2023
abe2cd3
added helper functions, more test cases & check cosmos based dest info
ducphamle2 Jul 27, 2023
afc6cef
refactored code & used new cw20-ics20 package
ducphamle2 Jul 27, 2023
b24739d
added cosmos based txs without test cases
ducphamle2 Jul 27, 2023
de1c428
added test cases for process ibc msg
ducphamle2 Jul 28, 2023
e7eacb9
added more tests for build ibc msg
ducphamle2 Jul 28, 2023
adc983f
passed all test cases
ducphamle2 Jul 28, 2023
118f0a8
fixed deduct relayer fee formula
ducphamle2 Jul 28, 2023
c885799
fixed u32 overflow error deduct relayer fee
ducphamle2 Jul 28, 2023
209413e
fixed relayer fee wrong local token denom
ducphamle2 Jul 28, 2023
45366d4
renamed ratio nominator to numerator
ducphamle2 Jul 28, 2023
03b0a61
added fee relayer receiver config & test cases
ducphamle2 Jul 28, 2023
85c9ca3
commented out api debug relayer fee
ducphamle2 Jul 28, 2023
7ddbcd5
deduct relayer fee swap 10^7 for certainty
ducphamle2 Jul 28, 2023
cc7a89a
query config added token fees & relayer fees
ducphamle2 Aug 1, 2023
36ed9ca
renamed update pair msg for better understanding
ducphamle2 Aug 1, 2023
6e1520f
finished cosmos based single step flow
ducphamle2 Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# IBC transfer flow:

Let's assume the network that has the contract cw20-ics20 deployed is network B, the other network is A.

In the source code, we call the network having cw20-ics20 deployed local chain, other networks are remote chains.

In the cw-ics20-latest contract, there are couple transfer flows in the code below:

## Network A transfers native tokens to B first (A->B, where native token is not IBC token)
Expand All @@ -26,3 +29,5 @@ This is really important because by using the CosmosMsg, we force the `allow_con
If we use CosmosMsg, then the acknowledgement packet will fail entirely, and it will be retried by the relayer as long as we fix the `allow_contract`.

Normally, if it is a `ibctransfer` application developed as a submodule in Cosmos SDK, then the refund part must not fail, and we can trust that it will not fail. However, the `allow_contract` can be developed by anyone, and can be replaced => cannot be trusted.

# build packages
4 changes: 2 additions & 2 deletions contracts/cw-ics20-latest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cosmwasm-schema = "1.1.9"
cw-utils = "0.16.0"
cw2 = "1.0.1"
cw20 = "1.0.1"
cw20-ics20-msg = "0.0.2"
oraiswap = "1.0.0"
cw20-ics20-msg = { path = "../../packages/cw20-ics20-msg" }
oraiswap = "1.0.1"
cosmwasm-std = { version = "1.1.0", features = ["stargate"] }
cw-storage-plus = "1.0.1"
cw-controllers = "1.0.1"
Expand Down
Loading