Documentation
¶
Index ¶
- Constants
- Variables
- func LoadOnchainStatesui(env cldf.Environment) (map[uint64]CCIPChainState, error)
- func StoreMCMSInAddressBook(ab *cldf.AddressBookMap, chainSelector uint64, ...) error
- func StrTo32(s string) ([]byte, error)
- func StrToBytes(s string) ([]byte, error)
- type CCIPChainState
- func (s CCIPChainState) EffectiveCCIPPackageID() string
- func (s CCIPChainState) EffectiveOffRampPackageID() string
- func (s CCIPChainState) EffectiveOnRampPackageID() string
- func (s CCIPChainState) GenerateView(e *cldf.Environment, selector uint64, chainName string) (SuiChainView, error)
- func (s CCIPChainState) HasMCMSInstance(instance MCMSInstance) bool
- func (s CCIPChainState) MCMSState(isFastCurse bool) MCMSStateFields
- func (s CCIPChainState) MCMSStateByInstance(instance MCMSInstance) MCMSStateFields
- type CCIPPoolState
- type MCMSInstance
- type MCMSStateFields
- type ManagedTokenFaucetState
- type ManagedTokenState
- type SuiChainView
- type TokenPoolType
Constants ¶
const MCMSFastCurseLabel = "fastcurse"
MCMSLabel is the address book label applied to the fastcurse MCMS instance.
Variables ¶
var ( // CCIP SuiCCIPType deployment.ContractType = "SuiCCIP" SuiLatestCCIPPackageIDType deployment.ContractType = "SuiLatestCCIPPackageID" SuiCCIPObjectRefType deployment.ContractType = "SuiCCIPObjectRef" SuiCCIPOwnerCapObjectIDType deployment.ContractType = "SuiCCIPOwnerCapObjectID" SuiCurserCapObjectIDType deployment.ContractType = "SuiCurserCapObjectID" SuiCCIPUpgradeCapObjectIDType deployment.ContractType = "SuiCCIPUpgradeCapObjectID" SuiFeeQuoterCapType deployment.ContractType = "SuiCCIPFeeQuoterCap" SuiOnRampType deployment.ContractType = "SuiOnRamp" SuiLatestOnRampPackageIDType deployment.ContractType = "SuiLatestOnRampPackageID" SuiOnRampStateObjectIDType deployment.ContractType = "SuiOnRampStateObjectID" SuiOnRampOwnerCapObjectIDType deployment.ContractType = "SuiOnRampOwnerCapObjectID" SuiOnRampUpgradeCapObjectIDType deployment.ContractType = "SuiOnRampUpgradeCapObjectID" SuiOffRampType deployment.ContractType = "SuiOffRamp" SuiLatestOffRampPackageIDType deployment.ContractType = "SuiLatestOffRampPackageID" SuiOffRampOwnerCapObjectIDType deployment.ContractType = "SuiOffRampOwnerCapObjectID" SuiOffRampUpgradeCapObjectIDType deployment.ContractType = "SuiOffRampUpgradeCapObjectID" SuiOffRampStateObjectIDType deployment.ContractType = "SuiOffRampStateObjectID" SuiLockReleaseTPType deployment.ContractType = "SuiLockReleaseToken" SuiLockReleaseTPStateType deployment.ContractType = "SuiLockReleaseTokenState" // CCIP Router SuiCCIPRouterType deployment.ContractType = "SuiRouter" SuiCCIPRouterStateObjectType deployment.ContractType = "SuiRouterStateObjectID" SuiCCIPRouterOwnerCapObjectIDType deployment.ContractType = "SuiCCIPRouterOwnerCapObjectID" SuiRouterUpgradeCapObjectIDType deployment.ContractType = "SuiRouterUpgradeCapObjectID" // MCMS Related SuiMCMSType deployment.ContractType = "SuiManyChainMultisig" SuiMcmsPackageIDType deployment.ContractType = "SuiManyChainMultisigPackageID" SuiMcmsObjectIDType deployment.ContractType = "SuiManyChainMultisigObjectID" SuiMcmsRegistryObjectIDType deployment.ContractType = "SuiManyChainMultisigRegistryObjectID" SuiMcmsAccountStateObjectIDType deployment.ContractType = "SuiManyChainMultisigAccountStateObjectID" SuiMcmsAccountOwnerCapObjectIDType deployment.ContractType = "SuiManyChainMultisigAccountOwnerCapObjectID" SuiMcmsTimelockObjectIDType deployment.ContractType = "SuiManyChainMultisigTimelockObjectID" SuiMcmsDeployerObjectIDType deployment.ContractType = "SuiManyChainMultisigDeployerObjectID" // MCMS User Related SuiMcmsUserPackageIDType deployment.ContractType = "SuiMcmsUserPackageID" SuiMcmsUserDataObjectIDType deployment.ContractType = "SuiMcmsUserDataObjectID" SuiMcmsUserOwnerCapObjectIDType deployment.ContractType = "SuiMcmsUserOwnerCapObjectID" // Link related SuiLinkTokenObjectMetadataID deployment.ContractType = "SuiLinkTokenObjectMetadataID" SuiLinkTokenTreasuryCapID deployment.ContractType = "SuiLinkTokenTreasuryCapID" SuiLinkTokenUpgradeCapID deployment.ContractType = "SuiLinkTokenUpgradeCapID" SuiLinkTokenType deployment.ContractType = "SuiLinkToken" // Managed Token related // the coins under management SuiManagedTokenType deployment.ContractType = "SuiManagedToken" SuiManagedTokenCoinMetadataIDType deployment.ContractType = "SuiManagedTokenCoinMetadataID" SuiManagedTokenTreasuryCapIDType deployment.ContractType = "SuiManagedTokenTreasuryCapID" SuiManagedTokenUpgradeCapIDType deployment.ContractType = "SuiManagedTokenUpgradeCapID" // the managed token wrapper package for the tokens SuiManagedTokenPackageIDType deployment.ContractType = "SuiManagedTokenPackageID" SuiManagedTokenOwnerCapObjectID deployment.ContractType = "SuiManagedTokenOwnerCapObjectID" SuiManagedTokenStateObjectID deployment.ContractType = "SuiManagedTokenStateObjectID" SuiManagedTokenMinterCapID deployment.ContractType = "SuiManagedTokenMinterCapID" SuiManagedTokenPublisherObjectId deployment.ContractType = "SuiManagedTokenPublisherObjectId" // Managed token faucet package SuiManagedTokenFaucetPackageIDType deployment.ContractType = "SuiManagedTokenFaucetPackageID" SuiManagedTokenFaucetStateObjectIDType deployment.ContractType = "SuiManagedTokenFaucetStateObjectID" SuiManagedTokenFaucetUpgradeCapObjectIDType deployment.ContractType = "SuiManagedTokenFaucetUpgradeCapObjectID" // BnM Token Pool related SuiBnMTokenPoolType deployment.ContractType = "SuiBnMTokenPool" SuiBnMTokenPoolStateType deployment.ContractType = "SuiBnMTokenPoolState" SuiBnMTokenPoolOwnerIDType deployment.ContractType = "SuiBnMTokenPoolOwnerID" // LnR Token Pool related SuiLnRTokenPoolType deployment.ContractType = "SuiLnRTokenPool" SuiLnRTokenPoolStateType deployment.ContractType = "SuiLnRTokenPoolState" SuiLnRTokenPoolOwnerIDType deployment.ContractType = "SuiLnRTokenPoolOwnerID" SuiLnRTokenPoolRebalancerCapIDType deployment.ContractType = "SuiLnRTokenPoolRebalancerCapID" // Managed Token Pool related SuiManagedTokenPoolType deployment.ContractType = "SuiManagedTokenPool" SuiManagedTokenPoolStateType deployment.ContractType = "SuiManagedTokenPoolState" SuiManagedTokenPoolOwnerIDType deployment.ContractType = "SuiManagedTokenPoolOwnerID" // Upgrade Related SuiCCIPMockV2 deployment.ContractType = "SuiCCIPMockV2PackageID" SuiOnRampMockV2 deployment.ContractType = "SuiOnRampMockV2PackageID" SuiOffRampMockV2 deployment.ContractType = "SuiOffRampMockV2PackageID" SuiUpgradeRegistryObjectId deployment.ContractType = "SuiUpgradeRegistryObjectId" )
var DefaultCCIPSeqConfig = ccipops.DeployAndInitCCIPSeqInput{ MaxFeeJuelsPerMsg: "200000000000000000000", TokenPriceStalenessThreshold: 1000000, AddMinFeeUsdCents: []uint32{3000}, AddMaxFeeUsdCents: []uint32{30000}, AddDeciBps: []uint16{1000}, AddDestGasOverhead: []uint32{1000000}, AddDestBytesOverhead: []uint32{1000}, AddIsEnabled: []bool{true}, RemoveTokens: []string{}, IsEnabled: true, MaxNumberOfTokensPerMsg: 1, MaxDataBytes: 16_000, MaxPerMsgGasLimit: 3_000_000, DestGasOverhead: 1_000_000, DestGasPerPayloadByteBase: byte(16), DestGasPerPayloadByteHigh: byte(40), DestGasPerPayloadByteThreshold: uint16(3000), DestDataAvailabilityOverheadGas: 100, DestGasPerDataAvailabilityByte: 16, DestDataAvailabilityMultiplierBps: 1, ChainFamilySelector: []byte{40, 18, 213, 44}, EnforceOutOfOrder: false, DefaultTokenFeeUsdCents: 25, DefaultTokenDestGasOverhead: 90_000, DefaultTxGasLimit: 200_000, GasMultiplierWeiPerEth: 1_000_000_000_000_000_000, GasPriceStalenessThreshold: 1_000_000, NetworkFeeUsdCents: 10, PremiumMultiplierWeiPerEth: []uint64{900_000_000_000_000_000}, }
These are the static/default FeeQuoter + chain params
var DefaultOffRampSeqConfig = offrampops.DeployAndInitCCIPOffRampSeqInput{ InitializeOffRampInput: offrampops.InitializeOffRampInput{ PremissionExecThresholdSeconds: uint32(60 * 60 * 8), SourceChainsIsEnabled: []bool{true}, SourceChainsIsRMNVerificationDisabled: []bool{true}, }, }
var DefaultOnRampSeqConfig = onrampops.DeployAndInitCCIPOnRampSeqInput{ OnRampInitializeInput: onrampops.OnRampInitializeInput{ DestChainAllowListEnabled: []bool{true}, }, ApplyDestChainConfigureOnRampInput: onrampops.ApplyDestChainConfigureOnRampInput{ DestChainAllowListEnabled: []bool{false}, }, ApplyAllowListUpdatesInput: onrampops.ApplyAllowListUpdatesInput{ DestChainAllowListEnabled: []bool{false}, DestChainAddAllowedSenders: [][]string{{}}, DestChainRemoveAllowedSenders: [][]string{{}}, }, }
var (
Version1_0_0 = *semver.MustParse("1.0.0")
)
Functions ¶
func LoadOnchainStatesui ¶
func LoadOnchainStatesui(env cldf.Environment) (map[uint64]CCIPChainState, error)
LoadOnchainStatesui loads chain state for sui chains from env
func StoreMCMSInAddressBook ¶
func StoreMCMSInAddressBook(ab *cldf.AddressBookMap, chainSelector uint64, mcmsReport mcmsops.DeployMCMSSeqOutput, instance MCMSInstance) error
StoreMCMSInAddressBook saves one MCMS deployment into the address book under the correct instance label so slow and fastcurse entries can coexist on one chain.
func StrToBytes ¶
Types ¶
type CCIPChainState ¶
type CCIPChainState struct {
// MCMS related (normal governance instance)
MCMSPackageID string
MCMSStateObjectID string
MCMSRegistryObjectID string
MCMSDeployerStateObjectID string
MCMSAccountStateObjectID string
MCMSAccountOwnerCapObjectID string
MCMSTimelockObjectID string
// FastCurse MCMS related (fastcurse governance instance, stored with label "fastcurse")
FastCurseMCMSPackageID string
FastCurseMCMSStateObjectID string
FastCurseMCMSRegistryObjectID string
FastCurseMCMSDeployerStateObjectID string
FastCurseMCMSAccountStateObjectID string
FastCurseMCMSAccountOwnerCapObjectID string
FastCurseMCMSTimelockObjectID string
// CCIP related
CCIPAddress string
LatestCCIPPackageID string
CCIPObjectRef string
CCIPOwnerCapObjectId string
CurserCapObjectId string
CCIPUpgradeCapObjectId string
FeeQuoterCapId string
// CCIP Router related
CCIPRouterAddress string
CCIPRouterStateObjectID string
CCIPRouterOwnerCapObjectId string
CCIPRouterUpgradeCapId string
// OnRamp related
OnRampAddress string
LatestOnRampPackageID string
OnRampStateObjectId string
OnRampOwnerCapObjectId string
OnRampUpgradeCapId string
// OffRamp related
OffRampAddress string
LatestOffRampPackageID string
OffRampStateObjectId string
OffRampOwnerCapId string
OffRampUpgradeCapId string
// LINK token related
LinkTokenAddress string
LinkTokenCoinMetadataId string
LinkTokenTreasuryCapId string
LinkTokenUpgradeCapId string
// Managed Token related
ManagedTokens map[string]ManagedTokenState
ManagedTokenFaucets map[string]ManagedTokenFaucetState
// Token pools related
LnRTokenPools map[string]CCIPPoolState
BnMTokenPools map[string]CCIPPoolState
ManagedTokenPools map[string]CCIPPoolState
// mock upgrade related
OnRampMockV2PackageId string
OffRampMockV2PackageId string
CCIPMockV2PackageId string
}
func (CCIPChainState) EffectiveCCIPPackageID ¶
func (s CCIPChainState) EffectiveCCIPPackageID() string
EffectiveCCIPPackageID returns the latest upgraded CCIP package head when recorded, otherwise the genesis package ID from initial deploy.
func (CCIPChainState) EffectiveOffRampPackageID ¶
func (s CCIPChainState) EffectiveOffRampPackageID() string
EffectiveOffRampPackageID returns the latest upgraded OffRamp package head when recorded, otherwise the genesis package ID from initial deploy.
func (CCIPChainState) EffectiveOnRampPackageID ¶
func (s CCIPChainState) EffectiveOnRampPackageID() string
EffectiveOnRampPackageID returns the latest upgraded OnRamp package head when recorded, otherwise the genesis package ID from initial deploy.
func (CCIPChainState) GenerateView ¶
func (s CCIPChainState) GenerateView(e *cldf.Environment, selector uint64, chainName string) (SuiChainView, error)
func (CCIPChainState) HasMCMSInstance ¶
func (s CCIPChainState) HasMCMSInstance(instance MCMSInstance) bool
HasMCMSInstance reports whether the chain state has a deployed MCMS for the instance.
func (CCIPChainState) MCMSState ¶
func (s CCIPChainState) MCMSState(isFastCurse bool) MCMSStateFields
MCMSState returns the MCMS object IDs for the requested instance. When isFastCurse is true the fastcurse instance fields are returned; otherwise the normal governance instance fields are returned.
func (CCIPChainState) MCMSStateByInstance ¶
func (s CCIPChainState) MCMSStateByInstance(instance MCMSInstance) MCMSStateFields
MCMSStateByInstance returns the MCMS object IDs for the requested instance.
type CCIPPoolState ¶
type MCMSInstance ¶
type MCMSInstance string
MCMSInstance identifies which MCMS deployment on a chain an operation targets. Slow and fastcurse instances share the same address-book type constants and are distinguished by the fastcurse label on address-book entries.
const ( MCMSInstanceSlow MCMSInstance = "slow" MCMSInstanceFastCurse MCMSInstance = MCMSFastCurseLabel )
func MCMSInstanceFromFastCurseFlag ¶
func MCMSInstanceFromFastCurseFlag(isFastCurse bool) MCMSInstance
MCMSInstanceFromFastCurseFlag maps the legacy isFastCurse config flag to an instance.
func (MCMSInstance) AddressBookLabel ¶
func (i MCMSInstance) AddressBookLabel() string
AddressBookLabel returns the address-book label for this instance. The slow instance uses no label.
func (MCMSInstance) IsFastCurse ¶
func (i MCMSInstance) IsFastCurse() bool
IsFastCurse reports whether this instance is the fastcurse MCMS.
func (MCMSInstance) String ¶
func (i MCMSInstance) String() string
type MCMSStateFields ¶
type MCMSStateFields struct {
PackageID string
StateObjectID string
RegistryObjectID string
DeployerStateObjectID string
AccountStateObjectID string
AccountOwnerCapObjectID string
TimelockObjectID string
}
MCMSStateFields holds the seven object IDs that describe one MCMS deployment.
type ManagedTokenFaucetState ¶
type ManagedTokenState ¶
type SuiChainView ¶
type SuiChainView struct {
ChainSelector uint64 `json:"chainSelector,omitempty"`
ChainID string `json:"chainID,omitempty"`
MCMSWithTimelock view.MCMSWithTimelockView `json:"mcmsWithTimelock"`
FastCurseMCMSWithTimelock view.MCMSWithTimelockView `json:"fastcurseMcmsWithTimelock,omitempty"`
CCIP view.CCIPView `json:"ccip,omitempty"`
OnRamp map[string]view.OnRampView `json:"onRamp,omitempty"`
OffRamp map[string]view.OffRampView `json:"offRamp,omitempty"`
Router view.RouterView `json:"router,omitempty"`
TokenPools map[string]map[string]view.TokenPoolView `json:"tokenPools,omitempty"` // TokenSymbol => TokenPool Address => PoolView
}
type TokenPoolType ¶
type TokenPoolType string
const ( TokenPoolTypeBurnMint TokenPoolType = "bnm" TokenPoolTypeLockRelease TokenPoolType = "lnr" TokenPoolTypeManaged TokenPoolType = "managed" )
Directories
¶
| Path | Synopsis |
|---|---|
|
ccip_router
Package routerops provides operations for deploying and managing CCIP Router contracts.
|
Package routerops provides operations for deploying and managing CCIP Router contracts. |