-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: paloma bridge exit tax (#1196)
# Related Github tickets - VolumeFi#1709 # Background We're going to charge a tax fee for every transfer out of paloma. The tax rate is defined by governance vote and we can set exceptions to tokens and addresses. - Add new governance vote to gravity module - The bridge tax information is added to genesis - Before adding transfers to the batched pool in gravity, we set the tax amount, if applicable. This amount is removed from the total amount to transfer. Compass only sees the decreased amount. - On receiving the transfer complete event we burn the total amount of tokens (transferred + taxed) - On cancelling a transfer, we return the total amount including tax # Testing completed - [x] test coverage exists or has been added/updated - [ ] tested in a private testnet # Breaking changes - [x] I have checked my code for breaking changes - [x] If there are breaking changes, there is a supporting migration.
- Loading branch information
Showing
31 changed files
with
2,414 additions
and
475 deletions.
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
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,29 @@ | ||
# Gravity Bridge Tax | ||
|
||
All outbound transactions from the bridge to the target EVM and other chains pay | ||
a tax on the gravity bridge. This tax is added to the cost of the transfer. | ||
A governance vote is needed to define the tax rate, as well as a list of tokens | ||
and addresses that are exempt from the bridge tax. | ||
|
||
## Tax Rate | ||
|
||
The tax rate must be defined as a non-negative value, with 0 meaning no tax is | ||
applied. | ||
|
||
The tax is added to the cost of the transfer and will stay locked until the | ||
transfer is finished. | ||
If the transfer is successful, the taxed amount is burned on the Paloma side. | ||
If a transfer is canceled before being executed, the full initial amount, plus | ||
tax, is refunded. | ||
|
||
## Excluded Tokens | ||
|
||
The governance vote can define a list of tokens that are excluded from the | ||
bridge tax. Transfers of these tokens will never pay bridge tax and will be | ||
transferred in the full amount. | ||
|
||
## Exempt Addresses | ||
|
||
Similarly, the governance vote can define a list of addresses that are exempt | ||
from paying the bridge tax. Transfers from these senders will never pay bridge | ||
tax. |
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,14 @@ | ||
syntax = "proto3"; | ||
package palomachain.paloma.gravity; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
option go_package = "github.com/palomachain/paloma/x/gravity/types"; | ||
|
||
message BridgeTax { | ||
string rate = 1 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; | ||
repeated string excluded_tokens = 2; | ||
repeated bytes exempt_addresses = 3 | ||
[ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; | ||
} |
14 changes: 14 additions & 0 deletions
14
proto/palomachain/paloma/gravity/bridge_tax_proposal.proto
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,14 @@ | ||
syntax = "proto3"; | ||
package palomachain.paloma.gravity; | ||
|
||
import "cosmos_proto/cosmos.proto"; | ||
|
||
option go_package = "github.com/palomachain/paloma/x/gravity/types"; | ||
|
||
message SetBridgeTaxProposal { | ||
string title = 1; | ||
string description = 2; | ||
string rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; | ||
repeated string excluded_tokens = 4; | ||
repeated string exempt_addresses = 5; | ||
} |
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.