Documentation
¶
Index ¶
- Variables
- func AddressBytesToTONAddress(bytes []byte) (*address.Address, error)
- func AddressBytesToTONAddressWithBurning(bytes []byte) *address.Address
- func NewAddressCodec() ccipocr3.ChainSpecificAddressCodec
- func NewCommitPluginCodecV1() cciptypes.CommitPluginCodec
- func NewExecutePluginCodecV1(extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.ExecutePluginCodec
- func NewExtraDataDecoder() ccipocr3.SourceChainExtraDataCodec
- func NewMessageHasherV1(lg logger.Logger, extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.MessageHasher
- type RawAddr
- type TokenDataEncoder
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidWorkchain = errors.New("workchain value outside valid int8 range [-128, 127]")
var LeafDomainSeparator [32]byte
0x0000000000000000000000000000000000000000000000000000000000000000
Functions ¶
func AddressBytesToTONAddress ¶
This method is not part of the interface as it's TON specific AddressBytesToAddress converts a byte slice representing a TON address into its ton address representation, only supporting standard TON addresses.
func AddressBytesToTONAddressWithBurning ¶
AddressBytesToTONAddressWithBurning converts a byte slice representing a TON address into an *address.Address. This codec only supports standard TON addresses (MsgAddr std); variable-length (VarAddress) and external addresses are not supported.
It first attempts to parse the bytes as raw format: 4 byte workchain (int32) + 32 byte data. If that fails, it attempts user-friendly format (36 bytes): 1 byte flags + 1 byte workchain + 32 bytes data + 2 bytes CRC16. If parsing fails (invalid format, length, or CRC16), returns the zero address to indicate funds should be burned. This is only used in the hot path in plugin (executecodec.go and msghasher.go) where we want to avoid errors and just burn funds if the address is invalid.
Format disambiguation: the two 36-byte formats are safely distinguished because valid user-friendly flag bytes (0x11, 0x51, 0x91, 0xD1) always produce an out-of-range int32 when interpreted as the high byte of a big-endian workchain, causing raw-format parsing to fail workchain validation. Only then is the input re-tried as a user-friendly address with CRC16 verification.
func NewAddressCodec ¶
func NewAddressCodec() ccipocr3.ChainSpecificAddressCodec
func NewCommitPluginCodecV1 ¶
func NewCommitPluginCodecV1() cciptypes.CommitPluginCodec
func NewExecutePluginCodecV1 ¶
func NewExecutePluginCodecV1(extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.ExecutePluginCodec
func NewExtraDataDecoder ¶
func NewExtraDataDecoder() ccipocr3.SourceChainExtraDataCodec
NewExtraDataDecoder creates a new ExtraDataDecoder
func NewMessageHasherV1 ¶
func NewMessageHasherV1(lg logger.Logger, extraDataCodec ccipocr3.ExtraDataCodecBundle) ccipocr3.MessageHasher
Types ¶
type RawAddr ¶
type RawAddr [tvm.AddressLength]byte
RawAddr is a fixed-size byte array representing a TON standard address
type TokenDataEncoder ¶
type TokenDataEncoder struct{}
func NewTokenDataEncoder ¶
func NewTokenDataEncoder() TokenDataEncoder