Skip to content

Commit

Permalink
fix(dogfood): implement erc20 interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Apr 5, 2024
1 parent 77b7e84 commit afb785c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion x/dogfood/keeper/impl_evm.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package keeper

import (
"github.com/ExocoreNetwork/exocore/utils"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
erc20types "github.com/evmos/evmos/v14/x/erc20/types"
evmtypes "github.com/evmos/evmos/v14/x/evm/types"
)

var _ evmtypes.StakingKeeper = Keeper{}
// interface guards
var (
_ erc20types.StakingKeeper = Keeper{}
_ evmtypes.StakingKeeper = Keeper{}
)

// GetValidatorByConsAddr is an implementation of the StakingKeeper interface
// expected by the EVM module. It returns a validator given a consensus address.
Expand All @@ -23,3 +29,12 @@ func (k Keeper) GetValidatorByConsAddr(
}
return val.(stakingtypes.Validator), true
}

// BondDenom is an implementation of the StakingKeeper interface expected by the
// ERC20 module. It returns the bond denom for the module. The ERC20 module uses
// this function to determine whether a token sent (or received) over IBC is the
// staking (==native) token. If it is, then the module lets the token through.
// That is the behaviour we wish to retain with our chain as well.
func (k Keeper) BondDenom(ctx sdk.Context) string {
return utils.BaseDenom
}

0 comments on commit afb785c

Please sign in to comment.