core icon indicating copy to clipboard operation
core copied to clipboard

Implement a Reverse Charge tax approach

Open StrathCole opened this issue 4 months ago • 0 comments

Summary of changes

This is an implementation as an alternative to tax2gas.
It solves similar issues as tax2gas does, but additionally shifts taxation to the recipient side.
Also it removes double-taxation of contracts, i.e. contract calls are no longer taxed, but sending funds from inside contracts to the final wallet destination is.

Copilot Summary

This pull request introduces the integration of a new Tax module into the Terra blockchain application. The changes primarily involve adding the TaxKeeper to various parts of the application and ensuring it is properly initialized and utilized in transaction handling. Below is a summary of the most important changes:

Integration of Tax Module

  • Added TaxKeeper to the AppKeepers structure and initialized it in the NewAppKeepers function in app/keepers/keepers.go. [1] [2]
  • Included the Tax module in the module initialization and setup functions, such as appModules, simulationModules, orderBeginBlockers, orderEndBlockers, and orderInitGenesis in app/modules.go. [1] [2] [3] [4] [5]

Changes in AnteHandler

  • Updated the HandlerOptions and NewAnteHandler in custom/auth/ante/ante.go to include and check for TaxKeeper. [1] [2]
  • Modified the FeeDecorator to account for taxes and handle scenarios where fees are insufficient to cover both gas and taxes in custom/auth/ante/fee.go. [1] [2] [3]

Import Statements

  • Added necessary import statements for the Tax module in various files (app/keepers/keepers.go, app/modules.go, custom/auth/ante/ante.go, and custom/auth/ante/fee.go). [1] [2] [3] [4]

Initialization and Configuration

  • Added the Tax module's store key and subspace initialization in NewAppKeepers and initParamsKeeper functions in app/keepers/keepers.go. [1] [2]

These changes collectively ensure that the new Tax module is fully integrated into the Terra blockchain application, with proper initialization, configuration, and handling within the transaction processing pipeline.

StrathCole avatar Oct 11 '24 21:10 StrathCole