From d2f3e8f782ffbbacf2017f5d67cb658044d6597b Mon Sep 17 00:00:00 2001 From: beer-1 Date: Thu, 24 Oct 2024 13:45:06 +0900 Subject: [PATCH] fix to use types function to convert denom<>erc20 --- x/evm/precompiles/cosmos/contract.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/evm/precompiles/cosmos/contract.go b/x/evm/precompiles/cosmos/contract.go index 0eae4bdd..1e6a1d7d 100644 --- a/x/evm/precompiles/cosmos/contract.go +++ b/x/evm/precompiles/cosmos/contract.go @@ -297,7 +297,7 @@ func (e CosmosPrecompile) ExtendedRun(caller vm.ContractRef, input []byte, suppl return nil, ctx.GasMeter().GasConsumedToLimit(), types.ErrPrecompileFailed.Wrap(err.Error()) } - denom, err := e.edk.GetDenomByContractAddr(ctx, toDenomArguments.ERC20Address) + denom, err := types.ContractAddrToDenom(ctx, e.edk, toDenomArguments.ERC20Address) if err != nil { return nil, ctx.GasMeter().GasConsumedToLimit(), types.ErrPrecompileFailed.Wrap(err.Error()) } @@ -315,7 +315,7 @@ func (e CosmosPrecompile) ExtendedRun(caller vm.ContractRef, input []byte, suppl return nil, ctx.GasMeter().GasConsumedToLimit(), types.ErrPrecompileFailed.Wrap(err.Error()) } - contractAddr, err := e.edk.GetContractAddrByDenom(ctx, toERC20Arguments.Denom) + contractAddr, err := types.DenomToContractAddr(ctx, e.edk, toERC20Arguments.Denom) if err != nil { return nil, ctx.GasMeter().GasConsumedToLimit(), types.ErrPrecompileFailed.Wrap(err.Error()) }