Skip to content

Commit 3edf0d4

Browse files
yihuangmmsqe
authored andcommitted
Problem: ibc transfer don't support hex address
Solution: - change address conversion in middleware fix build fix lint change erc20 callback Squashed commit of the following: commit d8e3baa Merge: f6b7337 ec57b96 Author: yihuang <yi.codeplayer@gmail.com> Date: Mon Sep 1 14:43:35 2025 +0800 Merge branch 'main' into ibc-hex-address commit f6b7337 Author: yihuang <yi.codeplayer@gmail.com> Date: Mon Sep 1 14:43:21 2025 +0800 cleanup commit 3f331c3 Author: yihuang <yi.codeplayer@gmail.com> Date: Mon Sep 1 14:41:31 2025 +0800 fix GetTransferSenderRecipient commit ec57b96 Author: Antonio Pitasi <antonio@pitasi.dev> Date: Fri Aug 29 22:23:47 2025 +0200 fix: CometBlockResultByNumber when height is 0 (cosmos#416) * fix TendermintBlockResultByNumber when height is 0 Signed-off-by: Antonio Pitasi <antonio@pitasi.dev> * add changelog entry Signed-off-by: Antonio Pitasi <antonio@pitasi.dev> --------- Signed-off-by: Antonio Pitasi <antonio@pitasi.dev> Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> commit 4be8aba Author: yihuang <yi.codeplayer@gmail.com> Date: Sat Aug 30 04:22:35 2025 +0800 feat: AddPrecompileFn on stateObject not needed (cosmos#511) * Problem: AddPrecompileFn on stateObject not needed what is does is only add a journal entry, not related to the state object at all. Solution: - remove the method, move the logic to statedb directly. * remove unused parameter * changelog --------- Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> commit 2a0eb3a Author: Vlad J <vladjdk@gmail.com> Date: Fri Aug 29 16:18:45 2025 -0400 perf: optimize gas estimation (cosmos#538) * Fix error semantics * changelog * Add benchmark (cosmos#542) Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> --------- Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> Co-authored-by: Eric Warehime <eric.warehime@gmail.com> commit af53a0f Author: Vlad J <vladjdk@gmail.com> Date: Fri Aug 29 15:09:36 2025 -0400 docs(migration): boilerplate v0.5.0 migration docs with mempool migra… (cosmos#540) * docs(migration): boilerplate v0.5.0 migration docs with mempool migration * shorten line * Update docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md --------- Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> commit 2fff19e Author: Antonio Pitasi <antonio@pitasi.dev> Date: Fri Aug 29 20:58:21 2025 +0200 fix(evmd): remove pebble replace directive (cosmos#574) commit 5ffe3cc Author: mmsqe <tqd0800210105@gmail.com> Date: Sat Aug 30 02:52:41 2025 +0800 chore: check if mempool is not nil before accepting nonce gap error tx (cosmos#572) commit ce05fc6 Author: yihuang <yi.codeplayer@gmail.com> Date: Fri Aug 29 10:35:22 2025 +0800 change erc20 callback commit 9d2c924 Author: yihuang <yi.codeplayer@gmail.com> Date: Fri Aug 29 10:26:25 2025 +0800 fix lint commit abe2870 Author: yihuang <yi.codeplayer@gmail.com> Date: Fri Aug 29 10:17:12 2025 +0800 fix build commit e12e02d Author: yihuang <yi.codeplayer@gmail.com> Date: Fri Aug 29 10:09:52 2025 +0800 Problem: ibc transfer don't support hex address Solution: - change address conversion in middleware commit 3e37931 Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Wed Aug 27 21:30:00 2025 -0700 add pr title job (cosmos#541) commit 83ae83d Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Wed Aug 27 16:25:29 2025 -0700 docs: update contrib guide (cosmos#539) * update contrib guide * fix number commit 0032812 Author: Abdul Malek <me@almk.dev> Date: Wed Aug 27 11:32:19 2025 -0400 fix: allow mempool interrupt while it is still ongoing (cosmos#495) * add context cancel * simplify channel cases * add changelog * revert config change * add minimal change set for sigint * rename * offload server shutdown go goroutine * remove goroutine in favor of timeout * use short timeout commit 68436ec Author: mmsqe <tqd0800210105@gmail.com> Date: Wed Aug 27 23:07:02 2025 +0800 fix: allow value with slashes when query token_pairs (cosmos#509) * chore: allow value with slashes when query token_pairs * add doc --------- Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io> commit bcc17d4 Author: zchn <kevin.zchn@gmail.com> Date: Tue Aug 26 14:40:46 2025 -0400 refactor: replace TestEncodingConfig with production Config (cosmos#513) * refactor: replace TestEncodingConfig with production EncodingConfig Replace the usage of sdktestutil.TestEncodingConfig with a proper production-ready EncodingConfig struct. This removes the dependency on test utilities in production code while maintaining full compatibility. Changes: - Define custom EncodingConfig struct with same fields as TestEncodingConfig - Remove import of cosmos-sdk/types/module/testutil - Update MakeConfig return type to use the new production struct This improves code quality by avoiding test dependencies in production code. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: fix golangci-lint errors - Fix import ordering (gci) - Rename EncodingConfig to Config to avoid stuttering (revive) The type name change from EncodingConfig to Config addresses the lint warning about stuttering (encoding.EncodingConfig). Since the struct is only used as a return value from MakeConfig(), this change maintains backward compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * test: update ledger tests to use encoding.Config Update the ledger test files to use the new encoding.Config type instead of sdktestutil.TestEncodingConfig, following the changes made to the encoding package. Changes: - Update encCfg variable type from TestEncodingConfig to Config - Update NewKeyringAndCtxs parameter type to use Config - Add encoding import to evmosd_suite_test.go - Remove unused sdktestutil import 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add CHANGELOG entry for encoding config refactor Add CHANGELOG.md entry documenting the replacement of TestEncodingConfig with production EncodingConfig in PR cosmos#513. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Kevin Kz <kz@interchainlabs.io> Co-authored-by: Claude <noreply@anthropic.com> commit 750d77d Author: mmsqe <tqd0800210105@gmail.com> Date: Tue Aug 26 02:23:56 2025 +0800 chore: cleanup deprecated BalanceChangeEntry (cosmos#506) * chore: align balance change reason for tracing for more info, https://github.com/ethereum/go-ethereum/blob/v1.16.2/core/evm.go#L143 * cleanup deprecated BalanceChangeEntry for more info, https://github.com/cosmos/evm/pull/201/files * Revert "chore: align balance change reason for tracing" This reverts commit 07a628c. commit 2d3df2b Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Fri Aug 22 14:12:27 2025 -0700 ci: workflow fails when feat, fix, or refactor PRs do not have changelog entry (cosmos#499) * attempt fix * test * read granularity * remove all conditions * default af * some more * try this * making a change * ok this should make it pass * and if i change it back it should fail * remove all go code cahnges to see if wf passes * re adding go code changes should trigger it * only run on specific types of PRs * an update * revert that * when its edited too * revert go code change commit e01cc50 Author: Vlad J <vladjdk@gmail.com> Date: Fri Aug 22 16:37:40 2025 -0400 (chore):Simplify Mempool Config (cosmos#496) * refactor mempool initialization to accept configs instead of objects * clean * add changelog commit 48e3c83 Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Fri Aug 22 13:35:52 2025 -0700 test: v0.4.1 -> main upgrade test (cosmos#498) * wip upgrade test * upgrade test complete * make script * fix the order * remove that * fixes * fetch tags commit 03083a8 Author: Abdul Malek <me@almk.dev> Date: Thu Aug 21 13:14:59 2025 -0400 fix: duplicate case switch to avoid empty execution block (cosmos#492) * duplicate switch * add changelog commit 4d93f2d Author: Abdul Malek <me@almk.dev> Date: Thu Aug 21 11:37:31 2025 -0400 feature: Add eth_createAccessList method and implementation (cosmos#346) * apply 3eb2135 * apply 4f9b8c2 * apply 0e7fd50 * apply 5cfe96d * apply 0e7fd50: fix lint workflow * apply 679305d * Fix middleware test * Format * apply 9fae984: fix conflicts * consolidate diverging test suite structures * apply 9fae984: fix conflicts * consolidate diverging test suite structures * apply b9a4d41 * apply 96ad38f * fix lint * apply b9a4d41 * apply 96ad38f * apply 578b346 * apply fd7badc * apply f7a3922 * apply 0e511d3 * apply 09e1895 * apply fb7e407 * apply 8cd184f * apply 9b96d1f * apply 029ed3b * apply e6fe094 * apply 76d8d10 * apply 0517dcf * apply af6f8d4 * apply 17cb0d5 * apply cb64292 * apply cbae613 * apply e57a44e * apply 66dd661 * apply 16ec2d0 * apply ec1a928 * apply 058eb6d * apply 82a7981 * apply 71d26cf * apply 4c27407 * apply bda7ad0 * apply bb811f4 * apply 6644e35 * apply 8d21baf * apply ebcaefa * apply 4913831 * apply 76819ba * apply cd9cd1a * apply 60a6cd2 * apply 2518c1b * apply bb9d02e * apply 5e7359e * apply a8112f4 * apply 388b5c0 * apply 727407e * apply a5ddd15 * apply 03ede6c * apply 9ad7d66 * apply e921750 * apply 17c65a7 * apply 9ddd976 * apply cffad65 * apply 6085578 * apply 099f44e * apply 2934281 * apply f9ca3ea * apply b826e3a * apply 5024129 * apply bfa2f05 * apply fb20472 * apply 4b0d478 * apply b065764 * apply ebc4b6c * apply 0f22f9f * clean up gh workflows * add-test-chain-id * pointer to precise bank keeper * cover all * apply balance handler patch * fix lint * fix solidity test * add evmd tests fix * add omitted fractional balance clear * fix lint * clean up panic message * try 16 core depot * try 8 core * Add debug flags to init-node.sh * More logging * Fix denom * Remove logging additions * default runner * update hardhat config * fix * re-opening branch to merge into main * add solidity to push group * regen contracts and fix solidity group * use default runner for solidity (again) * rebase and add stubs * add trace call with accesslist tracer config * fix lint: * conform to auto registration * revert tracer logic * fix signatures * fix nil pointer issues * rev local node pruning settings * remove custom pruning settings * rename var to be clearer * fix typo * remove unsigned tx logic from tests * group vars * add debug logs * update test pointer * fix nil gas * clean up traceTx conditional handling * fix vmerr * fix lint * add debug logs * add error and info logs * add test suite with actual backend mock * lint: add helper marker * standardize vars * remove unnecessary flag in run json compat * add back to exclusion * add godocs * add permalink * clarify auth checks * add changelog --------- Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: Eric Warehime <eric.warehime@gmail.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Aditya <14364734+AdityaSripal@users.noreply.github.com> Co-authored-by: Haber <kyuhyeon@bharvest.io> Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> commit 642c8e9 Author: mmsqe <tqd0800210105@gmail.com> Date: Thu Aug 21 22:37:32 2025 +0800 fix: notify new block for mempool in time to avoid insufficient funds error (cosmos#471) * fix: avoid insufficient funds error when fund and send tx within same block get SpendableCoin from sdk ctx to reflect uncommitted balance change * wrong hash * fix test * cleanup doc * notify * revert * cleanup * doc * unsubscribe * lint * cleanup * align shutdown timeout to avoid stuck on closing JSON-RPC * cleanup * Apply suggestions from code review * Apply suggestions from code review * lint * lint --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit 2cf6593 Author: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Date: Thu Aug 21 15:48:37 2025 +0200 feat: allow PostTxProcessing to run on failures and persist data (cosmos#479) * feat: allow PostProcessingTx to run on failures and persist data * linf fix * add check for hooks --------- Co-authored-by: Vlad J <vladjdk@gmail.com> commit 1f22f19 Author: yihuang <yi.codeplayer@gmail.com> Date: Thu Aug 21 21:46:24 2025 +0800 Problem: IsStorageEmpty is not implemented (cosmos#490) * Problem: IsStorageEmpty is not implemented Closes: cosmos#486 * update deps commit 3991c2c Author: Haber <kyuhyeon@bharvest.io> Date: Thu Aug 21 03:43:08 2025 +0900 tests: add revert error e2e tests for contract and precompile calls (cosmos#476) * update launch script path & remove duplicate We should use only one launch script. Managing both is extra un-necessary overhead * chore: add private keys info in local_node.sh * add bech32 and bank e2e tests * add undelegate test * faster local node and udpate delegate test * add create validator tc * update delegate tc include event checking also * update test codes added event checking to undelegate tc receipt has hash field instead of transactionHash * chore: remove un-used variable * add edit validator tc * add cancel unbonding tc * chore: format test files * add redelegate tc * skip gas estimation for faster tests * add redelegations query test * chore: refactor variable names * chore: change filename * add validators query test and fix gov interface * add set withdraw address tc * order test sequences and add withdraw delegator reward tc * add claim rewards tc * add withdraw validator commission * add fund community pool tc * add deposit validator rewards pool tc * add validator queries tc * chore: unify convention * add erc20 tc * update local node script it should contains every precompiles by default * fix slashing query and add e2e tests for it * fix: decode bech32 consensus address before converting to bytes The consensus address was previously used in its bech32-encoded form (a 52-character string), which is incorrect. This led to attempts to interpret a bech32 string directly as a 20-byte address, resulting in invalid conversions and data loss. This fix ensures the bech32 consensus address is properly decoded into its original 20-byte form before further processing, preserving the correct address representation expected in EVM-compatible byte format. * add gov tc * add more tcs to gov precompile (should fix cancel) * fix cancel proposal tc * add p256 tc * remove un-used variables * add werc20 tc * more timeout and verbose log * fix local_node.sh * add edgecase test for staking precompile and lint local node script * revert solidity test script change * chore: trim comments * p256 happy case * refactoring * refactor: make findEvent as common * check delegation shares and balance also * add checking user balance for withdraw delegator reward test * add checking user balance for claim rewards tc * strict balance check * add user balance check for fund community pool tc * add user balance check for deposit validator rewards pool tc * should use owner, not contract address itself * add event checks for erc20 precompile tc * add balance checks for werc20 tc * add balance check for gov deposit tc * add balance check for gov cancel proposal tc * add revert e2e test cases * lint: unused variable * chore(tests): set default evm chain id - 262144 * WIP: test: enhance revert test * WIP: test: enhance revert test * WIP: test: enhance revert test * test: enhance revert test * chore(tests): refine code * chore: update changelog * chore: add semi-colon --------- Co-authored-by: zsystm <actor93kor@gmail.com> Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit befde4f Author: LEE JUNSEO <heiji@bharvest.io> Date: Thu Aug 21 01:25:25 2025 +0900 feat: Delete EVM instance in AnteHandler (cosmos#352) * test: adjusts GasTipCap to equal GasFeeCap when it exceeds the maximum fee cap * ensures adequate fees for bank msg send * Optimize CanTransfer AnteHandler * refactor(antehandler): remove stateDB allocation * chore: replace GlobalEVMMempool by passing to JSONRPC on initiate (cosmos#467) * chore: ensure SetGlobalEVMMempool is thread-safe and only set once keep singleton behavior on concurrent initialization * doc * keep reset * pass in mempool * cleanup --------- Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> * Problem: eip-2935 is not implemented (cosmos#407) * Problem: eip-2935 is not implemented Solution: - adapt the implementation from geth * change BLOCKHASH opcode to query contract storage * commit statedb * fix panic * temp * just emulate the contract behavior with native code * fix test * fix lint * fix lint * revert unneeded changes * fix test * revert * only set contract storage if it's deployed * fix build * add history serve window parameter * cleanup * fix lint --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Vlad J <vladjdk@gmail.com> * fix : EVMKeeper GetBalance missed when version upgrades * add CHANGELOG --------- Co-authored-by: mmsqe <tqd0800210105@gmail.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: yihuang <yi.codeplayer@gmail.com> commit 7451d9b Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Wed Aug 20 11:37:26 2025 -0400 set-up (cosmos#491) commit 8903f9d Author: yoosah <34054347+yoosah@users.noreply.github.com> Date: Wed Aug 20 23:20:55 2025 +0900 refactor: decouple keeper using interface on precompile (cosmos#477) * refactor: decouple keeper using interface on precompile - Define a set of keeper interfaces in precompiles/common/interfaces.go that specify the exact methods required by the precompiles. - Update all precompile constructors and internal structs to use these new interfaces. - Modifie the precompile assembly in `evmd/precompiles.go` to inject the concrete `MsgServer` and `Querier` implementations, which satisfy the required interfaces. - Removed unnecessary keeper dependencies from the function signatures of several precompiles * docs: add changelog commit f164197 Author: yihuang <yi.codeplayer@gmail.com> Date: Wed Aug 20 09:00:09 2025 +0800 Problem: eip-2935 is not implemented (cosmos#407) * Problem: eip-2935 is not implemented Solution: - adapt the implementation from geth * change BLOCKHASH opcode to query contract storage * commit statedb * fix panic * temp * just emulate the contract behavior with native code * fix test * fix lint * fix lint * revert unneeded changes * fix test * revert * only set contract storage if it's deployed * fix build * add history serve window parameter * cleanup * fix lint --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Vlad J <vladjdk@gmail.com> commit aa9a834 Author: mmsqe <tqd0800210105@gmail.com> Date: Wed Aug 20 05:48:45 2025 +0800 chore: replace GlobalEVMMempool by passing to JSONRPC on initiate (cosmos#467) * chore: ensure SetGlobalEVMMempool is thread-safe and only set once keep singleton behavior on concurrent initialization * doc * keep reset * pass in mempool * cleanup --------- Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit dda0fb1 Author: aljo242 <alex@interchainlabs.io> Date: Tue Aug 19 17:04:01 2025 -0400 add thanks commit a9cb401 Author: Cordt Hanson <96965330+Cordtus@users.noreply.github.com> Date: Tue Aug 19 14:17:19 2025 -0600 add erc20 migration guide (cosmos#485) commit 1d8b9e1 Author: Sujong Lee <leesj9476lsj@gmail.com> Date: Wed Aug 20 02:30:07 2025 +0900 feat: remove allow-unprotected-txs(non eip-155) from x/vm params (cosmos#415) * feat: remove allow-unprotected-txs(non eip-155) from x/vm params * fix: build --------- Co-authored-by: Vlad J <vladjdk@gmail.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit 47b43b4 Author: Abdul Malek <me@almk.dev> Date: Tue Aug 19 13:18:44 2025 -0400 add comments (cosmos#489) commit 144922a Author: Cordt Hanson <96965330+Cordtus@users.noreply.github.com> Date: Tue Aug 19 08:28:41 2025 -0600 revert auto-fix for markdown linting (cosmos#483) commit 7dc893d Author: mmsqe <tqd0800210105@gmail.com> Date: Tue Aug 19 03:51:14 2025 +0800 fix: add pagination flags to token-pairs query (cosmos#468) * fix: add pagination flags to token-pairs query * doc --------- Co-authored-by: Vlad J <vladjdk@gmail.com> commit 909c8e2 Author: Vlad J <vladjdk@gmail.com> Date: Mon Aug 18 15:40:06 2025 -0400 (docs):Add SetClientCtx instructions to migration guide (cosmos#481) * fix annoying md lints * add setclientctx instructions w * Auto-fix markdown lint issues * improve the look of the comments --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit 29c1fac Author: Haber <kyuhyeon@bharvest.io> Date: Tue Aug 19 03:57:24 2025 +0900 fix: precisebank & werc20 precompile (cosmos#457) * feat(x/precisebank): add FracionalBalanceChange event * feat(precmopile/common): Add FractionalBalanceChangeEvent to balanceHandler * feat(precompilse): apply changed balance handler * fix(precompiles/common): balance handler logic * test(precompiles): apply changed balance handler to evmd & integration test suite * test(precompiles/werc20): fix integration test * test(x/precisebank): fix integration tests * test(precompiles/werc20): fix integration tests * chore(x/precisebank): modify method name * chore: fix lint --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit ab1cd0c Author: Haber <kyuhyeon@bharvest.io> Date: Tue Aug 19 03:15:57 2025 +0900 test(jsonrpc): add jsonrpc compatibility test (cosmos#419) * test(rpc-compat): add test simulator * refactor(tests): jsonrpc test * test(jsonprc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): add network start/stop scripts of evmd and geth * test(jsonrpc): fix api counting in report * test(jsonrpc): refactor result format * test(jsonrpc): refactor * test(jsonrpc): add state generator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor * test(jsonrpc): setup geth dev mode * test(jsonrpc): clean unused code * test(jsonrpc): setup initial state * test(jsonrpc): add tx metadata for test * WIP: test(jsonrpc): fix some failing tests of eth_ apis * test(jsonrpc): fix eth test * WIP: test(jsonrpc): fix debug api test cases * test(jsonrpc): set pruning config as nothing for testing * test(jsonrpc): enhance debug testing * test(jsonrpc): fix net test case * chore: update working history * test(jsonrpc): skip personal apis * test(jsonrpc): add websocket api test * jsonrpc(test): fix personal apis * test(jsonrpc): add missing debug apis * test(jsonrpc): update working history * test(jsonrpc): fix eth_sign / eth_signTransaction test * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): refactor simulator * test(jsonrpc): update working history * WIP: add type check between responses from evmd and geth * WIP: add type check between responses from evmd and geth * WIP: test(jsonrpc): add type check between responses from evmd and geth * test(jsonrpc): modify test * test(jsonrpc): add debug apis * test(jsonrpc): fix failing tests * test(jsonrpc): fix failing test * test(jsonrpc): fix test * test(jsonrpc): fix test * test(jsonrpc): remove unnecessary files * chore: add compatibility test github ci job * chore: update github-ci job * chore: fix jsonrpc-compatibility test githib-ci job * test(jsonrpc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): refactor * test(jsonrpc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): fix github-ci * test(jsonrpc): refactor test suite * fix github-ci * fix github-ci * fix github-ci * fix: github-ci * fix: github-ci * test(jsonrpc): add eth tests * WIP: chore: debugging github-ci failure * fix: github-ci * test(jsonrpc): add missing debug tests * fix github-ci * test(jsonrpc): add eth_pendingtransaction test * fix: github-ci * test(jsonrpc): add missing debug tests * Revert "test(jsonrpc): add missing debug tests" This reverts commit 790cce7. * Revert "fix: github-ci" This reverts commit b3a777a. * fix: github-ci * fix: github-ci * WIP: fix: github-ci * WIP: fix github0-ci * test(jsonrpc): refactor test suite * fix: github-ci * chore: add debug code for github-ci * chore: add debug code for github-ci * fix: github-ci * fix: github-ci * test(jsonrpc): refactor test suite * test(jsonrpc): fix github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix github-ci * test(jsonrpc): fix eth_getProof api * fix eth_getProof api * fix: github-ci * fix: github-ci * fix: github-ci * test(jsonrpc): fix api test * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * fix: github-ci * test(jsonrpc): modify test script * fix: github-ci * test(jsonrpc): refactor test suite * test(jsonrpc): refactor test suite * test(jsonrpc): fix websocket api tests * chore: update README.md for jsonrpc test * chore: remove binary file --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit b9bdbe6 Author: Haber <kyuhyeon@bharvest.io> Date: Tue Aug 19 01:02:44 2025 +0900 chore: update contracts-compile script (cosmos#475) Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit 810e9ef Author: mmsqe <tqd0800210105@gmail.com> Date: Mon Aug 18 23:07:19 2025 +0800 Problem: query decimals get reverted when Display doesn't match with DenomUnit for ibc token (cosmos#397) * Problem: query decimals get reverted when Display doesn't match with DenomUnit for ibc token * add test --------- Co-authored-by: Vlad J <vladjdk@gmail.com> commit 39ddca4 Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Mon Aug 18 07:17:31 2025 -0700 feat: local_node.sh upgrades (cosmos#470) * upgrade script * some comments * allow mnemonics file input * fix script * add in the dev0-dev3s info --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit 6492ef5 Author: yihuang <yi.codeplayer@gmail.com> Date: Mon Aug 18 22:16:35 2025 +0800 feat: re-use tx validation rules from go-ethereum (cosmos#286) * feat: re-use tx validation rules from go-ethereum * fix format * fix lint * add missing gas rules * fix test * fix build * don't check tx gas --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Vlad J <vladjdk@gmail.com> commit 1bdd7d2 Author: mmsqe <tqd0800210105@gmail.com> Date: Mon Aug 18 22:16:09 2025 +0800 chore: cleanup deprecated increaseAllowance and decreaseAllowance (cosmos#472) non-standard methods have been removed after audit commit 204ff4e Author: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> Date: Mon Aug 18 05:19:32 2025 +0900 tests: evm tools compatibility (cosmos#287) * add foundry uniswap v3 deploy test cases * add gitignore for foundry * exclude sol files in compatibility dir * add verbose flag to debug * fix script and ci yml * remove verbose tag * fix ci * add checking logic at testing script * shfmt ci-foundry-uniswap * bash lint * add foundry tc * clean deps * revert version * add tc for cast * lint * lint * add sdk viem tc * fix viem workflow * add web3 tc * add hardhat tc * lint * refactor: script and action file names * clean up * chore: fix typo at filename * fix typo and update chain-id * udpate chain id in tc --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Abdul Malek <me@almk.dev> commit a259976 Author: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Fri Aug 15 00:15:39 2025 -0700 fix rpc accessability (cosmos#469) commit 384ea4a Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Thu Aug 14 14:40:31 2025 -0400 retract (cosmos#464) commit dd448d2 Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Thu Aug 14 14:14:03 2025 -0400 update-mergify (cosmos#463) commit 41199a7 Author: Vlad J <vladjdk@gmail.com> Date: Thu Aug 14 13:19:52 2025 -0400 Mempool Readme (cosmos#462) * initial doc * add diagram and description * add transaction flow diagram * reorganizing * Auto-fix markdown lint issues * add links to tools and an example script link * Warning callout --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit ae319ac Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Thu Aug 14 12:53:27 2025 -0400 chore: update log package to support go v1.25 (cosmos#459) * update log package * cl commit 491b574 Author: Cordt Hanson <96965330+Cordtus@users.noreply.github.com> Date: Thu Aug 14 08:53:17 2025 -0600 fix solidity examples in precompile readmes (cosmos#458) commit e2930f6 Author: mmsqe <tqd0800210105@gmail.com> Date: Thu Aug 14 22:16:12 2025 +0800 fix: avoid nil pointer by checking error in gov precompile FromResponse (cosmos#442) * fix: avoid nil pointer by checking error in gov precompile FromResponse * doc * add test --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> commit 43f1521 Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Thu Aug 14 10:10:14 2025 -0400 chore: add migration guide (cosmos#448) * add guide * callout * Auto-fix markdown lint issues * fix-nit diff --git c/docs/migrations/v0.3.0_to_v0.4.0.md i/docs/migrations/v0.3.0_to_v0.4.0.md index 222b9e2..a5308d1 100644 --- c/docs/migrations/v0.3.0_to_v0.4.0.md +++ i/docs/migrations/v0.3.0_to_v0.4.0.md @@ -33,7 +33,7 @@ Bump the `cosmos/evm` dependency in `go.mod` and tidy modules: ### 1.2 Transitive bumps (observed in `go.sum`) -Check for minor dependency bumps such as minor bumps (e.g., `google.golang.org/protobuf`, `github.com/gofrs/flock`, `github.com/consensys/gnark-crypto`). Run the following commands: +Check for minor dependency bumps (e.g., `google.golang.org/protobuf`, `github.com/gofrs/flock`, `github.com/consensys/gnark-crypto`). Run the following commands: ```bash go mod tidy --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit 11e8be0 Author: mmsqe <tqd0800210105@gmail.com> Date: Thu Aug 14 22:05:13 2025 +0800 fix: cleanup unused cancel function in filter (cosmos#452) * fix: cleanup unused cancel function in filter * doc * test --------- Co-authored-by: Vlad J <vladjdk@gmail.com> commit eb60af8 Author: mmsqe <tqd0800210105@gmail.com> Date: Thu Aug 14 21:33:58 2025 +0800 fix: apply multi decode functions instead of string contains check in HexAddressFromBech32String (cosmos#454) * fix: apply multi decode functions instead of string contains check in HexAddressFromBech32String * align for account, validator, and consensus addresses like sdk * https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/client/debug/main.go#L262 * test commit 6acac06 Author: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> Date: Thu Aug 14 22:03:09 2025 +0900 feat: remove deprecated apis (cosmos#456) * remove deprecated apis (removed from geth) * add changelog * chore: fix link commit 99abc7f Author: Vlad J <vladjdk@gmail.com> Date: Wed Aug 13 16:15:44 2025 -0400 (feat):Appside Mempool (cosmos#387) * wip * wip: iterator * nil check * wip: selectby * add todo * pointer * pointer 2 * remove impl, type assertions * add txpool locally * change statedb types to interface * fix tests * scaffold app setup * Add initial tests to ExtMempool * real priority nonce mempool + fixes * improve test for wrong denom ordering * move initialization to mempool * ok * Nonce gap tx test * revert * bloom parsing dumb * redundant * ignore this dir for markdown linting * Cleanup + Test SelectBy * implement blockchain * update systemtest test tag * add subscription * fix tests * wiring and bug fixes and todos and etc * wip * fix * WIP on vlad/mempool * Auto stash before checking out "origin/vlad/mempool" * rpc no error * clean up logging * verification * Add broadcasting * add retries to tx results * feature: Add txpool namespace stubs ahead of app-side mempool implementation (cosmos#344) * add txpool implementation stubs * update interface * fix lint --------- Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> * txpool endpoint * wip refactor * do not allow block 1 submission * fix some tests * fix more tests * fix last remaining evmd test * add second registry for testing * wip: integration tests * wip: functional tests time to add more test cases * fix tests and chain * demo ready todo: fix removals * fix removals (out of gas errors should be skipped) * add gas to config * attempt to fix flakes * strict equalities * FIXED FLAKES * reformat tests into original structure * nonce gap tests * add demo test and fix prev system case * remove done todos and the other mempool * add instructions to remove mempool * remove mocks * lint fixes * review test cases * add some more test cases * fix scripts * add more backoff for testing * remove logs from simplesends * fix systest CI * skip test for now see if main one works * Update .markdownlintignore Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> * Update evmd/tests/integration/create_app.go Co-authored-by: Eric Warehime <eric.warehime@gmail.com> * Refactor: Rename 'nonce' to 'accountNonce' in IncrementNonce function * refactor app.go imports * extract atest to constant * fix nonce name test * use actual release * evmd use release tag * refactor ctx -> getCtxCallback * rename errors2 and types2 to sdkerrors and sdktypes * group vars in mempool init * privatize newBlockchain * enhance mempool init readability on nil checks * move txPool checks to right after initialization * use errors.Is for nonce gap errors in rpc * group vars * Update tests/systemtests/.gitignore * refactor iterator to make it more readable * refactor iterator to make it more readable * rename blocked -> queued and runnable -> pending * explain some questionable naming choices * add some status constants * add logging * move custom endblocker to vm * fix rpc error compare * fix system tests * lints * fixed from main merge * rename mempool to experimental * Auto-fix markdown lint issues * we tidy * overflow comment * add changelog entry * Update evmd/app.go Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> * remove comment * initialize txpool unconditionally * sort by effective gas tips instead of fees on cosmos * lints * small test cleanup --------- Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Abdul Malek <me@almk.dev> Co-authored-by: Eric Warehime <eric.warehime@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com> commit 20dea4b Author: Alex | Interchain Labs <alex@interchainlabs.io> Date: Wed Aug 13 14:14:22 2025 -0400 chore: move `evmd` ante options to `evm` lib (cosmos#443) * fix * move-to-lib * godoc * cl * Auto-fix markdown lint issues * bump for ci * bump for ci * fix * fix * fix --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit a6d5dea Author: mmsqe <tqd0800210105@gmail.com> Date: Wed Aug 13 22:52:35 2025 +0800 feat: enforce app creator returning application implement AppWithPendingTxStream in build time (cosmos#440) * feat: enforce app creator returning application implementing AppWithPendingTxStream in build time * update application interface and app creator wiring for EVM server integration * use cosmosevmserver.Application interface instead of servertypes.Application with assertion * add new Application interface and AppCreator type to support pending tx stream * add doc commit c5ca267 Author: mmsqe <tqd0800210105@gmail.com> Date: Wed Aug 13 22:48:56 2025 +0800 fix: align precompiles map with available static check (cosmos#441) * fix: align precompiles map with available static check for more info, https://github.com/cosmos/evm/blob/be2c215481ef1466328811d878675be75c90edf3/x/vm/keeper/static_precompiles.go#L46 * add doc fix GetTransferSenderRecipient cleanup
1 parent cdd966c commit 3edf0d4

8 files changed

Lines changed: 27 additions & 105 deletions

File tree

evmd/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ func NewExampleApp(
497497
app.EVMKeeper,
498498
app.StakingKeeper,
499499
&app.TransferKeeper,
500+
app.AccountKeeper.AddressCodec(),
500501
)
501502

502503
// instantiate IBC transfer keeper AFTER the ERC-20 keeper to use it in the instantiation
@@ -538,6 +539,7 @@ func NewExampleApp(
538539
app.AccountKeeper,
539540
app.EVMKeeper,
540541
app.Erc20Keeper,
542+
app.AccountKeeper.AddressCodec(),
541543
)
542544
transferStack = ibccallbacks.NewIBCMiddleware(transferStack, app.IBCKeeper.ChannelKeeper, app.CallbackKeeper, maxCallbackGas)
543545

ibc/utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package ibc
33
import (
44
"strings"
55

6-
"github.com/cosmos/evm/utils"
76
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
87
transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
98
channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
109

10+
"cosmossdk.io/core/address"
1111
errorsmod "cosmossdk.io/errors"
1212
"cosmossdk.io/math"
1313

@@ -21,21 +21,21 @@ import (
2121
// - the packet data is not FungibleTokenPacketData
2222
// - sender address is invalid
2323
// - recipient address is invalid
24-
func GetTransferSenderRecipient(data transfertypes.FungibleTokenPacketData) (
24+
func GetTransferSenderRecipient(data transfertypes.FungibleTokenPacketData, addressCodec address.Codec) (
2525
sender, recipient sdk.AccAddress,
2626
senderBech32, recipientBech32 string,
2727
err error,
2828
) {
2929
// validate the sender bech32 address from the counterparty chain
3030
// and change the bech32 human readable prefix (HRP) of the sender to `evmos`
31-
sender, err = utils.GetAccAddressFromBech32(data.Sender)
31+
sender, err = addressCodec.StringToBytes(data.Sender)
3232
if err != nil {
3333
return nil, nil, "", "", errorsmod.Wrap(err, "invalid sender")
3434
}
3535

3636
// validate the recipient bech32 address from the counterparty chain
3737
// and change the bech32 human readable prefix (HRP) of the recipient to `evmos`
38-
recipient, err = utils.GetAccAddressFromBech32(data.Receiver)
38+
recipient, err = addressCodec.StringToBytes(data.Receiver)
3939
if err != nil {
4040
return nil, nil, "", "", errorsmod.Wrap(err, "invalid recipient")
4141
}

ibc/utils_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/stretchr/testify/require"
77

8+
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
89
cosmosevmibc "github.com/cosmos/evm/ibc"
910
precompilestestutil "github.com/cosmos/evm/precompiles/testutil"
1011
testconstants "github.com/cosmos/evm/testutil/constants"
@@ -94,8 +95,9 @@ func TestGetTransferSenderRecipient(t *testing.T) {
9495
},
9596
}
9697

98+
addressCodec := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())
9799
for _, tc := range testCases {
98-
sender, recipient, _, _, err := cosmosevmibc.GetTransferSenderRecipient(tc.data)
100+
sender, recipient, _, _, err := cosmosevmibc.GetTransferSenderRecipient(tc.data, addressCodec)
99101
if tc.expError {
100102
require.Error(t, err, tc.name)
101103
} else {

utils/utils.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
2626
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
2727
sdk "github.com/cosmos/cosmos-sdk/types"
28-
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
2928
)
3029

3130
// EthHexToCosmosAddr takes a given Hex string and derives a Cosmos SDK account address
@@ -127,30 +126,6 @@ func IsSupportedKey(pubkey cryptotypes.PubKey) bool {
127126
}
128127
}
129128

130-
// GetAccAddressFromBech32 returns the sdk.Account address of given address,
131-
// while also changing bech32 human readable prefix (HRP) to the value set on
132-
// the global sdk.Config (eg: `evmos`).
133-
//
134-
// The function fails if the provided bech32 address is invalid.
135-
func GetAccAddressFromBech32(address string) (sdk.AccAddress, error) {
136-
bech32Prefix := strings.SplitN(address, "1", 2)[0]
137-
if bech32Prefix == address {
138-
return nil, errorsmod.Wrapf(errortypes.ErrInvalidAddress, "invalid bech32 address: %s", address)
139-
}
140-
141-
addressBz, err := sdk.GetFromBech32(address, bech32Prefix)
142-
if err != nil {
143-
return nil, errorsmod.Wrapf(errortypes.ErrInvalidAddress, "invalid address %s, %s", address, err.Error())
144-
}
145-
146-
// safety check: shouldn't happen
147-
if err := sdk.VerifyAddressFormat(addressBz); err != nil {
148-
return nil, err
149-
}
150-
151-
return sdk.AccAddress(addressBz), nil
152-
}
153-
154129
// CreateAccAddressFromBech32 creates an AccAddress from a Bech32 string.
155130
func CreateAccAddressFromBech32(address string, bech32prefix string) (addr sdk.AccAddress, err error) {
156131
if len(strings.TrimSpace(address)) == 0 {

utils/utils_test.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -86,65 +86,6 @@ func TestIsSupportedKeys(t *testing.T) {
8686
}
8787
}
8888

89-
func TestGetAccAddressFromBech32(t *testing.T) {
90-
config := sdk.GetConfig()
91-
config.SetBech32PrefixForAccount("cosmos", "cosmospub")
92-
93-
testCases := []struct {
94-
name string
95-
address string
96-
expAddress string
97-
expError bool
98-
}{
99-
{
100-
"blank bech32 address",
101-
" ",
102-
"",
103-
true,
104-
},
105-
{
106-
"invalid bech32 address",
107-
"evmos",
108-
"",
109-
true,
110-
},
111-
{
112-
"invalid address bytes",
113-
"cosmos1123",
114-
"",
115-
true,
116-
},
117-
{
118-
"evmos address",
119-
"cosmos1qql8ag4cluz6r4dz28p3w00dnc9w8ueulg2gmc",
120-
"cosmos1qql8ag4cluz6r4dz28p3w00dnc9w8ueulg2gmc",
121-
false,
122-
},
123-
{
124-
"cosmos address",
125-
"cosmos1qql8ag4cluz6r4dz28p3w00dnc9w8ueulg2gmc",
126-
"cosmos1qql8ag4cluz6r4dz28p3w00dnc9w8ueulg2gmc",
127-
false,
128-
},
129-
{
130-
"osmosis address",
131-
"osmo1qql8ag4cluz6r4dz28p3w00dnc9w8ueuhnecd2",
132-
"cosmos1qql8ag4cluz6r4dz28p3w00dnc9w8ueulg2gmc",
133-
false,
134-
},
135-
}
136-
137-
for _, tc := range testCases {
138-
addr, err := utils.GetAccAddressFromBech32(tc.address)
139-
if tc.expError {
140-
require.Error(t, err, tc.name)
141-
} else {
142-
require.NoError(t, err, tc.name)
143-
require.Equal(t, tc.expAddress, addr.String(), tc.name)
144-
}
145-
}
146-
}
147-
14889
func TestEvmosCoinDenom(t *testing.T) {
14990
testCases := []struct {
15091
name string

x/erc20/keeper/ibc_callbacks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (k Keeper) OnRecvPacket(
5555
WithKVGasConfig(storetypes.GasConfig{}).
5656
WithTransientKVGasConfig(storetypes.GasConfig{})
5757

58-
sender, recipient, _, _, err := ibc.GetTransferSenderRecipient(data)
58+
sender, recipient, _, _, err := ibc.GetTransferSenderRecipient(data, k.addressCodec)
5959
if err != nil {
6060
return channeltypes.NewErrorAcknowledgement(err)
6161
}
@@ -188,7 +188,7 @@ func (k Keeper) OnTimeoutPacket(ctx sdk.Context, _ channeltypes.Packet, data tra
188188
// ConvertCoinToERC20FromPacket converts the IBC coin to ERC20 after refunding the sender
189189
// This function is only executed when IBC timeout or an Error ACK happens.
190190
func (k Keeper) ConvertCoinToERC20FromPacket(ctx sdk.Context, data transfertypes.FungibleTokenPacketData) error {
191-
sender, err := sdk.AccAddressFromBech32(data.Sender)
191+
sender, err := k.addressCodec.StringToBytes(data.Sender)
192192
if err != nil {
193193
return err
194194
}

x/erc20/keeper/keeper.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/cosmos/evm/x/erc20/types"
77
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
88

9+
"cosmossdk.io/core/address"
910
"cosmossdk.io/log"
1011
storetypes "cosmossdk.io/store/types"
1112

@@ -18,7 +19,8 @@ type Keeper struct {
1819
storeKey storetypes.StoreKey
1920
cdc codec.BinaryCodec
2021
// the address capable of executing a MsgUpdateParams message. Typically, this should be the x/gov module account.
21-
authority sdk.AccAddress
22+
authority sdk.AccAddress
23+
addressCodec address.Codec
2224

2325
accountKeeper types.AccountKeeper
2426
bankKeeper types.BankKeeper
@@ -37,6 +39,7 @@ func NewKeeper(
3739
evmKeeper types.EVMKeeper,
3840
sk types.StakingKeeper,
3941
transferKeeper *transferkeeper.Keeper,
42+
addressCodec address.Codec,
4043
) Keeper {
4144
// ensure gov module account is set and is not nil
4245
if err := sdk.VerifyAddressFormat(authority); err != nil {
@@ -52,6 +55,7 @@ func NewKeeper(
5255
evmKeeper: evmKeeper,
5356
stakingKeeper: sk,
5457
transferKeeper: transferKeeper,
58+
addressCodec: addressCodec,
5559
}
5660
}
5761

x/ibc/callbacks/keeper/keeper.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
2121
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
2222

23+
"cosmossdk.io/core/address"
2324
errorsmod "cosmossdk.io/errors"
2425
"cosmossdk.io/math"
2526

@@ -34,17 +35,19 @@ type ContractKeeper struct {
3435
evmKeeper types.EVMKeeper
3536
erc20Keeper types.ERC20Keeper
3637
packetDataUnmarshaler porttypes.PacketDataUnmarshaler
38+
addressCodec address.Codec
3739
}
3840

3941
// NewKeeper creates and initializes a new ContractKeeper instance.
4042
//
4143
// The ContractKeeper manages cross-chain contract execution and handles IBC packet
4244
// callbacks for smart contract interactions.
43-
func NewKeeper(authKeeper types.AccountKeeper, evmKeeper types.EVMKeeper, erc20Keeper types.ERC20Keeper) ContractKeeper {
45+
func NewKeeper(authKeeper types.AccountKeeper, evmKeeper types.EVMKeeper, erc20Keeper types.ERC20Keeper, addressCodec address.Codec) ContractKeeper {
4446
ck := ContractKeeper{
45-
authKeeper: authKeeper,
46-
evmKeeper: evmKeeper,
47-
erc20Keeper: erc20Keeper,
47+
authKeeper: authKeeper,
48+
evmKeeper: evmKeeper,
49+
erc20Keeper: erc20Keeper,
50+
addressCodec: addressCodec,
4851
}
4952
ck.packetDataUnmarshaler = types.Unmarshaler{}
5053
return ck
@@ -130,17 +133,12 @@ func (k ContractKeeper) IBCReceivePacketCallback(
130133
cachedCtx = evmante.BuildEvmExecutionCtx(cachedCtx).
131134
WithGasMeter(types2.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit))
132135

133-
// receiver := sdk.MustAccAddressFromBech32(data.Receiver)
134-
receiver, err := sdk.AccAddressFromBech32(data.Receiver)
136+
receiver, err := k.addressCodec.StringToBytes(data.Receiver)
135137
if err != nil {
136138
return errorsmod.Wrapf(types.ErrInvalidReceiverAddress,
137139
"acc addr from bech32 conversion failed for receiver address: %s", data.Receiver)
138140
}
139-
receiverHex, err := utils.HexAddressFromBech32String(receiver.String())
140-
if err != nil {
141-
return errorsmod.Wrapf(types.ErrInvalidReceiverAddress,
142-
"hex address conversion failed for receiver address: %s", receiver)
143-
}
141+
receiverHex := common.BytesToAddress(receiver)
144142

145143
// Generate secure isolated address from sender.
146144
isolatedAddr := types.GenerateIsolatedAddress(packet.GetDestChannel(), data.Sender)
@@ -404,11 +402,11 @@ func (k ContractKeeper) IBCOnTimeoutPacketCallback(
404402
return errorsmod.Wrap(types.ErrInvalidCalldata, "timeout callback data should not contain calldata")
405403
}
406404

407-
senderAccount, err := sdk.AccAddressFromBech32(packetSenderAddress)
405+
senderAccount, err := k.addressCodec.StringToBytes(packetSenderAddress)
408406
if err != nil {
409407
return errorsmod.Wrapf(err, "unable to parse packet sender address %s", packetSenderAddress)
410408
}
411-
sender := common.BytesToAddress(senderAccount.Bytes())
409+
sender := common.BytesToAddress(senderAccount)
412410
contractAddr := common.HexToAddress(contractAddress)
413411
contractAccount := k.evmKeeper.GetAccountOrEmpty(ctx, contractAddr)
414412

0 commit comments

Comments
 (0)