Skip to content

Commit 49bdefe

Browse files
authored
feat(funtoken): accept either a Nibiru address or EVM address in sendToBank (#2239)
* feat(funtoken): accept either a Nibiru address or EVM address in sendToBank * Update CHANGELOG.md
1 parent 1f230d0 commit 49bdefe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343
- [#2222](https://github.com/NibiruChain/nibiru/pull/2222) - fix(evm): evm indexer proper stopping of the indexer service
4444
- [#2224](https://github.com/NibiruChain/nibiru/pull/2224) - fix(evm): suppressing error on missing block bloom event
4545
- [#2238](https://github.com/NibiruChain/nibiru/pull/2238) - feat(evm-embeds): Add WNIBI.sol implementatino to contracts and related TypeScript and Solidity package updates for npm.
46+
- [#2239](https://github.com/NibiruChain/nibiru/pull/2239) - feat(funtoken): update `FunToken.sendToBank` to accept EVM and nibi addresses.
4647

4748
### Dependencies
49+
4850
- Bump `axios` from 1.7.4 to 1.8.2 ([#2230](https://github.com/NibiruChain/nibiru/pull/2230))
4951

5052
## [v2.1.0](https://github.com/NibiruChain/nibiru/releases/tag/v2.1.0) - 2025-02-25

x/evm/precompile/funtoken.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ func (p precompileFunToken) sendToBank(
161161
return nil, fmt.Errorf("transfer amount must be positive")
162162
}
163163

164-
// The "to" argument must be a valid Nibiru address
165-
toAddr, err := sdk.AccAddressFromBech32(to)
164+
// The "to" argument must be a valid nibi or EVM address
165+
toAddr, err := parseToAddr(to)
166166
if err != nil {
167-
return nil, fmt.Errorf("\"to\" is not a valid address (%s): %w", to, err)
167+
return nil, fmt.Errorf("recipient address invalid (%s): %w", to, err)
168168
}
169169

170170
// Caller transfers ERC20 to the EVM module account
@@ -213,7 +213,7 @@ func (p precompileFunToken) sendToBank(
213213
err = p.evmKeeper.Bank.SendCoinsFromModuleToAccount(
214214
ctx,
215215
evm.ModuleName,
216-
toAddr,
216+
eth.EthAddrToNibiruAddr(toAddr),
217217
sdk.NewCoins(coinToSend),
218218
)
219219
if err != nil {

0 commit comments

Comments
 (0)