Closed onikonychev closed 1 day ago
This update introduces functionality for sending bank coins as ERC20 tokens within the EVM module. This feature is driven by the creation and transfer of "FunTokens" and involves changes in the event definitions, message handling, CLI commands, and key module functions. Additionally, various tests and utility functions have been refactored or added to ensure this new feature operates smoothly.
File/Directory | Summary of Changes |
---|---|
CHANGELOG.md |
Added description of new features related to bank coin to ERC20 functionality. |
proto/eth/evm/v1/events.proto , proto/eth/evm/v1/tx.proto |
Updated to include new message definitions and RPC endpoints. |
x/evm/cli/cli.go |
Added CLI commands for creating ERC20 tokens from bank coins and sending them. |
x/evm/deps.go |
Updated AccountKeeper interface to include SetModuleAccount and GetModuleAccount methods. |
x/evm/evmmodule/genesis.go |
Modified InitGenesis function to use GetModuleAccount . |
x/evm/keeper/erc20_test.go |
Added tests for sending FunTokens from bank coins to ERC20 contracts. |
x/evm/keeper/msg_server.go |
Modified CreateFunToken function and added SendFunTokenToEvm function. |
x/evm/msg.go |
Adjusted validation logic and signer handling for new message types. |
x/evm/keeper/erc20.go |
Refactored LoadERC20BigInt function to include commit control. |
x/evm/evmtest/eth_test.go , x/evm/evmtest/smart_contract_test.go |
Renamed structs and functions for better clarity. Added tests for ERC20 helper functions. |
New changeset: x/evm/precompile/funtoken_test.go |
Removed CreateFunTokenForBankCoin , refactored function calls, and adjusted ERC20 minting test cases. |
sequenceDiagram
participant User
participant CLI
participant TxHandler
participant EVMModule
participant EventManager
User ->> CLI: issue CmdCreateFunTokenFromBankCoin
CLI ->> TxHandler: Broadcast MsgCreateFunToken
TxHandler ->> EVMModule: Process MsgCreateFunToken
EVMModule ->> EventManager: Emit EventFunTokenFromBankCoin
User ->> CLI: issue SendFunTokenToEvm
CLI ->> TxHandler: Broadcast MsgSendFunTokenToEvm
TxHandler ->> EVMModule: Process MsgSendFunTokenToEvm
EVMModule ->> EventManager: Emit EventSendFunTokenToEvm
In the realm where tokens weave, FunTokens now can achieve, To ERC20 they shall transform, In a dance that becomes the norm. New commands for coins to flow, Watch the CLI magic grow! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 77.66990%
with 23 lines
in your changes missing coverage. Please review.
Project coverage is 65.66%. Comparing base (
a5ff022
) to head (b8e1b59
).
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores