From 6c2ea390e131a6e3d43a1481c1892dc5c35f382b Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Mon, 30 Dec 2024 08:44:31 -0600 Subject: [PATCH 1/2] fix(evm): query of NIBI should use bank state, not the StateDB --- x/evm/keeper/grpc_query.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 6c0f005e5..fd71412a1 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -65,12 +65,13 @@ func (k Keeper) EthAccount( ctx := sdk.UnwrapSDKContext(goCtx) acct := k.GetAccountOrEmpty(ctx, addrEth) + balNative := k.Bank.GetBalance(ctx, addrBech32, evm.EVMBankDenom).Amount.BigInt() return &evm.QueryEthAccountResponse{ EthAddress: addrEth.Hex(), Bech32Address: addrBech32.String(), - Balance: acct.BalanceNative.String(), - BalanceWei: evm.NativeToWei(acct.BalanceNative).String(), + Balance: balNative.String(), + BalanceWei: evm.NativeToWei(balNative).String(), CodeHash: gethcommon.BytesToHash(acct.CodeHash).Hex(), Nonce: acct.Nonce, }, nil From 532973e7e6de8a5cc5b39657d79aacd8f04f08d5 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Dec 2024 16:42:39 -0600 Subject: [PATCH 2/2] chore: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79d291174..3cb880339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ payment required based on the effective fee from the tx data. Improve documentation. - [#2125](https://github.com/NibiruChain/nibiru/pull/2125) - feat(evm-precompile):Emit EVM events created to reflect the ABCI events that occur outside the EVM to make sure that block explorers and indexers can find indexed ABCI event information. - [#2129](https://github.com/NibiruChain/nibiru/pull/2129) - fix(evm): issue with infinite recursion in erc20 funtoken contracts +- [#2134](https://github.com/NibiruChain/nibiru/pull/2134) - fix(evm): query of NIBI should use bank state, not the StateDB #### Nibiru EVM | Before Audit 2 - 2024-12-06