core
core copied to clipboard
Whitelisting (tax exemption) feature according to prop #11824
Summary of changes
alternative implementation to #388 using message types and v1 governance
Introduce zone-based tax exemption. Zones are always tax-free internally. Optionally they can be set to be tax-free for incoming and/or outgoing txs. Cross-Zone transactions are always taxed, unless cross-zone exemption is also set for the zone
Report of required housekeeping
- [ ] Github issue OR spec proposal link
- [x] Added Binance whitelist migration
- [x] Wrote tests
- [x] Updated API documentation (client/lcd/swagger-ui/swagger.yaml)
- [ ] Added a relevant changelog entry: clog add [section] [stanza] [message]
(FOR ADMIN) Before merging
- [ ] Added appropriate labels to PR
- [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
- [ ] Confirm added tests are consistent with the intended behavior of changes
- [ ] Ensure all tests pass
Copilot Summary
This pull request introduces a new taxexemption
module and integrates it into the existing system. The changes include adding the module's dependencies, updating the application to include the new module, and defining the upgrade handler for the new module.
Integration of taxexemption
Module:
-
app/app.go
: Added thev9
upgrade and included theTaxExemptionKeeper
in theNewTerraApp
function. [1] [2] [3] -
app/keepers/keepers.go
: Imported thetaxexemption
types and keeper, added theTaxExemptionKeeper
to theAppKeepers
struct, and initialized it in theNewAppKeepers
function. [1] [2] [3] [4] [5] [6] -
app/modules.go
: Imported thetaxexemption
module and added it to various module lists and functions, includingappModules
,simulationModules
,orderBeginBlockers
,orderEndBlockers
, andorderInitGenesis
. [1] [2] [3] [4] [5] [6] [7] [8]
Upgrade Handler:
-
app/upgrades/v9/constants.go
: Defined constants and theUpgrade
struct for thev9
upgrade. -
app/upgrades/v9/upgrades.go
: Implemented theCreateV9UpgradeHandler
function to migrate old tax exemption data to the newtaxexemption
module.
Documentation Updates:
-
client/docs/config.json
: Added thetaxexemption
module's query swagger definitions. -
client/docs/swagger-ui/swagger.yaml
: Defined the API endpoints for thetaxexemption
module, including routes for listing tax exemption zones and addresses.