Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

2 changes: 2 additions & 0 deletions ccv/chains/evm/deployment/operations_gen_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ contracts:
access: public
- name: getTokenTransferFeeConfig
access: public
- name: getRequiredCCVs
access: public

- contract_name: BurnMintTokenPool
version: "2.0.0"
Expand Down
13 changes: 6 additions & 7 deletions ccv/chains/evm/deployment/v1_7_0/adapters/lanemigrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/ethereum/go-ethereum/accounts/abi/bind"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/gobindings/generated/latest/fee_quoter"
evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
"github.com/smartcontractkit/chainlink-ccip/deployment/deploy"
datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
"github.com/smartcontractkit/chainlink-deployments-framework/chain"
cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
Expand All @@ -21,6 +15,11 @@ import (
offrampops "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/offramp"
onrampops "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/onramp"
fqops "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/fee_quoter"
evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
"github.com/smartcontractkit/chainlink-ccip/deployment/deploy"
datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
)

const (
Expand Down Expand Up @@ -95,7 +94,7 @@ func (r *LaneMigrator) UpdateVersionWithRouter() *cldf_ops.Sequence[deploy.RampU
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("error finding feequoter address ref: %w", err)
}
feeQuoterContract, err := fee_quoter.NewFeeQuoter(feequoterAddr, c.Client)
feeQuoterContract, err := fqops.NewFeeQuoterContract(feequoterAddr, c.Client)
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("error creating fee quoter contract instance: %w", err)
}
Expand Down
36 changes: 17 additions & 19 deletions ccv/chains/evm/deployment/v1_7_0/adapters/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

tp_bindings "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/gobindings/generated/latest/token_pool"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-deployments-framework/deployment"
"github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment"
"github.com/smartcontractkit/chainlink-deployments-framework/operations"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/committee_verifier"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/token_pool"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/adapters"
v1_7_0 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/changesets"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/create2_factory"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/testsetup"
evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
contract_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
Expand All @@ -18,22 +29,9 @@ import (
v1_6_1_adapters "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/adapters"
v1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/changesets"
burn_mint_token_pool_v1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/operations/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-deployments-framework/deployment"
"github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment"
"github.com/smartcontractkit/chainlink-deployments-framework/operations"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/token_pool"
"github.com/smartcontractkit/chainlink-ccip/deployment/tokens"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets"
datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/committee_verifier"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/adapters"
v1_7_0 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/changesets"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/create2_factory"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/testsetup"
)

