eth

package
v0.0.0-...-cc24d94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinAddrLen = 20
	MaxAddrLen = 32
)

Variables

This section is empty.

Functions

func BridgeLogToEvent

func BridgeLogToEvent(
	log ethcoretypes.Log,
	denom string,
) bridgetypes.BridgeEvent

BridgeLogToEvent converts an Ethereum log from Bridge contract to a BridgeEvent. Note: The format of a jInX address is [prefix][separator][address][checksum], where `prefix` is `jinx`, `separator` is `1`, `address` is the actual address portion, and `checksum` occupies last 6 characters. An address in Ethereum logs is in hexadecimal format and in Cosmos bech32 format. For example, a 20-byte address in hexadecimal format is 20*8=160 bits, which is 160/5=32 bech32 characters.

func GetBridgeEventAbi

func GetBridgeEventAbi() *ethabi.ABI

GetBridgeEventAbi returns the ABI (application binary interface) for the Bridge contract.

func PadOrTruncateAddress

func PadOrTruncateAddress(address []byte) []byte

PadOrTruncateAddress right-pads an address with zeros if it's shorter than `MinAddrLen` or takes the first `MaxAddrLen` if it's longer than that.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL