Skip to content
13 changes: 7 additions & 6 deletions bindings/bind/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,14 @@ func ExecutePTB(ctx context.Context, opts *CallOpts, chainClient client.Bindings
ptb.SetSender(models.SuiAddress(signerAddress))
}

if ptb.Data.V1.GasData.Budget == nil {
budget := DefaultGasBudget
if opts.GasBudget != nil {
budget = *opts.GasBudget
}
ptb.SetGasBudget(budget)
budget := DefaultGasBudget
if opts.GasBudget != nil {
budget = *opts.GasBudget
}
if ptb.Data.V1.GasData.Budget != nil && *ptb.Data.V1.GasData.Budget > budget {
budget = *ptb.Data.V1.GasData.Budget
}
ptb.SetGasBudget(budget)

if ptb.Data.V1.GasData.Price == nil {
gasPrice, gasPriceErr := chainClient.GetReferenceGasPrice(ctx)
Expand Down
140 changes: 139 additions & 1 deletion bindings/generated/ccip/ccip/fee_quoter/fee_quoter.go

Large diffs are not rendered by default.

95 changes: 94 additions & 1 deletion bindings/generated/ccip/ccip/rmn_remote/rmn_remote.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions bindings/mcms_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
module_fee_quoter "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/fee_quoter"
module_rmn_remote "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/rmn_remote"
module_state_object "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/state_object"
module_token_admin_registry "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/token_admin_registry"
module_upgrade_registry "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip/upgrade_registry"
module_offramp "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip_offramp/offramp"
module_onramp "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip_onramp/onramp"
module_router "github.com/smartcontractkit/chainlink-sui/bindings/generated/ccip/ccip_router"
Expand Down Expand Up @@ -132,6 +134,31 @@ func (e *CCIPEntrypointArgEncoder) EncodeEntryPointArg(executingCallbackParams *
}

return feeQuoter.Encoder().McmsUpdatePricesWithOwnerCapWithArgs(ccipRef, registryObj, clock, executingCallbackParams)
case "apply_fee_token_updates":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return feeQuoter.Encoder().McmsApplyFeeTokenUpdatesWithArgs(ccipRef, registryObj, executingCallbackParams)
case "apply_dest_chain_config_updates":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return feeQuoter.Encoder().McmsApplyDestChainConfigUpdatesWithArgs(ccipRef, registryObj, executingCallbackParams)
case "apply_token_transfer_fee_config_updates":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return feeQuoter.Encoder().McmsApplyTokenTransferFeeConfigUpdatesWithArgs(ccipRef, registryObj, executingCallbackParams)
case "apply_premium_multiplier_wei_per_eth_updates":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return feeQuoter.Encoder().McmsApplyPremiumMultiplierWeiPerEthUpdatesWithArgs(ccipRef, registryObj, executingCallbackParams)
case "new_fee_quoter_cap_and_transfer":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return feeQuoter.Encoder().McmsNewFeeQuoterCapAndTransferWithArgs(ccipRef, registryObj, executingCallbackParams)
case "destroy_fee_quoter_cap":
deserializer := bcs.NewDeserializer(data)
deserializer.ReadFixedBytes(SuiAddressLength)
deserializer.ReadFixedBytes(SuiAddressLength)
capBytes := deserializer.ReadFixedBytes(SuiAddressLength)
ccipRef := bind.Object{Id: stateObjID}
c := bind.Object{Id: toHexString(capBytes)}
return feeQuoter.Encoder().McmsDestroyFeeQuoterCapWithArgs(ccipRef, registryObj, executingCallbackParams, c)
default:
return nil, fmt.Errorf("unsupported fee_quoter MCMS function: %q", function)
}

// STATE OBJECT
Expand Down Expand Up @@ -363,6 +390,64 @@ func (e *CCIPEntrypointArgEncoder) EncodeEntryPointArg(executingCallbackParams *
return nil, fmt.Errorf("unsupported rmn_remote MCMS function: %q", function)
}

// TOKEN ADMIN REGISTRY
case "token_admin_registry":
tokenAdminRegistry, err := module_token_admin_registry.NewTokenAdminRegistry(target, nil)
if err != nil {
return nil, err
}
switch function {
case "initialize_local_decimals":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return tokenAdminRegistry.Encoder().McmsInitializeLocalDecimalsWithArgs(
ccipRef,
registryObj,
executingCallbackParams,
)
case "backfill_local_decimals":
deserializer := bcs.NewDeserializer(data)
deserializer.ReadFixedBytes(SuiAddressLength)
ccipRef := bind.Object{Id: toHexString(deserializer.ReadFixedBytes(SuiAddressLength))}
return tokenAdminRegistry.Encoder().McmsBackfillLocalDecimalsWithArgs(
ccipRef,
registryObj,
executingCallbackParams,
)
case "unregister_pool":
deserializer := bcs.NewDeserializer(data)
deserializer.ReadFixedBytes(SuiAddressLength)
ccipRef := bind.Object{Id: toHexString(deserializer.ReadFixedBytes(SuiAddressLength))}
return tokenAdminRegistry.Encoder().McmsUnregisterPoolWithArgs(ccipRef, registryObj, executingCallbackParams)
case "transfer_admin_role":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return tokenAdminRegistry.Encoder().McmsTransferAdminRoleWithArgs(ccipRef, registryObj, executingCallbackParams)
case "accept_admin_role":
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
return tokenAdminRegistry.Encoder().McmsAcceptAdminRoleWithArgs(ccipRef, registryObj, executingCallbackParams)
default:
return nil, fmt.Errorf("unsupported token_admin_registry MCMS function: %q", function)
}

// UPGRADE REGISTRY
case "upgrade_registry":
upgradeRegistry, err := module_upgrade_registry.NewUpgradeRegistry(target, nil)
if err != nil {
return nil, err
}
ccipRef := bind.Object{Id: toHexString(deserializeFirst32Bytes(data))}
switch function {
case "block_version":
return upgradeRegistry.Encoder().McmsBlockVersionWithArgs(ccipRef, registryObj, executingCallbackParams)
case "unblock_version":
return upgradeRegistry.Encoder().McmsUnblockVersionWithArgs(ccipRef, registryObj, executingCallbackParams)
case "block_function":
return upgradeRegistry.Encoder().McmsBlockFunctionWithArgs(ccipRef, registryObj, executingCallbackParams)
case "unblock_function":
return upgradeRegistry.Encoder().McmsUnblockFunctionWithArgs(ccipRef, registryObj, executingCallbackParams)
default:
return nil, fmt.Errorf("unsupported upgrade_registry MCMS function: %q", function)
}

// MANAGED TOKEN
case "managed_token":
managedToken, err := module_managed_token.NewManagedToken(target, nil)
Expand Down
Loading
Loading