const (
Expand Down Expand Up @@ -107,9 +105,9 @@ func TestTokenAdapter(t *testing.T) {

deployChainOut, err := v1_7_0.DeployChainContracts(mcmsRegistry).Apply(*e, changesets.WithMCMS[v1_7_0.DeployChainContractsCfg]{
Cfg: v1_7_0.DeployChainContractsCfg{
ChainSel: chainSel,
CREATE2Factory: common.HexToAddress(create2FactoryRef.Address),
Params: testsetup.CreateBasicContractParams(),
ChainSel: chainSel,
CREATE2Factory: common.HexToAddress(create2FactoryRef.Address),
Params: testsetup.CreateBasicContractParams(),
DeployerKeyOwned: true,
},
})
Expand Down Expand Up @@ -348,9 +346,9 @@ func TestTokenAdapter(t *testing.T) {
requireRateLimiterScaled(t, cfg.DefaultFinalityOutboundRateLimiterConfig.Rate, cfg.DefaultFinalityOutboundRateLimiterConfig.Capacity, currentStates.OutboundRateLimiterState.Rate, currentStates.OutboundRateLimiterState.Capacity, decimals, false)
}

// Chain A has a 1.7.0 token pool so should have set CCVs
// Chain A has a v2 token pool so should have set CCVs
if chainSel == chainA {
boundTokenPool, err := tp_bindings.NewTokenPool(tokenPoolAddr, evmChain.Client)
boundTokenPool, err := token_pool.NewTokenPoolContract(tokenPoolAddr, evmChain.Client)
require.NoError(t, err, "Failed to instantiate token pool contract")
inboundCCVs, err := boundTokenPool.GetRequiredCCVs(nil, common.Address{}, remoteChainSel, big.NewInt(0), 0, []byte{}, inbound)
require.NoError(t, err, "Failed to get inbound CCVs from token pool")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/ethereum/go-ethereum/common"

fee_quoter_ops "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/gobindings/generated/latest/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/link"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/weth"
router_ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
Expand Down Expand Up @@ -195,7 +194,7 @@ func discoverLINKFromFeeQuoter(e cldf_deployment.Environment, sel uint64, client
}

fqAddr := common.HexToAddress(ref.Address)
fqContract, err := fee_quoter.NewFeeQuoter(fqAddr, client)
fqContract, err := fee_quoter_ops.NewFeeQuoterContract(fqAddr, client)
if err != nil {
e.Logger.Warnf("Failed to bind FeeQuoter at %s: %v, trying next", fqAddr.Hex(), err)
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package changesets_test

import (
"math/big"
"strings"
"testing"

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/changesets"
fee_quoter_ops "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/gobindings/generated/latest/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/link"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/weth"
router_ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
Expand Down Expand Up @@ -316,15 +318,17 @@ func TestDiscoverTokens_FallsBackToFeeQuoterForLINK(t *testing.T) {
_, err = chain.Confirm(tx)
require.NoError(t, err)

fqAddr, tx, _, err := fee_quoter.DeployFeeQuoter(
chain.DeployerKey, chain.Client,
fee_quoter.FeeQuoterStaticConfig{
fqParsedABI, err := abi.JSON(strings.NewReader(fee_quoter_ops.FeeQuoterABI))
require.NoError(t, err)
fqAddr, tx, _, err := bind.DeployContract(
chain.DeployerKey, fqParsedABI, common.FromHex(fee_quoter_ops.FeeQuoterBin), chain.Client,
fee_quoter_ops.StaticConfig{
MaxFeeJuelsPerMsg: big.NewInt(1e18),
LinkToken: expectedLINK,
},
[]common.Address{},
[]fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{},
[]fee_quoter.FeeQuoterDestChainConfigArgs{},
[]fee_quoter_ops.TokenTransferFeeConfigArgs{},
[]fee_quoter_ops.DestChainConfigArgs{},
)
require.NoError(t, err)
_, err = chain.Confirm(tx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ import (
cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations"
mcms_types "github.com/smartcontractkit/mcms/types"

"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
"github.com/smartcontractkit/chainlink-ccip/deployment/lanes"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"

"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/executor"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/offramp"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/onramp"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/proxy"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/fee_quoter"
fqc "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/gobindings/generated/latest/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
"github.com/smartcontractkit/chainlink-ccip/deployment/lanes"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
)

var ConfigureLaneLegAsSource = cldf_ops.NewSequence(
Expand Down Expand Up @@ -106,7 +104,7 @@ var ConfigureLaneLegAsSource = cldf_ops.NewSequence(
}

// ApplyDestChainConfigUpdates on FeeQuoter
feeQContract, err := fqc.NewFeeQuoter(common.HexToAddress(sourceFeeQuoter), chain.Client)
feeQContract, err := fee_quoter.NewFeeQuoterContract(common.HexToAddress(sourceFeeQuoter), chain.Client)
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("failed to bind fee quoter contract at address %s on chain %s: %w",
sourceFeeQuoter, chain.String(), err)
Expand Down Expand Up @@ -452,7 +450,7 @@ func maybeAddOnRampDestChainConfigArg(b cldf_ops.Bundle, chain evm.Chain, input
}

// feeQuoterDestChainConfigEqual reports whether the on-chain config matches the desired adapter config (binding struct has no USDPerUnitGas; that is updated via UpdatePrices).
func feeQuoterDestChainConfigEqual(cur fqc.FeeQuoterDestChainConfig, desired lanes.FeeQuoterDestChainConfig) bool {
func feeQuoterDestChainConfigEqual(cur fee_quoter.DestChainConfig, desired lanes.FeeQuoterDestChainConfig) bool {
var linkFeeMultiplierPercent uint8
if desired.V2Params != nil {
linkFeeMultiplierPercent = desired.V2Params.LinkFeeMultiplierPercent
Expand All @@ -473,7 +471,7 @@ func feeQuoterDestChainConfigEqual(cur fqc.FeeQuoterDestChainConfig, desired lan
// maybeAddFeeQuoterDestChainConfigArg fetches current FeeQuoter dest chain config and appends to feeQuoterArgs
// only when the config differs from desired (idempotent). Call only when OverrideExistingConfig is false.
// When a desired field is zero, the on-chain value is used so we do not overwrite with zero.
func maybeAddFeeQuoterDestChainConfigArg(feeQContract *fqc.FeeQuoter, b cldf_ops.Bundle, feeQuoterAddr string, chain evm.Chain, remoteSelector uint64, remoteConfig *lanes.ChainDefinition, feeQuoterArgs []fee_quoter.DestChainConfigArgs) ([]fee_quoter.DestChainConfigArgs, error) {
func maybeAddFeeQuoterDestChainConfigArg(feeQContract *fee_quoter.FeeQuoterContract, b cldf_ops.Bundle, feeQuoterAddr string, chain evm.Chain, remoteSelector uint64, remoteConfig *lanes.ChainDefinition, feeQuoterArgs []fee_quoter.DestChainConfigArgs) ([]fee_quoter.DestChainConfigArgs, error) {
cur, err := feeQContract.GetDestChainConfig(&bind.CallOpts{
Context: b.GetContext(),
}, remoteSelector)
Expand Down
Loading
Loading