Skip to content

Commit

Permalink
fix to use types function to convert denom<>erc20
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Oct 24, 2024
1 parent fc19f1a commit d2f3e8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/evm/precompiles/cosmos/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand All @@ -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())
}
Expand Down

0 comments on commit d2f3e8f

Please sign in to comment.