Documentation
¶
Index ¶
- Variables
- type Any2TVMMessage
- type CCIPReceive
- type Commit
- type CommitReportAccepted
- type Config
- type ConfigInfo
- type DeployableInitializeBounced
- type Deployables
- type DynamicConfigSet
- type Execute
- type ExecutionStateChanged
- type ExitCode
- type OCR3Base
- type OCR3Config
- type ReceiveExecutorInitExecuteBounced
- type RouteMessageBounced
- type SetDynamicConfig
- type SetOCR3Config
- type Signer
- type SourceChainConfig
- type SourceChainConfigUpdated
- type SourceChainSelectorAdded
- type Storage
- type UpdateDeployables
- type UpdateSourceChainConfig
- type UpdateSourceChainConfigs
Constants ¶
This section is empty.
Variables ¶
var ExitCodeCodec tvm.ExitCodeCodecInt[ExitCode] = ExitCode(tvm.ExitCode(-1))
var GetConfig = tvm.NewNoArgsGetter(tvm.NoArgsOpts[Config]{ Name: configGetter, Decoder: tvm.NewResultDecoder(func(r *ton.ExecutionResult) (Config, error) { var c Config cs, err := r.Int(0) if err != nil { return c, fmt.Errorf("failed to get ChainSelector: %w", err) } chainSelector := cs.Uint64() feeQuoterAddressSlice, err := r.Slice(1) if err != nil { return c, fmt.Errorf("failed to get feeQuoter address slice: %w", err) } feeQuoterAddress, err := feeQuoterAddressSlice.LoadAddr() if err != nil { return c, fmt.Errorf("failed to load feeQuoter address: %w", err) } thresholdInt, err := r.Int(2) if err != nil { return c, fmt.Errorf("failed to get permissionlessExecutionThresholdSeconds: %w", err) } return Config{ ChainSelector: chainSelector, FeeQuoterAddress: feeQuoterAddress, PermissionlessExecutionThresholdSeconds: uint32(thresholdInt.Uint64()), }, nil }), })
GetConfig gets the configuration of the OffRamp contract
var GetCursedSubjects = tvm.NewNoArgsGetter(tvm.NoArgsOpts[[]*big.Int]{ Name: cursedSubjectsGetter, Decoder: tvm.NewResultDecoder(func(r *ton.ExecutionResult) ([]*big.Int, error) { return parser.ParseLispTuple[*big.Int](r.AsTuple()) }), })
GetCursedSubjects gets all cursed subjects from the OffRamp contract
var GetOCR3Config = tvm.NewNoArgsGetter(tvm.NoArgsOpts[OCR3Base]{ Name: ocr3BaseGetter, Decoder: tvm.NewResultDecoder(func(r *ton.ExecutionResult) (OCR3Base, error) { var c OCR3Base chainIDInt, err := r.Int(0) if err != nil { return c, fmt.Errorf("failed to get ChainID: %w", err) } c.ChainID = uint8(chainIDInt.Uint64()) isNil, err := r.IsNil(1) if err != nil { return c, err } if !isNil { configCell, err1 := r.Cell(1) if err1 != nil { return c, err1 } var config OCR3Config if err = tlb.LoadFromCell(&config, configCell.BeginParse()); err != nil { return c, fmt.Errorf("load OCR3Config from cell: %w", err) } c.Commit = &config } isNil, err = r.IsNil(2) if err != nil { return c, err } if !isNil { configCell, err2 := r.Cell(2) if err2 != nil { return c, err2 } var config OCR3Config if err = tlb.LoadFromCell(&config, configCell.BeginParse()); err != nil { return c, fmt.Errorf("load OCR3Config from cell: %w", err) } c.Execute = &config } return c, nil }), })
GetOCR3Config gets the OCR3 configuration of the OffRamp contract
var GetOwner = ownable2step.GetOwner
GetOwner gets the owner of the OffRamp contract
var GetPendingOwner = ownable2step.GetPendingOwner
GetPendingOwner gets the pending owner of the OffRamp contract
var GetSourceChainConfig = tvm.Getter[uint64, SourceChainConfig]{ Name: srcChainConfigGetter, Decoder: tvm.NewResultDecoder(func(r *ton.ExecutionResult) (SourceChainConfig, error) { var c SourceChainConfig routerAddressSlice, err := r.Slice(0) if err != nil { return c, fmt.Errorf("failed to get router address slice: %w", err) } routerAddress, err := routerAddressSlice.LoadAddr() if err != nil { return c, fmt.Errorf("failed to load router address: %w", err) } isEnabledInt, err := r.Int(1) if err != nil { return c, fmt.Errorf("failed to get isEnabled: %w", err) } isEnabled := isEnabledInt.Cmp(big.NewInt(0)) != 0 minSeqNrInt, err := r.Int(2) if err != nil { return c, fmt.Errorf("failed to get minSeqNr: %w", err) } minSeqNr := minSeqNrInt.Uint64() isRMNDisabledInt, err := r.Int(3) if err != nil { return c, fmt.Errorf("failed to get isRMNVerificationDisabled: %w", err) } isRMNVerificationDisabled := isRMNDisabledInt.Cmp(big.NewInt(0)) != 0 onRampSlice, err := r.Slice(4) if err != nil { return c, fmt.Errorf("failed to get onRamp slice: %w", err) } onRamp, err := ccipcommon.LoadCrossChainAddressWithoutPrefix(onRampSlice) if err != nil { return c, fmt.Errorf("failed to parse onRamp: %w", err) } return SourceChainConfig{ Router: routerAddress, IsEnabled: isEnabled, MinSeqNr: minSeqNr, IsRMNVerificationDisabled: isRMNVerificationDisabled, OnRamp: onRamp, }, nil }), }
GetSourceChainConfig gets the source chain configuration for a given chain selector
var GetSourceChainSelectors = tvm.NewNoArgsGetter(tvm.NoArgsOpts[[]uint64]{ Name: sourceChainSelectorsGetter, Decoder: tvm.NewResultDecoder(func(r *ton.ExecutionResult) ([]uint64, error) { selectors, err := parser.ParseLispTuple[*big.Int](r.AsTuple()) if err != nil { return nil, err } return lo.Map(selectors, func(x *big.Int, _ int) uint64 { return x.Uint64() }), nil }), })
GetSourceChainSelectors gets all source chain selectors
var (
OpcodeCCIPReceive = tvm.MustExtractMagic(reflect.TypeOf(CCIPReceive{}))
)
var TLBs = tvm.MustNewTLBMap([]any{ CCIPReceive{}, SetOCR3Config{}, UpdateSourceChainConfigs{}, Commit{}, Execute{}, SetDynamicConfig{}, UpdateDeployables{}, }).MustWithStorageType(Storage{})
Functions ¶
This section is empty.
Types ¶
type Any2TVMMessage ¶
type Any2TVMMessage struct {
MessageID []byte `tlb:"bits 256"`
SourceChainSelector uint64 `tlb:"## 64"`
Sender ccipcommon.CrossChainAddress `tlb:"."` // CrossChainAddress (inline: length prefix + bytes)
Data *cell.Cell `tlb:"^"`
TokenAmounts *cell.Cell `tlb:"maybe ^"`
}
Any2TVMMessage represents a cross-chain message to TON
type CCIPReceive ¶
type CCIPReceive struct {
RootID []byte `tlb:"bits 192"`
Message Any2TVMMessage `tlb:"."`
// contains filtered or unexported fields
}
CCIPReceive represents the CCIP message received on TON
type Commit ¶
type Commit struct {
QueryID uint64 `tlb:"## 64"`
ConfigDigest []byte `tlb:"bits 512"`
CommitReport ocr.CommitReport `tlb:"."`
SignatureEd25519 ccipcommon.SnakedCell[ocr.SignatureEd25519] `tlb:"^"`
// contains filtered or unexported fields
}
Commit represents the commit method call on the offRamp contract
type CommitReportAccepted ¶
type CommitReportAccepted struct {
MerkleRoot *ocr.MerkleRoot `tlb:"maybe ."`
PriceUpdates *ocr.PriceUpdates `tlb:"maybe ^"`
}
CommitReportAccepted represents the CommitReportAccepted event data
type Config ¶
type Config struct {
ChainSelector uint64 `tlb:"## 64"`
FeeQuoterAddress *address.Address `tlb:"addr"`
PermissionlessExecutionThresholdSeconds uint32 `tlb:"## 32"`
}
Config represents the offRamp contract configuration
func (*Config) GetterMethodName
deprecated
func (*Config) UnmarshalResult
deprecated
func (c *Config) UnmarshalResult(result *ton.ExecutionResult) error
Deprecated: Use GetConfig getter instead.
type ConfigInfo ¶
type ConfigInfo struct {
ConfigDigest []byte `tlb:"bits 256"`
F uint8 `tlb:"## 8"`
N uint8 `tlb:"## 8"`
IsSignatureVerificationEnabled bool `tlb:"bool"`
}
ConfigInfo represents the configuration information for OCR3
type DeployableInitializeBounced ¶
DeployableInitializeBounced represents the DeployableInitializeBounced event data
type Deployables ¶
type Deployables struct {
RMNRouter *address.Address `tlb:"addr"`
Deployer *cell.Cell `tlb:"^"`
MerkleRootCode *cell.Cell `tlb:"^"`
ReceiveExecutorCode *cell.Cell `tlb:"^"`
}
Deployables holds the deployable code cells for the offRamp contract
type DynamicConfigSet ¶
type DynamicConfigSet struct {
FeeQuoter *address.Address `tlb:"addr"`
PermissionlessExecutionThresholdSeconds uint32 `tlb:"## 32"`
}
DynamicConfigSet represents the DynamicConfigSet event data
type Execute ¶
type Execute struct {
QueryID uint64 `tlb:"## 64"`
ConfigDigest []byte `tlb:"bits 512"`
ExecuteReport ocr.ExecuteReport `tlb:"."`
// contains filtered or unexported fields
}
Execute represents the execute method call on the offRamp contract
type ExecutionStateChanged ¶
type ExecutionStateChanged struct {
SourceChainSelector uint64 `tlb:"## 64"`
SequenceNumber uint64 `tlb:"## 64"`
MessageID []byte `tlb:"bits 256"`
State uint8 `tlb:"## 8"`
}
ExecutionStateChanged represents the ExecutionStateChanged event data
type ExitCode ¶
const ( ErrorMessageNotFromOwnedContract ExitCode = iota + 22100 // Facility ID * 100 ErrorSourceChainNotEnabled ErrorEmptyExecutionReport ErrorInvalidMessageDestChainSelector ErrorSourceChainSelectorMismatch ErrorInvalidOnRampUpdate ErrorInsufficientFee ErrorSubjectCursed ErrorZeroAddressNotAllowed ErrorTooManyMessagesInReport ErrorSignatureVerificationRequiredInCommitPlugin ErrorSignatureVerificationNotAllowedInExecutionPlugin ErrorInvalidInterval ErrorBatchingNotSupported ErrorOnRampAddressMismatch ErrorEmptyCommitReport ErrorMerkleRootCannotBeZero )
type OCR3Base ¶
type OCR3Base struct {
ChainID uint8 `tlb:"## 8"`
Commit *OCR3Config `tlb:"maybe ^"`
Execute *OCR3Config `tlb:"maybe ^"`
}
OCR3Base represents the OCR3 base configuration stored on-chain
func (*OCR3Base) GetterMethodName
deprecated
func (*OCR3Base) UnmarshalResult
deprecated
func (c *OCR3Base) UnmarshalResult(result *ton.ExecutionResult) error
Deprecated: Use GetOCR3Config getter instead.
type OCR3Config ¶
type OCR3Config struct {
ConfigInfo ConfigInfo `tlb:"."`
Signers *cell.Dictionary `tlb:"dict 256"`
Transmitters *cell.Dictionary `tlb:"dict 267"`
}
OCR3Config represents the OCR3 configuration stored on-chain
type ReceiveExecutorInitExecuteBounced ¶
type ReceiveExecutorInitExecuteBounced struct {
ReceiveExecutor *address.Address `tlb:"addr"`
Root *address.Address `tlb:"addr"`
SequenceNumber uint64 `tlb:"## 64"`
}
ReceiveExecutorInitExecuteBounced represents the ReceiveExecutorInitExecuteBounced event data
type RouteMessageBounced ¶
type RouteMessageBounced struct {
Router *address.Address `tlb:"addr"`
ExecID []byte `tlb:"bits 192"`
}
RouteMessageBounced represents the RouteMessageBounced event data
type SetDynamicConfig ¶
type SetOCR3Config ¶
type SetOCR3Config struct {
QueryID uint64 `tlb:"## 64"`
ConfigDigest []byte `tlb:"bits 256"`
PluginType uint16 `tlb:"## 16"`
F uint8 `tlb:"## 8"`
IsSignatureVerificationEnabled bool `tlb:"bool"`
Signers ccipcommon.SnakedCell[Signer] `tlb:"^"`
Transmitters ccipcommon.SnakedCell[ccipcommon.AddressWrap] `tlb:"^"`
// contains filtered or unexported fields
}
SetOCR3Config represents the setOCR3Config method call on the offRamp contract
type Signer ¶
type Signer struct {
Pubkey []byte `tlb:"bits 256"`
}
Signer represents a signer entry in the OCR3 config
type SourceChainConfig ¶
type SourceChainConfig struct {
Router *address.Address `tlb:"addr"`
IsEnabled bool `tlb:"bool"`
MinSeqNr uint64 `tlb:"## 64"`
IsRMNVerificationDisabled bool `tlb:"bool"`
OnRamp ccipcommon.CrossChainAddress `tlb:"."`
}
SourceChainConfig represents the configuration for a specific source chain
func (*SourceChainConfig) GetterMethodName
deprecated
func (c *SourceChainConfig) GetterMethodName() string
Deprecated: Use GetSourceChainConfig getter instead.
func (*SourceChainConfig) UnmarshalResult
deprecated
func (c *SourceChainConfig) UnmarshalResult(result *ton.ExecutionResult) error
Deprecated: Use GetSourceChainConfig getter instead.
type SourceChainConfigUpdated ¶
type SourceChainConfigUpdated struct {
SourceChainSelector uint64 `tlb:"## 64"`
SourceChainConfig SourceChainConfig `tlb:"."`
}
SourceChainConfigUpdated represents the SourceChainConfigUpdated event data
type SourceChainSelectorAdded ¶
type SourceChainSelectorAdded struct {
SourceChainSelector uint64 `tlb:"## 64"`
}
SourceChainSelectorAdded represents the SourceChainSelectorAdded event data
type Storage ¶
type Storage struct {
ID uint32 `tlb:"## 32"`
Ownable ownable2step.Storage `tlb:"."`
Deployables Deployables `tlb:"^"`
FeeQuoter *address.Address `tlb:"addr"`
OCR3Base OCR3Base `tlb:"^"`
CursedSubjects *cell.Dictionary `tlb:"dict 128"`
ChainSelector uint64 `tlb:"## 64"`
PermissionlessExecutionThresholdSeconds uint32 `tlb:"## 32"`
SourceChainConfigs *cell.Dictionary `tlb:"dict 64"`
LatestPriceSequenceNumber uint64 `tlb:"## 64"`
}
Storage represents the offRamp contract storage state
type UpdateDeployables ¶
type UpdateSourceChainConfig ¶
type UpdateSourceChainConfig struct {
SourceChainSelector uint64 `tlb:"## 64"`
Config SourceChainConfig `tlb:"."`
}
UpdateSourceChainConfig represents the updateSourceChainConfig structure
type UpdateSourceChainConfigs ¶
type UpdateSourceChainConfigs struct {
QueryID uint64 `tlb:"## 64"`
Configs ccipcommon.SnakedCell[UpdateSourceChainConfig] `tlb:"^"`
// contains filtered or unexported fields
}
UpdateSourceChainConfigs represents the updateSourceChainConfigs method call on the offRamp contract