Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact(v2.7): feeshare #206

Merged
merged 17 commits into from
Nov 21, 2023
Merged

refact(v2.7): feeshare #206

merged 17 commits into from
Nov 21, 2023

Conversation

emidev98
Copy link
Contributor

@emidev98 emidev98 commented Nov 3, 2023

This pull request modifies the distribution method for feeshare incentives. Rather than solely rewarding the contract in execution—which may disadvantage other smart contracts engaged in the transaction and discourage the composition of multiple contracts...

The revised approach ensures equitable distribution of feeshare incentives among all smart contracts participating in a transaction. Each contract linked to the withdrawing address will receive an equal portion of the revenue share defined in the module param as a % of the transaction fee.

To achieve the previous statement, the official version of wasm is wrapped on a custom implementation which allows to keeps track of contract executions. When a contract is Executed the custom wasm module will keep track of each contract address in a list. When the transaction is completed the PostHanlder from x/feeshare will distribute the rewards between the participants and another post handler from x/wasm will remove the addresses that does not need to be stored for anything.

Base automatically changed from chore/v2.7/refact to release/v2.7 November 8, 2023 16:00
@terra-money terra-money deleted a comment from coderabbitai bot Nov 8, 2023
@emidev98 emidev98 changed the title Refact/v2.7/feeshare refact: feeshare 2.7 Nov 8, 2023
@emidev98 emidev98 marked this pull request as ready for review November 8, 2023 16:53
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #206 (3ed296d) into release/v2.7 (6bb62ad) will increase coverage by 2.72%.
Report is 6 commits behind head on release/v2.7.
The diff coverage is 87.65%.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release/v2.7     #206      +/-   ##
================================================
+ Coverage         65.41%   68.13%   +2.72%     
================================================
  Files                45       45              
  Lines              2137     2150      +13     
================================================
+ Hits               1398     1465      +67     
+ Misses              583      524      -59     
- Partials            156      161       +5     
Files Coverage Δ
app/app.go 63.47% <100.00%> (+1.31%) ⬆️
app/modules.go 100.00% <100.00%> (ø)
app/upgrade_handler.go 58.33% <ø> (ø)
x/feeshare/keeper/keeper.go 76.92% <ø> (ø)
x/tokenfactory/bindings/wasm.go 100.00% <ø> (ø)
x/tokenfactory/keeper/grpc_query.go 90.00% <100.00%> (+1.76%) ⬆️
x/tokenfactory/keeper/keeper.go 88.88% <ø> (ø)
x/feeshare/post/post.go 84.84% <84.84%> (ø)

... and 1 file with indirect coverage changes

@emidev98 emidev98 requested a review from evanorti November 10, 2023 15:11
@emidev98 emidev98 force-pushed the refact/v2.7/feeshare branch from 0e3156e to f61fd9f Compare November 14, 2023 13:23
@emidev98 emidev98 force-pushed the refact/v2.7/feeshare branch from f61fd9f to 69b4339 Compare November 14, 2023 13:27
@emidev98 emidev98 changed the title refact: feeshare 2.7 refact(2.7): feeshare Nov 14, 2023
@emidev98 emidev98 changed the title refact(2.7): feeshare refact(v2.7): feeshare Nov 14, 2023
Copy link
Member

@javiersuweijie javiersuweijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments

@emidev98 emidev98 merged commit ec11083 into release/v2.7 Nov 21, 2023
@emidev98 emidev98 deleted the refact/v2.7/feeshare branch November 21, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants