Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- [\#582](https://github.com/cosmos/evm/pull/582) Add block max-gas (from genesis.json) and new min-tip (from app.toml/flags) ingestion into mempool config
- [\#598](https://github.com/cosmos/evm/pull/598) Reduce number of times CreateQueryContext in mempool.
- [\#606](https://github.com/cosmos/evm/pull/606) Regenerate mock file for bank keeper related test.
- [\#609](https://github.com/cosmos/evm/pull/609) Make `erc20Keeper` optional in the EVM keeper
- [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`.

### FEATURES
Expand Down
2 changes: 1 addition & 1 deletion x/vm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Keeper struct {
stakingKeeper types.StakingKeeper
// fetch EIP1559 base fee and parameters
feeMarketWrapper *wrappers.FeeMarketWrapper
// erc20Keeper interface needed to instantiate erc20 precompiles
// optional erc20Keeper interface needed to instantiate erc20 precompiles
erc20Keeper types.Erc20Keeper
// consensusKeeper is used to get consensus params during query contexts.
// This is needed as block.gasLimit is expected to be available in eth_call, which is routed through Cosmos SDK's
Expand Down
5 changes: 5 additions & 0 deletions x/vm/keeper/precompiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func (k *Keeper) GetPrecompileInstance(
}, found, nil
}

// Since erc20Keeper is optional, we check if it is nil, in which case we just return that we didn't find the precompile
if k.erc20Keeper == nil {
return nil, false, nil
}

// Get the precompile from the dynamic precompiles
precompile, found, err := k.erc20Keeper.GetERC20PrecompileInstance(ctx, address)
if err != nil || !found {
Expand Down
Loading