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

feat(erc20): auto convert to erc20 on various cases #685

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mtsitrin
Copy link
Collaborator

@mtsitrin mtsitrin commented Jan 30, 2025

This mainly adds support to:

  1. distribute rewards of erc20 token to proposer
  2. auto convert to erc20 on Undelegate
  • distribution hooks (WIP.
    • withdraw due to delgetaion modify
    • commission withdraw due to validator remove

NOT COVERED:

  • txs that needs a conversion before (createVal, delegate, gov submit, WithdrawComisison, WithdrawRewards,...)

func mustValAddressFromBech32(addr string) sdk.ValAddress {
valAddr, err := sdk.ValAddressFromBech32(addr)
if err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
return AppModule{
AppModule: staking.NewAppModule(cdc, keeper.Keeper, ak, bk),
keeper: keeper,
}
}

func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
_ = staking.EndBlocker(ctx, am.keeper.Keeper)
am.keeper.BlockValidatorUpdates(ctx)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant