NibiruChain / nibiru

Nibiru Chain: The breakthrough smart contract platform ushering in the next era of money. Nibiru powers an ecosystem of dApps including perps, RWAs, and more.
https://nibiru.fi
Apache License 2.0
178 stars 208 forks source link

spike(evm): Explore problems arising from ERC1155 fungible tokens with FunToken.ID() #1933

Open Unique-Divine opened 2 weeks ago

Unique-Divine commented 2 weeks ago
package evm

import (
    "github.com/cometbft/cometbft/crypto/tmhash"
)

// FIXME: Explore problems arrising from ERC1155 creating multiple fungible
// tokens that are valid ERC20s with the same address.
func (fun FunToken) ID() []byte {
    return tmhash.Sum([]byte(fun.Erc20Addr + "|" + fun.BankDenom))
}