core icon indicating copy to clipboard operation
core copied to clipboard

Whitelisting (tax exemption) feature according to prop #11824

Open StrathCole opened this issue 1 year ago • 1 comments

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 the v9 upgrade and included the TaxExemptionKeeper in the NewTerraApp function. [1] [2] [3]
  • app/keepers/keepers.go: Imported the taxexemption types and keeper, added the TaxExemptionKeeper to the AppKeepers struct, and initialized it in the NewAppKeepers function. [1] [2] [3] [4] [5] [6]
  • app/modules.go: Imported the taxexemption module and added it to various module lists and functions, including appModules, simulationModules, orderBeginBlockers, orderEndBlockers, and orderInitGenesis. [1] [2] [3] [4] [5] [6] [7] [8]

Upgrade Handler:

  • app/upgrades/v9/constants.go: Defined constants and the Upgrade struct for the v9 upgrade.
  • app/upgrades/v9/upgrades.go: Implemented the CreateV9UpgradeHandler function to migrate old tax exemption data to the new taxexemption module.

Documentation Updates:

  • client/docs/config.json: Added the taxexemption module's query swagger definitions.
  • client/docs/swagger-ui/swagger.yaml: Defined the API endpoints for the taxexemption module, including routes for listing tax exemption zones and addresses.

StrathCole avatar Dec 01 '23 21:12 StrathCole