Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(evm): query of NIBI should use bank state, not the StateDB #2134

Merged
merged 2 commits into from
Dec 31, 2024
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 @@ -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

Expand Down
5 changes: 3 additions & 2 deletions x/evm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading