Description
Summary
Authz empowers Cosmos developers to build noncustodial solutions. However, the integration of Authz in Defi-like products today prevents protocol engineers from capturing fees and creating an elegant user experience for customers. Authz doesn't allow us to charge a performance fee for our service as authz dynamically can't read state nor does it store a type to charge the fee owned by a user that the delegator can claim. The solution we propose is to implement stateful checks inside an authz execution and incorporate a fee type that can store the fee amount that needs to be paid out after a specific duration.
Problem Definition
The inclusion of a FeeAuthorization type may be complex and introduce security concerns unaware during implementation. However, this is a risk majority of new implications have and requires thorough testing and safeguards.
Proposal
The idea is to capture a fee or tax for the authx grant.
type TaxedAuthorization struct {
Authorization
TaxAmount sdk.Coins
}
And then, inside the Accept method, simply transfer the TaxAmount from the Authorization.Granter to the Authorization.Grantee. The solution would be to implement the statefull checks inside the authz execution, have that released into a new Cosmos SDK version.
We worked on this solution with @RiccardoM . Love to hear other input on how to best implement a fee capture mechanism in Authz. The introduction of this improvement will increase the adoption of this module.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Metadata
Assignees
Type
Projects
Status
☃️ Icebox
Activity