Skip to content

Conversation

@AryaLanjewar3005
Copy link
Collaborator

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

vladjdk and others added 28 commits March 26, 2025 09:12
* fix: cast send --legacy support

* changelog

---------

Co-authored-by: Eric Warehime <eric.warehime@gmail.com>
* Remove example_chain, move to evmd

* Update changelog

* Replace activators

* Remove Makefile

* Fix solidity tests
* refactor: remove print on the evm app options

* fix: add the chain add setup to export app

* refactor: update getChainIDFromOpts with ID in uppercase
Link mention to Cosmos EVM docs' page on the main readme of the repository.
* Change all the things

* Fix test

* Remove activators nolint

* Fix test

* Update readme

* Fix readme lint
* utest -> atest

* example chain script fix

* fix node script

---------

Co-authored-by: Eric Warehime <eric.warehime@gmail.com>
* fix name() query on native ERC20 failing out

* fix indent

* lint fix

* lint

* tab character

* another hidden tab
solving the problem using different versions of glibc
* Remove old params object from feemarket

* Add changelog entry
* Remove legacy subspaces

* Add changelog entry
* Update README.md

Update disclaimer note

* long line fix

---------

Co-authored-by: Noam <81436914+nooomski@users.noreply.github.com>
* feat: bump up ibc-go from v8 to v10 (cosmos#51)

* bump up ibc-go from v8 to v10

- bumped up ibc-go from v8 to v10
- removed unused ibc test codes because bumping unused testing codes are wasting time. we should use ibc testing package instead.

* add ibc v1 transfer test

added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.

* add ibc v2 components (module, middleware)

- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.

* add nil checks and convert erc20 keeper to interface in IBCMiddleware

- added nil checks for app and keeper in NewIBCMiddleware to prevent nil pointer dereference.
- changed erc20 keeper from struct to interface type to enable proper nil checking.

* copy and modify from ibc-go testing

To test certain key scenarios involving EVM messages (e.g., deploying an ERC20 contract), we needed a block header context with a proposer address. This required:
- A custom `TestChain` to handle these messages.
- A custom `SignAndDeliver` function to support the transaction signing and delivery process.
- A custom `Coordinator` to integrate this tailored `TestChain`.

Since `TestChain` and `SignAndDeliver` are directly or indirectly tied to most components in the testing package, and ibc-go cannot use a `TestChain` struct defined in our separate package, we had to copy and adapt nearly all related files to ensure compatibility and functionality.

* fix: ci issues

* replace deprecated functions

* revert disable base fee

Disabling the base fee to simplify testing is not ideal for a reference chain intended for developers building EVM-compatible chains. Ethereum relies on a fee market mechanism, and as a reference implementation, this chain should enable it by default to align with expected behavior.

* update TestGetReceivedCoin

Updated TestGetReceivedCoin to use the newly introduced interface instead of hardcoded strings.
This improves maintainability by making the test logic more aligned with the actual send/receive flow.
It also enhances readability and helps developers better understand how denoms are constructed and handled in real IBC transfers.

* bump up ibc-go from v10.1.0 to v10.1.1

* tests: add ibc test cases (cosmos#63)

* add basic test cases for ibc middleware v1, v2

more test cases will be added.

* add test cases for ibc middleware v2

* add test cases for ibc middleware v1 and post state check

* add OnAcknowledgementPacket tc for v1 ibc middleware

* add OnTimeoutPacket tc for v1 ibc middleware

* chore: unify variable names

* use internal testing pkg and add TestOnRecvPacketNativeErc20 tc

* add v1 tcs for handling erc20 native coin

OnTimeoutPacket, OnAcknowledgementPacket

* refactor v1 middleware test codes

* apply gci

* fix ci: receiver name should be same

* fix ci: unify receiver name

and also update comments and variable name

* fix ci: run gofumpt and remove tc copy

* test: update TestOnRecvPacket

make sure whether it is registered as dynamic precompiled contract or not

* chore: test suite name convention

* fix!: replace erc20 prefix (cosmos#92)

* replace erc20 native coin's prefix

from: erc20/
to: erc20

* change prefix to erc20:

* don't allow legacy format

ValidateErc20Denom is not used anywhere except test code, but what if it is used from somewhere else in the future?

We shouldn't treat legacy format as valid.

* fix!: ensure ics20 precompile on ibc v1 and v2 and add test cases (cosmos#74)

* test: WIP debugging ibc e2e test

* fix: ics20 precompile receiver addr to bech32, not bech32

* test: add erc20 case for ics20 v1 e2e test

(cherry picked from commit 2737b63160d9cefcad52cf86048638a861a478a5)

* test: add ibc v2 relayer logic on testing package, add v2 ics20 precompile test cases

(cherry picked from commit 886fdb7581cdcd0dcce15592aae0d8206e78a783)

* chore: fix lint Useless assignment to local variable

* fix!: denom trace to denom for ibc v8 -> v10 breaking changes

* fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms cosmos#92

320236a

* test: add native erc20 case on ics20 precompile e2e test

(cherry picked from commit d8db271978f9a23d26a7c180ff8d7ec5edccc643)

* chore: fix lint

(cherry picked from commit 0d998cefc0c5bb57c396c01544b3ebe610f8a510)

* fix: update comments on ics20.sol

* refactor: Improve variable name clarity, apply suggestions

* Revert "fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms cosmos#92"

This reverts commit e5afb56.

* chore: update omitted contracts json by make contracts-all

* docs: update CHANGELOG.md

* tests: add erc20 native coin test cases for ibc v2 middleware (cosmos#96)

* add OnRecvPacketNativeERC20 test case

test scenario where evm chain receives erc20 native coin through IBC

* add OnTimeoutPacketNativeERC20 test case

* fix ci and comments

* fix test case

* fix: apply review comments, add testcases, error handling

---------

Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com>
Co-authored-by: Vlad J <vladjdk@gmail.com>
* fix govulncheck failure

* lint fix

* do dependency review regardless of diff
* feat: x/precisebank module

* test: fix unit tests

* test: fix markdown lint

* test: apply gci for x/precisebank

* test: fix markdown lint

* test: fix lint

* feat: generalize decimals

* feat: add query cli

* feat: generalize conversion factor

* feat: add invariant about total supply

* chore: move config related files to evmd/config

* feat: store coin info (denom, conversion factor)

* chore: remove chain specific logic from x/vm/keeper/keeper.go

* test: fix lint

* chore: revert go.mod

* test: add fuzz test

* test: fix fuzz test

* test: fix test_find_solidity_files

* test: fix lint for python file

* feat: use precisebank module from precompile

* Revert "feat: store coin info (denom, conversion factor)"

This reverts commit b309bd9.

* chore: add ConversionFactorVal for genesis block

* chore: remove unused proto import

* test: add generalized decimal tests

* test: add random value test with multi decimals

* test: add contract interaction test

* feat: remove flooring logic

* Revert "feat: remove flooring logic"

This reverts commit 05aa469.

* feat: change logic from flooring to precisebank

* Revert "chore: move config related files to evmd/config"

* fix: node start

* refactor: bank wrapper in x/vm scaling codes

* test: fix lint

* chore: cache EVMCoin infos before ResetTestConfig

* fix: return from sendExtendedCoins, if from == to

* test: add SEED for deterministic random test

* test: add random evm coin transfer with random gas

* test: fix lint

* test: revert TestEvmAnteTestSuite test cases

* chore: revert useless changes

* chore: remove evmtype constant dependency from precisebank module

* chore: register precisebank query cli to AppModuleBasic

* test: remove useless configurator setting

* fix: build

* fix: lint

* feat: add extended denom to 18 decimals

* refactor: ConversionFactorVal -> Decimals

* chore: sdkmath -> math

* chore: revert useless changes

* chore: remove useless check for extended denom

* refactor: simplify GetBalance of BankWrapper

* test: restore removed test

* chore: remove useless decimal validation check

* chore: fix condition more clearly

* docs: CHANGELOG.md

* chore: use only precisebank module for evm module and precompile

* chore: add extended denom for TestChainID

* refactor: invariants

* chore: add comments for precisebank

* refactor: remove hardcoded values in precisebanktypes

* test: set evm coin info explicitly

* refactor: rename funcs

* chore: remove deprecated interface check

* docs: add thanks message to kava

* test: remove debug print

* chore: remove TotalFractionalBalances query

* refactor: rename funcs(ChangeEvmCoinDenomFrom18Decimals -> ConvertEvmCoinDenomToExtendedDenom)

* test: fix lint

* Revert "test: fix lint"

This reverts commit d546ec2.

* test: rename test names

* test: add vesting test

* chore: remove GetAllBalances from bank keeper interface
* feat: evm hooks

* lint fix

* hooks refactor (match ethermint)

* state transition test - evm cumulative gas spent > cosmos block gas limit

* lints

* note for gas in hooks

* use errorsmod.wrap

---------

Co-authored-by: Reece Williams <reecepbcups@gmail.com>
* fix: follow-up fix for ibc v2 feature

* build: add explicit solhint version for constant ci
* feat(erc20): add convert coin endpoint

Co-Authored-By: Joel Smith <joelsmith.2019@gmail.com>

* lints

* Update proto/cosmos/evm/erc20/v1/tx.proto

Co-authored-by: Eric Warehime <eric.warehime@gmail.com>

* return error on negative amount

* NewMsgConvertCoin

* add negative error

* msg validation testing

* keeper call testing

* lints

---------

Co-authored-by: Reece Williams <reecepbcups@gmail.com>
Co-authored-by: Joel Smith <joelsmith.2019@gmail.com>
Co-authored-by: Eric Warehime <eric.warehime@gmail.com>
* feat: permissionless erc20 registration

* lints

* use non-gov signer

* fix proto

---------

Co-authored-by: Reece Williams <reecepbcups@gmail.com>
* feat: remove authz dependency from precompiles except for erc20

* wip: feat(precompiles): remove x/authz dependency

* test(precompiles): remove x/authz dependent test cases

* feat: remove x/authz dependency from x/erc20 and werc20 precompile

* fix(precompiles): modify contract interface and test contracts

* fix(precompiles): remove unused authz related types and test utils

* fix(precompiles): modify integration test of staking precompile

* feat(x/erc20): add allowance state (cosmos#90)

* feat(x/erc20): add allowance state

* test(x/erc20): add unit test for Allowance

* fix(x/erc20): add deleteAllowances method and modify genesis validation

* fix(x/erc20): validation of SetAllowance/GetAllowance and InitGenesis

* test(x/erc20) add test cases for UnsafeSetAllowance

* chore: fix lint

* wip: test: modify erc20 precompile tests

* test: modify erc20 precompile tests

* test(precompiles): �fix integration test

fix owner == sender case

* refactor(precompiles): remove authz dependent naming and comments

* wip: test(x/vm): modify flashLoan test

* test(x/vm): fix flashLoan integration test

* fix: merge conflict

* chore: fix lint

* chore: fix lint

* feat: remove authz keeper dependency from x/erc20 keeper

* chore: fix lint

* fix: increase consensusVersion of x/erc20 module

* chore: udpate CHANGELOG.md

* chore: update CHANGELOG.md

* chore: add comments to StakingCaller solidity contract

* fix: typo

* fix: remove duplicated test case

* fix: wrong args for ApprovalEvent

* fix: wrong error message for test

* refactor: refine code for staking precompile

* fix: merge conflicts

* refactor: change file name

* refactor(testutil): move constants for test to testutil/constants package

* refactor(erc20): InitGenesis

* test(erc20): add genesis test case

* fix(erc20): revert consensusVersion change

* refactor(erc20): refactor keeper methods of Allowance state

* test(testutil): fix test case and lint

* wip: fix(precompiles/erc20): remove incompatible logic with ERC20 Specification

* fix: add Approval event to transferFrom method and fix integration tests

* fix: FlashLoan.sol contract

* fix(x/erc20): allowance methods and test cases

* test(precompiles): add test cases for erc20 precompile

---------

Co-authored-by: Vlad <vladjdk@gmail.com>
* increase test coverage of abi.go

before: 36.8%
after: 91.2%

* fix lint
* apply patch

* fix merge conflict

* recompile contracts
// when resetting the chain config
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning test

This definition of denom is never used.

Copilot Autofix

AI 3 months ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning test

This definition of extendedDenom is never used.

Copilot Autofix

AI 3 months ago

To fix the problem, simply remove the line assigning extendedDenom as its value is never used. This removes unnecessary code and eliminates the static analyzer warning. Specifically, edit ante/testutils/testutil.go and delete line 107:

extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck

No additional imports, definitions, or code changes are required since this variable is unused.

Suggested changeset 1
ante/testutils/testutil.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/ante/testutils/testutil.go b/ante/testutils/testutil.go
--- a/ante/testutils/testutil.go
+++ b/ante/testutils/testutil.go
@@ -104,7 +104,6 @@
 	// to set them again
 	// when resetting the chain config
 	denom := evmtypes.GetEVMCoinDenom()                 //nolint:staticcheck
-	extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck
 	decimals := evmtypes.GetEVMCoinDecimals()           //nolint:staticcheck
 
 	configurator := evmtypes.NewEVMConfigurator()
EOF
@@ -104,7 +104,6 @@
// to set them again
// when resetting the chain config
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck

configurator := evmtypes.NewEVMConfigurator()
Copilot is powered by AI and may make mistakes. Always verify output.
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning test

This definition of decimals is never used.

Copilot Autofix

AI 3 months ago

To fix this, remove the unused local variable decimals (on line 108), and directly call evmtypes.GetEVMCoinDecimals() in the Decimals field of the evmtypes.EvmCoinInfo struct in the chained call to WithEVMCoinInfo. Do not change any functionality; this edit is only a simplification, with no effect on the logic or data flow. Only the provided snippet in ante/testutils/testutil.go needs editing, and no imports or other definitions are necessary.


Suggested changeset 1
ante/testutils/testutil.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/ante/testutils/testutil.go b/ante/testutils/testutil.go
--- a/ante/testutils/testutil.go
+++ b/ante/testutils/testutil.go
@@ -105,7 +105,6 @@
 	// when resetting the chain config
 	denom := evmtypes.GetEVMCoinDenom()                 //nolint:staticcheck
 	extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck
-	decimals := evmtypes.GetEVMCoinDecimals()           //nolint:staticcheck
 
 	configurator := evmtypes.NewEVMConfigurator()
 	configurator.ResetTestConfig()
@@ -114,7 +113,7 @@
 		WithEVMCoinInfo(evmtypes.EvmCoinInfo{
 			Denom:         denom,
 			ExtendedDenom: extendedDenom,
-			Decimals:      decimals,
+			Decimals:      evmtypes.GetEVMCoinDecimals(), //nolint:staticcheck
 		}).
 		Configure()
 	suite.Require().NoError(err)
EOF
@@ -105,7 +105,6 @@
// when resetting the chain config
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck
extendedDenom := evmtypes.GetEVMCoinExtendedDenom() //nolint:staticcheck
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck

configurator := evmtypes.NewEVMConfigurator()
configurator.ResetTestConfig()
@@ -114,7 +113,7 @@
WithEVMCoinInfo(evmtypes.EvmCoinInfo{
Denom: denom,
ExtendedDenom: extendedDenom,
Decimals: decimals,
Decimals: evmtypes.GetEVMCoinDecimals(), //nolint:staticcheck
}).
Configure()
suite.Require().NoError(err)
Copilot is powered by AI and may make mistakes. Always verify output.
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
Comment on lines +78 to +80
for _, chain := range coord.Chains {
coord.UpdateTimeForChain(chain)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning test

Iteration over map may be a possible source of non-determinism
tb.Helper()
sdkExp := new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil)
tx, err := simtestutil.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),

Check warning

Code scanning / CodeQL

Calling the system time Warning test

Calling the system time may be a possible source of non-determinism
@0xNilesh 0xNilesh merged commit c5816de into feat/derived-tx Nov 5, 2025
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.