From 640a2a957ec4ea67a3148ec050629a39bba61e7b Mon Sep 17 00:00:00 2001 From: Rens Rooimans <5789419+RensR@users.noreply.github.com> Date: Tue, 24 Feb 2026 16:15:45 +0100 Subject: [PATCH 01/41] bump go deps (#1734) * bump go deps * bump chain selectors * bump filippo.io/edwards25519 --- chains/evm/deployment/go.mod | 33 ++++----- chains/evm/deployment/go.sum | 63 ++++++++-------- ...rapper-dependency-versions-do-not-edit.txt | 2 +- chains/solana/deployment/go.mod | 35 ++++----- chains/solana/deployment/go.sum | 67 ++++++++--------- chains/solana/go.mod | 2 +- chains/solana/go.sum | 3 +- chains/solana/gobindings/go.mod | 2 +- chains/solana/gobindings/go.sum | 4 +- deployment/go.mod | 35 ++++----- deployment/go.sum | 67 ++++++++--------- devenv/go.mod | 29 ++++---- devenv/go.sum | 57 +++++++------- go.mod | 34 ++++----- go.sum | 74 +++++++++---------- integration-tests/go.mod | 33 ++++----- integration-tests/go.sum | 63 ++++++++-------- 17 files changed, 284 insertions(+), 319 deletions(-) diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index c756f6a37f..5aea04a58d 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -15,10 +15,10 @@ replace github.com/smartcontractkit/chainlink-ccip/deployment => ../../../deploy require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 @@ -33,7 +33,7 @@ require ( require ( dario.cat/mergo v1.0.2 // indirect - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/BurntSushi/toml v1.5.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect @@ -59,7 +59,7 @@ require ( github.com/btcsuite/btcutil v1.0.2 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect @@ -79,7 +79,6 @@ require ( github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect @@ -92,7 +91,6 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -121,9 +119,11 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect + github.com/grafana/pyroscope-go v1.2.7 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect @@ -162,7 +162,6 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect @@ -182,7 +181,6 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.2.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect @@ -199,7 +197,6 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -253,24 +250,24 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.6.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect diff --git a/chains/evm/deployment/go.sum b/chains/evm/deployment/go.sum index c739cd306c..874601bf88 100644 --- a/chains/evm/deployment/go.sum +++ b/chains/evm/deployment/go.sum @@ -1,8 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -122,8 +123,8 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -177,8 +178,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3 github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -227,10 +226,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -345,14 +342,18 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4zG2vvqG6uWNkBHSTqXOZk0= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -517,7 +518,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= @@ -568,8 +568,6 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E= github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -633,7 +631,6 @@ github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzM github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -676,8 +673,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde h1:dMUf1YOX5hdUkQDgnA/A/sWVoMaQWGB+EYBPuYffYIA= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d h1:xdFpzbApEMz4Rojg2Y2OjFlrh0wu7eB10V2tSZGW5y8= @@ -813,8 +810,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -823,12 +820,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -837,20 +834,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= -go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 01ae4a25f3..8852f13bb5 100644 --- a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ -GETH_VERSION: 1.16.8 +GETH_VERSION: 1.17.0 burn_from_mint_token_pool: ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.abi.json ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.bin 4d1365eeafb6edc657e618fb7868e4712914ef7a256c6ef1c74f3d0f79e77f9d burn_mint_token_pool: ../solc/ccip/BurnMintTokenPool/BurnMintTokenPool.sol/BurnMintTokenPool.abi.json ../solc/ccip/BurnMintTokenPool/BurnMintTokenPool.sol/BurnMintTokenPool.bin 56228bebbb4dec1f664ae27c0f06d43a86a4b564cf51c6969c81a30a1165c0a4 burn_mint_with_lock_release_flag_token_pool: ../solc/ccip/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.sol/BurnMintWithLockReleaseFlagTokenPool.abi.json ../solc/ccip/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.sol/BurnMintWithLockReleaseFlagTokenPool.bin 4fa84bfd8fe0b6bfaa3450e199c591ac64cc202ed130b14b7b9904f0ea0e550a diff --git a/chains/solana/deployment/go.mod b/chains/solana/deployment/go.mod index 8a83aa93cc..165adcaf2c 100644 --- a/chains/solana/deployment/go.mod +++ b/chains/solana/deployment/go.mod @@ -18,11 +18,11 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/gagliardetto/binary v0.8.0 github.com/gagliardetto/solana-go v1.13.0 github.com/rs/zerolog v1.34.0 - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 @@ -34,7 +34,7 @@ require ( ) require ( - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -55,7 +55,7 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btcutil v1.0.2 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect @@ -70,7 +70,6 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect @@ -78,7 +77,6 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect github.com/ferranbt/fastssz v0.1.4 // indirect @@ -104,9 +102,11 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect + github.com/grafana/pyroscope-go v1.2.7 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect @@ -142,7 +142,6 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect @@ -153,7 +152,6 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.2.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect @@ -167,7 +165,6 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -213,24 +210,24 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.6.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect @@ -245,7 +242,7 @@ require ( golang.org/x/tools v0.40.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.76.0 // indirect + google.golang.org/grpc v1.77.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/chains/solana/deployment/go.sum b/chains/solana/deployment/go.sum index d60abaff7b..2ad095de78 100644 --- a/chains/solana/deployment/go.sum +++ b/chains/solana/deployment/go.sum @@ -28,8 +28,9 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= @@ -126,8 +127,8 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -188,8 +189,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= @@ -242,10 +241,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -402,6 +399,10 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -411,8 +412,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4z github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -613,7 +614,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= @@ -675,8 +675,6 @@ github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+ github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E= github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -753,7 +751,6 @@ github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlT github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -799,8 +796,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 h1:cMzoreLtepEiB5pfYrvreXNoZideVRzQQKNr5Io5J7M= @@ -954,8 +951,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -964,12 +961,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -978,20 +975,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= -go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1369,8 +1366,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A= -google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c= +google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= +google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/chains/solana/go.mod b/chains/solana/go.mod index 7f2188fbe8..dc9779894b 100644 --- a/chains/solana/go.mod +++ b/chains/solana/go.mod @@ -60,7 +60,7 @@ require ( ) require ( - filippo.io/edwards25519 v1.0.0-rc.1 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/BurntSushi/toml v1.4.0 github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/blendle/zapdriver v1.3.1 // indirect diff --git a/chains/solana/go.sum b/chains/solana/go.sum index 1534454303..60fd136f14 100644 --- a/chains/solana/go.sum +++ b/chains/solana/go.sum @@ -25,8 +25,9 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= diff --git a/chains/solana/gobindings/go.mod b/chains/solana/gobindings/go.mod index b3f27d6d9e..0b4bb22edc 100644 --- a/chains/solana/gobindings/go.mod +++ b/chains/solana/gobindings/go.mod @@ -12,7 +12,7 @@ require ( ) require ( - filippo.io/edwards25519 v1.0.0-rc.1 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/chains/solana/gobindings/go.sum b/chains/solana/gobindings/go.sum index ad93c62cd4..f5deeccf3c 100644 --- a/chains/solana/gobindings/go.sum +++ b/chains/solana/gobindings/go.sum @@ -1,5 +1,5 @@ -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= diff --git a/deployment/go.mod b/deployment/go.mod index 6acd400ad7..a48cce8694 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -9,9 +9,9 @@ require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aptos-labs/aptos-go-sdk v1.11.0 github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/gagliardetto/solana-go v1.13.0 - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 @@ -22,7 +22,7 @@ require ( ) require ( - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -42,7 +42,7 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btcutil v1.0.2 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect @@ -57,14 +57,12 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect github.com/ferranbt/fastssz v0.1.4 // indirect @@ -90,9 +88,11 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect + github.com/grafana/pyroscope-go v1.2.7 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect @@ -128,7 +128,6 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect @@ -139,7 +138,6 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.2.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect @@ -153,7 +151,6 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -199,24 +196,24 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.6.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect @@ -231,7 +228,7 @@ require ( golang.org/x/tools v0.40.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.76.0 // indirect + google.golang.org/grpc v1.77.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index e3d64b9d6f..0bbb91a379 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1,8 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= @@ -80,8 +81,8 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -134,8 +135,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= @@ -182,10 +181,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -299,14 +296,18 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4zG2vvqG6uWNkBHSTqXOZk0= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -464,7 +465,6 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= @@ -511,8 +511,6 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E= github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -576,7 +574,6 @@ github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzM github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -614,8 +611,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d h1:xdFpzbApEMz4Rojg2Y2OjFlrh0wu7eB10V2tSZGW5y8= @@ -743,8 +740,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -753,12 +750,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -767,20 +764,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= -go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1009,8 +1006,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A= -google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c= +google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= +google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/devenv/go.mod b/devenv/go.mod index d68724f80b..47c4fc8589 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -24,14 +24,14 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/docker/docker v28.5.1+incompatible github.com/docker/go-connections v0.6.0 // indirect - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/gagliardetto/solana-go v1.13.0 github.com/go-resty/resty/v2 v2.17.1 github.com/google/uuid v1.6.0 github.com/pelletier/go-toml/v2 v2.2.4 github.com/prometheus/client_golang v1.23.0 github.com/rs/zerolog v1.34.0 - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d @@ -64,7 +64,7 @@ require ( cloud.google.com/go/auth v0.14.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect @@ -104,7 +104,7 @@ require ( github.com/bytedance/sonic/loader v0.3.0 // indirect github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect @@ -127,7 +127,6 @@ require ( github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/dchest/siphash v1.2.3 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect @@ -142,7 +141,6 @@ require ( github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -206,7 +204,7 @@ require ( github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/consul/api v1.31.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect @@ -292,7 +290,6 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/oklog/run v1.2.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.116.0 // indirect @@ -393,24 +390,24 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect diff --git a/devenv/go.sum b/devenv/go.sum index bd4d7e81e8..6b8b9020ab 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -35,8 +35,9 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -234,8 +235,8 @@ github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500 h1:6lhrsTEnloDPXye github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -307,8 +308,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3 github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= @@ -380,10 +379,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -635,8 +632,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4z github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.31.2 h1:NicObVJHcCmyOIl7Z9iHPvvFrocgTYo9cITSGg0/7pw= @@ -995,8 +992,6 @@ github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E= github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -1178,8 +1173,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde h1:dMUf1YOX5hdUkQDgnA/A/sWVoMaQWGB+EYBPuYffYIA= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d h1:ytcMsJM0zlw5PnaZ1D8JmyGT1m6Fxtb8ycqWYMGheYs= @@ -1417,8 +1412,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0. go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0/go.mod h1:54CaSNqYEXvpzDh8KPjiMVoWm60t5R0dZRt0leEPgAs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1427,12 +1422,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 h1:Ahq7pZmv87yiyn3jeFz/LekZmPLLdKejuO3NcK9MssM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0/go.mod h1:MJTqhM0im3mRLw1i8uGHnCvUEeS7VwRyxlLC78PA18M= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -1441,20 +1436,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os= -go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/go.mod b/go.mod index 0d8aab454d..2df6fbf9e5 100644 --- a/go.mod +++ b/go.mod @@ -4,24 +4,24 @@ go 1.25.3 require ( github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/prometheus/client_golang v1.22.0 github.com/prometheus/client_model v0.6.2 - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d github.com/stretchr/testify v1.11.1 github.com/zksync-sdk/zksync2-go v1.1.0 - go.opentelemetry.io/otel v1.38.0 - go.opentelemetry.io/otel/metric v1.38.0 + go.opentelemetry.io/otel v1.39.0 + go.opentelemetry.io/otel/metric v1.39.0 go.uber.org/zap v1.27.1 golang.org/x/crypto v0.47.0 golang.org/x/sync v0.19.0 golang.org/x/time v0.12.0 - google.golang.org/protobuf v1.36.8 + google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v3 v3.0.1 ) @@ -37,17 +37,15 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect github.com/consensys/gnark-crypto v0.18.1 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect @@ -60,7 +58,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/holiman/uint256 v1.3.2 // indirect github.com/invopop/jsonschema v0.13.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -95,25 +93,25 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.6.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/sys v0.40.0 // indirect golang.org/x/text v0.33.0 // indirect golang.org/x/tools v0.40.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect - google.golang.org/grpc v1.75.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/grpc v1.77.0 // indirect ) diff --git a/go.sum b/go.sum index fad35e9d06..cc8a058895 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -71,8 +71,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -97,10 +95,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -163,10 +159,14 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/holiman/billy v0.0.0-20250707135307-f2f9b9aae7db h1:IZUYC/xb3giYwBLMnr8d0TGTzPKFGNTCGgGLoyeX330= @@ -232,8 +232,6 @@ github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjW github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -287,8 +285,8 @@ github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1 github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= @@ -336,8 +334,8 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -346,12 +344,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -360,20 +358,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= -go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -427,20 +425,20 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 h1:BIRfGDEjiHRrk0QKZe3Xv2ieMhtgRGeLcZQ0mIVn4EY= -google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5/go.mod h1:j3QtIyytwqGr1JUDtYXwtMXWPKsEa5LtzIFN1Wn5WvE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 h1:eaY8u2EuxbRv7c3NiGK0/NedzVsCcV6hDuU5qPX5EGE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5/go.mod h1:M4/wBTSeyLxupu3W3tJtOgB14jILAS/XWPSSa3TAlJc= -google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= -google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= +google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= +google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= -google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d54609904a..235757b299 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -22,9 +22,9 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.16.8 + github.com/ethereum/go-ethereum v1.17.0 github.com/gagliardetto/solana-go v1.13.0 - github.com/smartcontractkit/chain-selectors v1.0.89 + github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d @@ -39,13 +39,13 @@ require ( ) require ( - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect ) require ( dario.cat/mergo v1.0.2 // indirect - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/BurntSushi/toml v1.5.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect @@ -90,7 +90,6 @@ require ( github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect @@ -103,7 +102,6 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect - github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -132,9 +130,11 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect + github.com/grafana/pyroscope-go v1.2.7 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect @@ -173,7 +173,6 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect @@ -193,7 +192,6 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.2.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect @@ -210,7 +208,6 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/rs/zerolog v1.34.0 // indirect @@ -263,24 +260,24 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.6.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 1bf996a844..fba177ce43 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -28,8 +28,9 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -168,8 +169,8 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -230,8 +231,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3 github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= -github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -286,10 +285,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3 github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= -github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= -github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= +github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= +github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -446,6 +443,10 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac= +github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= +github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -455,8 +456,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4z github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -661,7 +662,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= @@ -727,8 +727,6 @@ github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+ github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E= github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -805,7 +803,6 @@ github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlT github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -855,8 +852,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde h1:dMUf1YOX5hdUkQDgnA/A/sWVoMaQWGB+EYBPuYffYIA= github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= -github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= -github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a h1:jrP1CEWevxo5Ls7C/leXfO24LUZ53uqPMVvX+D7DDV0= @@ -1014,8 +1011,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1024,12 +1021,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 h1:zwd go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0/go.mod h1:rUKCPscaRWWcqGT6HnEmYrK+YNe5+Sw64xgQTOJ5b30= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 h1:gAU726w9J8fwr4qRDqu1GYMNNs4gXrU+Pv20/N1UpB4= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0/go.mod h1:RboSDkp7N292rgu+T0MgVt2qgFGu6qa1RpZDOtpL76w= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= @@ -1038,20 +1035,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= -go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= From cb23ec38649f9d23aabd0350e30d3d649ebc2174 Mon Sep 17 00:00:00 2001 From: Agustina Aldasoro Date: Tue, 24 Feb 2026 18:48:16 -0300 Subject: [PATCH 02/41] Solana contracts/v1.6.1 candidate (#1565) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fee Quoter changes to support ton and aptos (#1518) * Fee Quoter changes to support ton and aptos * add tests for other families * Add tests for all remote chain selectors * Bump versios (#1550) * Bump versios * Bump all contracts * Add cpi event * Reenable tests * Fix ping-pong test setup * Fix devenv CI setup and enable verbose logs in some integration tests * devenv go mod tidy * Fix CI command * Fix CI command * Disable broken tests again, unrelated to these changes * Update changelog and remove `-candidate` version suffix --------- Co-authored-by: Tobías Lichtig --- chains/solana/CHANGELOG.md | 15 +- chains/solana/contracts/Cargo.lock | 24 +- .../programs/base-token-pool/Cargo.toml | 13 +- .../programs/burnmint-token-pool/Cargo.toml | 19 +- .../contracts/programs/ccip-common/Cargo.toml | 9 +- .../contracts/programs/ccip-common/src/lib.rs | 18 +- .../contracts/programs/ccip-common/src/v1.rs | 340 ++++- .../programs/ccip-offramp/Cargo.toml | 17 +- .../contracts/programs/ccip-router/Cargo.toml | 17 +- .../programs/ccip-router/src/context.rs | 2 +- .../ccip-router/src/instructions/v1/onramp.rs | 48 +- .../programs/cctp-token-pool/Cargo.toml | 13 +- .../programs/example-ccip-sender/Cargo.toml | 11 +- .../contracts/programs/fee-quoter/Cargo.toml | 11 +- .../fee-quoter/src/instructions/v1/admin.rs | 68 +- .../src/instructions/v1/messages.rs | 108 +- .../lockrelease-token-pool/Cargo.toml | 19 +- .../programs/ping-pong-demo/Cargo.toml | 15 +- .../contracts/programs/rmn-remote/Cargo.toml | 9 +- .../programs/rmn-remote/src/config.rs | 71 + .../programs/rmn-remote/src/context.rs | 63 +- .../programs/rmn-remote/src/event.rs | 5 + .../rmn-remote/src/instructions/interfaces.rs | 14 +- .../rmn-remote/src/instructions/v1/admin.rs | 21 +- .../rmn-remote/src/instructions/v1/public.rs | 61 +- .../contracts/programs/rmn-remote/src/lib.rs | 58 +- .../programs/rmn-remote/src/state.rs | 10 + .../programs/test-token-pool/Cargo.toml | 27 +- .../contracts/target/idl/base_token_pool.json | 2 +- .../target/idl/burnmint_token_pool.json | 2 +- .../contracts/target/idl/ccip_common.json | 17 +- .../contracts/target/idl/ccip_offramp.json | 2 +- .../contracts/target/idl/ccip_router.json | 2 +- .../contracts/target/idl/cctp_token_pool.json | 2 +- .../target/idl/example_ccip_sender.json | 2 +- .../contracts/target/idl/fee_quoter.json | 2 +- .../target/idl/lockrelease_token_pool.json | 2 +- .../contracts/target/idl/ping_pong_demo.json | 2 +- .../contracts/target/idl/rmn_remote.json | 133 +- .../contracts/target/idl/test_token_pool.json | 2 +- .../contracts/target/types/base_token_pool.ts | 4 +- .../target/types/burnmint_token_pool.ts | 4 +- .../contracts/target/types/ccip_common.ts | 34 +- .../contracts/target/types/ccip_offramp.ts | 4 +- .../contracts/target/types/ccip_router.ts | 4 +- .../contracts/target/types/cctp_token_pool.ts | 4 +- .../target/types/example_ccip_sender.ts | 4 +- .../contracts/target/types/fee_quoter.ts | 4 +- .../target/types/lockrelease_token_pool.ts | 4 +- .../contracts/target/types/ping_pong_demo.ts | 4 +- .../contracts/target/types/rmn_remote.ts | 266 +++- .../contracts/target/types/test_token_pool.ts | 4 +- .../contracts/tests/ccip/ccip_router_test.go | 100 +- .../tests/devnet/cctp_tp_devnet_test.go | 40 +- .../tests/examples/ping_pong_test.go | 12 +- .../contracts/tests/testutils/anchor.go | 24 + .../deployment/utils/artifact_versions.go | 3 + .../gobindings/latest/rmn_remote/CpiEvent.go | 156 ++ .../latest/rmn_remote/CpiEvent_test.go | 32 + .../latest/rmn_remote/MigrateConfigV1ToV2.go | 144 ++ .../rmn_remote/MigrateConfigV1ToV2_test.go | 32 + .../latest/rmn_remote/SetEventAuthorities.go | 171 +++ .../rmn_remote/SetEventAuthorities_test.go | 32 + .../latest/rmn_remote/VerifyNotCursed.go | 3 + .../gobindings/latest/rmn_remote/accounts.go | 11 + .../latest/rmn_remote/instructions.go | 45 + .../v1_6_1/base_token_pool/accounts.go | 3 + .../v1_6_1/base_token_pool/instructions.go | 109 ++ .../v1_6_1/base_token_pool/testing_utils.go | 20 + .../v1_6_1/base_token_pool/types.go | 728 ++++++++++ .../burnmint_token_pool/AcceptOwnership.go | 136 ++ .../AcceptOwnership_test.go | 32 + .../AppendRemotePoolAddresses.go | 230 +++ .../AppendRemotePoolAddresses_test.go | 32 + .../burnmint_token_pool/ConfigureAllowList.go | 207 +++ .../ConfigureAllowList_test.go | 32 + .../burnmint_token_pool/DeleteChainConfig.go | 188 +++ .../DeleteChainConfig_test.go | 32 + .../EditChainRemoteConfig.go | 230 +++ .../EditChainRemoteConfig_test.go | 32 + .../InitChainRemoteConfig.go | 230 +++ .../InitChainRemoteConfig_test.go | 32 + .../burnmint_token_pool/InitGlobalConfig.go | 226 +++ .../InitGlobalConfig_test.go | 32 + .../v1_6_1/burnmint_token_pool/Initialize.go | 212 +++ .../InitializeStateVersion.go | 127 ++ .../InitializeStateVersion_test.go | 32 + .../burnmint_token_pool/Initialize_test.go | 32 + .../burnmint_token_pool/LockOrBurnTokens.go | 298 ++++ .../LockOrBurnTokens_test.go | 32 + .../ReleaseOrMintTokens.go | 367 +++++ .../ReleaseOrMintTokens_test.go | 32 + .../RemoveFromAllowList.go | 184 +++ .../RemoveFromAllowList_test.go | 32 + .../burnmint_token_pool/SetChainRateLimit.go | 234 +++ .../SetChainRateLimit_test.go | 32 + .../burnmint_token_pool/SetRateLimitAdmin.go | 169 +++ .../SetRateLimitAdmin_test.go | 32 + .../v1_6_1/burnmint_token_pool/SetRmn.go | 203 +++ .../v1_6_1/burnmint_token_pool/SetRmn_test.go | 32 + .../v1_6_1/burnmint_token_pool/SetRouter.go | 203 +++ .../burnmint_token_pool/SetRouter_test.go | 32 + .../TransferMintAuthorityToMultisig.go | 231 +++ .../TransferMintAuthorityToMultisig_test.go | 32 + .../burnmint_token_pool/TransferOwnership.go | 165 +++ .../TransferOwnership_test.go | 32 + .../v1_6_1/burnmint_token_pool/TypeVersion.go | 102 ++ .../burnmint_token_pool/TypeVersion_test.go | 32 + .../burnmint_token_pool/UpdateDefaultRmn.go | 184 +++ .../UpdateDefaultRmn_test.go | 32 + .../UpdateDefaultRouter.go | 184 +++ .../UpdateDefaultRouter_test.go | 32 + .../UpdateSelfServedAllowed.go | 184 +++ .../UpdateSelfServedAllowed_test.go | 32 + .../v1_6_1/burnmint_token_pool/accounts.go | 179 +++ .../v1_6_1/burnmint_token_pool/alias.go | 16 + .../burnmint_token_pool/instructions.go | 269 ++++ .../burnmint_token_pool/testing_utils.go | 20 + .../v1_6_1/burnmint_token_pool/types.go | 3 + .../gobindings/v1_6_1/ccip_common/accounts.go | 117 ++ .../v1_6_1/ccip_common/instructions.go | 109 ++ .../v1_6_1/ccip_common/testing_utils.go | 20 + .../gobindings/v1_6_1/ccip_common/types.go | 3 + .../v1_6_1/ccip_offramp/AcceptOwnership.go | 124 ++ .../ccip_offramp/AcceptOwnership_test.go | 32 + .../v1_6_1/ccip_offramp/AddSourceChain.go | 215 +++ .../ccip_offramp/AddSourceChain_test.go | 32 + .../ccip_offramp/BufferExecutionReport.go | 297 ++++ .../BufferExecutionReport_test.go | 32 + .../ccip_offramp/CloseCommitReportAccount.go | 264 ++++ .../CloseCommitReportAccount_test.go | 32 + .../CloseExecutionReportBuffer.go | 188 +++ .../CloseExecutionReportBuffer_test.go | 32 + .../gobindings/v1_6_1/ccip_offramp/Commit.go | 492 +++++++ .../v1_6_1/ccip_offramp/CommitPriceOnly.go | 448 ++++++ .../ccip_offramp/CommitPriceOnly_test.go | 32 + .../v1_6_1/ccip_offramp/Commit_test.go | 32 + .../ccip_offramp/DeriveAccountsExecute.go | 187 +++ .../DeriveAccountsExecute_test.go | 32 + .../DisableSourceChainSelector.go | 172 +++ .../DisableSourceChainSelector_test.go | 32 + .../gobindings/v1_6_1/ccip_offramp/Execute.go | 413 ++++++ .../v1_6_1/ccip_offramp/Execute_test.go | 32 + .../v1_6_1/ccip_offramp/Initialize.go | 277 ++++ .../v1_6_1/ccip_offramp/InitializeConfig.go | 235 +++ .../ccip_offramp/InitializeConfig_test.go | 32 + .../v1_6_1/ccip_offramp/Initialize_test.go | 32 + .../v1_6_1/ccip_offramp/ManuallyExecute.go | 380 +++++ .../ccip_offramp/ManuallyExecute_test.go | 32 + .../ccip_offramp/SetDefaultCodeVersion.go | 154 ++ .../SetDefaultCodeVersion_test.go | 32 + .../v1_6_1/ccip_offramp/SetOcrConfig.go | 243 ++++ .../v1_6_1/ccip_offramp/SetOcrConfig_test.go | 32 + .../v1_6_1/ccip_offramp/TransferOwnership.go | 153 ++ .../ccip_offramp/TransferOwnership_test.go | 32 + .../v1_6_1/ccip_offramp/TypeVersion.go | 102 ++ .../v1_6_1/ccip_offramp/TypeVersion_test.go | 32 + .../UpdateEnableManualExecutionAfter.go | 154 ++ .../UpdateEnableManualExecutionAfter_test.go | 32 + .../ccip_offramp/UpdateReferenceAddresses.go | 244 ++++ .../UpdateReferenceAddresses_test.go | 32 + .../ccip_offramp/UpdateSourceChainConfig.go | 196 +++ .../UpdateSourceChainConfig_test.go | 32 + .../ccip_offramp/UpdateSvmChainSelector.go | 153 ++ .../UpdateSvmChainSelector_test.go | 32 + .../v1_6_1/ccip_offramp/accounts.go | 547 +++++++ .../v1_6_1/ccip_offramp/instructions.go | 504 +++++++ .../v1_6_1/ccip_offramp/testing_utils.go | 20 + .../gobindings/v1_6_1/ccip_offramp/types.go | 1279 +++++++++++++++++ .../AcceptAdminRoleTokenAdminRegistry.go | 162 +++ .../AcceptAdminRoleTokenAdminRegistry_test.go | 32 + .../v1_6_1/ccip_router/AcceptOwnership.go | 124 ++ .../ccip_router/AcceptOwnership_test.go | 32 + .../v1_6_1/ccip_router/AddChainSelector.go | 218 +++ .../ccip_router/AddChainSelector_test.go | 32 + .../v1_6_1/ccip_router/AddOfframp.go | 215 +++ .../v1_6_1/ccip_router/AddOfframp_test.go | 32 + .../BumpCcipVersionForDestChain.go | 172 +++ .../BumpCcipVersionForDestChain_test.go | 32 + .../CcipAdminOverridePendingAdministrator.go | 208 +++ ...pAdminOverridePendingAdministrator_test.go | 32 + .../CcipAdminProposeAdministrator.go | 209 +++ .../CcipAdminProposeAdministrator_test.go | 32 + .../gobindings/v1_6_1/ccip_router/CcipSend.go | 519 +++++++ .../v1_6_1/ccip_router/CcipSend_test.go | 32 + .../ccip_router/DeriveAccountsCcipSend.go | 182 +++ .../DeriveAccountsCcipSend_test.go | 32 + .../gobindings/v1_6_1/ccip_router/GetFee.go | 273 ++++ .../v1_6_1/ccip_router/GetFee_test.go | 32 + .../v1_6_1/ccip_router/Initialize.go | 307 ++++ .../v1_6_1/ccip_router/Initialize_test.go | 32 + .../OwnerOverridePendingAdministrator.go | 208 +++ .../OwnerOverridePendingAdministrator_test.go | 32 + .../ccip_router/OwnerProposeAdministrator.go | 210 +++ .../OwnerProposeAdministrator_test.go | 32 + .../v1_6_1/ccip_router/RemoveOfframp.go | 215 +++ .../v1_6_1/ccip_router/RemoveOfframp_test.go | 32 + .../RollbackCcipVersionForDestChain.go | 172 +++ .../RollbackCcipVersionForDestChain_test.go | 32 + .../ccip_router/SetDefaultCodeVersion.go | 174 +++ .../ccip_router/SetDefaultCodeVersion_test.go | 32 + .../v1_6_1/ccip_router/SetLinkTokenMint.go | 171 +++ .../ccip_router/SetLinkTokenMint_test.go | 32 + .../gobindings/v1_6_1/ccip_router/SetPool.go | 210 +++ .../SetPoolSupportsAutoDerivation.go | 196 +++ .../SetPoolSupportsAutoDerivation_test.go | 32 + .../v1_6_1/ccip_router/SetPool_test.go | 32 + .../TransferAdminRoleTokenAdminRegistry.go | 192 +++ ...ransferAdminRoleTokenAdminRegistry_test.go | 32 + .../v1_6_1/ccip_router/TransferOwnership.go | 153 ++ .../ccip_router/TransferOwnership_test.go | 32 + .../v1_6_1/ccip_router/TypeVersion.go | 102 ++ .../v1_6_1/ccip_router/TypeVersion_test.go | 32 + .../ccip_router/UpdateDestChainConfig.go | 215 +++ .../ccip_router/UpdateDestChainConfig_test.go | 32 + .../v1_6_1/ccip_router/UpdateFeeAggregator.go | 171 +++ .../ccip_router/UpdateFeeAggregator_test.go | 32 + .../v1_6_1/ccip_router/UpdateRmnRemote.go | 171 +++ .../ccip_router/UpdateRmnRemote_test.go | 32 + .../ccip_router/UpdateSvmChainSelector.go | 172 +++ .../UpdateSvmChainSelector_test.go | 32 + .../UpgradeTokenAdminRegistryFromV1.go | 187 +++ .../UpgradeTokenAdminRegistryFromV1_test.go | 32 + .../v1_6_1/ccip_router/WithdrawBilledFunds.go | 272 ++++ .../ccip_router/WithdrawBilledFunds_test.go | 32 + .../gobindings/v1_6_1/ccip_router/accounts.go | 308 ++++ .../v1_6_1/ccip_router/instructions.go | 578 ++++++++ .../v1_6_1/ccip_router/testing_utils.go | 20 + .../gobindings/v1_6_1/ccip_router/types.go | 841 +++++++++++ .../v1_6_1/cctp_token_pool/AcceptOwnership.go | 136 ++ .../cctp_token_pool/AcceptOwnership_test.go | 32 + .../AppendRemotePoolAddresses.go | 230 +++ .../AppendRemotePoolAddresses_test.go | 32 + .../cctp_token_pool/ConfigureAllowList.go | 207 +++ .../ConfigureAllowList_test.go | 32 + .../cctp_token_pool/DeleteChainConfig.go | 188 +++ .../cctp_token_pool/DeleteChainConfig_test.go | 32 + .../DeriveAccountsLockOrBurnTokens.go | 130 ++ .../DeriveAccountsLockOrBurnTokens_test.go | 32 + .../DeriveAccountsReleaseOrMintTokens.go | 130 ++ .../DeriveAccountsReleaseOrMintTokens_test.go | 32 + .../cctp_token_pool/EditChainRemoteConfig.go | 230 +++ .../EditChainRemoteConfigCctp.go | 211 +++ .../EditChainRemoteConfigCctp_test.go | 32 + .../EditChainRemoteConfig_test.go | 32 + .../cctp_token_pool/InitChainRemoteConfig.go | 230 +++ .../InitChainRemoteConfig_test.go | 32 + .../cctp_token_pool/InitGlobalConfig.go | 174 +++ .../cctp_token_pool/InitGlobalConfig_test.go | 32 + .../v1_6_1/cctp_token_pool/Initialize.go | 264 ++++ .../v1_6_1/cctp_token_pool/Initialize_test.go | 32 + .../cctp_token_pool/LockOrBurnTokens.go | 552 +++++++ .../cctp_token_pool/LockOrBurnTokens_test.go | 32 + .../cctp_token_pool/ReclaimEventAccount.go | 333 +++++ .../ReclaimEventAccount_test.go | 32 + .../v1_6_1/cctp_token_pool/ReclaimFunds.go | 232 +++ .../cctp_token_pool/ReclaimFunds_test.go | 32 + .../cctp_token_pool/ReleaseOrMintTokens.go | 367 +++++ .../ReleaseOrMintTokens_test.go | 32 + .../cctp_token_pool/RemoveFromAllowList.go | 184 +++ .../RemoveFromAllowList_test.go | 32 + .../cctp_token_pool/SetChainRateLimit.go | 234 +++ .../cctp_token_pool/SetChainRateLimit_test.go | 32 + .../v1_6_1/cctp_token_pool/SetFundManager.go | 165 +++ .../cctp_token_pool/SetFundManager_test.go | 32 + .../SetFundReclaimDestination.go | 165 +++ .../SetFundReclaimDestination_test.go | 32 + .../cctp_token_pool/SetMinimumSignerFunds.go | 165 +++ .../SetMinimumSignerFunds_test.go | 32 + .../cctp_token_pool/SetRateLimitAdmin.go | 169 +++ .../cctp_token_pool/SetRateLimitAdmin_test.go | 32 + .../v1_6_1/cctp_token_pool/SetRmn.go | 203 +++ .../v1_6_1/cctp_token_pool/SetRmn_test.go | 32 + .../v1_6_1/cctp_token_pool/SetRouter.go | 203 +++ .../v1_6_1/cctp_token_pool/SetRouter_test.go | 32 + .../cctp_token_pool/TransferOwnership.go | 165 +++ .../cctp_token_pool/TransferOwnership_test.go | 32 + .../v1_6_1/cctp_token_pool/TypeVersion.go | 80 ++ .../cctp_token_pool/TypeVersion_test.go | 32 + .../v1_6_1/cctp_token_pool/accounts.go | 178 +++ .../v1_6_1/cctp_token_pool/alias.go | 19 + .../v1_6_1/cctp_token_pool/instructions.go | 298 ++++ .../v1_6_1/cctp_token_pool/testing_utils.go | 20 + .../v1_6_1/cctp_token_pool/types.go | 231 +++ .../example_ccip_sender/AcceptOwnership.go | 117 ++ .../AcceptOwnership_test.go | 32 + .../v1_6_1/example_ccip_sender/CcipSend.go | 637 ++++++++ .../example_ccip_sender/CcipSend_test.go | 32 + .../example_ccip_sender/InitChainConfig.go | 230 +++ .../InitChainConfig_test.go | 32 + .../v1_6_1/example_ccip_sender/Initialize.go | 165 +++ .../example_ccip_sender/Initialize_test.go | 32 + .../example_ccip_sender/RemoveChainConfig.go | 184 +++ .../RemoveChainConfig_test.go | 32 + .../example_ccip_sender/TransferOwnership.go | 146 ++ .../TransferOwnership_test.go | 32 + .../example_ccip_sender/UpdateChainConfig.go | 230 +++ .../UpdateChainConfig_test.go | 32 + .../example_ccip_sender/UpdateRouter.go | 146 ++ .../example_ccip_sender/UpdateRouter_test.go | 32 + .../example_ccip_sender/WithdrawTokens.go | 264 ++++ .../WithdrawTokens_test.go | 32 + .../v1_6_1/example_ccip_sender/accounts.go | 126 ++ .../v1_6_1/example_ccip_sender/alias.go | 10 + .../example_ccip_sender/instructions.go | 175 +++ .../example_ccip_sender/testing_utils.go | 20 + .../v1_6_1/example_ccip_sender/types.go | 20 + .../v1_6_1/fee_quoter/AcceptOwnership.go | 124 ++ .../v1_6_1/fee_quoter/AcceptOwnership_test.go | 32 + .../fee_quoter/AddBillingTokenConfig.go | 285 ++++ .../fee_quoter/AddBillingTokenConfig_test.go | 32 + .../v1_6_1/fee_quoter/AddDestChain.go | 216 +++ .../v1_6_1/fee_quoter/AddDestChain_test.go | 32 + .../v1_6_1/fee_quoter/AddPriceUpdater.go | 190 +++ .../v1_6_1/fee_quoter/AddPriceUpdater_test.go | 32 + .../v1_6_1/fee_quoter/DisableDestChain.go | 172 +++ .../fee_quoter/DisableDestChain_test.go | 32 + .../gobindings/v1_6_1/fee_quoter/GetFee.go | 233 +++ .../v1_6_1/fee_quoter/GetFee_test.go | 32 + .../v1_6_1/fee_quoter/Initialize.go | 255 ++++ .../v1_6_1/fee_quoter/Initialize_test.go | 32 + .../v1_6_1/fee_quoter/RemovePriceUpdater.go | 189 +++ .../fee_quoter/RemovePriceUpdater_test.go | 32 + .../fee_quoter/SetDefaultCodeVersion.go | 154 ++ .../fee_quoter/SetDefaultCodeVersion_test.go | 32 + .../v1_6_1/fee_quoter/SetLinkTokenMint.go | 142 ++ .../fee_quoter/SetLinkTokenMint_test.go | 32 + .../v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg.go | 154 ++ .../fee_quoter/SetMaxFeeJuelsPerMsg_test.go | 32 + .../fee_quoter/SetTokenTransferFeeConfig.go | 241 ++++ .../SetTokenTransferFeeConfig_test.go | 32 + .../v1_6_1/fee_quoter/TransferOwnership.go | 153 ++ .../fee_quoter/TransferOwnership_test.go | 32 + .../v1_6_1/fee_quoter/TypeVersion.go | 102 ++ .../v1_6_1/fee_quoter/TypeVersion_test.go | 32 + .../fee_quoter/UpdateBillingTokenConfig.go | 171 +++ .../UpdateBillingTokenConfig_test.go | 32 + .../fee_quoter/UpdateDestChainConfig.go | 196 +++ .../fee_quoter/UpdateDestChainConfig_test.go | 32 + .../v1_6_1/fee_quoter/UpdatePrices.go | 210 +++ .../v1_6_1/fee_quoter/UpdatePrices_test.go | 32 + .../gobindings/v1_6_1/fee_quoter/accounts.go | 361 +++++ .../v1_6_1/fee_quoter/instructions.go | 396 +++++ .../v1_6_1/fee_quoter/testing_utils.go | 20 + .../gobindings/v1_6_1/fee_quoter/types.go | 883 ++++++++++++ .../lockrelease_token_pool/AcceptOwnership.go | 136 ++ .../AcceptOwnership_test.go | 32 + .../AppendRemotePoolAddresses.go | 230 +++ .../AppendRemotePoolAddresses_test.go | 32 + .../ConfigureAllowList.go | 207 +++ .../ConfigureAllowList_test.go | 32 + .../DeleteChainConfig.go | 188 +++ .../DeleteChainConfig_test.go | 32 + .../EditChainRemoteConfig.go | 230 +++ .../EditChainRemoteConfig_test.go | 32 + .../InitChainRemoteConfig.go | 230 +++ .../InitChainRemoteConfig_test.go | 32 + .../InitGlobalConfig.go | 226 +++ .../InitGlobalConfig_test.go | 32 + .../lockrelease_token_pool/Initialize.go | 212 +++ .../InitializeStateVersion.go | 127 ++ .../InitializeStateVersion_test.go | 32 + .../lockrelease_token_pool/Initialize_test.go | 32 + .../LockOrBurnTokens.go | 298 ++++ .../LockOrBurnTokens_test.go | 32 + .../ProvideLiquidity.go | 241 ++++ .../ProvideLiquidity_test.go | 32 + .../ReleaseOrMintTokens.go | 367 +++++ .../ReleaseOrMintTokens_test.go | 32 + .../RemoveFromAllowList.go | 184 +++ .../RemoveFromAllowList_test.go | 32 + .../SetCanAcceptLiquidity.go | 165 +++ .../SetCanAcceptLiquidity_test.go | 32 + .../SetChainRateLimit.go | 234 +++ .../SetChainRateLimit_test.go | 32 + .../SetRateLimitAdmin.go | 169 +++ .../SetRateLimitAdmin_test.go | 32 + .../lockrelease_token_pool/SetRebalancer.go | 165 +++ .../SetRebalancer_test.go | 32 + .../v1_6_1/lockrelease_token_pool/SetRmn.go | 203 +++ .../lockrelease_token_pool/SetRmn_test.go | 32 + .../lockrelease_token_pool/SetRouter.go | 203 +++ .../lockrelease_token_pool/SetRouter_test.go | 32 + .../TransferOwnership.go | 165 +++ .../TransferOwnership_test.go | 32 + .../lockrelease_token_pool/TypeVersion.go | 102 ++ .../TypeVersion_test.go | 32 + .../UpdateDefaultRmn.go | 184 +++ .../UpdateDefaultRmn_test.go | 32 + .../UpdateDefaultRouter.go | 184 +++ .../UpdateDefaultRouter_test.go | 32 + .../UpdateSelfServedAllowed.go | 184 +++ .../UpdateSelfServedAllowed_test.go | 32 + .../WithdrawLiquidity.go | 241 ++++ .../WithdrawLiquidity_test.go | 32 + .../v1_6_1/lockrelease_token_pool/accounts.go | 179 +++ .../v1_6_1/lockrelease_token_pool/alias.go | 16 + .../lockrelease_token_pool/instructions.go | 290 ++++ .../lockrelease_token_pool/testing_utils.go | 20 + .../v1_6_1/lockrelease_token_pool/types.go | 3 + .../v1_6_1/ping_pong_demo/CcipReceive.go | 602 ++++++++ .../v1_6_1/ping_pong_demo/CcipReceive_test.go | 32 + .../v1_6_1/ping_pong_demo/Initialize.go | 275 ++++ .../v1_6_1/ping_pong_demo/InitializeConfig.go | 314 ++++ .../ping_pong_demo/InitializeConfig_test.go | 32 + .../v1_6_1/ping_pong_demo/Initialize_test.go | 32 + .../v1_6_1/ping_pong_demo/SetCounterpart.go | 169 +++ .../ping_pong_demo/SetCounterpart_test.go | 32 + .../v1_6_1/ping_pong_demo/SetExtraArgs.go | 165 +++ .../ping_pong_demo/SetExtraArgs_test.go | 32 + .../v1_6_1/ping_pong_demo/SetPaused.go | 146 ++ .../v1_6_1/ping_pong_demo/SetPaused_test.go | 32 + .../v1_6_1/ping_pong_demo/StartPingPong.go | 523 +++++++ .../ping_pong_demo/StartPingPong_test.go | 32 + .../v1_6_1/ping_pong_demo/TypeVersion.go | 102 ++ .../v1_6_1/ping_pong_demo/TypeVersion_test.go | 32 + .../v1_6_1/ping_pong_demo/accounts.go | 170 +++ .../gobindings/v1_6_1/ping_pong_demo/alias.go | 10 + .../v1_6_1/ping_pong_demo/instructions.go | 171 +++ .../v1_6_1/ping_pong_demo/testing_utils.go | 20 + .../gobindings/v1_6_1/ping_pong_demo/types.go | 38 + .../v1_6_1/rmn_remote/AcceptOwnership.go | 124 ++ .../v1_6_1/rmn_remote/AcceptOwnership_test.go | 32 + .../gobindings/v1_6_1/rmn_remote/CpiEvent.go | 156 ++ .../v1_6_1/rmn_remote/CpiEvent_test.go | 32 + .../gobindings/v1_6_1/rmn_remote/Curse.go | 192 +++ .../v1_6_1/rmn_remote/Curse_test.go | 32 + .../v1_6_1/rmn_remote/Initialize.go | 199 +++ .../v1_6_1/rmn_remote/Initialize_test.go | 32 + .../v1_6_1/rmn_remote/MigrateConfigV1ToV2.go | 144 ++ .../rmn_remote/MigrateConfigV1ToV2_test.go | 32 + .../rmn_remote/SetDefaultCodeVersion.go | 173 +++ .../rmn_remote/SetDefaultCodeVersion_test.go | 32 + .../v1_6_1/rmn_remote/SetEventAuthorities.go | 171 +++ .../rmn_remote/SetEventAuthorities_test.go | 32 + .../v1_6_1/rmn_remote/TransferOwnership.go | 172 +++ .../rmn_remote/TransferOwnership_test.go | 32 + .../v1_6_1/rmn_remote/TypeVersion.go | 102 ++ .../v1_6_1/rmn_remote/TypeVersion_test.go | 32 + .../gobindings/v1_6_1/rmn_remote/Uncurse.go | 193 +++ .../v1_6_1/rmn_remote/Uncurse_test.go | 32 + .../v1_6_1/rmn_remote/VerifyNotCursed.go | 156 ++ .../v1_6_1/rmn_remote/VerifyNotCursed_test.go | 32 + .../gobindings/v1_6_1/rmn_remote/accounts.go | 148 ++ .../v1_6_1/rmn_remote/instructions.go | 275 ++++ .../v1_6_1/rmn_remote/testing_utils.go | 20 + .../gobindings/v1_6_1/rmn_remote/types.go | 45 + .../v1_6_1/test_token_pool/AcceptOwnership.go | 136 ++ .../test_token_pool/AcceptOwnership_test.go | 32 + .../AppendRemotePoolAddresses.go | 230 +++ .../AppendRemotePoolAddresses_test.go | 32 + .../test_token_pool/DeleteChainConfig.go | 207 +++ .../test_token_pool/DeleteChainConfig_test.go | 32 + .../DeriveAccountsLockOrBurnTokens.go | 130 ++ .../DeriveAccountsLockOrBurnTokens_test.go | 32 + .../DeriveAccountsReleaseOrMintTokens.go | 130 ++ .../DeriveAccountsReleaseOrMintTokens_test.go | 32 + .../test_token_pool/EditChainRemoteConfig.go | 230 +++ .../EditChainRemoteConfig_test.go | 32 + .../test_token_pool/InitChainRemoteConfig.go | 230 +++ .../InitChainRemoteConfig_test.go | 32 + .../v1_6_1/test_token_pool/Initialize.go | 268 ++++ .../v1_6_1/test_token_pool/Initialize_test.go | 32 + .../test_token_pool/LockOrBurnTokens.go | 298 ++++ .../test_token_pool/LockOrBurnTokens_test.go | 32 + .../test_token_pool/ReleaseOrMintTokens.go | 367 +++++ .../ReleaseOrMintTokens_test.go | 32 + .../test_token_pool/SetChainRateLimit.go | 253 ++++ .../test_token_pool/SetChainRateLimit_test.go | 32 + .../test_token_pool/SetRateLimitAdmin.go | 169 +++ .../test_token_pool/SetRateLimitAdmin_test.go | 32 + .../v1_6_1/test_token_pool/SetRouter.go | 165 +++ .../v1_6_1/test_token_pool/SetRouter_test.go | 32 + .../test_token_pool/TransferOwnership.go | 165 +++ .../test_token_pool/TransferOwnership_test.go | 32 + .../v1_6_1/test_token_pool/accounts.go | 103 ++ .../v1_6_1/test_token_pool/alias.go | 14 + .../v1_6_1/test_token_pool/instructions.go | 208 +++ .../v1_6_1/test_token_pool/testing_utils.go | 20 + .../v1_6_1/test_token_pool/types.go | 26 + chains/solana/utils/ccip/ccip_events.go | 34 + chains/solana/utils/common/transactions.go | 9 + devenv/chainimpl/ccip-solana/impl.go | 50 +- devenv/go.mod | 1 + devenv/go.sum | 2 - 485 files changed, 56431 insertions(+), 221 deletions(-) create mode 100644 chains/solana/contracts/programs/rmn-remote/src/config.rs create mode 100644 chains/solana/gobindings/latest/rmn_remote/CpiEvent.go create mode 100644 chains/solana/gobindings/latest/rmn_remote/CpiEvent_test.go create mode 100644 chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2.go create mode 100644 chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2_test.go create mode 100644 chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities.go create mode 100644 chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities_test.go create mode 100644 chains/solana/gobindings/v1_6_1/base_token_pool/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/base_token_pool/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/base_token_pool/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/base_token_pool/types.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed_test.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/burnmint_token_pool/types.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_common/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_common/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_common/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_common/types.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Commit.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Commit_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Execute.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Execute_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_offramp/types.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipSend.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/CcipSend_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/GetFee.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/GetFee_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetPool.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/SetPool_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/ccip_router/types.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/cctp_token_pool/types.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/example_ccip_sender/types.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/GetFee.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/GetFee_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices_test.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/fee_quoter/types.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity_test.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/lockrelease_token_pool/types.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/ping_pong_demo/types.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Curse.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Curse_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed_test.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/rmn_remote/types.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/Initialize.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/Initialize_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership_test.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/accounts.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/alias.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/instructions.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/testing_utils.go create mode 100644 chains/solana/gobindings/v1_6_1/test_token_pool/types.go diff --git a/chains/solana/CHANGELOG.md b/chains/solana/CHANGELOG.md index 55036af7a8..b849c48f2d 100644 --- a/chains/solana/CHANGELOG.md +++ b/chains/solana/CHANGELOG.md @@ -2,16 +2,14 @@ This document describes the changes introduced in the different versions of the **Chainlink CCIP Solana programs**, located in [`chains/solana/contracts/programs`](https://github.com/smartcontractkit/chainlink-ccip/tree/main/chains/solana/contracts/programs). - - - +--- + +## [1.6.1] - - +### Added - +- [FeeQuoter] Support for other non-EVM families +- [RMNRemote] Support for backwards-compatible CPI Events without requiring additional accounts --- @@ -21,7 +19,6 @@ This document describes the changes introduced in the different versions of the - [Token Pools] Allow setting rate limit with rate and capacity set to 0 [#1290](https://github.com/smartcontractkit/chainlink-ccip/pull/1290) - --- ## [0.1.2] diff --git a/chains/solana/contracts/Cargo.lock b/chains/solana/contracts/Cargo.lock index bccae5e831..838f5d6cb0 100644 --- a/chains/solana/contracts/Cargo.lock +++ b/chains/solana/contracts/Cargo.lock @@ -406,7 +406,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base-token-pool" -version = "1.6.0" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -622,7 +622,7 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "burnmint-token-pool" -version = "1.6.0" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -682,7 +682,7 @@ dependencies = [ [[package]] name = "ccip_common" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -692,7 +692,7 @@ dependencies = [ [[package]] name = "ccip_offramp" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -708,7 +708,7 @@ dependencies = [ [[package]] name = "ccip_router" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -724,7 +724,7 @@ dependencies = [ [[package]] name = "cctp-token-pool" -version = "1.6.0" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -1016,7 +1016,7 @@ dependencies = [ [[package]] name = "example_ccip_sender" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -1040,7 +1040,7 @@ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] name = "fee_quoter" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -1337,7 +1337,7 @@ dependencies = [ [[package]] name = "lockrelease-token-pool" -version = "1.6.0" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -1559,7 +1559,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "ping_pong_demo" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", @@ -1793,7 +1793,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rmn_remote" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "build_commit", @@ -2509,7 +2509,7 @@ dependencies = [ [[package]] name = "test-token-pool" -version = "0.1.1" +version = "1.6.1" dependencies = [ "anchor-lang", "anchor-spl", diff --git a/chains/solana/contracts/programs/base-token-pool/Cargo.toml b/chains/solana/contracts/programs/base-token-pool/Cargo.toml index 5b397cc135..6d9a406057 100644 --- a/chains/solana/contracts/programs/base-token-pool/Cargo.toml +++ b/chains/solana/contracts/programs/base-token-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "base-token-pool" -version = "1.6.0" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -19,9 +19,14 @@ default = [] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" solana-program = "1.17.25" # pin solana to 1.17 -spl-math = { version = "0.2.0", features = [ "no-entrypoint" ] } -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} +spl-math = { version = "0.2.0", features = ["no-entrypoint"] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/burnmint-token-pool/Cargo.toml b/chains/solana/contracts/programs/burnmint-token-pool/Cargo.toml index 7971bdc72a..1e8b45269a 100644 --- a/chains/solana/contracts/programs/burnmint-token-pool/Cargo.toml +++ b/chains/solana/contracts/programs/burnmint-token-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "burnmint-token-pool" -version = "1.6.0" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -19,14 +19,21 @@ default = [] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" solana-program = "1.17.25" # pin solana to 1.17 -spl-math = { version = "0.2.0", features = [ "no-entrypoint" ] } -base-token-pool = { version = "1.6.0", path = "../base-token-pool/", features = ["no-entrypoint"] } -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} -ccip_common = {path = "../ccip-common"} +spl-math = { version = "0.2.0", features = ["no-entrypoint"] } +base-token-pool = { version = "1.6.1", path = "../base-token-pool/", features = [ + "no-entrypoint", +] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } [build-dependencies] build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/ccip-common/Cargo.toml b/chains/solana/contracts/programs/ccip-common/Cargo.toml index 173024d8d3..f322b7fe85 100644 --- a/chains/solana/contracts/programs/ccip-common/Cargo.toml +++ b/chains/solana/contracts/programs/ccip-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ccip_common" -version = "0.1.1" +version = "1.6.1" edition = "2021" [lib] @@ -17,11 +17,14 @@ cpi = ["no-entrypoint"] default = ["no-entrypoint"] [dependencies] -solana-program = "1.17.25" # pin solana to 1.17 +solana-program = "1.17.25" # pin solana to 1.17 anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" ethnum = "1.5" [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/ccip-common/src/lib.rs b/chains/solana/contracts/programs/ccip-common/src/lib.rs index 996ab3af0e..c999650c94 100644 --- a/chains/solana/contracts/programs/ccip-common/src/lib.rs +++ b/chains/solana/contracts/programs/ccip-common/src/lib.rs @@ -33,11 +33,27 @@ pub enum CommonCcipError { InvalidEVMAddress, #[msg("Invalid SVM address")] InvalidSVMAddress, + #[msg("Invalid TVM address")] + InvalidTVMAddress, + #[msg("Invalid Aptos address")] + InvalidAptosAddress, + #[msg("Invalid Sui address")] + InvalidSuiAddress, } -// https://github.com/smartcontractkit/chainlink/blob/ff8a597fd9df653f8967427498eaa5a04b19febb/contracts/src/v0.8/ccip/libraries/Internal.sol#L276 +// bytes4(keccak256("CCIP ChainFamilySelector APTOS")); +pub const CHAIN_FAMILY_SELECTOR_APTOS: u32 = 0xac77ffec; + +// bytes4(keccak256("CCIP ChainFamilySelector EVM")); pub const CHAIN_FAMILY_SELECTOR_EVM: u32 = 0x2812d52c; + +// bytes4(keccak256("CCIP ChainFamilySelector SUI")); +pub const CHAIN_FAMILY_SELECTOR_SUI: u32 = 0xc4e05953; + +// bytes4(keccak256("CCIP ChainFamilySelector SVM")); pub const CHAIN_FAMILY_SELECTOR_SVM: u32 = 0x1e10bdc4; + +// byte4(keccak256("CCIP ChainFamilySelector TVM")); pub const CHAIN_FAMILY_SELECTOR_TVM: u32 = 0x647e2ba9; // Duplicates the router ID to declare router accounts that must be visible from the common crate, diff --git a/chains/solana/contracts/programs/ccip-common/src/v1.rs b/chains/solana/contracts/programs/ccip-common/src/v1.rs index 3a48afb03c..0bf996092f 100644 --- a/chains/solana/contracts/programs/ccip-common/src/v1.rs +++ b/chains/solana/contracts/programs/ccip-common/src/v1.rs @@ -11,9 +11,26 @@ use crate::{ pub const MIN_TOKEN_POOL_ACCOUNTS: usize = 13; // see TokenAccounts struct for all required accounts const U160_MAX: U256 = U256::from_words(u32::MAX as u128, u128::MAX); -const EVM_PRECOMPILE_SPACE: u32 = 1024; pub const V1_TOKEN_ADMIN_REGISTRY_SIZE: usize = 169; // for migration v1->v2 of the TokenAdminRegistry, which adds the `supports_auto_derivation` field. +/// 32-byte big-endian uint256 representation of 11 (0x0b) +pub const APTOS_PRECOMPILE_SPACE: [u8; 32] = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x0b, +]; + +/// 32-byte big-endian uint256 representation of 1024 (0x0400) +pub const EVM_PRECOMPILE_SPACE: [u8; 32] = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x04, + 0x00, +]; + +/// 32-byte big-endian uint256 representation of 0xdee9 +pub const SUI_PRECOMPILE_SPACE: [u8; 32] = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xde, + 0xe9, +]; + pub struct TokenAccounts<'a> { pub user_token_account: &'a AccountInfo<'a>, pub token_billing_config: &'a AccountInfo<'a>, @@ -387,23 +404,39 @@ pub mod token_admin_registry_writable { } } +/// Returns true iff `a >= b` when both are interpreted as big-endian uint256. +fn ge_be_u256(a: &[u8; 32], b: &[u8; 32]) -> bool { + // Big-endian uint256 compare == lexicographic compare + for i in 0..32 { + match a[i].cmp(&b[i]) { + std::cmp::Ordering::Greater => return true, + std::cmp::Ordering::Less => return false, + std::cmp::Ordering::Equal => {} // continue + } + } + true // equal +} + // address validation helpers based on the chain family selector pub fn validate_evm_address(address: &[u8]) -> Result<()> { require_eq!(address.len(), 32, CommonCcipError::InvalidEVMAddress); + let addr_32: &[u8; 32] = address + .try_into() + .expect("slice length is guaranteed to be 32"); + + require!( + ge_be_u256(addr_32, &EVM_PRECOMPILE_SPACE), + CommonCcipError::InvalidEVMAddress + ); + let address: U256 = U256::from_be_bytes( address .try_into() .map_err(|_| CommonCcipError::InvalidEncoding)?, ); require!(address <= U160_MAX, CommonCcipError::InvalidEVMAddress); - if let Ok(small_address) = TryInto::::try_into(address) { - require_gte!( - small_address, - EVM_PRECOMPILE_SPACE, - CommonCcipError::InvalidEVMAddress - ) - }; + Ok(()) } @@ -419,6 +452,56 @@ pub fn validate_svm_address(address: &[u8], address_must_be_nonzero: bool) -> Re .map_err(|_| CommonCcipError::InvalidSVMAddress.into()) } +/// 36-byte TON address raw format: +/// - [0] flags +/// - [1] workchain_id +/// - [2..34) account_id (32 bytes) +/// - [34..36) crc16 (ignored here) +pub fn validate_tvm_address(address: &[u8]) -> Result<()> { + require_eq!(address.len(), 36, CommonCcipError::InvalidTVMAddress); + + // account_id starts at offset 2 and is 32 bytes long + let account_id: &[u8; 32] = address[2..34] + .try_into() + .expect("slice length is guaranteed to be 32"); + + require!( + account_id.iter().any(|b| *b != 0), + CommonCcipError::InvalidTVMAddress + ); + + Ok(()) +} + +pub fn validate_aptos_address(address: &[u8]) -> Result<()> { + require_eq!(address.len(), 32, CommonCcipError::InvalidAptosAddress); + + let addr_32: &[u8; 32] = address + .try_into() + .expect("slice length is guaranteed to be 32"); + + require!( + ge_be_u256(addr_32, &APTOS_PRECOMPILE_SPACE), + CommonCcipError::InvalidAptosAddress + ); + + Ok(()) +} + +pub fn validate_sui_address(address: &[u8]) -> Result<()> { + require_eq!(address.len(), 32, CommonCcipError::InvalidSuiAddress); + + let addr_32: &[u8; 32] = address + .try_into() + .expect("slice length is guaranteed to be 32"); + + require!( + ge_be_u256(addr_32, &SUI_PRECOMPILE_SPACE), + CommonCcipError::InvalidSuiAddress + ); + + Ok(()) +} #[cfg(test)] mod tests { use super::*; @@ -519,4 +602,245 @@ mod tests { let result = load_v1_token_admin_registry(&account_info); assert!(result.is_err()); } + + // ----------------------------- + // Helpers for address tests + // ----------------------------- + + fn u256_to_32_be(x: U256) -> [u8; 32] { + x.to_be_bytes() + } + + fn be32_with_last_byte(v: u8) -> [u8; 32] { + let mut a = [0u8; 32]; + a[31] = v; + a + } + + // ----------------------------- + // TON / TVM address tests + // ----------------------------- + + #[test] + fn validate_tvm_address_accepts_len_36_nonzero_account_id() { + // 36-byte TON address raw format: + // [0] flags, [1] workchain_id, [2..34) account_id (32 bytes), [34..36) crc16 + let mut addr = [0u8; 36]; + addr[0] = 1; + addr[1] = 2; + addr[2] = 1; // make account_id non-zero + validate_tvm_address(&addr).unwrap(); + } + + #[test] + fn validate_tvm_address_rejects_wrong_len() { + let addr = [1u8; 35]; + assert_eq!( + validate_tvm_address(&addr).unwrap_err(), + CommonCcipError::InvalidTVMAddress.into() + ); + } + + #[test] + fn validate_tvm_address_rejects_zero_account_id() { + let mut addr = [0u8; 36]; + addr[0] = 1; + addr[1] = 2; + // account_id is all-zero + assert_eq!( + validate_tvm_address(&addr).unwrap_err(), + CommonCcipError::InvalidTVMAddress.into() + ); + } + + // ----------------------------- + // Aptos address tests + // ----------------------------- + + #[test] + fn validate_aptos_address_accepts_valid_ge_min() { + // exactly min + validate_aptos_address(&APTOS_PRECOMPILE_SPACE).unwrap(); + + // > min + let mut addr = APTOS_PRECOMPILE_SPACE; + addr[31] = 0x0c; + validate_aptos_address(&addr).unwrap(); + } + + #[test] + fn validate_aptos_address_rejects_wrong_len() { + let addr = [1u8; 31]; + assert_eq!( + validate_aptos_address(&addr).unwrap_err(), + CommonCcipError::InvalidAptosAddress.into() + ); + } + + #[test] + fn validate_aptos_address_rejects_zero_address() { + let addr = [0u8; 32]; + assert_eq!( + validate_aptos_address(&addr).unwrap_err(), + CommonCcipError::InvalidAptosAddress.into() + ); + } + + #[test] + fn validate_aptos_address_rejects_lower_than_min() { + // 0x0a < 0x0b + let addr = be32_with_last_byte(0x0a); + assert_eq!( + validate_aptos_address(&addr).unwrap_err(), + CommonCcipError::InvalidAptosAddress.into() + ); + } + + // ----------------------------- + // Sui address tests + // ----------------------------- + + #[test] + fn validate_sui_address_accepts_valid_ge_min() { + // exactly min + validate_sui_address(&SUI_PRECOMPILE_SPACE).unwrap(); + + // > min (increase last byte, staying >=) + let mut addr = SUI_PRECOMPILE_SPACE; + addr[31] = 0xea; + validate_sui_address(&addr).unwrap(); + } + + #[test] + fn validate_sui_address_rejects_wrong_len() { + let addr = [1u8; 31]; + assert_eq!( + validate_sui_address(&addr).unwrap_err(), + CommonCcipError::InvalidSuiAddress.into() + ); + } + + #[test] + fn validate_sui_address_rejects_zero_address() { + let addr = [0u8; 32]; + assert_eq!( + validate_sui_address(&addr).unwrap_err(), + CommonCcipError::InvalidSuiAddress.into() + ); + } + + #[test] + fn validate_sui_address_rejects_lower_than_min() { + // Make something just below 0xdee9: 0xdee8 + let mut addr = SUI_PRECOMPILE_SPACE; + addr[31] = 0xe8; + assert_eq!( + validate_sui_address(&addr).unwrap_err(), + CommonCcipError::InvalidSuiAddress.into() + ); + } + + // ----------------------------- + // EVM address tests + // ----------------------------- + + #[test] + fn validate_evm_address_accepts_valid_ge_min_and_le_u160max() { + // exactly min (1024) + validate_evm_address(&EVM_PRECOMPILE_SPACE).unwrap(); + + // > min but still small + let mut addr = EVM_PRECOMPILE_SPACE; + addr[31] = 0x01; // 0x0401 + validate_evm_address(&addr).unwrap(); + + // a high-but-valid 160-bit address: U160_MAX itself + let high = u256_to_32_be(U160_MAX); + validate_evm_address(&high).unwrap(); + } + + #[test] + fn validate_evm_address_rejects_wrong_len() { + let addr = [1u8; 31]; + assert_eq!( + validate_evm_address(&addr).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + } + + #[test] + fn validate_evm_address_rejects_zero_address() { + let addr = [0u8; 32]; + assert_eq!( + validate_evm_address(&addr).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + } + + #[test] + fn validate_evm_address_rejects_lower_than_min() { + // 1023 (0x03ff) is below 1024 + let addr = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0x03, 0xff, + ]; + assert_eq!( + validate_evm_address(&addr).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + + // also check something very small like 1 + let addr = be32_with_last_byte(1); + assert_eq!( + validate_evm_address(&addr).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + } + + #[test] + fn validate_evm_address_rejects_greater_than_u160max() { + // U160_MAX + 1 should fail the <= U160_MAX check + let too_big = u256_to_32_be(U160_MAX + U256::new(1)); + assert_eq!( + validate_evm_address(&too_big).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + + // also fail for something with non-zero in the top 96 bits (definitely > u160 max) + let mut definitely_too_big = [0u8; 32]; + definitely_too_big[0] = 1; // sets a high-order byte + definitely_too_big[31] = 0x10; // keep non-zero + assert_eq!( + validate_evm_address(&definitely_too_big).unwrap_err(), + CommonCcipError::InvalidEVMAddress.into() + ); + } + + // ----------------------------- + // SVM address tests (Solana) + // ----------------------------- + + #[test] + fn validate_svm_address_accepts_valid_pubkey_bytes() { + let pk = Pubkey::new_unique(); + validate_svm_address(pk.as_ref(), true).unwrap(); + } + + #[test] + fn validate_svm_address_rejects_wrong_len() { + let addr = [1u8; 31]; + assert_eq!( + validate_svm_address(&addr, true).unwrap_err(), + CommonCcipError::InvalidSVMAddress.into() + ); + } + + #[test] + fn validate_svm_address_rejects_all_zero() { + let addr = [0u8; 32]; + assert_eq!( + validate_svm_address(&addr, true).unwrap_err(), + CommonCcipError::InvalidSVMAddress.into() + ); + } } diff --git a/chains/solana/contracts/programs/ccip-offramp/Cargo.toml b/chains/solana/contracts/programs/ccip-offramp/Cargo.toml index 12bae28569..568cb82b31 100644 --- a/chains/solana/contracts/programs/ccip-offramp/Cargo.toml +++ b/chains/solana/contracts/programs/ccip-offramp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ccip_offramp" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -21,9 +21,13 @@ anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" bytemuck = "1.7" ethnum = "1.5" -fee_quoter = {path = "../fee-quoter", features = ["cpi"]} -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} -ccip_common = {path = "../ccip-common"} +fee_quoter = { version = "1.6.1", path = "../fee-quoter", features = [ + "cpi", +] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } [dev-dependencies] hex = "0.4.3" @@ -33,4 +37,7 @@ build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))', +] diff --git a/chains/solana/contracts/programs/ccip-router/Cargo.toml b/chains/solana/contracts/programs/ccip-router/Cargo.toml index e3123c299e..daa8a22a4b 100644 --- a/chains/solana/contracts/programs/ccip-router/Cargo.toml +++ b/chains/solana/contracts/programs/ccip-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ccip_router" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" build = "build.rs" @@ -22,9 +22,13 @@ anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" bytemuck = "1.7" ethnum = "1.5" -fee_quoter = {path = "../fee-quoter", features = ["cpi"]} -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} -ccip_common = {path = "../ccip-common"} +fee_quoter = { version = "1.6.1", path = "../fee-quoter", features = [ + "cpi", +] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } [dev-dependencies] hex = "0.4.3" @@ -34,4 +38,7 @@ build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/ccip-router/src/context.rs b/chains/solana/contracts/programs/ccip-router/src/context.rs index f1c1f0ab18..5e6bf68972 100644 --- a/chains/solana/contracts/programs/ccip-router/src/context.rs +++ b/chains/solana/contracts/programs/ccip-router/src/context.rs @@ -285,7 +285,7 @@ pub struct CcipSend<'info> { bump, constraint = valid_version(dest_chain_state.version, MAX_CHAINSTATE_V) @ CcipRouterError::InvalidVersion, )] - pub dest_chain_state: Box>, + pub dest_chain_state: Account<'info, DestChain>, /// CHECK this represents the PDA where the message counters are stored. As it may be initialized or not, /// and it may be in it's v1 or v2 form, it is an UncheckedAccount and the code handles all cases manually. diff --git a/chains/solana/contracts/programs/ccip-router/src/instructions/v1/onramp.rs b/chains/solana/contracts/programs/ccip-router/src/instructions/v1/onramp.rs index 302444da72..ffc72b9d68 100644 --- a/chains/solana/contracts/programs/ccip-router/src/instructions/v1/onramp.rs +++ b/chains/solana/contracts/programs/ccip-router/src/instructions/v1/onramp.rs @@ -296,11 +296,15 @@ impl OnRamp for Impl { let message_id = &helpers::hash(&new_message); new_message.header.message_id.clone_from(message_id); - emit!(events::CCIPMessageSent { + let ccip_message_sent_event = events::CCIPMessageSent { dest_chain_selector, sequence_number: new_message.header.sequence_number, message: new_message, - }); + }; + + emit!(ccip_message_sent_event); + + helpers::rmn_emit_cpi_event(&ctx, ccip_message_sent_event)?; Ok(*message_id) } @@ -366,10 +370,14 @@ impl OnRamp for Impl { } mod helpers { - use anchor_lang::system_program; + use anchor_lang::{system_program, Event}; use ccip_common::{ - v1::{validate_evm_address, validate_svm_address}, - CommonCcipError, CHAIN_FAMILY_SELECTOR_EVM, CHAIN_FAMILY_SELECTOR_SVM, + v1::{ + validate_aptos_address, validate_evm_address, validate_sui_address, + validate_svm_address, validate_tvm_address, + }, + CommonCcipError, CHAIN_FAMILY_SELECTOR_APTOS, CHAIN_FAMILY_SELECTOR_EVM, + CHAIN_FAMILY_SELECTOR_SUI, CHAIN_FAMILY_SELECTOR_SVM, CHAIN_FAMILY_SELECTOR_TVM, }; use rmn_remote::state::CurseSubject; @@ -395,6 +403,23 @@ mod helpers { ) } + pub(super) fn rmn_emit_cpi_event<'info>( + ctx: &Context<'_, '_, 'info, 'info, CcipSend<'_>>, + event: events::CCIPMessageSent, + ) -> Result<()> { + let cpi_program = ctx.accounts.rmn_remote.to_account_info(); + let cpi_accounts = rmn_remote::cpi::accounts::CpiEvent { + config: ctx.accounts.rmn_remote_config.to_account_info(), + // Re-using the signer from the FQ calls for backwards-compatibility, so we don't introduce + // a new account that might break existing user integrations to send messages. + authority: ctx.accounts.fee_billing_signer.to_account_info(), + }; + let seeds = &[seed::FEE_BILLING_SIGNER, &[ctx.bumps.fee_billing_signer]]; + let signer_seeds = &[&seeds[..]]; + let cpi_context = CpiContext::new_with_signer(cpi_program, cpi_accounts, signer_seeds); + rmn_remote::cpi::cpi_event(cpi_context, event.data()) + } + pub(super) fn token_transfer( lock_or_burn_out_data: LockOrBurnOutV1, source_pool_address: Pubkey, @@ -582,8 +607,11 @@ mod helpers { ) -> Result<()> { let selector = u32::from_be_bytes(chain_family_selector); match selector { + CHAIN_FAMILY_SELECTOR_APTOS => validate_aptos_address(dest_token_address), CHAIN_FAMILY_SELECTOR_EVM => validate_evm_address(dest_token_address), + CHAIN_FAMILY_SELECTOR_SUI => validate_sui_address(dest_token_address), CHAIN_FAMILY_SELECTOR_SVM => validate_svm_address(dest_token_address, true), + CHAIN_FAMILY_SELECTOR_TVM => validate_tvm_address(dest_token_address), _ => Err(CommonCcipError::InvalidChainFamilySelector.into()), } } @@ -720,5 +748,15 @@ mod helpers { CcipRouterError::SourceTokenDataTooLarge.into() ); } + + #[test] + fn validate_transfer_dest_address_rejects_unknown_selector() { + let selector = [0u8; 4]; + let addr = [1u8; 32]; + assert_eq!( + validate_transfer_dest_address(selector, &addr).unwrap_err(), + CommonCcipError::InvalidChainFamilySelector.into() + ); + } } } diff --git a/chains/solana/contracts/programs/cctp-token-pool/Cargo.toml b/chains/solana/contracts/programs/cctp-token-pool/Cargo.toml index d8b0533ded..fcefd6aa5a 100644 --- a/chains/solana/contracts/programs/cctp-token-pool/Cargo.toml +++ b/chains/solana/contracts/programs/cctp-token-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cctp-token-pool" -version = "1.6.0" +version = "1.6.1" description = "USDC Token Pool for CCIP utilizing CCTP" edition = "2021" @@ -18,8 +18,10 @@ default = [] [dependencies] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" -base-token-pool = { version = "1.6.0", path = "../base-token-pool/", features = ["no-entrypoint"] } -ccip_common = {path = "../ccip-common"} +base-token-pool = { version = "1.6.1", path = "../base-token-pool/", features = [ + "no-entrypoint", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } solana-program = "1.17.25" [build-dependencies] @@ -27,4 +29,7 @@ build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))', +] diff --git a/chains/solana/contracts/programs/example-ccip-sender/Cargo.toml b/chains/solana/contracts/programs/example-ccip-sender/Cargo.toml index eaa390d154..74e9675dba 100644 --- a/chains/solana/contracts/programs/example-ccip-sender/Cargo.toml +++ b/chains/solana/contracts/programs/example-ccip-sender/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "example_ccip_sender" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -20,9 +20,14 @@ custom-heap = [] solana-program = "1.17.25" # pin solana to 1.17 anchor-lang = { version = "0.29.0", features = [] } anchor-spl = "0.29.0" -ccip_router = { version = "0.1.1", path = "../ccip-router", features = ["no-entrypoint"]} +ccip_router = { version = "1.6.1", path = "../ccip-router", features = [ + "no-entrypoint", +] } smalloc = "0.1.2" [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/fee-quoter/Cargo.toml b/chains/solana/contracts/programs/fee-quoter/Cargo.toml index f1f8aa86f8..010b98528a 100644 --- a/chains/solana/contracts/programs/fee-quoter/Cargo.toml +++ b/chains/solana/contracts/programs/fee-quoter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fee_quoter" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -16,12 +16,12 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -solana-program = "1.17.25" # pin solana to 1.17 +solana-program = "1.17.25" # pin solana to 1.17 anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" bytemuck = "1.7" ethnum = "1.5" -ccip_common = {path = "../ccip-common"} +ccip_common = { version = "1.6.1", path = "../ccip-common" } [dev-dependencies] hex = "0.4.3" @@ -31,4 +31,7 @@ build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))', +] diff --git a/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/admin.rs b/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/admin.rs index 9d65f9021b..f056c1b252 100644 --- a/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/admin.rs +++ b/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/admin.rs @@ -1,6 +1,9 @@ use anchor_lang::prelude::*; -use ccip_common::{CommonCcipError, CHAIN_FAMILY_SELECTOR_EVM, CHAIN_FAMILY_SELECTOR_SVM}; +use ccip_common::{ + CommonCcipError, CHAIN_FAMILY_SELECTOR_APTOS, CHAIN_FAMILY_SELECTOR_EVM, + CHAIN_FAMILY_SELECTOR_SUI, CHAIN_FAMILY_SELECTOR_SVM, CHAIN_FAMILY_SELECTOR_TVM, +}; use crate::context::{ AcceptOwnership, AddBillingTokenConfig, AddDestChain, AddPriceUpdater, RemovePriceUpdater, @@ -302,10 +305,71 @@ fn validate_dest_chain_config(dest_chain_selector: u64, config: &DestChainConfig require!( matches!( u32::from_be_bytes(config.chain_family_selector), - CHAIN_FAMILY_SELECTOR_EVM | CHAIN_FAMILY_SELECTOR_SVM + CHAIN_FAMILY_SELECTOR_APTOS + | CHAIN_FAMILY_SELECTOR_EVM + | CHAIN_FAMILY_SELECTOR_SUI + | CHAIN_FAMILY_SELECTOR_SVM + | CHAIN_FAMILY_SELECTOR_TVM ), CommonCcipError::InvalidChainFamilySelector ); Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + use crate::instructions::v1::messages::tests::sample_dest_chain; + + #[test] + fn validate_dest_chain_config_rejects_unknown_selector() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = [0u8; 4]; + + assert_eq!( + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap_err(), + CommonCcipError::InvalidChainFamilySelector.into() + ); + } + + #[test] + fn validate_dest_chain_config_accepts_tvm() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_TVM.to_be_bytes(); + + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap(); + } + + #[test] + fn validate_dest_chain_config_accepts_aptos() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_APTOS.to_be_bytes(); + + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap(); + } + + #[test] + fn validate_dest_chain_config_accepts_evm() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_EVM.to_be_bytes(); + + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap(); + } + + #[test] + fn validate_dest_chain_config_accepts_sui() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_SUI.to_be_bytes(); + + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap(); + } + + #[test] + fn validate_dest_chain_config_accepts_svm() { + let mut dest_chain = sample_dest_chain(); + dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_SVM.to_be_bytes(); + + validate_dest_chain_config(dest_chain.chain_selector, &dest_chain.config).unwrap(); + } +} diff --git a/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/messages.rs b/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/messages.rs index 75d1686e02..2c360482c8 100644 --- a/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/messages.rs +++ b/chains/solana/contracts/programs/fee-quoter/src/instructions/v1/messages.rs @@ -1,7 +1,13 @@ use anchor_lang::prelude::*; -use ccip_common::v1::{validate_evm_address, validate_svm_address}; -use ccip_common::{CommonCcipError, CHAIN_FAMILY_SELECTOR_EVM, CHAIN_FAMILY_SELECTOR_SVM}; +use ccip_common::v1::{ + validate_aptos_address, validate_evm_address, validate_sui_address, validate_svm_address, + validate_tvm_address, +}; +use ccip_common::{ + CommonCcipError, CHAIN_FAMILY_SELECTOR_APTOS, CHAIN_FAMILY_SELECTOR_EVM, + CHAIN_FAMILY_SELECTOR_SUI, CHAIN_FAMILY_SELECTOR_SVM, CHAIN_FAMILY_SELECTOR_TVM, +}; use crate::extra_args::{ GenericExtraArgsV2, SVMExtraArgsV1, GENERIC_EXTRA_ARGS_V2_TAG, SVM_EXTRA_ARGS_MAX_ACCOUNTS, @@ -69,10 +75,13 @@ fn validate_dest_family_address( ) -> Result<()> { let selector = u32::from_be_bytes(chain_family_selector); match selector { + CHAIN_FAMILY_SELECTOR_APTOS => validate_aptos_address(&msg.receiver), CHAIN_FAMILY_SELECTOR_EVM => validate_evm_address(&msg.receiver), + CHAIN_FAMILY_SELECTOR_SUI => validate_sui_address(&msg.receiver), CHAIN_FAMILY_SELECTOR_SVM => { validate_svm_address(&msg.receiver, msg_extra_args.gas_limit > 0) } + CHAIN_FAMILY_SELECTOR_TVM => validate_tvm_address(&msg.receiver), _ => Err(CommonCcipError::InvalidChainFamilySelector.into()), } } @@ -326,55 +335,72 @@ pub mod tests { } #[test] - fn process_extra_args_matches_family() { + fn process_extra_args_matches_family_evm_and_unknown() { let evm_dest_chain = sample_dest_chain(); + let mut none_dest_chain = sample_dest_chain(); + none_dest_chain.config.chain_family_selector = [0; 4]; + + let svm_tag_bytes = SVM_EXTRA_ARGS_V1_TAG.to_be_bytes().to_vec(); + + // EVM behaves like generic. + assert_generic_family_behaviour(&evm_dest_chain, &svm_tag_bytes); + + // Unknown family selector also behaves like generic. + assert_generic_family_behaviour(&none_dest_chain, &svm_tag_bytes); + } + + #[test] + fn process_extra_args_matches_family_svm() { let mut svm_dest_chain = sample_dest_chain(); svm_dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_SVM.to_be_bytes(); - let evm_tag_bytes = GENERIC_EXTRA_ARGS_V2_TAG.to_be_bytes().to_vec(); + + let generic_tag_bytes = GENERIC_EXTRA_ARGS_V2_TAG.to_be_bytes().to_vec(); + assert_svm_family_behaviour(&svm_dest_chain, &generic_tag_bytes); + } + + #[test] + fn process_extra_args_matches_family_tvm() { + let mut tvm_dest_chain = sample_dest_chain(); + tvm_dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_TVM.to_be_bytes(); + let svm_tag_bytes = SVM_EXTRA_ARGS_V1_TAG.to_be_bytes().to_vec(); - let mut none_dest_chain = sample_dest_chain(); - none_dest_chain.config.chain_family_selector = [0; 4]; + assert_generic_family_behaviour(&tvm_dest_chain, &svm_tag_bytes); + } + + #[test] + fn process_extra_args_matches_family_aptos() { + let mut aptos_dest_chain = sample_dest_chain(); + aptos_dest_chain.config.chain_family_selector = CHAIN_FAMILY_SELECTOR_APTOS.to_be_bytes(); + + let svm_tag_bytes = SVM_EXTRA_ARGS_V1_TAG.to_be_bytes().to_vec(); + assert_generic_family_behaviour(&aptos_dest_chain, &svm_tag_bytes); + } + + fn assert_generic_family_behaviour(dest_chain: &DestChain, other_family_tag: &[u8]) { + let generic_tag_bytes = GENERIC_EXTRA_ARGS_V2_TAG.to_be_bytes().to_vec(); - // evm - tag but no data fails + // tag but no data fails assert_eq!( - process_extra_args(&evm_dest_chain.config, &evm_tag_bytes, false).unwrap_err(), + process_extra_args(&dest_chain.config, &generic_tag_bytes, false).unwrap_err(), FeeQuoterError::InvalidInputsMissingDataAfterExtraArgs.into() ); - // evm - default case: (no data or tag) - let extra_args = process_extra_args(&evm_dest_chain.config, &[], false).unwrap(); + // default case: (no data or tag) + let extra_args = process_extra_args(&dest_chain.config, &[], false).unwrap(); assert_eq!( extra_args.bytes[..4], GENERIC_EXTRA_ARGS_V2_TAG.to_be_bytes() ); assert_eq!( extra_args.gas_limit, - evm_dest_chain.config.default_tx_gas_limit as u128 + dest_chain.config.default_tx_gas_limit as u128 ); assert!(!extra_args.allow_out_of_order_execution); - - // evm - passed in data - let extra_args = process_extra_args( - &evm_dest_chain.config, - &GenericExtraArgsV2 { - gas_limit: 100, - allow_out_of_order_execution: true, - } - .serialize_with_tag(), - false, - ) - .unwrap(); - assert_eq!( - extra_args.bytes[..4], - GENERIC_EXTRA_ARGS_V2_TAG.to_be_bytes() - ); - assert_eq!(extra_args.gas_limit, 100); - assert!(extra_args.allow_out_of_order_execution); assert_eq!(extra_args.token_receiver, None); - // unknown family - uses generic (same as evm) tag + // passed in data let extra_args = process_extra_args( - &none_dest_chain.config, + &dest_chain.config, &GenericExtraArgsV2 { gas_limit: 100, allow_out_of_order_execution: true, @@ -391,13 +417,17 @@ pub mod tests { assert!(extra_args.allow_out_of_order_execution); assert_eq!(extra_args.token_receiver, None); - // evm - fail to match + // fail to match an unrelated family's tag assert_eq!( - process_extra_args(&evm_dest_chain.config, &svm_tag_bytes, false).unwrap_err(), + process_extra_args(&dest_chain.config, other_family_tag, false).unwrap_err(), FeeQuoterError::InvalidExtraArgsTag.into() ); + } + + fn assert_svm_family_behaviour(svm_dest_chain: &DestChain, generic_tag_bytes: &[u8]) { + let svm_tag_bytes = SVM_EXTRA_ARGS_V1_TAG.to_be_bytes().to_vec(); - // svm - default case + // default case requires the SVM tag bytes let extra_args = process_extra_args(&svm_dest_chain.config, &svm_tag_bytes, false).unwrap(); assert_eq!(extra_args.bytes[..4], SVM_EXTRA_ARGS_V1_TAG.to_be_bytes()); assert_eq!( @@ -408,19 +438,19 @@ pub mod tests { assert_eq!(extra_args.token_receiver, None); assert!(!extra_args.allow_out_of_order_execution); - // svm - empty tag (no data) fails + // empty tag (no data) fails assert_eq!( process_extra_args(&svm_dest_chain.config, &[], false).unwrap_err(), FeeQuoterError::InvalidInputsMissingExtraArgs.into() ); - // svm - contains tokens but no receiver address + // contains tokens but no receiver address assert_eq!( process_extra_args(&svm_dest_chain.config, &svm_tag_bytes, true).unwrap_err(), FeeQuoterError::InvalidTokenReceiver.into(), ); - // svm - passed in data + // passed in data let token_receiver = Pubkey::try_from("DS2tt4BX7YwCw7yrDNwbAdnYrxjeCPeGJbHmZEYC8RTa") .unwrap() .to_bytes(); @@ -445,9 +475,9 @@ pub mod tests { assert_eq!(extra_args.token_receiver, Some(token_receiver.to_vec())); assert!(extra_args.allow_out_of_order_execution); - // svm - fail to match + // fail to match generic tag assert_eq!( - process_extra_args(&svm_dest_chain.config, &evm_tag_bytes, false).unwrap_err(), + process_extra_args(&svm_dest_chain.config, generic_tag_bytes, false).unwrap_err(), FeeQuoterError::InvalidExtraArgsTag.into() ); } diff --git a/chains/solana/contracts/programs/lockrelease-token-pool/Cargo.toml b/chains/solana/contracts/programs/lockrelease-token-pool/Cargo.toml index 968153ae88..0fb6e0ebdc 100644 --- a/chains/solana/contracts/programs/lockrelease-token-pool/Cargo.toml +++ b/chains/solana/contracts/programs/lockrelease-token-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lockrelease-token-pool" -version = "1.6.0" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -19,14 +19,21 @@ default = [] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" solana-program = "1.17.25" # pin solana to 1.17 -spl-math = { version = "0.2.0", features = [ "no-entrypoint" ] } -base-token-pool = { version = "1.6.0", path = "../base-token-pool/", features = ["no-entrypoint"] } -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} -ccip_common = {path = "../ccip-common"} +spl-math = { version = "0.2.0", features = ["no-entrypoint"] } +base-token-pool = { version = "1.6.1", path = "../base-token-pool/", features = [ + "no-entrypoint", +] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } [build-dependencies] build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/ping-pong-demo/Cargo.toml b/chains/solana/contracts/programs/ping-pong-demo/Cargo.toml index 2b4377bcc4..d0d8b17588 100644 --- a/chains/solana/contracts/programs/ping-pong-demo/Cargo.toml +++ b/chains/solana/contracts/programs/ping-pong-demo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ping_pong_demo" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -19,12 +19,19 @@ default = [] solana-program = "1.17.25" # pin solana to 1.17 anchor-lang = { version = "0.29.0", features = [] } anchor-spl = "0.29.0" -example_ccip_receiver = { path = "../example-ccip-receiver", features = ["no-entrypoint"]} -ccip_router = { path = "../ccip-router", features = ["cpi"] } +example_ccip_receiver = { path = "../example-ccip-receiver", features = [ + "no-entrypoint", +] } +ccip_router = { version = "1.6.1", path = "../ccip-router", features = [ + "cpi", +] } [build-dependencies] build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))', +] diff --git a/chains/solana/contracts/programs/rmn-remote/Cargo.toml b/chains/solana/contracts/programs/rmn-remote/Cargo.toml index c89cbb9fe8..4c4de1d080 100644 --- a/chains/solana/contracts/programs/rmn-remote/Cargo.toml +++ b/chains/solana/contracts/programs/rmn-remote/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rmn_remote" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -18,11 +18,14 @@ default = [] [dependencies] anchor-lang = "0.29.0" bytemuck = "1.7" -ccip_common = {path = "../ccip-common"} +ccip_common = { version = "1.6.1", path = "../ccip-common" } [build-dependencies] build_commit = { path = "../../crates/build-commit" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic"))', +] diff --git a/chains/solana/contracts/programs/rmn-remote/src/config.rs b/chains/solana/contracts/programs/rmn-remote/src/config.rs new file mode 100644 index 0000000000..a26387ccc0 --- /dev/null +++ b/chains/solana/contracts/programs/rmn-remote/src/config.rs @@ -0,0 +1,71 @@ +use std::cell::Ref; + +use anchor_lang::prelude::*; +use anchor_lang::Discriminator; + +use crate::context::ANCHOR_DISCRIMINATOR; +use crate::state::{CodeVersion, Config}; +use crate::RmnRemoteError; + +#[derive(AnchorDeserialize, InitSpace, Debug)] +pub(super) struct ConfigV1 { + pub version: u8, + pub owner: Pubkey, + + pub proposed_owner: Pubkey, + pub default_code_version: CodeVersion, +} + +impl TryFrom for Config { + type Error = anchor_lang::error::Error; + + fn try_from(v1: ConfigV1) -> std::result::Result { + require_eq!( + v1.version, + 1, // this deserialization is only valid for v1 + RmnRemoteError::InvalidInputsConfigAccount + ); + + Ok(Config { + version: 1, + owner: v1.owner, + proposed_owner: v1.proposed_owner, + default_code_version: v1.default_code_version, + event_authorities: vec![], // this is not part of the v1 data, it defaults to empty + }) + } +} + +pub(super) fn load_config(config: &AccountInfo<'_>) -> Result { + let borrowed_data = config.try_borrow_data()?; + let (discriminator, data) = borrowed_data.split_at(ANCHOR_DISCRIMINATOR); + + require!( + Config::DISCRIMINATOR == discriminator, + RmnRemoteError::InvalidInputsConfigAccount + ); + + let version_byte = data[0]; // version is the first byte of the data (after the discriminator) + + const V1_SPACE: usize = ANCHOR_DISCRIMINATOR + ConfigV1::INIT_SPACE; + if config.data_len() == V1_SPACE && version_byte == 1 { + let config_v1 = load_config_v1_unchecked(borrowed_data)?; + return Config::try_from(config_v1); + } + + // Use >= for the size because the event_authorities vec makes the size variable + const V2_MIN_SPACE: usize = ANCHOR_DISCRIMINATOR + Config::INIT_SPACE; + if config.data_len() >= V2_MIN_SPACE && version_byte == 2 { + let mut data: &[u8] = &borrowed_data; + return Config::try_deserialize(&mut data); + } + + Err(RmnRemoteError::InvalidInputsConfigAccount.into()) +} + +pub(super) fn load_config_v1_unchecked(borrowed_data: Ref<&mut [u8]>) -> Result { + let (_discriminator, data) = borrowed_data.split_at(ANCHOR_DISCRIMINATOR); + let config_v1 = ConfigV1::deserialize(&mut &data[..]) + .map_err(|_| RmnRemoteError::InvalidInputsConfigAccount)?; + Ok(config_v1) +} diff --git a/chains/solana/contracts/programs/rmn-remote/src/context.rs b/chains/solana/contracts/programs/rmn-remote/src/context.rs index def945e2ac..15a71cf601 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/context.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/context.rs @@ -12,13 +12,17 @@ pub fn valid_version(v: u8, max_v: u8) -> bool { !uninitialized(v) && v <= max_v } +pub fn version_in_range(v: u8, min_v: u8, max_v: u8) -> bool { + min_v <= v && v <= max_v +} + pub fn uninitialized(v: u8) -> bool { v == 0 } /// Maximum acceptable config version accepted by this module: any accounts with higher /// version numbers than this will be rejected. -pub const MAX_CONFIG_V: u8 = 1; +pub const MAX_CONFIG_V: u8 = 2; pub const MAX_CURSES_V: u8 = 1; #[derive(Accounts)] @@ -82,6 +86,44 @@ pub struct UpdateConfig<'info> { pub authority: Signer<'info>, } +#[derive(Accounts)] +#[instruction(new_event_authorities: Vec)] +pub struct UpdateEventAuthorities<'info> { + #[account( + mut, + seeds = [seed::CONFIG], + bump, + constraint = version_in_range(config.version, 2, MAX_CONFIG_V) @ RmnRemoteError::InvalidVersion, + realloc = ANCHOR_DISCRIMINATOR + Config::dynamic_len(new_event_authorities.len()), + realloc::payer = authority, + realloc::zero = false, + )] + pub config: Account<'info, Config>, + + #[account(mut, address = config.owner @ RmnRemoteError::Unauthorized)] + pub authority: Signer<'info>, + + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct MigrateConfigV1ToV2<'info> { + #[account( + mut, + seeds = [seed::CONFIG], + bump, + owner = crate::ID, // check it is initialized + )] + /// CHECK: using Unchecked as it is being extended in-place and the Config struct already + /// has the new property in it, so it can't be deserialized as Config before the migration has happened. + pub config: UncheckedAccount<'info>, + + #[account(mut)] + pub authority: Signer<'info>, + + pub system_program: Program<'info, System>, +} + #[derive(Accounts)] pub struct AcceptOwnership<'info> { #[account( @@ -163,7 +205,24 @@ pub struct InspectCurses<'info> { #[account( seeds = [seed::CONFIG], bump, - constraint = valid_version(config.version, MAX_CONFIG_V) @ RmnRemoteError::InvalidVersion, + owner = crate::ID, // check it is initialized, can be removed when using Account<'info, Config> + )] + /// CHECK: using UncheckedAccount to allow no-downtime during config upgrade, so load using load_config method. + /// After the upgrade is made, this can be changed to Account<'info, Config>. + pub config: UncheckedAccount<'info>, +} + +#[derive(Accounts)] +pub struct CpiEvent<'info> { + #[account( + seeds = [seed::CONFIG], + bump, + constraint = version_in_range(config.version, 2, MAX_CONFIG_V) @ RmnRemoteError::InvalidVersion, )] pub config: Account<'info, Config>, + + #[account( + constraint = config.event_authorities.contains(authority.key) @ RmnRemoteError::Unauthorized, + )] + pub authority: Signer<'info>, } diff --git a/chains/solana/contracts/programs/rmn-remote/src/event.rs b/chains/solana/contracts/programs/rmn-remote/src/event.rs index 6d3ef39c29..d3ef7b8410 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/event.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/event.rs @@ -28,3 +28,8 @@ pub struct SubjectCursed { pub struct SubjectUncursed { pub subject: CurseSubject, } + +#[event] +pub struct EventAuthoritiesSet { + pub event_authorities: Vec, +} diff --git a/chains/solana/contracts/programs/rmn-remote/src/instructions/interfaces.rs b/chains/solana/contracts/programs/rmn-remote/src/instructions/interfaces.rs index 0854d61db3..92d93bc1e7 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/instructions/interfaces.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/instructions/interfaces.rs @@ -1,11 +1,13 @@ use anchor_lang::prelude::*; -use crate::{ - state::CodeVersion, AcceptOwnership, Curse, CurseSubject, InspectCurses, Uncurse, UpdateConfig, -}; +use crate::context::{MigrateConfigV1ToV2, UpdateEventAuthorities}; +use crate::state::CodeVersion; +use crate::{AcceptOwnership, Curse, CurseSubject, InspectCurses, Uncurse, UpdateConfig}; pub trait Public { fn verify_not_cursed(&self, ctx: Context, subject: CurseSubject) -> Result<()>; + + fn migrate_config_v1_to_v2(&self, ctx: Context) -> Result<()>; } pub trait Admin { @@ -21,4 +23,10 @@ pub trait Admin { fn curse(&self, ctx: Context, subject: CurseSubject) -> Result<()>; fn uncurse(&self, ctx: Context, subject: CurseSubject) -> Result<()>; + + fn set_event_authorities( + &self, + ctx: Context, + new_event_authorities: Vec, + ) -> Result<()>; } diff --git a/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/admin.rs b/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/admin.rs index ed4d419c2c..c81895719e 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/admin.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/admin.rs @@ -1,9 +1,11 @@ use anchor_lang::prelude::*; +use crate::context::UpdateEventAuthorities; +use crate::event::EventAuthoritiesSet; +use crate::instructions::interfaces::Admin; use crate::{ - instructions::interfaces::Admin, AcceptOwnership, CodeVersion, ConfigSet, Curse, CurseSubject, - OwnershipTransferRequested, OwnershipTransferred, RmnRemoteError, SubjectCursed, - SubjectUncursed, Uncurse, UpdateConfig, + AcceptOwnership, CodeVersion, ConfigSet, Curse, CurseSubject, OwnershipTransferRequested, + OwnershipTransferred, RmnRemoteError, SubjectCursed, SubjectUncursed, Uncurse, UpdateConfig, }; pub struct Impl; @@ -83,4 +85,17 @@ impl Admin for Impl { emit!(SubjectUncursed { subject }); Ok(()) } + + fn set_event_authorities( + &self, + ctx: Context, + new_event_authorities: Vec, + ) -> Result<()> { + ctx.accounts.config.event_authorities = new_event_authorities; + emit!(EventAuthoritiesSet { + event_authorities: ctx.accounts.config.event_authorities.clone(), + }); + + Ok(()) + } } diff --git a/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/public.rs b/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/public.rs index 579426bd8f..4515db99ac 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/public.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/instructions/v1/public.rs @@ -1,8 +1,12 @@ use anchor_lang::prelude::*; +use anchor_lang::system_program; -use crate::{ - instructions::interfaces::Public, CurseSubject, Curses, InspectCurses, RmnRemoteError, -}; +use crate::config::load_config_v1_unchecked; +use crate::config::ConfigV1; +use crate::context::{MigrateConfigV1ToV2, ANCHOR_DISCRIMINATOR}; +use crate::instructions::interfaces::Public; +use crate::state::Config; +use crate::{CurseSubject, Curses, InspectCurses, RmnRemoteError}; pub struct Impl; @@ -23,6 +27,57 @@ impl Public for Impl { ); Ok(()) } + + fn migrate_config_v1_to_v2(&self, ctx: Context) -> Result<()> { + let required_v2_space = ANCHOR_DISCRIMINATOR + Config::INIT_SPACE; + let minimum_balance = Rent::get()?.minimum_balance(required_v2_space); + + let account_info = &ctx.accounts.config.to_account_info(); + + require_eq!( + account_info.data_len(), + ANCHOR_DISCRIMINATOR + ConfigV1::INIT_SPACE, // it's v1 space + RmnRemoteError::InvalidInputsConfigAccount + ); + + // Extend the account + msg!("Extending RMNRemote Config account..."); + let current_lamports = account_info.lamports(); + if current_lamports < minimum_balance { + system_program::transfer( + CpiContext::new( + ctx.accounts.system_program.to_account_info(), + system_program::Transfer { + from: ctx.accounts.authority.to_account_info(), + to: account_info.clone(), + }, + ), + minimum_balance.checked_sub(current_lamports).unwrap(), + )?; + } + account_info.realloc(required_v2_space, false)?; + + // Set the new values + msg!("Loading config V1..."); + let config_v1 = load_config_v1_unchecked(account_info.try_borrow_data()?)?; + msg!("Read config V1: {:?}", config_v1); + require_eq!( + config_v1.version, + 1, // confirm it was v1 + RmnRemoteError::InvalidInputsConfigAccount + ); + + let mut config: Config = config_v1.try_into()?; + + config.version = 2; // migrate to version 2 + config.event_authorities = vec![]; // backwards-compatible default, so the migration can be permissionless + + // Write back to permanent state + msg!("Writing migrated RMNRemote Config v2 to account..."); + config.try_serialize(&mut &mut ctx.accounts.config.try_borrow_mut_data()?[..])?; + + Ok(()) + } } fn is_subject_cursed(curses: &Curses, subject: CurseSubject) -> bool { diff --git a/chains/solana/contracts/programs/rmn-remote/src/lib.rs b/chains/solana/contracts/programs/rmn-remote/src/lib.rs index 7462bf21eb..0c7f1f6aec 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/lib.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/lib.rs @@ -13,6 +13,9 @@ use event::*; mod instructions; +mod config; +use config::*; + #[program] pub mod rmn_remote { use instructions::router; @@ -29,9 +32,10 @@ pub mod rmn_remote { pub fn initialize(ctx: Context) -> Result<()> { ctx.accounts.config.set_inner(Config { owner: ctx.accounts.authority.key(), - version: 1, + version: 2, proposed_owner: Pubkey::default(), default_code_version: CodeVersion::V1, + event_authorities: vec![], }); ctx.accounts.curses.version = 1; @@ -121,6 +125,21 @@ pub mod rmn_remote { router::admin(ctx.accounts.config.default_code_version).uncurse(ctx, subject) } + /// Overwrites the list of addresses authorized to invoke the `cpi_event` instruction. + /// + /// Only the CCIP Admin may perform this operation. + /// + /// # Arguments + /// * `ctx` - The context containing the accounts required for updating event authorities. + /// * `new_event_authorities` - The new list of event authority public keys. + pub fn set_event_authorities( + ctx: Context, + new_event_authorities: Vec, + ) -> Result<()> { + let code_version = ctx.accounts.config.default_code_version; + router::admin(code_version).set_event_authorities(ctx, new_event_authorities) + } + /// Verifies that the subject is not cursed AND that this chain is not globally cursed. /// In case either of those assumptions fail, the instruction reverts. /// @@ -129,8 +148,39 @@ pub mod rmn_remote { /// * `ctx` - The context containing the accounts required to inspect curses. /// * `subject` - The subject to verify. Note that this instruction will revert if the chain /// is globally cursed too, even if the provided subject is not explicitly cursed. - pub fn verify_not_cursed(ctx: Context, subject: CurseSubject) -> Result<()> { - router::public(ctx.accounts.config.default_code_version).verify_not_cursed(ctx, subject) + pub fn verify_not_cursed<'info>( + ctx: Context<'_, '_, 'info, 'info, InspectCurses<'info>>, + subject: CurseSubject, + ) -> Result<()> { + let code_version = load_config(&ctx.accounts.config)?.default_code_version; + router::public(code_version).verify_not_cursed(ctx, subject) + } + + /// Backwards-compatible way of implementing CPI events without other contracts needing to + /// add more accounts to make a self-CPI. Calls made to this instruction include the event data + /// in the instruction data, so offchain code can inspect it. + /// + /// Only event authorities can invoke this instruction. While there is basic onchain + /// authorization, the offchain is still expected to check the caller program to attribute the + /// event to it, as this method may be invoked by more than one program so that it can be reused. + /// + /// # Arguments + /// * `_ctx` - The context containing the accounts required for the CPI event. + /// * `_event_data` - The raw event data to be emitted. + pub fn cpi_event(_ctx: Context, _event_data: Vec) -> Result<()> { + // all validations happen in the context constraints + Ok(()) + } + + /// Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state + /// from v1 to v2. This is a permissionless operation, as the default values set for the new + /// v2 fields are backwards-compatible and safe. + /// # Arguments + /// + /// * `ctx` - The context containing the accounts required for the migration. + pub fn migrate_config_v1_to_v2(ctx: Context) -> Result<()> { + let code_version = load_config(&ctx.accounts.config)?.default_code_version; + router::public(code_version).migrate_config_v1_to_v2(ctx) } } @@ -156,4 +206,6 @@ pub enum RmnRemoteError { InvalidCodeVersion, #[msg("Proposed owner is the default pubkey")] DefaultOwnerProposal, + #[msg("Config account has invalid space, data, or shape")] + InvalidInputsConfigAccount, } diff --git a/chains/solana/contracts/programs/rmn-remote/src/state.rs b/chains/solana/contracts/programs/rmn-remote/src/state.rs index cddb70f135..91df75d520 100644 --- a/chains/solana/contracts/programs/rmn-remote/src/state.rs +++ b/chains/solana/contracts/programs/rmn-remote/src/state.rs @@ -1,6 +1,7 @@ use std::fmt::Display; use anchor_lang::prelude::*; +use anchor_lang::solana_program::pubkey::PUBKEY_BYTES; /// Abstract curse subject. /// @@ -61,6 +62,15 @@ pub struct Config { pub proposed_owner: Pubkey, pub default_code_version: CodeVersion, + + #[max_len(0)] // just for INIT_SPACE calculation + pub event_authorities: Vec, +} + +impl Config { + pub fn dynamic_len(event_authorities_len: usize) -> usize { + Config::INIT_SPACE + event_authorities_len * PUBKEY_BYTES + } } #[account] diff --git a/chains/solana/contracts/programs/test-token-pool/Cargo.toml b/chains/solana/contracts/programs/test-token-pool/Cargo.toml index 284251c71f..df3d67c8ff 100644 --- a/chains/solana/contracts/programs/test-token-pool/Cargo.toml +++ b/chains/solana/contracts/programs/test-token-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-token-pool" -version = "0.1.1" +version = "1.6.1" description = "Created with Anchor" edition = "2021" @@ -19,13 +19,24 @@ default = [] anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } anchor-spl = "0.29.0" solana-program = "1.17.25" # pin solana to 1.17 -spl-math = { version = "0.2.0", features = [ "no-entrypoint" ] } -base-token-pool = { version = "1.6.0", path = "../base-token-pool/", features = ["no-entrypoint"] } -burnmint-token-pool = { version = "1.6.0", path = "../burnmint-token-pool", features = ["no-entrypoint"] } -lockrelease-token-pool = { version = "1.6.0", path = "../lockrelease-token-pool", features = ["no-entrypoint"] } -rmn_remote = {path = "../rmn-remote", features = ["cpi"]} -ccip_common = {path = "../ccip-common"} +spl-math = { version = "0.2.0", features = ["no-entrypoint"] } +base-token-pool = { version = "1.6.1", path = "../base-token-pool/", features = [ + "no-entrypoint", +] } +burnmint-token-pool = { version = "1.6.1", path = "../burnmint-token-pool", features = [ + "no-entrypoint", +] } +lockrelease-token-pool = { version = "1.6.1", path = "../lockrelease-token-pool", features = [ + "no-entrypoint", +] } +rmn_remote = { version = "1.6.1", path = "../rmn-remote", features = [ + "cpi", +] } +ccip_common = { version = "1.6.1", path = "../ccip-common" } [lints.rust.unexpected_cfgs] level = "warn" -check-cfg = ['cfg(target_os, values("solana"))', 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))'] +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("anchor-debug", "custom-panic", "custom-heap"))', +] diff --git a/chains/solana/contracts/target/idl/base_token_pool.json b/chains/solana/contracts/target/idl/base_token_pool.json index 0c78993dba..c7e999dcac 100644 --- a/chains/solana/contracts/target/idl/base_token_pool.json +++ b/chains/solana/contracts/target/idl/base_token_pool.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "name": "base_token_pool", "instructions": [], "types": [ diff --git a/chains/solana/contracts/target/idl/burnmint_token_pool.json b/chains/solana/contracts/target/idl/burnmint_token_pool.json index b5a02425b3..4e8659bd54 100644 --- a/chains/solana/contracts/target/idl/burnmint_token_pool.json +++ b/chains/solana/contracts/target/idl/burnmint_token_pool.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "name": "burnmint_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/idl/ccip_common.json b/chains/solana/contracts/target/idl/ccip_common.json index 60dadcbaf4..b069971fda 100644 --- a/chains/solana/contracts/target/idl/ccip_common.json +++ b/chains/solana/contracts/target/idl/ccip_common.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_common", "instructions": [], "accounts": [ @@ -100,6 +100,21 @@ "code": 10010, "name": "InvalidSVMAddress", "msg": "Invalid SVM address" + }, + { + "code": 10011, + "name": "InvalidTVMAddress", + "msg": "Invalid TVM address" + }, + { + "code": 10012, + "name": "InvalidAptosAddress", + "msg": "Invalid Aptos address" + }, + { + "code": 10013, + "name": "InvalidSuiAddress", + "msg": "Invalid Sui address" } ] } \ No newline at end of file diff --git a/chains/solana/contracts/target/idl/ccip_offramp.json b/chains/solana/contracts/target/idl/ccip_offramp.json index 3469ab165e..4d69870b52 100644 --- a/chains/solana/contracts/target/idl/ccip_offramp.json +++ b/chains/solana/contracts/target/idl/ccip_offramp.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_offramp", "constants": [ { diff --git a/chains/solana/contracts/target/idl/ccip_router.json b/chains/solana/contracts/target/idl/ccip_router.json index a0001b1b50..772245260b 100644 --- a/chains/solana/contracts/target/idl/ccip_router.json +++ b/chains/solana/contracts/target/idl/ccip_router.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_router", "docs": [ "The `ccip_router` module contains the implementation of the Cross-Chain Interoperability Protocol (CCIP) Router.", diff --git a/chains/solana/contracts/target/idl/cctp_token_pool.json b/chains/solana/contracts/target/idl/cctp_token_pool.json index 0b1d5c4a90..baa3e60d18 100644 --- a/chains/solana/contracts/target/idl/cctp_token_pool.json +++ b/chains/solana/contracts/target/idl/cctp_token_pool.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "name": "cctp_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/idl/example_ccip_sender.json b/chains/solana/contracts/target/idl/example_ccip_sender.json index 0f2f16117f..367c2dc1b0 100644 --- a/chains/solana/contracts/target/idl/example_ccip_sender.json +++ b/chains/solana/contracts/target/idl/example_ccip_sender.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "example_ccip_sender", "docs": [ "This program an example of a CCIP Sender Program.", diff --git a/chains/solana/contracts/target/idl/fee_quoter.json b/chains/solana/contracts/target/idl/fee_quoter.json index 9ff885a102..51d2ed46b5 100644 --- a/chains/solana/contracts/target/idl/fee_quoter.json +++ b/chains/solana/contracts/target/idl/fee_quoter.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "fee_quoter", "instructions": [ { diff --git a/chains/solana/contracts/target/idl/lockrelease_token_pool.json b/chains/solana/contracts/target/idl/lockrelease_token_pool.json index 9e29266d62..14a226196a 100644 --- a/chains/solana/contracts/target/idl/lockrelease_token_pool.json +++ b/chains/solana/contracts/target/idl/lockrelease_token_pool.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "name": "lockrelease_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/idl/ping_pong_demo.json b/chains/solana/contracts/target/idl/ping_pong_demo.json index 4e516b04d7..f5c204872e 100644 --- a/chains/solana/contracts/target/idl/ping_pong_demo.json +++ b/chains/solana/contracts/target/idl/ping_pong_demo.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "ping_pong_demo", "instructions": [ { diff --git a/chains/solana/contracts/target/idl/rmn_remote.json b/chains/solana/contracts/target/idl/rmn_remote.json index 733336a1ca..239404e475 100644 --- a/chains/solana/contracts/target/idl/rmn_remote.json +++ b/chains/solana/contracts/target/idl/rmn_remote.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "rmn_remote", "instructions": [ { @@ -256,6 +256,43 @@ } ] }, + { + "name": "setEventAuthorities", + "docs": [ + "Overwrites the list of addresses authorized to invoke the `cpi_event` instruction.", + "", + "Only the CCIP Admin may perform this operation.", + "", + "# Arguments", + "* `ctx` - The context containing the accounts required for updating event authorities.", + "* `new_event_authorities` - The new list of event authority public keys." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "newEventAuthorities", + "type": { + "vec": "publicKey" + } + } + ] + }, { "name": "verifyNotCursed", "docs": [ @@ -277,7 +314,10 @@ { "name": "config", "isMut": false, - "isSigner": false + "isSigner": false, + "docs": [ + "After the upgrade is made, this can be changed to Account<'info, Config>." + ] } ], "args": [ @@ -288,6 +328,72 @@ } } ] + }, + { + "name": "cpiEvent", + "docs": [ + "Backwards-compatible way of implementing CPI events without other contracts needing to", + "add more accounts to make a self-CPI. Calls made to this instruction include the event data", + "in the instruction data, so offchain code can inspect it.", + "", + "Only event authorities can invoke this instruction. While there is basic onchain", + "authorization, the offchain is still expected to check the caller program to attribute the", + "event to it, as this method may be invoked by more than one program so that it can be reused.", + "", + "# Arguments", + "* `_ctx` - The context containing the accounts required for the CPI event.", + "* `_event_data` - The raw event data to be emitted." + ], + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "eventData", + "type": "bytes" + } + ] + }, + { + "name": "migrateConfigV1ToV2", + "docs": [ + "Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state", + "from v1 to v2. This is a permissionless operation, as the default values set for the new", + "v2 fields are backwards-compatible and safe.", + "# Arguments", + "", + "* `ctx` - The context containing the accounts required for the migration." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false, + "docs": [ + "has the new property in it, so it can't be deserialized as Config before the migration has happened." + ] + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] } ], "accounts": [ @@ -313,6 +419,12 @@ "type": { "defined": "CodeVersion" } + }, + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + } } ] } @@ -446,6 +558,18 @@ "index": false } ] + }, + { + "name": "EventAuthoritiesSet", + "fields": [ + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + }, + "index": false + } + ] } ], "errors": [ @@ -493,6 +617,11 @@ "code": 9008, "name": "DefaultOwnerProposal", "msg": "Proposed owner is the default pubkey" + }, + { + "code": 9009, + "name": "InvalidInputsConfigAccount", + "msg": "Config account has invalid space, data, or shape" } ] } \ No newline at end of file diff --git a/chains/solana/contracts/target/idl/test_token_pool.json b/chains/solana/contracts/target/idl/test_token_pool.json index 091e6feb0c..d9ee4f1c39 100644 --- a/chains/solana/contracts/target/idl/test_token_pool.json +++ b/chains/solana/contracts/target/idl/test_token_pool.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "1.6.1", "name": "test_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/types/base_token_pool.ts b/chains/solana/contracts/target/types/base_token_pool.ts index 6ace7a092c..bd544d07c7 100644 --- a/chains/solana/contracts/target/types/base_token_pool.ts +++ b/chains/solana/contracts/target/types/base_token_pool.ts @@ -1,5 +1,5 @@ export type BaseTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "base_token_pool", "instructions": [], "types": [ @@ -869,7 +869,7 @@ export type BaseTokenPool = { }; export const IDL: BaseTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "base_token_pool", "instructions": [], "types": [ diff --git a/chains/solana/contracts/target/types/burnmint_token_pool.ts b/chains/solana/contracts/target/types/burnmint_token_pool.ts index 86a0ed04c5..bba7bc5aa4 100644 --- a/chains/solana/contracts/target/types/burnmint_token_pool.ts +++ b/chains/solana/contracts/target/types/burnmint_token_pool.ts @@ -1,5 +1,5 @@ export type BurnmintTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "burnmint_token_pool", "instructions": [ { @@ -947,7 +947,7 @@ export type BurnmintTokenPool = { }; export const IDL: BurnmintTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "burnmint_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/types/ccip_common.ts b/chains/solana/contracts/target/types/ccip_common.ts index 66de7c9266..6cc44863fd 100644 --- a/chains/solana/contracts/target/types/ccip_common.ts +++ b/chains/solana/contracts/target/types/ccip_common.ts @@ -1,5 +1,5 @@ export type CcipCommon = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_common", "instructions": [], "accounts": [ @@ -100,12 +100,27 @@ export type CcipCommon = { "code": 10010, "name": "InvalidSVMAddress", "msg": "Invalid SVM address" + }, + { + "code": 10011, + "name": "InvalidTVMAddress", + "msg": "Invalid TVM address" + }, + { + "code": 10012, + "name": "InvalidAptosAddress", + "msg": "Invalid Aptos address" + }, + { + "code": 10013, + "name": "InvalidSuiAddress", + "msg": "Invalid Sui address" } ] }; export const IDL: CcipCommon = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_common", "instructions": [], "accounts": [ @@ -206,6 +221,21 @@ export const IDL: CcipCommon = { "code": 10010, "name": "InvalidSVMAddress", "msg": "Invalid SVM address" + }, + { + "code": 10011, + "name": "InvalidTVMAddress", + "msg": "Invalid TVM address" + }, + { + "code": 10012, + "name": "InvalidAptosAddress", + "msg": "Invalid Aptos address" + }, + { + "code": 10013, + "name": "InvalidSuiAddress", + "msg": "Invalid Sui address" } ] }; diff --git a/chains/solana/contracts/target/types/ccip_offramp.ts b/chains/solana/contracts/target/types/ccip_offramp.ts index 4339fcbe50..346baa606a 100644 --- a/chains/solana/contracts/target/types/ccip_offramp.ts +++ b/chains/solana/contracts/target/types/ccip_offramp.ts @@ -1,5 +1,5 @@ export type CcipOfframp = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_offramp", "constants": [ { @@ -2854,7 +2854,7 @@ export type CcipOfframp = { }; export const IDL: CcipOfframp = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_offramp", "constants": [ { diff --git a/chains/solana/contracts/target/types/ccip_router.ts b/chains/solana/contracts/target/types/ccip_router.ts index b3b36d1145..6b249c0e0c 100644 --- a/chains/solana/contracts/target/types/ccip_router.ts +++ b/chains/solana/contracts/target/types/ccip_router.ts @@ -1,5 +1,5 @@ export type CcipRouter = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_router", "docs": [ "The `ccip_router` module contains the implementation of the Cross-Chain Interoperability Protocol (CCIP) Router.", @@ -2345,7 +2345,7 @@ export type CcipRouter = { }; export const IDL: CcipRouter = { - "version": "0.1.1", + "version": "1.6.1", "name": "ccip_router", "docs": [ "The `ccip_router` module contains the implementation of the Cross-Chain Interoperability Protocol (CCIP) Router.", diff --git a/chains/solana/contracts/target/types/cctp_token_pool.ts b/chains/solana/contracts/target/types/cctp_token_pool.ts index 405fec4361..c1a87ee47e 100644 --- a/chains/solana/contracts/target/types/cctp_token_pool.ts +++ b/chains/solana/contracts/target/types/cctp_token_pool.ts @@ -1,5 +1,5 @@ export type CctpTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "cctp_token_pool", "instructions": [ { @@ -1388,7 +1388,7 @@ export type CctpTokenPool = { }; export const IDL: CctpTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "cctp_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/types/example_ccip_sender.ts b/chains/solana/contracts/target/types/example_ccip_sender.ts index e00aef5594..65b987ac65 100644 --- a/chains/solana/contracts/target/types/example_ccip_sender.ts +++ b/chains/solana/contracts/target/types/example_ccip_sender.ts @@ -1,5 +1,5 @@ export type ExampleCcipSender = { - "version": "0.1.1", + "version": "1.6.1", "name": "example_ccip_sender", "docs": [ "This program an example of a CCIP Sender Program.", @@ -489,7 +489,7 @@ export type ExampleCcipSender = { }; export const IDL: ExampleCcipSender = { - "version": "0.1.1", + "version": "1.6.1", "name": "example_ccip_sender", "docs": [ "This program an example of a CCIP Sender Program.", diff --git a/chains/solana/contracts/target/types/fee_quoter.ts b/chains/solana/contracts/target/types/fee_quoter.ts index d3d15676dd..39684ca59b 100644 --- a/chains/solana/contracts/target/types/fee_quoter.ts +++ b/chains/solana/contracts/target/types/fee_quoter.ts @@ -1,5 +1,5 @@ export type FeeQuoter = { - "version": "0.1.1", + "version": "1.6.1", "name": "fee_quoter", "instructions": [ { @@ -1746,7 +1746,7 @@ export type FeeQuoter = { }; export const IDL: FeeQuoter = { - "version": "0.1.1", + "version": "1.6.1", "name": "fee_quoter", "instructions": [ { diff --git a/chains/solana/contracts/target/types/lockrelease_token_pool.ts b/chains/solana/contracts/target/types/lockrelease_token_pool.ts index 42ef0d4e6d..f0a38a6e00 100644 --- a/chains/solana/contracts/target/types/lockrelease_token_pool.ts +++ b/chains/solana/contracts/target/types/lockrelease_token_pool.ts @@ -1,5 +1,5 @@ export type LockreleaseTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "lockrelease_token_pool", "instructions": [ { @@ -983,7 +983,7 @@ export type LockreleaseTokenPool = { }; export const IDL: LockreleaseTokenPool = { - "version": "1.6.0", + "version": "1.6.1", "name": "lockrelease_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/target/types/ping_pong_demo.ts b/chains/solana/contracts/target/types/ping_pong_demo.ts index a20f798b52..73171505c0 100644 --- a/chains/solana/contracts/target/types/ping_pong_demo.ts +++ b/chains/solana/contracts/target/types/ping_pong_demo.ts @@ -1,5 +1,5 @@ export type PingPongDemo = { - "version": "0.1.1", + "version": "1.6.1", "name": "ping_pong_demo", "instructions": [ { @@ -649,7 +649,7 @@ export type PingPongDemo = { }; export const IDL: PingPongDemo = { - "version": "0.1.1", + "version": "1.6.1", "name": "ping_pong_demo", "instructions": [ { diff --git a/chains/solana/contracts/target/types/rmn_remote.ts b/chains/solana/contracts/target/types/rmn_remote.ts index 4332402252..c6b94e015e 100644 --- a/chains/solana/contracts/target/types/rmn_remote.ts +++ b/chains/solana/contracts/target/types/rmn_remote.ts @@ -1,5 +1,5 @@ export type RmnRemote = { - "version": "0.1.1", + "version": "1.6.1", "name": "rmn_remote", "instructions": [ { @@ -256,6 +256,43 @@ export type RmnRemote = { } ] }, + { + "name": "setEventAuthorities", + "docs": [ + "Overwrites the list of addresses authorized to invoke the `cpi_event` instruction.", + "", + "Only the CCIP Admin may perform this operation.", + "", + "# Arguments", + "* `ctx` - The context containing the accounts required for updating event authorities.", + "* `new_event_authorities` - The new list of event authority public keys." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "newEventAuthorities", + "type": { + "vec": "publicKey" + } + } + ] + }, { "name": "verifyNotCursed", "docs": [ @@ -277,7 +314,10 @@ export type RmnRemote = { { "name": "config", "isMut": false, - "isSigner": false + "isSigner": false, + "docs": [ + "After the upgrade is made, this can be changed to Account<'info, Config>." + ] } ], "args": [ @@ -288,6 +328,72 @@ export type RmnRemote = { } } ] + }, + { + "name": "cpiEvent", + "docs": [ + "Backwards-compatible way of implementing CPI events without other contracts needing to", + "add more accounts to make a self-CPI. Calls made to this instruction include the event data", + "in the instruction data, so offchain code can inspect it.", + "", + "Only event authorities can invoke this instruction. While there is basic onchain", + "authorization, the offchain is still expected to check the caller program to attribute the", + "event to it, as this method may be invoked by more than one program so that it can be reused.", + "", + "# Arguments", + "* `_ctx` - The context containing the accounts required for the CPI event.", + "* `_event_data` - The raw event data to be emitted." + ], + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "eventData", + "type": "bytes" + } + ] + }, + { + "name": "migrateConfigV1ToV2", + "docs": [ + "Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state", + "from v1 to v2. This is a permissionless operation, as the default values set for the new", + "v2 fields are backwards-compatible and safe.", + "# Arguments", + "", + "* `ctx` - The context containing the accounts required for the migration." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false, + "docs": [ + "has the new property in it, so it can't be deserialized as Config before the migration has happened." + ] + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] } ], "accounts": [ @@ -313,6 +419,12 @@ export type RmnRemote = { "type": { "defined": "CodeVersion" } + }, + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + } } ] } @@ -446,6 +558,18 @@ export type RmnRemote = { "index": false } ] + }, + { + "name": "EventAuthoritiesSet", + "fields": [ + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + }, + "index": false + } + ] } ], "errors": [ @@ -493,12 +617,17 @@ export type RmnRemote = { "code": 9008, "name": "DefaultOwnerProposal", "msg": "Proposed owner is the default pubkey" + }, + { + "code": 9009, + "name": "InvalidInputsConfigAccount", + "msg": "Config account has invalid space, data, or shape" } ] }; export const IDL: RmnRemote = { - "version": "0.1.1", + "version": "1.6.1", "name": "rmn_remote", "instructions": [ { @@ -755,6 +884,43 @@ export const IDL: RmnRemote = { } ] }, + { + "name": "setEventAuthorities", + "docs": [ + "Overwrites the list of addresses authorized to invoke the `cpi_event` instruction.", + "", + "Only the CCIP Admin may perform this operation.", + "", + "# Arguments", + "* `ctx` - The context containing the accounts required for updating event authorities.", + "* `new_event_authorities` - The new list of event authority public keys." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "newEventAuthorities", + "type": { + "vec": "publicKey" + } + } + ] + }, { "name": "verifyNotCursed", "docs": [ @@ -776,7 +942,10 @@ export const IDL: RmnRemote = { { "name": "config", "isMut": false, - "isSigner": false + "isSigner": false, + "docs": [ + "After the upgrade is made, this can be changed to Account<'info, Config>." + ] } ], "args": [ @@ -787,6 +956,72 @@ export const IDL: RmnRemote = { } } ] + }, + { + "name": "cpiEvent", + "docs": [ + "Backwards-compatible way of implementing CPI events without other contracts needing to", + "add more accounts to make a self-CPI. Calls made to this instruction include the event data", + "in the instruction data, so offchain code can inspect it.", + "", + "Only event authorities can invoke this instruction. While there is basic onchain", + "authorization, the offchain is still expected to check the caller program to attribute the", + "event to it, as this method may be invoked by more than one program so that it can be reused.", + "", + "# Arguments", + "* `_ctx` - The context containing the accounts required for the CPI event.", + "* `_event_data` - The raw event data to be emitted." + ], + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "eventData", + "type": "bytes" + } + ] + }, + { + "name": "migrateConfigV1ToV2", + "docs": [ + "Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state", + "from v1 to v2. This is a permissionless operation, as the default values set for the new", + "v2 fields are backwards-compatible and safe.", + "# Arguments", + "", + "* `ctx` - The context containing the accounts required for the migration." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": false, + "docs": [ + "has the new property in it, so it can't be deserialized as Config before the migration has happened." + ] + }, + { + "name": "authority", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] } ], "accounts": [ @@ -812,6 +1047,12 @@ export const IDL: RmnRemote = { "type": { "defined": "CodeVersion" } + }, + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + } } ] } @@ -945,6 +1186,18 @@ export const IDL: RmnRemote = { "index": false } ] + }, + { + "name": "EventAuthoritiesSet", + "fields": [ + { + "name": "eventAuthorities", + "type": { + "vec": "publicKey" + }, + "index": false + } + ] } ], "errors": [ @@ -992,6 +1245,11 @@ export const IDL: RmnRemote = { "code": 9008, "name": "DefaultOwnerProposal", "msg": "Proposed owner is the default pubkey" + }, + { + "code": 9009, + "name": "InvalidInputsConfigAccount", + "msg": "Config account has invalid space, data, or shape" } ] }; diff --git a/chains/solana/contracts/target/types/test_token_pool.ts b/chains/solana/contracts/target/types/test_token_pool.ts index e51689ef1b..35aea1118d 100644 --- a/chains/solana/contracts/target/types/test_token_pool.ts +++ b/chains/solana/contracts/target/types/test_token_pool.ts @@ -1,5 +1,5 @@ export type TestTokenPool = { - "version": "0.1.1", + "version": "1.6.1", "name": "test_token_pool", "instructions": [ { @@ -610,7 +610,7 @@ export type TestTokenPool = { }; export const IDL: TestTokenPool = { - "version": "0.1.1", + "version": "1.6.1", "name": "test_token_pool", "instructions": [ { diff --git a/chains/solana/contracts/tests/ccip/ccip_router_test.go b/chains/solana/contracts/tests/ccip/ccip_router_test.go index b47475be74..fc596a4961 100644 --- a/chains/solana/contracts/tests/ccip/ccip_router_test.go +++ b/chains/solana/contracts/tests/ccip/ccip_router_test.go @@ -806,9 +806,17 @@ func TestCCIPRouter(t *testing.T) { config.RMNRemoteProgram, programData.Address, ).ValidateAndBuild() + require.NoError(t, err) + ix2, err := rmn_remote.NewSetEventAuthoritiesInstruction( + []solana.PublicKey{config.BillingSignerPDA}, + config.RMNRemoteConfigPDA, + legacyAdmin.PublicKey(), + solana.SystemProgramID, + ).ValidateAndBuild() require.NoError(t, err) - result := testutils.SendAndConfirm(ctx, t, solanaGoClient, []solana.Instruction{ix}, legacyAdmin, config.DefaultCommitment) + + result := testutils.SendAndConfirm(ctx, t, solanaGoClient, []solana.Instruction{ix, ix2}, legacyAdmin, config.DefaultCommitment) require.NotNil(t, result) }) }) @@ -2081,6 +2089,22 @@ func TestCCIPRouter(t *testing.T) { }) }) + ///////////////////// + // RMNRemote Tests // + ///////////////////// + t.Run("RMNRemote", func(t *testing.T) { + t.Run("Unauthorized event authorities cannot invoke cpi_event", func(t *testing.T) { + ix, err := rmn_remote.NewCpiEventInstruction( + []byte("test"), + config.RMNRemoteConfigPDA, + anotherUser.PublicKey(), // not an authorized event authority + ).ValidateAndBuild() + require.NoError(t, err) + testutils.SendAndFailWith(ctx, t, solanaGoClient, []solana.Instruction{ix}, anotherUser, config.DefaultCommitment, []string{"Error Code: " + ccip.Unauthorized_RmnRemoteError.String()}) + // the positive case of successful cpi_event calls is covered in the CCIP Send onramp tests + }) + }) + ////////////////////////// // Billing Config Tests // ////////////////////////// @@ -4270,6 +4294,28 @@ func TestCCIPRouter(t *testing.T) { hash, err := ccip.HashSVMToAnyMessage(ccipMessageSentEvent.Message) require.NoError(t, err) require.Equal(t, hash, ccipMessageSentEvent.Message.Header.MessageId[:]) + + tx, err := result.Transaction.GetTransaction() + require.NoError(t, err) + + foundEvent := false + for _, innerIx := range result.Meta.InnerInstructions { + for _, ix := range innerIx.Instructions { + programID, err := testutils.GetProgramID(tx, result.Meta, ix.ProgramIDIndex) + require.NoError(t, err) + if programID == config.RMNRemoteProgram && [8]byte(ix.Data[0:8]) == [8]byte(rmn_remote.Instruction_CpiEvent[:]) { + foundEvent = true + lenPrefix := binary.LittleEndian.Uint32(ix.Data[8:12]) + require.Equal(t, uint32(288), lenPrefix) // this event with this msg data & receiver is 288 bytes long + eventData := ix.Data[12:] + cpiEvent, err := common.UnmarshalAnchorType[ccip.EventCCIPMessageSent](eventData) + require.NoError(t, err) + require.Equal(t, ccipMessageSentEvent, *cpiEvent) + break + } + } + } + require.True(t, foundEvent, "Did not find CCIPMessageSent event emitted via CPI to RMNRemote") }) t.Run("When sending a CCIP Message with ExtraArgs overrides Emits CCIPMessageSent", func(t *testing.T) { @@ -4956,6 +5002,8 @@ func TestCCIPRouter(t *testing.T) { }) t.Run("two tokens", func(t *testing.T) { + t.Skip() // we will no longer support 2 tokens at once + _, initBal0, err := tokens.TokenBalance(ctx, solanaGoClient, token0.User[user.PublicKey()], config.DefaultCommitment) require.NoError(t, err) _, initBal1, err := tokens.TokenBalance(ctx, solanaGoClient, token1.User[user.PublicKey()], config.DefaultCommitment) @@ -5513,6 +5561,8 @@ func TestCCIPRouter(t *testing.T) { }) t.Run("Two tokens transferred with derived accounts", func(t *testing.T) { + t.Skip() // we will no longer support 2 tokens at once + _, initBal0, err := tokens.TokenBalance(ctx, solanaGoClient, token0.User[user.PublicKey()], config.DefaultCommitment) require.NoError(t, err) _, initBal1, err := tokens.TokenBalance(ctx, solanaGoClient, token1.User[user.PublicKey()], config.DefaultCommitment) @@ -5698,7 +5748,7 @@ func TestCCIPRouter(t *testing.T) { token0ATAIx, token0SenderATA, err := tokens.CreateAssociatedTokenAccount(token0.Program, token0.Mint, senderPDA, user.PublicKey()) require.NoError(t, err) - token1ATAIx, token1SenderATA, err := tokens.CreateAssociatedTokenAccount(token1.Program, token1.Mint, senderPDA, user.PublicKey()) + token1ATAIx /*token1SenderATA*/, _, err := tokens.CreateAssociatedTokenAccount(token1.Program, token1.Mint, senderPDA, user.PublicKey()) require.NoError(t, err) t.Run("setup", func(t *testing.T) { @@ -5832,14 +5882,14 @@ func TestCCIPRouter(t *testing.T) { Token: token0.Mint, Amount: 1, }, - { - Token: token1.Mint, - Amount: 2, - }, + // { + // Token: token1.Mint, + // Amount: 2, + // }, }, []byte{1, 2, 3}, // message data fc.feeToken, // empty fee token to indicate native SOL - []uint8{2, 16}, + []uint8{1}, // []uint8{2, 16}, senderState, cc.senderChainConfig, senderPDA, @@ -5868,17 +5918,17 @@ func TestCCIPRouter(t *testing.T) { base.AccountMetaSlice = append( base.AccountMetaSlice, solana.Meta(token0.User[user.PublicKey()]).WRITE(), - solana.Meta(token1.User[user.PublicKey()]).WRITE(), + // solana.Meta(token1.User[user.PublicKey()]).WRITE(), ) // pass token pool accounts with the sender program ATA tokenMetas0, addressTables, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, token0, token0SenderATA, cc.chainSelector) require.NoError(t, err) base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetas0...) - tokenMetas1, addressTables1, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, token1, token1SenderATA, cc.chainSelector) - require.NoError(t, err) - base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetas1...) - addressTables[token1.PoolLookupTable] = addressTables1[token1.PoolLookupTable] + // tokenMetas1, addressTables1, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, token1, token1SenderATA, cc.chainSelector) + // require.NoError(t, err) + // base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetas1...) + // addressTables[token1.PoolLookupTable] = addressTables1[token1.PoolLookupTable] maps.Copy(addressTables, ccipSendLookupTable) ix, err := base.ValidateAndBuild() @@ -5886,10 +5936,10 @@ func TestCCIPRouter(t *testing.T) { ixApprove0, err := tokens.TokenApproveChecked(1, token0Decimals, token0.Program, token0.User[user.PublicKey()], token0.Mint, senderPDA, user.PublicKey(), nil) require.NoError(t, err) - ixApprove1, err := tokens.TokenApproveChecked(2, token1Decimals, token1.Program, token1.User[user.PublicKey()], token1.Mint, senderPDA, user.PublicKey(), nil) - require.NoError(t, err) + // ixApprove1, err := tokens.TokenApproveChecked(2, token1Decimals, token1.Program, token1.User[user.PublicKey()], token1.Mint, senderPDA, user.PublicKey(), nil) + // require.NoError(t, err) - testutils.SendAndConfirmWithLookupTables(ctx, t, solanaGoClient, []solana.Instruction{ixApprove0, ixApprove1, ix}, user, config.DefaultCommitment, addressTables, common.AddComputeUnitLimit(computebudget.MAX_COMPUTE_UNIT_LIMIT)) + testutils.SendAndConfirmWithLookupTables(ctx, t, solanaGoClient, []solana.Instruction{ixApprove0 /*ixApprove1,*/, ix}, user, config.DefaultCommitment, addressTables, common.AddComputeUnitLimit(computebudget.MAX_COMPUTE_UNIT_LIMIT)) }) t.Run("When paying with "+fc.name+" and transferring link, it works", func(t *testing.T) { @@ -5900,14 +5950,14 @@ func TestCCIPRouter(t *testing.T) { Token: token0.Mint, Amount: 1, }, - { - Token: linkPool.Mint, - Amount: 2, - }, + // { + // Token: linkPool.Mint, + // Amount: 2, + // }, }, []byte{1, 2, 3}, // message data fc.feeToken, // empty fee token to indicate native SOL - []uint8{2, 16}, + []uint8{1}, // []uint8{2, 16}, senderState, cc.senderChainConfig, senderPDA, @@ -5936,17 +5986,17 @@ func TestCCIPRouter(t *testing.T) { base.AccountMetaSlice = append( base.AccountMetaSlice, solana.Meta(token0.User[user.PublicKey()]).WRITE(), - solana.Meta(linkPool.User[user.PublicKey()]).WRITE(), + // solana.Meta(linkPool.User[user.PublicKey()]).WRITE(), ) // pass token pool accounts with the sender program ATA tokenMetas0, addressTables, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, token0, token0SenderATA, cc.chainSelector) require.NoError(t, err) base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetas0...) - tokenMetasLink, addressTablesLink, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, linkPool, link22SenderATA, cc.chainSelector) - require.NoError(t, err) - base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetasLink...) - addressTables[linkPool.PoolLookupTable] = addressTablesLink[linkPool.PoolLookupTable] + // tokenMetasLink, addressTablesLink, err := tokens.ParseTokenLookupTableWithChain(ctx, solanaGoClient, linkPool, link22SenderATA, cc.chainSelector) + // require.NoError(t, err) + // base.AccountMetaSlice = append(base.AccountMetaSlice, tokenMetasLink...) + // addressTables[linkPool.PoolLookupTable] = addressTablesLink[linkPool.PoolLookupTable] maps.Copy(addressTables, ccipSendLookupTable) ix, err := base.ValidateAndBuild() diff --git a/chains/solana/contracts/tests/devnet/cctp_tp_devnet_test.go b/chains/solana/contracts/tests/devnet/cctp_tp_devnet_test.go index 817b2e11fe..0ad0c54400 100644 --- a/chains/solana/contracts/tests/devnet/cctp_tp_devnet_test.go +++ b/chains/solana/contracts/tests/devnet/cctp_tp_devnet_test.go @@ -26,6 +26,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/ccip_router" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/cctp_token_pool" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/fee_quoter" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/rmn_remote" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/ccip" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/eth" @@ -59,6 +60,7 @@ func TestCctpTpDevnet(t *testing.T) { ccip_router.SetProgramID(referenceAddresses.Router) fee_quoter.SetProgramID(referenceAddresses.FeeQuoter) + rmn_remote.SetProgramID(referenceAddresses.RmnRemote) cctpTpProgram := solana.MustPublicKeyFromBase58(devnetInfo.CCTP.TokenPool) cctpMtProgram := solana.MustPublicKeyFromBase58(devnetInfo.CCTP.MessageTransmitter) @@ -122,6 +124,42 @@ func TestCctpTpDevnet(t *testing.T) { fmt.Printf("Type Version: %s\n", output) }) + t.Run("Migrate RMNRemote config", func(t *testing.T) { + t.Skip() + + rmnConfig, _, err := state.FindRMNRemoteConfigPDA(referenceAddresses.RmnRemote) + require.NoError(t, err) + + ix, err := rmn_remote.NewMigrateConfigV1ToV2Instruction( + rmnConfig, + admin.PublicKey(), + solana.SystemProgramID, + ).ValidateAndBuild() + require.NoError(t, err) + result := testutils.SendAndConfirm(ctx, t, client, []solana.Instruction{ix}, admin, config.DefaultCommitment) + require.NotNil(t, result) + }) + + t.Run("Set RMNRemote event authorities", func(t *testing.T) { + t.Skip() + + rmnConfig, _, err := state.FindRMNRemoteConfigPDA(referenceAddresses.RmnRemote) + require.NoError(t, err) + + routerBillingSigner, _, err := state.FindFeeBillingSignerPDA(referenceAddresses.Router) + require.NoError(t, err) + + ix, err := rmn_remote.NewSetEventAuthoritiesInstruction( + []solana.PublicKey{routerBillingSigner}, + rmnConfig, + deployer.PublicKey(), + solana.SystemProgramID, + ).ValidateAndBuild() + require.NoError(t, err) + result := testutils.SendAndConfirm(ctx, t, client, []solana.Instruction{ix}, deployer, config.DefaultCommitment) + require.NotNil(t, result) + }) + routerConfig, _, err := state.FindConfigPDA(referenceAddresses.Router) require.NoError(t, err) tokenAdminRegistry, _, err := state.FindTokenAdminRegistryPDA(usdcMint, referenceAddresses.Router) @@ -339,7 +377,7 @@ func TestCctpTpDevnet(t *testing.T) { }) t.Run("Router interaction (setup + onramp)", func(t *testing.T) { - // t.Skip() + t.Skip() fqUsdcBillingTokenConfig, _, err := state.FindFqBillingTokenConfigPDA(usdcMint, referenceAddresses.FeeQuoter) require.NoError(t, err) diff --git a/chains/solana/contracts/tests/examples/ping_pong_test.go b/chains/solana/contracts/tests/examples/ping_pong_test.go index a1738b62f4..f689107c81 100644 --- a/chains/solana/contracts/tests/examples/ping_pong_test.go +++ b/chains/solana/contracts/tests/examples/ping_pong_test.go @@ -202,7 +202,7 @@ func TestPingPong(t *testing.T) { var programData ProgramData require.NoError(t, bin.UnmarshalBorsh(&programData, data.Bytes())) - // Now, actually initialize the offramp + // Now, actually initialize RMN initIx, err := rmn_remote.NewInitializeInstruction( config.RMNRemoteConfigPDA, config.RMNRemoteCursesPDA, @@ -213,7 +213,15 @@ func TestPingPong(t *testing.T) { ).ValidateAndBuild() require.NoError(t, err) - testutils.SendAndConfirm(ctx, t, solanaGoClient, []solana.Instruction{initIx}, admin, + authIx, err := rmn_remote.NewSetEventAuthoritiesInstruction( + []solana.PublicKey{config.BillingSignerPDA}, + config.RMNRemoteConfigPDA, + admin.PublicKey(), + solana.SystemProgramID, + ).ValidateAndBuild() + require.NoError(t, err) + + testutils.SendAndConfirm(ctx, t, solanaGoClient, []solana.Instruction{initIx, authIx}, admin, config.DefaultCommitment) }) }) diff --git a/chains/solana/contracts/tests/testutils/anchor.go b/chains/solana/contracts/tests/testutils/anchor.go index d5054564db..65b7752cd5 100644 --- a/chains/solana/contracts/tests/testutils/anchor.go +++ b/chains/solana/contracts/tests/testutils/anchor.go @@ -146,3 +146,27 @@ func WaitForNewBlock(ctx context.Context, client *rpc.Client, height uint64, com } } } + +func GetProgramID(tx *solana.Transaction, meta *rpc.TransactionMeta, programIDIndex uint16) (solana.PublicKey, error) { + allKeys := getAllKeys(tx, meta) + + if int(programIDIndex) >= len(allKeys) { + return solana.PublicKey{}, fmt.Errorf("programID index %d out of bounds (total keys: %d)", programIDIndex, len(allKeys)) + } + + return allKeys[programIDIndex], nil +} + +func getAllKeys(tx *solana.Transaction, meta *rpc.TransactionMeta) []solana.PublicKey { + allKeys := make([]solana.PublicKey, 0, len(tx.Message.AccountKeys)) + allKeys = append(allKeys, tx.Message.AccountKeys...) + + if meta != nil && meta.LoadedAddresses.Writable != nil { + allKeys = append(allKeys, meta.LoadedAddresses.Writable...) + } + if meta != nil && meta.LoadedAddresses.ReadOnly != nil { + allKeys = append(allKeys, meta.LoadedAddresses.ReadOnly...) + } + + return allKeys +} diff --git a/chains/solana/deployment/utils/artifact_versions.go b/chains/solana/deployment/utils/artifact_versions.go index db73014e4e..42e5a095e6 100644 --- a/chains/solana/deployment/utils/artifact_versions.go +++ b/chains/solana/deployment/utils/artifact_versions.go @@ -15,6 +15,7 @@ const ( VersionSolanaV0_1_1TokenPools = "solana-v0.1.1" VersionSolanaV0_1_0 = "solana-v0.1.0" VersionSolanaV1_6_0 = "solana-v1.6.0" + VersionSolanaV1_6_1 = "solana-v1.6.1" ) // VersionToShortCommitSHA maps a version tag to its corresponding short commit SHA. @@ -24,6 +25,7 @@ var VersionToShortCommitSHA = map[string]string{ VersionSolanaV0_1_1TokenPools: "ee587a6c0562", VersionSolanaV0_1_0: "be8d09930aaa", VersionSolanaV1_6_0: "d0d81df31957", + VersionSolanaV1_6_1: "10b851bd2104", } var VersionToFullCommitSHA = map[string]string{ @@ -32,4 +34,5 @@ var VersionToFullCommitSHA = map[string]string{ VersionSolanaV0_1_1TokenPools: "ee587a6c056204009310019b790ed6d474825316", VersionSolanaV0_1_0: "be8d09930aaaae31b574ef316ca73021fe272b08", VersionSolanaV1_6_0: "d0d81df3195728091cad1b0569a2980201a92e97", + VersionSolanaV1_6_1: "10b851bd210430f58f2cbb507fe76be9a366571c", } diff --git a/chains/solana/gobindings/latest/rmn_remote/CpiEvent.go b/chains/solana/gobindings/latest/rmn_remote/CpiEvent.go new file mode 100644 index 0000000000..31cc31d9ef --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/CpiEvent.go @@ -0,0 +1,156 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Backwards-compatible way of implementing CPI events without other contracts needing to +// add more accounts to make a self-CPI. Calls made to this instruction include the event data +// in the instruction data, so offchain code can inspect it. +// +// Only event authorities can invoke this instruction. While there is basic onchain +// authorization, the offchain is still expected to check the caller program to attribute the +// event to it, as this method may be invoked by more than one program so that it can be reused. +// +// # Arguments +// * `_ctx` - The context containing the accounts required for the CPI event. +// * `_event_data` - The raw event data to be emitted. +type CpiEvent struct { + EventData *[]byte + + // [0] = [] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCpiEventInstructionBuilder creates a new `CpiEvent` instruction builder. +func NewCpiEventInstructionBuilder() *CpiEvent { + nd := &CpiEvent{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetEventData sets the "eventData" parameter. +func (inst *CpiEvent) SetEventData(eventData []byte) *CpiEvent { + inst.EventData = &eventData + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CpiEvent) SetConfigAccount(config ag_solanago.PublicKey) *CpiEvent { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CpiEvent) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CpiEvent) SetAuthorityAccount(authority ag_solanago.PublicKey) *CpiEvent { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CpiEvent) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst CpiEvent) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CpiEvent, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CpiEvent) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CpiEvent) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.EventData == nil { + return errors.New("EventData parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *CpiEvent) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CpiEvent")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("EventData", *inst.EventData)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj CpiEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `EventData` param: + err = encoder.Encode(obj.EventData) + if err != nil { + return err + } + return nil +} +func (obj *CpiEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `EventData`: + err = decoder.Decode(&obj.EventData) + if err != nil { + return err + } + return nil +} + +// NewCpiEventInstruction declares a new CpiEvent instruction with the provided parameters and accounts. +func NewCpiEventInstruction( + // Parameters: + eventData []byte, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *CpiEvent { + return NewCpiEventInstructionBuilder(). + SetEventData(eventData). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/latest/rmn_remote/CpiEvent_test.go b/chains/solana/gobindings/latest/rmn_remote/CpiEvent_test.go new file mode 100644 index 0000000000..22c1d3f180 --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/CpiEvent_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CpiEvent(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CpiEvent"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CpiEvent) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CpiEvent) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2.go b/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2.go new file mode 100644 index 0000000000..f1e2a4b71d --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2.go @@ -0,0 +1,144 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state +// from v1 to v2. This is a permissionless operation, as the default values set for the new +// v2 fields are backwards-compatible and safe. +// # Arguments +// +// * `ctx` - The context containing the accounts required for the migration. +type MigrateConfigV1ToV2 struct { + + // [0] = [WRITE] config + // ··········· has the new property in it, so it can't be deserialized as Config before the migration has happened. + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewMigrateConfigV1ToV2InstructionBuilder creates a new `MigrateConfigV1ToV2` instruction builder. +func NewMigrateConfigV1ToV2InstructionBuilder() *MigrateConfigV1ToV2 { + nd := &MigrateConfigV1ToV2{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetConfigAccount sets the "config" account. +// has the new property in it, so it can't be deserialized as Config before the migration has happened. +func (inst *MigrateConfigV1ToV2) SetConfigAccount(config ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +// has the new property in it, so it can't be deserialized as Config before the migration has happened. +func (inst *MigrateConfigV1ToV2) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *MigrateConfigV1ToV2) SetAuthorityAccount(authority ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *MigrateConfigV1ToV2) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *MigrateConfigV1ToV2) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *MigrateConfigV1ToV2) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst MigrateConfigV1ToV2) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_MigrateConfigV1ToV2, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst MigrateConfigV1ToV2) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *MigrateConfigV1ToV2) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *MigrateConfigV1ToV2) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("MigrateConfigV1ToV2")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj MigrateConfigV1ToV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *MigrateConfigV1ToV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewMigrateConfigV1ToV2Instruction declares a new MigrateConfigV1ToV2 instruction with the provided parameters and accounts. +func NewMigrateConfigV1ToV2Instruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + return NewMigrateConfigV1ToV2InstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2_test.go b/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2_test.go new file mode 100644 index 0000000000..5a76190f85 --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/MigrateConfigV1ToV2_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_MigrateConfigV1ToV2(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("MigrateConfigV1ToV2"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(MigrateConfigV1ToV2) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(MigrateConfigV1ToV2) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities.go b/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities.go new file mode 100644 index 0000000000..0ae5873b3f --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Overwrites the list of addresses authorized to invoke the `cpi_event` instruction. +// +// Only the CCIP Admin may perform this operation. +// +// # Arguments +// * `ctx` - The context containing the accounts required for updating event authorities. +// * `new_event_authorities` - The new list of event authority public keys. +type SetEventAuthorities struct { + NewEventAuthorities *[]ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetEventAuthoritiesInstructionBuilder creates a new `SetEventAuthorities` instruction builder. +func NewSetEventAuthoritiesInstructionBuilder() *SetEventAuthorities { + nd := &SetEventAuthorities{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetNewEventAuthorities sets the "newEventAuthorities" parameter. +func (inst *SetEventAuthorities) SetNewEventAuthorities(newEventAuthorities []ag_solanago.PublicKey) *SetEventAuthorities { + inst.NewEventAuthorities = &newEventAuthorities + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetEventAuthorities) SetConfigAccount(config ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetEventAuthorities) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetEventAuthorities) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetEventAuthorities) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetEventAuthorities) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetEventAuthorities) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetEventAuthorities) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetEventAuthorities, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetEventAuthorities) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetEventAuthorities) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewEventAuthorities == nil { + return errors.New("NewEventAuthorities parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetEventAuthorities) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetEventAuthorities")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewEventAuthorities", *inst.NewEventAuthorities)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetEventAuthorities) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewEventAuthorities` param: + err = encoder.Encode(obj.NewEventAuthorities) + if err != nil { + return err + } + return nil +} +func (obj *SetEventAuthorities) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewEventAuthorities`: + err = decoder.Decode(&obj.NewEventAuthorities) + if err != nil { + return err + } + return nil +} + +// NewSetEventAuthoritiesInstruction declares a new SetEventAuthorities instruction with the provided parameters and accounts. +func NewSetEventAuthoritiesInstruction( + // Parameters: + newEventAuthorities []ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetEventAuthorities { + return NewSetEventAuthoritiesInstructionBuilder(). + SetNewEventAuthorities(newEventAuthorities). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities_test.go b/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities_test.go new file mode 100644 index 0000000000..01d6763310 --- /dev/null +++ b/chains/solana/gobindings/latest/rmn_remote/SetEventAuthorities_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetEventAuthorities(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetEventAuthorities"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetEventAuthorities) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetEventAuthorities) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/latest/rmn_remote/VerifyNotCursed.go b/chains/solana/gobindings/latest/rmn_remote/VerifyNotCursed.go index 2dd29fa2d6..2da9bf7471 100644 --- a/chains/solana/gobindings/latest/rmn_remote/VerifyNotCursed.go +++ b/chains/solana/gobindings/latest/rmn_remote/VerifyNotCursed.go @@ -24,6 +24,7 @@ type VerifyNotCursed struct { // [0] = [] curses // // [1] = [] config + // ··········· After the upgrade is made, this can be changed to Account<'info, Config>. ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } @@ -53,12 +54,14 @@ func (inst *VerifyNotCursed) GetCursesAccount() *ag_solanago.AccountMeta { } // SetConfigAccount sets the "config" account. +// After the upgrade is made, this can be changed to Account<'info, Config>. func (inst *VerifyNotCursed) SetConfigAccount(config ag_solanago.PublicKey) *VerifyNotCursed { inst.AccountMetaSlice[1] = ag_solanago.Meta(config) return inst } // GetConfigAccount gets the "config" account. +// After the upgrade is made, this can be changed to Account<'info, Config>. func (inst *VerifyNotCursed) GetConfigAccount() *ag_solanago.AccountMeta { return inst.AccountMetaSlice[1] } diff --git a/chains/solana/gobindings/latest/rmn_remote/accounts.go b/chains/solana/gobindings/latest/rmn_remote/accounts.go index 34fc6cb53c..4ecb9e1661 100644 --- a/chains/solana/gobindings/latest/rmn_remote/accounts.go +++ b/chains/solana/gobindings/latest/rmn_remote/accounts.go @@ -13,6 +13,7 @@ type Config struct { Owner ag_solanago.PublicKey ProposedOwner ag_solanago.PublicKey DefaultCodeVersion CodeVersion + EventAuthorities []ag_solanago.PublicKey } var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} @@ -43,6 +44,11 @@ func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { if err != nil { return err } + // Serialize `EventAuthorities` param: + err = encoder.Encode(obj.EventAuthorities) + if err != nil { + return err + } return nil } @@ -80,6 +86,11 @@ func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) if err != nil { return err } + // Deserialize `EventAuthorities`: + err = decoder.Decode(&obj.EventAuthorities) + if err != nil { + return err + } return nil } diff --git a/chains/solana/gobindings/latest/rmn_remote/instructions.go b/chains/solana/gobindings/latest/rmn_remote/instructions.go index b4c2edf6df..f33b0dbf82 100644 --- a/chains/solana/gobindings/latest/rmn_remote/instructions.go +++ b/chains/solana/gobindings/latest/rmn_remote/instructions.go @@ -98,6 +98,15 @@ var ( // * `subject` - The subject to uncurse. Instruction_Uncurse = ag_binary.TypeID([8]byte{235, 227, 61, 167, 15, 109, 129, 79}) + // Overwrites the list of addresses authorized to invoke the `cpi_event` instruction. + // + // Only the CCIP Admin may perform this operation. + // + // # Arguments + // * `ctx` - The context containing the accounts required for updating event authorities. + // * `new_event_authorities` - The new list of event authority public keys. + Instruction_SetEventAuthorities = ag_binary.TypeID([8]byte{76, 83, 229, 160, 40, 1, 149, 103}) + // Verifies that the subject is not cursed AND that this chain is not globally cursed. // In case either of those assumptions fail, the instruction reverts. // @@ -107,6 +116,27 @@ var ( // * `subject` - The subject to verify. Note that this instruction will revert if the chain // is globally cursed too, even if the provided subject is not explicitly cursed. Instruction_VerifyNotCursed = ag_binary.TypeID([8]byte{86, 200, 58, 143, 7, 109, 155, 125}) + + // Backwards-compatible way of implementing CPI events without other contracts needing to + // add more accounts to make a self-CPI. Calls made to this instruction include the event data + // in the instruction data, so offchain code can inspect it. + // + // Only event authorities can invoke this instruction. While there is basic onchain + // authorization, the offchain is still expected to check the caller program to attribute the + // event to it, as this method may be invoked by more than one program so that it can be reused. + // + // # Arguments + // * `_ctx` - The context containing the accounts required for the CPI event. + // * `_event_data` - The raw event data to be emitted. + Instruction_CpiEvent = ag_binary.TypeID([8]byte{188, 216, 166, 108, 26, 166, 142, 182}) + + // Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state + // from v1 to v2. This is a permissionless operation, as the default values set for the new + // v2 fields are backwards-compatible and safe. + // # Arguments + // + // * `ctx` - The context containing the accounts required for the migration. + Instruction_MigrateConfigV1ToV2 = ag_binary.TypeID([8]byte{201, 212, 171, 0, 73, 91, 124, 99}) ) // InstructionIDToName returns the name of the instruction given its ID. @@ -126,8 +156,14 @@ func InstructionIDToName(id ag_binary.TypeID) string { return "Curse" case Instruction_Uncurse: return "Uncurse" + case Instruction_SetEventAuthorities: + return "SetEventAuthorities" case Instruction_VerifyNotCursed: return "VerifyNotCursed" + case Instruction_CpiEvent: + return "CpiEvent" + case Instruction_MigrateConfigV1ToV2: + return "MigrateConfigV1ToV2" default: return "" } @@ -169,9 +205,18 @@ var InstructionImplDef = ag_binary.NewVariantDefinition( { "uncurse", (*Uncurse)(nil), }, + { + "set_event_authorities", (*SetEventAuthorities)(nil), + }, { "verify_not_cursed", (*VerifyNotCursed)(nil), }, + { + "cpi_event", (*CpiEvent)(nil), + }, + { + "migrate_config_v1_to_v2", (*MigrateConfigV1ToV2)(nil), + }, }, ) diff --git a/chains/solana/gobindings/v1_6_1/base_token_pool/accounts.go b/chains/solana/gobindings/v1_6_1/base_token_pool/accounts.go new file mode 100644 index 0000000000..452beea981 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/base_token_pool/accounts.go @@ -0,0 +1,3 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package base_token_pool diff --git a/chains/solana/gobindings/v1_6_1/base_token_pool/instructions.go b/chains/solana/gobindings/v1_6_1/base_token_pool/instructions.go new file mode 100644 index 0000000000..93061611f2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/base_token_pool/instructions.go @@ -0,0 +1,109 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package base_token_pool + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "BaseTokenPool" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var () + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{}, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/base_token_pool/testing_utils.go b/chains/solana/gobindings/v1_6_1/base_token_pool/testing_utils.go new file mode 100644 index 0000000000..76739402ff --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/base_token_pool/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package base_token_pool + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/base_token_pool/types.go b/chains/solana/gobindings/v1_6_1/base_token_pool/types.go new file mode 100644 index 0000000000..e27d5d1d87 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/base_token_pool/types.go @@ -0,0 +1,728 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package base_token_pool + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type BaseConfig struct { + TokenProgram ag_solanago.PublicKey + Mint ag_solanago.PublicKey + Decimals uint8 + PoolSigner ag_solanago.PublicKey + PoolTokenAccount ag_solanago.PublicKey + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + RateLimitAdmin ag_solanago.PublicKey + RouterOnrampAuthority ag_solanago.PublicKey + Router ag_solanago.PublicKey + Rebalancer ag_solanago.PublicKey + CanAcceptLiquidity bool + ListEnabled bool + AllowList []ag_solanago.PublicKey + RmnRemote ag_solanago.PublicKey +} + +func (obj BaseConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenProgram` param: + err = encoder.Encode(obj.TokenProgram) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Decimals` param: + err = encoder.Encode(obj.Decimals) + if err != nil { + return err + } + // Serialize `PoolSigner` param: + err = encoder.Encode(obj.PoolSigner) + if err != nil { + return err + } + // Serialize `PoolTokenAccount` param: + err = encoder.Encode(obj.PoolTokenAccount) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `RateLimitAdmin` param: + err = encoder.Encode(obj.RateLimitAdmin) + if err != nil { + return err + } + // Serialize `RouterOnrampAuthority` param: + err = encoder.Encode(obj.RouterOnrampAuthority) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `Rebalancer` param: + err = encoder.Encode(obj.Rebalancer) + if err != nil { + return err + } + // Serialize `CanAcceptLiquidity` param: + err = encoder.Encode(obj.CanAcceptLiquidity) + if err != nil { + return err + } + // Serialize `ListEnabled` param: + err = encoder.Encode(obj.ListEnabled) + if err != nil { + return err + } + // Serialize `AllowList` param: + err = encoder.Encode(obj.AllowList) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +func (obj *BaseConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenProgram`: + err = decoder.Decode(&obj.TokenProgram) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Decimals`: + err = decoder.Decode(&obj.Decimals) + if err != nil { + return err + } + // Deserialize `PoolSigner`: + err = decoder.Decode(&obj.PoolSigner) + if err != nil { + return err + } + // Deserialize `PoolTokenAccount`: + err = decoder.Decode(&obj.PoolTokenAccount) + if err != nil { + return err + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `RateLimitAdmin`: + err = decoder.Decode(&obj.RateLimitAdmin) + if err != nil { + return err + } + // Deserialize `RouterOnrampAuthority`: + err = decoder.Decode(&obj.RouterOnrampAuthority) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `Rebalancer`: + err = decoder.Decode(&obj.Rebalancer) + if err != nil { + return err + } + // Deserialize `CanAcceptLiquidity`: + err = decoder.Decode(&obj.CanAcceptLiquidity) + if err != nil { + return err + } + // Deserialize `ListEnabled`: + err = decoder.Decode(&obj.ListEnabled) + if err != nil { + return err + } + // Deserialize `AllowList`: + err = decoder.Decode(&obj.AllowList) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +type BaseChain struct { + Remote RemoteConfig + InboundRateLimit RateLimitTokenBucket + OutboundRateLimit RateLimitTokenBucket +} + +func (obj BaseChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Remote` param: + err = encoder.Encode(obj.Remote) + if err != nil { + return err + } + // Serialize `InboundRateLimit` param: + err = encoder.Encode(obj.InboundRateLimit) + if err != nil { + return err + } + // Serialize `OutboundRateLimit` param: + err = encoder.Encode(obj.OutboundRateLimit) + if err != nil { + return err + } + return nil +} + +func (obj *BaseChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Remote`: + err = decoder.Decode(&obj.Remote) + if err != nil { + return err + } + // Deserialize `InboundRateLimit`: + err = decoder.Decode(&obj.InboundRateLimit) + if err != nil { + return err + } + // Deserialize `OutboundRateLimit`: + err = decoder.Decode(&obj.OutboundRateLimit) + if err != nil { + return err + } + return nil +} + +type RemoteConfig struct { + PoolAddresses []RemoteAddress + TokenAddress RemoteAddress + Decimals uint8 +} + +func (obj RemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PoolAddresses` param: + err = encoder.Encode(obj.PoolAddresses) + if err != nil { + return err + } + // Serialize `TokenAddress` param: + err = encoder.Encode(obj.TokenAddress) + if err != nil { + return err + } + // Serialize `Decimals` param: + err = encoder.Encode(obj.Decimals) + if err != nil { + return err + } + return nil +} + +func (obj *RemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PoolAddresses`: + err = decoder.Decode(&obj.PoolAddresses) + if err != nil { + return err + } + // Deserialize `TokenAddress`: + err = decoder.Decode(&obj.TokenAddress) + if err != nil { + return err + } + // Deserialize `Decimals`: + err = decoder.Decode(&obj.Decimals) + if err != nil { + return err + } + return nil +} + +type RemoteAddress struct { + Address []byte +} + +func (obj RemoteAddress) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Address` param: + err = encoder.Encode(obj.Address) + if err != nil { + return err + } + return nil +} + +func (obj *RemoteAddress) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Address`: + err = decoder.Decode(&obj.Address) + if err != nil { + return err + } + return nil +} + +type LockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender ag_solanago.PublicKey + Amount uint64 + LocalToken ag_solanago.PublicKey + MsgTotalNonce uint64 +} + +func (obj LockOrBurnInV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Receiver` param: + err = encoder.Encode(obj.Receiver) + if err != nil { + return err + } + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `OriginalSender` param: + err = encoder.Encode(obj.OriginalSender) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `LocalToken` param: + err = encoder.Encode(obj.LocalToken) + if err != nil { + return err + } + // Serialize `MsgTotalNonce` param: + err = encoder.Encode(obj.MsgTotalNonce) + if err != nil { + return err + } + return nil +} + +func (obj *LockOrBurnInV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Receiver`: + err = decoder.Decode(&obj.Receiver) + if err != nil { + return err + } + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `OriginalSender`: + err = decoder.Decode(&obj.OriginalSender) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `LocalToken`: + err = decoder.Decode(&obj.LocalToken) + if err != nil { + return err + } + // Deserialize `MsgTotalNonce`: + err = decoder.Decode(&obj.MsgTotalNonce) + if err != nil { + return err + } + return nil +} + +type LockOrBurnOutV1 struct { + DestTokenAddress RemoteAddress + DestPoolData []byte +} + +func (obj LockOrBurnOutV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestTokenAddress` param: + err = encoder.Encode(obj.DestTokenAddress) + if err != nil { + return err + } + // Serialize `DestPoolData` param: + err = encoder.Encode(obj.DestPoolData) + if err != nil { + return err + } + return nil +} + +func (obj *LockOrBurnOutV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestTokenAddress`: + err = decoder.Decode(&obj.DestTokenAddress) + if err != nil { + return err + } + // Deserialize `DestPoolData`: + err = decoder.Decode(&obj.DestPoolData) + if err != nil { + return err + } + return nil +} + +type ReleaseOrMintInV1 struct { + OriginalSender RemoteAddress + RemoteChainSelector uint64 + Receiver ag_solanago.PublicKey + Amount [32]uint8 + LocalToken ag_solanago.PublicKey + + // @dev WARNING: sourcePoolAddress should be checked prior to any processing of funds. Make sure it matches the + // expected pool address for the given remoteChainSelector. + SourcePoolAddress RemoteAddress + SourcePoolData []byte + + // @dev WARNING: offchainTokenData is untrusted data. + OffchainTokenData []byte +} + +func (obj ReleaseOrMintInV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `OriginalSender` param: + err = encoder.Encode(obj.OriginalSender) + if err != nil { + return err + } + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Receiver` param: + err = encoder.Encode(obj.Receiver) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `LocalToken` param: + err = encoder.Encode(obj.LocalToken) + if err != nil { + return err + } + // Serialize `SourcePoolAddress` param: + err = encoder.Encode(obj.SourcePoolAddress) + if err != nil { + return err + } + // Serialize `SourcePoolData` param: + err = encoder.Encode(obj.SourcePoolData) + if err != nil { + return err + } + // Serialize `OffchainTokenData` param: + err = encoder.Encode(obj.OffchainTokenData) + if err != nil { + return err + } + return nil +} + +func (obj *ReleaseOrMintInV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `OriginalSender`: + err = decoder.Decode(&obj.OriginalSender) + if err != nil { + return err + } + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Receiver`: + err = decoder.Decode(&obj.Receiver) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `LocalToken`: + err = decoder.Decode(&obj.LocalToken) + if err != nil { + return err + } + // Deserialize `SourcePoolAddress`: + err = decoder.Decode(&obj.SourcePoolAddress) + if err != nil { + return err + } + // Deserialize `SourcePoolData`: + err = decoder.Decode(&obj.SourcePoolData) + if err != nil { + return err + } + // Deserialize `OffchainTokenData`: + err = decoder.Decode(&obj.OffchainTokenData) + if err != nil { + return err + } + return nil +} + +type ReleaseOrMintOutV1 struct { + DestinationAmount uint64 +} + +func (obj ReleaseOrMintOutV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestinationAmount` param: + err = encoder.Encode(obj.DestinationAmount) + if err != nil { + return err + } + return nil +} + +func (obj *ReleaseOrMintOutV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestinationAmount`: + err = decoder.Decode(&obj.DestinationAmount) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsResponse struct { + AskAgainWith []CcipAccountMeta + AccountsToSave []CcipAccountMeta + LookUpTablesToSave []ag_solanago.PublicKey + CurrentStage string + NextStage string +} + +func (obj DeriveAccountsResponse) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `AskAgainWith` param: + err = encoder.Encode(obj.AskAgainWith) + if err != nil { + return err + } + // Serialize `AccountsToSave` param: + err = encoder.Encode(obj.AccountsToSave) + if err != nil { + return err + } + // Serialize `LookUpTablesToSave` param: + err = encoder.Encode(obj.LookUpTablesToSave) + if err != nil { + return err + } + // Serialize `CurrentStage` param: + err = encoder.Encode(obj.CurrentStage) + if err != nil { + return err + } + // Serialize `NextStage` param: + err = encoder.Encode(obj.NextStage) + if err != nil { + return err + } + return nil +} + +func (obj *DeriveAccountsResponse) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `AskAgainWith`: + err = decoder.Decode(&obj.AskAgainWith) + if err != nil { + return err + } + // Deserialize `AccountsToSave`: + err = decoder.Decode(&obj.AccountsToSave) + if err != nil { + return err + } + // Deserialize `LookUpTablesToSave`: + err = decoder.Decode(&obj.LookUpTablesToSave) + if err != nil { + return err + } + // Deserialize `CurrentStage`: + err = decoder.Decode(&obj.CurrentStage) + if err != nil { + return err + } + // Deserialize `NextStage`: + err = decoder.Decode(&obj.NextStage) + if err != nil { + return err + } + return nil +} + +type CcipAccountMeta struct { + Pubkey ag_solanago.PublicKey + IsSigner bool + IsWritable bool +} + +func (obj CcipAccountMeta) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Pubkey` param: + err = encoder.Encode(obj.Pubkey) + if err != nil { + return err + } + // Serialize `IsSigner` param: + err = encoder.Encode(obj.IsSigner) + if err != nil { + return err + } + // Serialize `IsWritable` param: + err = encoder.Encode(obj.IsWritable) + if err != nil { + return err + } + return nil +} + +func (obj *CcipAccountMeta) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Pubkey`: + err = decoder.Decode(&obj.Pubkey) + if err != nil { + return err + } + // Deserialize `IsSigner`: + err = decoder.Decode(&obj.IsSigner) + if err != nil { + return err + } + // Deserialize `IsWritable`: + err = decoder.Decode(&obj.IsWritable) + if err != nil { + return err + } + return nil +} + +type RateLimitTokenBucket struct { + Tokens uint64 + LastUpdated uint64 + Cfg RateLimitConfig +} + +func (obj RateLimitTokenBucket) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Tokens` param: + err = encoder.Encode(obj.Tokens) + if err != nil { + return err + } + // Serialize `LastUpdated` param: + err = encoder.Encode(obj.LastUpdated) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} + +func (obj *RateLimitTokenBucket) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Tokens`: + err = decoder.Decode(&obj.Tokens) + if err != nil { + return err + } + // Deserialize `LastUpdated`: + err = decoder.Decode(&obj.LastUpdated) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +type RateLimitConfig struct { + Enabled bool + Capacity uint64 + Rate uint64 +} + +func (obj RateLimitConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Enabled` param: + err = encoder.Encode(obj.Enabled) + if err != nil { + return err + } + // Serialize `Capacity` param: + err = encoder.Encode(obj.Capacity) + if err != nil { + return err + } + // Serialize `Rate` param: + err = encoder.Encode(obj.Rate) + if err != nil { + return err + } + return nil +} + +func (obj *RateLimitConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Enabled`: + err = decoder.Decode(&obj.Enabled) + if err != nil { + return err + } + // Deserialize `Capacity`: + err = decoder.Decode(&obj.Capacity) + if err != nil { + return err + } + // Deserialize `Rate`: + err = decoder.Decode(&obj.Rate) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership.go new file mode 100644 index 0000000000..bdd2f9c28b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership.go @@ -0,0 +1,136 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AcceptOwnership is the `acceptOwnership` instruction. +type AcceptOwnership struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *AcceptOwnership) SetMintAccount(mint ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *AcceptOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership_test.go new file mode 100644 index 0000000000..7fad8e5cf3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses.go new file mode 100644 index 0000000000..f27bf3d820 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AppendRemotePoolAddresses is the `appendRemotePoolAddresses` instruction. +type AppendRemotePoolAddresses struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Addresses *[]RemoteAddress + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAppendRemotePoolAddressesInstructionBuilder creates a new `AppendRemotePoolAddresses` instruction builder. +func NewAppendRemotePoolAddressesInstructionBuilder() *AppendRemotePoolAddresses { + nd := &AppendRemotePoolAddresses{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *AppendRemotePoolAddresses) SetRemoteChainSelector(remoteChainSelector uint64) *AppendRemotePoolAddresses { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *AppendRemotePoolAddresses) SetMint(mint ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.Mint = &mint + return inst +} + +// SetAddresses sets the "addresses" parameter. +func (inst *AppendRemotePoolAddresses) SetAddresses(addresses []RemoteAddress) *AppendRemotePoolAddresses { + inst.Addresses = &addresses + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *AppendRemotePoolAddresses) SetStateAccount(state ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AppendRemotePoolAddresses) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AppendRemotePoolAddresses) SetAuthorityAccount(authority ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AppendRemotePoolAddresses) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AppendRemotePoolAddresses) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AppendRemotePoolAddresses, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AppendRemotePoolAddresses) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AppendRemotePoolAddresses) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Addresses == nil { + return errors.New("Addresses parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AppendRemotePoolAddresses) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AppendRemotePoolAddresses")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Addresses", *inst.Addresses)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AppendRemotePoolAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Addresses` param: + err = encoder.Encode(obj.Addresses) + if err != nil { + return err + } + return nil +} +func (obj *AppendRemotePoolAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Addresses`: + err = decoder.Decode(&obj.Addresses) + if err != nil { + return err + } + return nil +} + +// NewAppendRemotePoolAddressesInstruction declares a new AppendRemotePoolAddresses instruction with the provided parameters and accounts. +func NewAppendRemotePoolAddressesInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + addresses []RemoteAddress, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + return NewAppendRemotePoolAddressesInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetAddresses(addresses). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses_test.go new file mode 100644 index 0000000000..62246b1405 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/AppendRemotePoolAddresses_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AppendRemotePoolAddresses(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AppendRemotePoolAddresses"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AppendRemotePoolAddresses) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AppendRemotePoolAddresses) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList.go new file mode 100644 index 0000000000..8a02a7a27a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList.go @@ -0,0 +1,207 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ConfigureAllowList is the `configureAllowList` instruction. +type ConfigureAllowList struct { + Add *[]ag_solanago.PublicKey + Enabled *bool + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewConfigureAllowListInstructionBuilder creates a new `ConfigureAllowList` instruction builder. +func NewConfigureAllowListInstructionBuilder() *ConfigureAllowList { + nd := &ConfigureAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetAdd sets the "add" parameter. +func (inst *ConfigureAllowList) SetAdd(add []ag_solanago.PublicKey) *ConfigureAllowList { + inst.Add = &add + return inst +} + +// SetEnabled sets the "enabled" parameter. +func (inst *ConfigureAllowList) SetEnabled(enabled bool) *ConfigureAllowList { + inst.Enabled = &enabled + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ConfigureAllowList) SetStateAccount(state ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ConfigureAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *ConfigureAllowList) SetMintAccount(mint ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ConfigureAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ConfigureAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ConfigureAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ConfigureAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ConfigureAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst ConfigureAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ConfigureAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ConfigureAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ConfigureAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Add == nil { + return errors.New("Add parameter is not set") + } + if inst.Enabled == nil { + return errors.New("Enabled parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *ConfigureAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ConfigureAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Add", *inst.Add)) + paramsBranch.Child(ag_format.Param("Enabled", *inst.Enabled)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj ConfigureAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Add` param: + err = encoder.Encode(obj.Add) + if err != nil { + return err + } + // Serialize `Enabled` param: + err = encoder.Encode(obj.Enabled) + if err != nil { + return err + } + return nil +} +func (obj *ConfigureAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Add`: + err = decoder.Decode(&obj.Add) + if err != nil { + return err + } + // Deserialize `Enabled`: + err = decoder.Decode(&obj.Enabled) + if err != nil { + return err + } + return nil +} + +// NewConfigureAllowListInstruction declares a new ConfigureAllowList instruction with the provided parameters and accounts. +func NewConfigureAllowListInstruction( + // Parameters: + add []ag_solanago.PublicKey, + enabled bool, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + return NewConfigureAllowListInstructionBuilder(). + SetAdd(add). + SetEnabled(enabled). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList_test.go new file mode 100644 index 0000000000..5fa2f26701 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ConfigureAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ConfigureAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ConfigureAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ConfigureAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ConfigureAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig.go new file mode 100644 index 0000000000..ffe32a53bb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig.go @@ -0,0 +1,188 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeleteChainConfig is the `deleteChainConfig` instruction. +type DeleteChainConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeleteChainConfigInstructionBuilder creates a new `DeleteChainConfig` instruction builder. +func NewDeleteChainConfigInstructionBuilder() *DeleteChainConfig { + nd := &DeleteChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *DeleteChainConfig) SetRemoteChainSelector(remoteChainSelector uint64) *DeleteChainConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *DeleteChainConfig) SetMint(mint ag_solanago.PublicKey) *DeleteChainConfig { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *DeleteChainConfig) SetStateAccount(state ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *DeleteChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *DeleteChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *DeleteChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DeleteChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DeleteChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst DeleteChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeleteChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeleteChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeleteChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *DeleteChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeleteChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj DeleteChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *DeleteChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewDeleteChainConfigInstruction declares a new DeleteChainConfig instruction with the provided parameters and accounts. +func NewDeleteChainConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *DeleteChainConfig { + return NewDeleteChainConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig_test.go new file mode 100644 index 0000000000..520299b23f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/DeleteChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeleteChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeleteChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeleteChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeleteChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig.go new file mode 100644 index 0000000000..f971d44e21 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// EditChainRemoteConfig is the `editChainRemoteConfig` instruction. +type EditChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewEditChainRemoteConfigInstructionBuilder creates a new `EditChainRemoteConfig` instruction builder. +func NewEditChainRemoteConfigInstructionBuilder() *EditChainRemoteConfig { + nd := &EditChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *EditChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *EditChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *EditChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *EditChainRemoteConfig) SetCfg(cfg RemoteConfig) *EditChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *EditChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *EditChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *EditChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *EditChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *EditChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *EditChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *EditChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *EditChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst EditChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_EditChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst EditChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *EditChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *EditChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("EditChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj EditChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *EditChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewEditChainRemoteConfigInstruction declares a new EditChainRemoteConfig instruction with the provided parameters and accounts. +func NewEditChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + return NewEditChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig_test.go new file mode 100644 index 0000000000..ac9e6edb75 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/EditChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_EditChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("EditChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(EditChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(EditChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig.go new file mode 100644 index 0000000000..50b738b05a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitChainRemoteConfig is the `initChainRemoteConfig` instruction. +type InitChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitChainRemoteConfigInstructionBuilder creates a new `InitChainRemoteConfig` instruction builder. +func NewInitChainRemoteConfigInstructionBuilder() *InitChainRemoteConfig { + nd := &InitChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *InitChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *InitChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *InitChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *InitChainRemoteConfig) SetCfg(cfg RemoteConfig) *InitChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *InitChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *InitChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst InitChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *InitChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj InitChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *InitChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewInitChainRemoteConfigInstruction declares a new InitChainRemoteConfig instruction with the provided parameters and accounts. +func NewInitChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + return NewInitChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig_test.go new file mode 100644 index 0000000000..d05c0a4f7c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig.go new file mode 100644 index 0000000000..9a89b43939 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig.go @@ -0,0 +1,226 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitGlobalConfig is the `initGlobalConfig` instruction. +type InitGlobalConfig struct { + RouterAddress *ag_solanago.PublicKey + RmnAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitGlobalConfigInstructionBuilder creates a new `InitGlobalConfig` instruction builder. +func NewInitGlobalConfigInstructionBuilder() *InitGlobalConfig { + nd := &InitGlobalConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetRouterAddress sets the "routerAddress" parameter. +func (inst *InitGlobalConfig) SetRouterAddress(routerAddress ag_solanago.PublicKey) *InitGlobalConfig { + inst.RouterAddress = &routerAddress + return inst +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *InitGlobalConfig) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *InitGlobalConfig { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *InitGlobalConfig) SetConfigAccount(config ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *InitGlobalConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitGlobalConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitGlobalConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitGlobalConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitGlobalConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *InitGlobalConfig) SetProgramAccount(program ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *InitGlobalConfig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *InitGlobalConfig) SetProgramDataAccount(programData ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *InitGlobalConfig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst InitGlobalConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitGlobalConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitGlobalConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitGlobalConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RouterAddress == nil { + return errors.New("RouterAddress parameter is not set") + } + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *InitGlobalConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitGlobalConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RouterAddress", *inst.RouterAddress)) + paramsBranch.Child(ag_format.Param(" RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj InitGlobalConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RouterAddress` param: + err = encoder.Encode(obj.RouterAddress) + if err != nil { + return err + } + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *InitGlobalConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RouterAddress`: + err = decoder.Decode(&obj.RouterAddress) + if err != nil { + return err + } + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewInitGlobalConfigInstruction declares a new InitGlobalConfig instruction with the provided parameters and accounts. +func NewInitGlobalConfigInstruction( + // Parameters: + routerAddress ag_solanago.PublicKey, + rmnAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *InitGlobalConfig { + return NewInitGlobalConfigInstructionBuilder(). + SetRouterAddress(routerAddress). + SetRmnAddress(rmnAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig_test.go new file mode 100644 index 0000000000..cee3fe7c65 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitGlobalConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitGlobalConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitGlobalConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitGlobalConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitGlobalConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize.go new file mode 100644 index 0000000000..d180b55e40 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize.go @@ -0,0 +1,212 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + // + // [6] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *Initialize) SetMintAccount(mint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *Initialize) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[6] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey, + config ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion.go new file mode 100644 index 0000000000..639fbf8eaf --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion.go @@ -0,0 +1,127 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitializeStateVersion is the `initializeStateVersion` instruction. +type InitializeStateVersion struct { + Mint *ag_solanago.PublicKey + + // [0] = [WRITE] state + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeStateVersionInstructionBuilder creates a new `InitializeStateVersion` instruction builder. +func NewInitializeStateVersionInstructionBuilder() *InitializeStateVersion { + nd := &InitializeStateVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *InitializeStateVersion) SetMint(mint ag_solanago.PublicKey) *InitializeStateVersion { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitializeStateVersion) SetStateAccount(state ag_solanago.PublicKey) *InitializeStateVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitializeStateVersion) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst InitializeStateVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitializeStateVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitializeStateVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitializeStateVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + } + return nil +} + +func (inst *InitializeStateVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitializeStateVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj InitializeStateVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *InitializeStateVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewInitializeStateVersionInstruction declares a new InitializeStateVersion instruction with the provided parameters and accounts. +func NewInitializeStateVersionInstruction( + // Parameters: + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey) *InitializeStateVersion { + return NewInitializeStateVersionInstructionBuilder(). + SetMint(mint). + SetStateAccount(state) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion_test.go new file mode 100644 index 0000000000..b4e42a615b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/InitializeStateVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitializeStateVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitializeStateVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitializeStateVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitializeStateVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize_test.go new file mode 100644 index 0000000000..9579ec5d7d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens.go new file mode 100644 index 0000000000..92b221a7fa --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens.go @@ -0,0 +1,298 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// LockOrBurnTokens is the `lockOrBurnTokens` instruction. +type LockOrBurnTokens struct { + LockOrBurn *LockOrBurnInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] state + // + // [2] = [] tokenProgram + // + // [3] = [WRITE] mint + // + // [4] = [] poolSigner + // + // [5] = [WRITE] poolTokenAccount + // + // [6] = [] rmnRemote + // + // [7] = [] rmnRemoteCurses + // + // [8] = [] rmnRemoteConfig + // + // [9] = [WRITE] chainConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewLockOrBurnTokensInstructionBuilder creates a new `LockOrBurnTokens` instruction builder. +func NewLockOrBurnTokensInstructionBuilder() *LockOrBurnTokens { + nd := &LockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 10), + } + return nd +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *LockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *LockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *LockOrBurnTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *LockOrBurnTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetStateAccount sets the "state" account. +func (inst *LockOrBurnTokens) SetStateAccount(state ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *LockOrBurnTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *LockOrBurnTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *LockOrBurnTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMintAccount sets the "mint" account. +func (inst *LockOrBurnTokens) SetMintAccount(mint ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *LockOrBurnTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *LockOrBurnTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *LockOrBurnTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *LockOrBurnTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *LockOrBurnTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *LockOrBurnTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *LockOrBurnTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +func (inst LockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_LockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst LockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *LockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.ChainConfig is not set") + } + } + return nil +} + +func (inst *LockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("LockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=10]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[9])) + }) + }) + }) +} + +func (obj LockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *LockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewLockOrBurnTokensInstruction declares a new LockOrBurnTokens instruction with the provided parameters and accounts. +func NewLockOrBurnTokensInstruction( + // Parameters: + lockOrBurn LockOrBurnInV1, + // Accounts: + authority ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + return NewLockOrBurnTokensInstructionBuilder(). + SetLockOrBurn(lockOrBurn). + SetAuthorityAccount(authority). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetChainConfigAccount(chainConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens_test.go new file mode 100644 index 0000000000..c29049398f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/LockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_LockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("LockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(LockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(LockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens.go new file mode 100644 index 0000000000..6477eb1202 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens.go @@ -0,0 +1,367 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ReleaseOrMintTokens is the `releaseOrMintTokens` instruction. +type ReleaseOrMintTokens struct { + ReleaseOrMint *ReleaseOrMintInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] offrampProgram + // ··········· CHECK offramp program: exists only to derive the allowed offramp PDA + // ··········· and the authority PDA. + // + // [2] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp + // + // [3] = [] state + // + // [4] = [] tokenProgram + // + // [5] = [WRITE] mint + // + // [6] = [] poolSigner + // + // [7] = [WRITE] poolTokenAccount + // + // [8] = [WRITE] chainConfig + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + // + // [12] = [WRITE] receiverTokenAccount + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReleaseOrMintTokensInstructionBuilder creates a new `ReleaseOrMintTokens` instruction builder. +func NewReleaseOrMintTokensInstructionBuilder() *ReleaseOrMintTokens { + nd := &ReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 13), + } + return nd +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *ReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *ReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReleaseOrMintTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReleaseOrMintTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetOfframpProgramAccount sets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) SetOfframpProgramAccount(offrampProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(offrampProgram) + return inst +} + +// GetOfframpProgramAccount gets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) GetOfframpProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetStateAccount sets the "state" account. +func (inst *ReleaseOrMintTokens) SetStateAccount(state ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReleaseOrMintTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetMintAccount sets the "mint" account. +func (inst *ReleaseOrMintTokens) SetMintAccount(mint ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ReleaseOrMintTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetReceiverTokenAccountAccount sets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetReceiverTokenAccountAccount(receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[12] = ag_solanago.Meta(receiverTokenAccount).WRITE() + return inst +} + +// GetReceiverTokenAccountAccount gets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetReceiverTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +func (inst ReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.OfframpProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.ReceiverTokenAccount is not set") + } + } + return nil +} + +func (inst *ReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" offrampProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" receiverToken", inst.AccountMetaSlice[12])) + }) + }) + }) +} + +func (obj ReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *ReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewReleaseOrMintTokensInstruction declares a new ReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewReleaseOrMintTokensInstruction( + // Parameters: + releaseOrMint ReleaseOrMintInV1, + // Accounts: + authority ag_solanago.PublicKey, + offrampProgram ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + return NewReleaseOrMintTokensInstructionBuilder(). + SetReleaseOrMint(releaseOrMint). + SetAuthorityAccount(authority). + SetOfframpProgramAccount(offrampProgram). + SetAllowedOfframpAccount(allowedOfframp). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetChainConfigAccount(chainConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetReceiverTokenAccountAccount(receiverTokenAccount) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..b32fcdf106 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/ReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList.go new file mode 100644 index 0000000000..6991aa530f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// RemoveFromAllowList is the `removeFromAllowList` instruction. +type RemoveFromAllowList struct { + Remove *[]ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemoveFromAllowListInstructionBuilder creates a new `RemoveFromAllowList` instruction builder. +func NewRemoveFromAllowListInstructionBuilder() *RemoveFromAllowList { + nd := &RemoveFromAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemove sets the "remove" parameter. +func (inst *RemoveFromAllowList) SetRemove(remove []ag_solanago.PublicKey) *RemoveFromAllowList { + inst.Remove = &remove + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *RemoveFromAllowList) SetStateAccount(state ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *RemoveFromAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *RemoveFromAllowList) SetMintAccount(mint ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *RemoveFromAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemoveFromAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemoveFromAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemoveFromAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemoveFromAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemoveFromAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemoveFromAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemoveFromAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemoveFromAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Remove == nil { + return errors.New("Remove parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemoveFromAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemoveFromAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Remove", *inst.Remove)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemoveFromAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Remove` param: + err = encoder.Encode(obj.Remove) + if err != nil { + return err + } + return nil +} +func (obj *RemoveFromAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Remove`: + err = decoder.Decode(&obj.Remove) + if err != nil { + return err + } + return nil +} + +// NewRemoveFromAllowListInstruction declares a new RemoveFromAllowList instruction with the provided parameters and accounts. +func NewRemoveFromAllowListInstruction( + // Parameters: + remove []ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + return NewRemoveFromAllowListInstructionBuilder(). + SetRemove(remove). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList_test.go new file mode 100644 index 0000000000..7d0f10354a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/RemoveFromAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemoveFromAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemoveFromAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemoveFromAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemoveFromAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit.go new file mode 100644 index 0000000000..2a28a1bd6f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit.go @@ -0,0 +1,234 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetChainRateLimit is the `setChainRateLimit` instruction. +type SetChainRateLimit struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Inbound *RateLimitConfig + Outbound *RateLimitConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetChainRateLimitInstructionBuilder creates a new `SetChainRateLimit` instruction builder. +func NewSetChainRateLimitInstructionBuilder() *SetChainRateLimit { + nd := &SetChainRateLimit{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *SetChainRateLimit) SetRemoteChainSelector(remoteChainSelector uint64) *SetChainRateLimit { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *SetChainRateLimit) SetMint(mint ag_solanago.PublicKey) *SetChainRateLimit { + inst.Mint = &mint + return inst +} + +// SetInbound sets the "inbound" parameter. +func (inst *SetChainRateLimit) SetInbound(inbound RateLimitConfig) *SetChainRateLimit { + inst.Inbound = &inbound + return inst +} + +// SetOutbound sets the "outbound" parameter. +func (inst *SetChainRateLimit) SetOutbound(outbound RateLimitConfig) *SetChainRateLimit { + inst.Outbound = &outbound + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetChainRateLimit) SetStateAccount(state ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetChainRateLimit) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *SetChainRateLimit) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *SetChainRateLimit) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetChainRateLimit) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetChainRateLimit) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetChainRateLimit) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetChainRateLimit, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetChainRateLimit) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetChainRateLimit) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Inbound == nil { + return errors.New("Inbound parameter is not set") + } + if inst.Outbound == nil { + return errors.New("Outbound parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetChainRateLimit) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetChainRateLimit")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Inbound", *inst.Inbound)) + paramsBranch.Child(ag_format.Param(" Outbound", *inst.Outbound)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetChainRateLimit) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Inbound` param: + err = encoder.Encode(obj.Inbound) + if err != nil { + return err + } + // Serialize `Outbound` param: + err = encoder.Encode(obj.Outbound) + if err != nil { + return err + } + return nil +} +func (obj *SetChainRateLimit) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Inbound`: + err = decoder.Decode(&obj.Inbound) + if err != nil { + return err + } + // Deserialize `Outbound`: + err = decoder.Decode(&obj.Outbound) + if err != nil { + return err + } + return nil +} + +// NewSetChainRateLimitInstruction declares a new SetChainRateLimit instruction with the provided parameters and accounts. +func NewSetChainRateLimitInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + inbound RateLimitConfig, + outbound RateLimitConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetChainRateLimit { + return NewSetChainRateLimitInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetInbound(inbound). + SetOutbound(outbound). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit_test.go new file mode 100644 index 0000000000..39bcdc41af --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetChainRateLimit_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetChainRateLimit(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetChainRateLimit"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetChainRateLimit) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetChainRateLimit) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin.go new file mode 100644 index 0000000000..73d21b943e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin.go @@ -0,0 +1,169 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRateLimitAdmin is the `setRateLimitAdmin` instruction. +type SetRateLimitAdmin struct { + Mint *ag_solanago.PublicKey + NewRateLimitAdmin *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRateLimitAdminInstructionBuilder creates a new `SetRateLimitAdmin` instruction builder. +func NewSetRateLimitAdminInstructionBuilder() *SetRateLimitAdmin { + nd := &SetRateLimitAdmin{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *SetRateLimitAdmin) SetMint(mint ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.Mint = &mint + return inst +} + +// SetNewRateLimitAdmin sets the "newRateLimitAdmin" parameter. +func (inst *SetRateLimitAdmin) SetNewRateLimitAdmin(newRateLimitAdmin ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.NewRateLimitAdmin = &newRateLimitAdmin + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRateLimitAdmin) SetStateAccount(state ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRateLimitAdmin) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRateLimitAdmin) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRateLimitAdmin) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetRateLimitAdmin) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRateLimitAdmin, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRateLimitAdmin) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRateLimitAdmin) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.NewRateLimitAdmin == nil { + return errors.New("NewRateLimitAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRateLimitAdmin) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRateLimitAdmin")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param("NewRateLimitAdmin", *inst.NewRateLimitAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetRateLimitAdmin) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `NewRateLimitAdmin` param: + err = encoder.Encode(obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} +func (obj *SetRateLimitAdmin) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `NewRateLimitAdmin`: + err = decoder.Decode(&obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} + +// NewSetRateLimitAdminInstruction declares a new SetRateLimitAdmin instruction with the provided parameters and accounts. +func NewSetRateLimitAdminInstruction( + // Parameters: + mint ag_solanago.PublicKey, + newRateLimitAdmin ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRateLimitAdmin { + return NewSetRateLimitAdminInstructionBuilder(). + SetMint(mint). + SetNewRateLimitAdmin(newRateLimitAdmin). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin_test.go new file mode 100644 index 0000000000..08cd192da8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRateLimitAdmin_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRateLimitAdmin(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRateLimitAdmin"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRateLimitAdmin) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRateLimitAdmin) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn.go new file mode 100644 index 0000000000..d2239fe1dc --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRmn is the `setRmn` instruction. +type SetRmn struct { + RmnAddress *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRmnInstructionBuilder creates a new `SetRmn` instruction builder. +func NewSetRmnInstructionBuilder() *SetRmn { + nd := &SetRmn{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *SetRmn) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *SetRmn { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRmn) SetStateAccount(state ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRmn) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRmn) SetMintAccount(mint ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRmn) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRmn) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRmn) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRmn) SetProgramAccount(program ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRmn) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRmn) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRmn) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRmn) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRmn, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRmn) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRmn) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRmn) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRmn")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRmn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *SetRmn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewSetRmnInstruction declares a new SetRmn instruction with the provided parameters and accounts. +func NewSetRmnInstruction( + // Parameters: + rmnAddress ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRmn { + return NewSetRmnInstructionBuilder(). + SetRmnAddress(rmnAddress). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn_test.go new file mode 100644 index 0000000000..2facd9e3cf --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRmn_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRmn(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRmn"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRmn) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRmn) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter.go new file mode 100644 index 0000000000..2db0386fe1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRouter is the `setRouter` instruction. +type SetRouter struct { + NewRouter *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRouterInstructionBuilder creates a new `SetRouter` instruction builder. +func NewSetRouterInstructionBuilder() *SetRouter { + nd := &SetRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetNewRouter sets the "newRouter" parameter. +func (inst *SetRouter) SetNewRouter(newRouter ag_solanago.PublicKey) *SetRouter { + inst.NewRouter = &newRouter + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRouter) SetStateAccount(state ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRouter) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRouter) SetMintAccount(mint ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRouter) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRouter) SetProgramAccount(program ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRouter) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRouter) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRouter) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewRouter == nil { + return errors.New("NewRouter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewRouter", *inst.NewRouter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewRouter` param: + err = encoder.Encode(obj.NewRouter) + if err != nil { + return err + } + return nil +} +func (obj *SetRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewRouter`: + err = decoder.Decode(&obj.NewRouter) + if err != nil { + return err + } + return nil +} + +// NewSetRouterInstruction declares a new SetRouter instruction with the provided parameters and accounts. +func NewSetRouterInstruction( + // Parameters: + newRouter ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRouter { + return NewSetRouterInstructionBuilder(). + SetNewRouter(newRouter). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter_test.go new file mode 100644 index 0000000000..68ac490149 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/SetRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig.go new file mode 100644 index 0000000000..20ee678cad --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig.go @@ -0,0 +1,231 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferMintAuthorityToMultisig is the `transferMintAuthorityToMultisig` instruction. +type TransferMintAuthorityToMultisig struct { + + // [0] = [WRITE] state + // + // [1] = [WRITE] mint + // + // [2] = [] tokenProgram + // + // [3] = [] poolSigner + // + // [4] = [SIGNER] authority + // + // [5] = [] newMultisigMintAuthority + // + // [6] = [] program + // + // [7] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferMintAuthorityToMultisigInstructionBuilder creates a new `TransferMintAuthorityToMultisig` instruction builder. +func NewTransferMintAuthorityToMultisigInstructionBuilder() *TransferMintAuthorityToMultisig { + nd := &TransferMintAuthorityToMultisig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 8), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *TransferMintAuthorityToMultisig) SetStateAccount(state ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferMintAuthorityToMultisig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferMintAuthorityToMultisig) SetMintAccount(mint ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferMintAuthorityToMultisig) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *TransferMintAuthorityToMultisig) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *TransferMintAuthorityToMultisig) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *TransferMintAuthorityToMultisig) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *TransferMintAuthorityToMultisig) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferMintAuthorityToMultisig) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferMintAuthorityToMultisig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetNewMultisigMintAuthorityAccount sets the "newMultisigMintAuthority" account. +func (inst *TransferMintAuthorityToMultisig) SetNewMultisigMintAuthorityAccount(newMultisigMintAuthority ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[5] = ag_solanago.Meta(newMultisigMintAuthority) + return inst +} + +// GetNewMultisigMintAuthorityAccount gets the "newMultisigMintAuthority" account. +func (inst *TransferMintAuthorityToMultisig) GetNewMultisigMintAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetProgramAccount sets the "program" account. +func (inst *TransferMintAuthorityToMultisig) SetProgramAccount(program ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[6] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *TransferMintAuthorityToMultisig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *TransferMintAuthorityToMultisig) SetProgramDataAccount(programData ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + inst.AccountMetaSlice[7] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *TransferMintAuthorityToMultisig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +func (inst TransferMintAuthorityToMultisig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferMintAuthorityToMultisig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferMintAuthorityToMultisig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferMintAuthorityToMultisig) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.NewMultisigMintAuthority is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *TransferMintAuthorityToMultisig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferMintAuthorityToMultisig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=8]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta("newMultisigMintAuthority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[7])) + }) + }) + }) +} + +func (obj TransferMintAuthorityToMultisig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TransferMintAuthorityToMultisig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTransferMintAuthorityToMultisigInstruction declares a new TransferMintAuthorityToMultisig instruction with the provided parameters and accounts. +func NewTransferMintAuthorityToMultisigInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + newMultisigMintAuthority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *TransferMintAuthorityToMultisig { + return NewTransferMintAuthorityToMultisigInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetTokenProgramAccount(tokenProgram). + SetPoolSignerAccount(poolSigner). + SetAuthorityAccount(authority). + SetNewMultisigMintAuthorityAccount(newMultisigMintAuthority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig_test.go new file mode 100644 index 0000000000..bf2d8dc7cd --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferMintAuthorityToMultisig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferMintAuthorityToMultisig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferMintAuthorityToMultisig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferMintAuthorityToMultisig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferMintAuthorityToMultisig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership.go new file mode 100644 index 0000000000..36799df943 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferOwnership is the `transferOwnership` instruction. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferOwnership) SetMintAccount(mint ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership_test.go new file mode 100644 index 0000000000..7604c54015 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion.go new file mode 100644 index 0000000000..ae7e29d687 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion_test.go new file mode 100644 index 0000000000..9fa1f5b957 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn.go new file mode 100644 index 0000000000..cfcc44ecf7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateDefaultRmn is the `updateDefaultRmn` instruction. +type UpdateDefaultRmn struct { + RmnAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDefaultRmnInstructionBuilder creates a new `UpdateDefaultRmn` instruction builder. +func NewUpdateDefaultRmnInstructionBuilder() *UpdateDefaultRmn { + nd := &UpdateDefaultRmn{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *UpdateDefaultRmn) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDefaultRmn) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDefaultRmn) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDefaultRmn) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDefaultRmn) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateDefaultRmn) SetProgramAccount(program ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateDefaultRmn) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateDefaultRmn) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateDefaultRmn) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateDefaultRmn) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDefaultRmn, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDefaultRmn) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDefaultRmn) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateDefaultRmn) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDefaultRmn")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateDefaultRmn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDefaultRmn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewUpdateDefaultRmnInstruction declares a new UpdateDefaultRmn instruction with the provided parameters and accounts. +func NewUpdateDefaultRmnInstruction( + // Parameters: + rmnAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateDefaultRmn { + return NewUpdateDefaultRmnInstructionBuilder(). + SetRmnAddress(rmnAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn_test.go new file mode 100644 index 0000000000..3ecea658cb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRmn_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDefaultRmn(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDefaultRmn"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDefaultRmn) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDefaultRmn) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter.go new file mode 100644 index 0000000000..5306fc87db --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateDefaultRouter is the `updateDefaultRouter` instruction. +type UpdateDefaultRouter struct { + RouterAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDefaultRouterInstructionBuilder creates a new `UpdateDefaultRouter` instruction builder. +func NewUpdateDefaultRouterInstructionBuilder() *UpdateDefaultRouter { + nd := &UpdateDefaultRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRouterAddress sets the "routerAddress" parameter. +func (inst *UpdateDefaultRouter) SetRouterAddress(routerAddress ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.RouterAddress = &routerAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDefaultRouter) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDefaultRouter) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDefaultRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDefaultRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateDefaultRouter) SetProgramAccount(program ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateDefaultRouter) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateDefaultRouter) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateDefaultRouter) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateDefaultRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDefaultRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDefaultRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDefaultRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RouterAddress == nil { + return errors.New("RouterAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateDefaultRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDefaultRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RouterAddress", *inst.RouterAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateDefaultRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RouterAddress` param: + err = encoder.Encode(obj.RouterAddress) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDefaultRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RouterAddress`: + err = decoder.Decode(&obj.RouterAddress) + if err != nil { + return err + } + return nil +} + +// NewUpdateDefaultRouterInstruction declares a new UpdateDefaultRouter instruction with the provided parameters and accounts. +func NewUpdateDefaultRouterInstruction( + // Parameters: + routerAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateDefaultRouter { + return NewUpdateDefaultRouterInstructionBuilder(). + SetRouterAddress(routerAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter_test.go new file mode 100644 index 0000000000..367428e035 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateDefaultRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDefaultRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDefaultRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDefaultRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDefaultRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed.go new file mode 100644 index 0000000000..138f110e48 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateSelfServedAllowed is the `updateSelfServedAllowed` instruction. +type UpdateSelfServedAllowed struct { + SelfServedAllowed *bool + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateSelfServedAllowedInstructionBuilder creates a new `UpdateSelfServedAllowed` instruction builder. +func NewUpdateSelfServedAllowedInstructionBuilder() *UpdateSelfServedAllowed { + nd := &UpdateSelfServedAllowed{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSelfServedAllowed sets the "selfServedAllowed" parameter. +func (inst *UpdateSelfServedAllowed) SetSelfServedAllowed(selfServedAllowed bool) *UpdateSelfServedAllowed { + inst.SelfServedAllowed = &selfServedAllowed + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateSelfServedAllowed) SetConfigAccount(config ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateSelfServedAllowed) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateSelfServedAllowed) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateSelfServedAllowed) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateSelfServedAllowed) SetProgramAccount(program ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateSelfServedAllowed) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateSelfServedAllowed) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateSelfServedAllowed) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateSelfServedAllowed) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateSelfServedAllowed, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateSelfServedAllowed) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateSelfServedAllowed) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SelfServedAllowed == nil { + return errors.New("SelfServedAllowed parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateSelfServedAllowed) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateSelfServedAllowed")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SelfServedAllowed", *inst.SelfServedAllowed)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateSelfServedAllowed) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SelfServedAllowed` param: + err = encoder.Encode(obj.SelfServedAllowed) + if err != nil { + return err + } + return nil +} +func (obj *UpdateSelfServedAllowed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SelfServedAllowed`: + err = decoder.Decode(&obj.SelfServedAllowed) + if err != nil { + return err + } + return nil +} + +// NewUpdateSelfServedAllowedInstruction declares a new UpdateSelfServedAllowed instruction with the provided parameters and accounts. +func NewUpdateSelfServedAllowedInstruction( + // Parameters: + selfServedAllowed bool, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateSelfServedAllowed { + return NewUpdateSelfServedAllowedInstructionBuilder(). + SetSelfServedAllowed(selfServedAllowed). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed_test.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed_test.go new file mode 100644 index 0000000000..15ae3e39a7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/UpdateSelfServedAllowed_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateSelfServedAllowed(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateSelfServedAllowed"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateSelfServedAllowed) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateSelfServedAllowed) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/accounts.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/accounts.go new file mode 100644 index 0000000000..a1af0e058a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/accounts.go @@ -0,0 +1,179 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type PoolConfig struct { + Version uint8 + SelfServedAllowed bool + Router ag_solanago.PublicKey + RmnRemote ag_solanago.PublicKey +} + +var PoolConfigDiscriminator = [8]byte{26, 108, 14, 123, 116, 230, 129, 43} + +func (obj PoolConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(PoolConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `SelfServedAllowed` param: + err = encoder.Encode(obj.SelfServedAllowed) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +func (obj *PoolConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(PoolConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[26 108 14 123 116 230 129 43]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `SelfServedAllowed`: + err = decoder.Decode(&obj.SelfServedAllowed) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +type State struct { + Version uint8 + Config BaseConfig +} + +var StateDiscriminator = [8]byte{216, 146, 107, 94, 104, 75, 182, 177} + +func (obj State) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(StateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *State) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(StateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[216 146 107 94 104 75 182 177]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type ChainConfig struct { + Base BaseChain +} + +var ChainConfigDiscriminator = [8]byte{13, 177, 233, 141, 212, 29, 148, 56} + +func (obj ChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ChainConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Base` param: + err = encoder.Encode(obj.Base) + if err != nil { + return err + } + return nil +} + +func (obj *ChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ChainConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[13 177 233 141 212 29 148 56]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Base`: + err = decoder.Decode(&obj.Base) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/alias.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/alias.go new file mode 100644 index 0000000000..4cd2792cba --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/alias.go @@ -0,0 +1,16 @@ +package burnmint_token_pool // revive:disable-line:var-naming + +import ( + base "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/base_token_pool" +) + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type RemoteAddress = base.RemoteAddress +type RemoteConfig = base.RemoteConfig +type LockOrBurnInV1 = base.LockOrBurnInV1 +type ReleaseOrMintInV1 = base.ReleaseOrMintInV1 +type RateLimitConfig = base.RateLimitConfig +type BaseConfig = base.BaseConfig +type BaseChain = base.BaseChain diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/instructions.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/instructions.go new file mode 100644 index 0000000000..d846a58c70 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/instructions.go @@ -0,0 +1,269 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "BurnmintTokenPool" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_InitGlobalConfig = ag_binary.TypeID([8]byte{140, 136, 214, 48, 87, 0, 120, 255}) + + Instruction_UpdateSelfServedAllowed = ag_binary.TypeID([8]byte{210, 165, 57, 132, 64, 203, 100, 73}) + + Instruction_UpdateDefaultRouter = ag_binary.TypeID([8]byte{29, 86, 6, 222, 73, 220, 6, 186}) + + Instruction_UpdateDefaultRmn = ag_binary.TypeID([8]byte{204, 186, 36, 125, 180, 133, 227, 162}) + + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + Instruction_TransferMintAuthorityToMultisig = ag_binary.TypeID([8]byte{229, 13, 219, 109, 252, 176, 138, 118}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + Instruction_SetRouter = ag_binary.TypeID([8]byte{236, 248, 107, 200, 151, 160, 44, 250}) + + Instruction_SetRmn = ag_binary.TypeID([8]byte{252, 89, 60, 179, 198, 54, 169, 120}) + + Instruction_InitializeStateVersion = ag_binary.TypeID([8]byte{54, 186, 181, 26, 2, 198, 200, 158}) + + Instruction_InitChainRemoteConfig = ag_binary.TypeID([8]byte{21, 150, 133, 36, 2, 116, 199, 129}) + + Instruction_EditChainRemoteConfig = ag_binary.TypeID([8]byte{149, 112, 186, 72, 116, 217, 159, 175}) + + Instruction_AppendRemotePoolAddresses = ag_binary.TypeID([8]byte{172, 57, 83, 55, 70, 112, 26, 197}) + + Instruction_SetChainRateLimit = ag_binary.TypeID([8]byte{188, 188, 161, 37, 100, 249, 123, 170}) + + Instruction_SetRateLimitAdmin = ag_binary.TypeID([8]byte{21, 182, 126, 128, 31, 241, 37, 34}) + + Instruction_DeleteChainConfig = ag_binary.TypeID([8]byte{241, 159, 142, 210, 64, 173, 77, 179}) + + Instruction_ConfigureAllowList = ag_binary.TypeID([8]byte{18, 180, 102, 187, 209, 0, 130, 191}) + + Instruction_RemoveFromAllowList = ag_binary.TypeID([8]byte{44, 46, 123, 213, 40, 11, 107, 18}) + + Instruction_ReleaseOrMintTokens = ag_binary.TypeID([8]byte{92, 100, 150, 198, 252, 63, 164, 228}) + + Instruction_LockOrBurnTokens = ag_binary.TypeID([8]byte{114, 161, 94, 29, 147, 25, 232, 191}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_InitGlobalConfig: + return "InitGlobalConfig" + case Instruction_UpdateSelfServedAllowed: + return "UpdateSelfServedAllowed" + case Instruction_UpdateDefaultRouter: + return "UpdateDefaultRouter" + case Instruction_UpdateDefaultRmn: + return "UpdateDefaultRmn" + case Instruction_Initialize: + return "Initialize" + case Instruction_TransferMintAuthorityToMultisig: + return "TransferMintAuthorityToMultisig" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetRouter: + return "SetRouter" + case Instruction_SetRmn: + return "SetRmn" + case Instruction_InitializeStateVersion: + return "InitializeStateVersion" + case Instruction_InitChainRemoteConfig: + return "InitChainRemoteConfig" + case Instruction_EditChainRemoteConfig: + return "EditChainRemoteConfig" + case Instruction_AppendRemotePoolAddresses: + return "AppendRemotePoolAddresses" + case Instruction_SetChainRateLimit: + return "SetChainRateLimit" + case Instruction_SetRateLimitAdmin: + return "SetRateLimitAdmin" + case Instruction_DeleteChainConfig: + return "DeleteChainConfig" + case Instruction_ConfigureAllowList: + return "ConfigureAllowList" + case Instruction_RemoveFromAllowList: + return "RemoveFromAllowList" + case Instruction_ReleaseOrMintTokens: + return "ReleaseOrMintTokens" + case Instruction_LockOrBurnTokens: + return "LockOrBurnTokens" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "init_global_config", (*InitGlobalConfig)(nil), + }, + { + "update_self_served_allowed", (*UpdateSelfServedAllowed)(nil), + }, + { + "update_default_router", (*UpdateDefaultRouter)(nil), + }, + { + "update_default_rmn", (*UpdateDefaultRmn)(nil), + }, + { + "initialize", (*Initialize)(nil), + }, + { + "transfer_mint_authority_to_multisig", (*TransferMintAuthorityToMultisig)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_router", (*SetRouter)(nil), + }, + { + "set_rmn", (*SetRmn)(nil), + }, + { + "initialize_state_version", (*InitializeStateVersion)(nil), + }, + { + "init_chain_remote_config", (*InitChainRemoteConfig)(nil), + }, + { + "edit_chain_remote_config", (*EditChainRemoteConfig)(nil), + }, + { + "append_remote_pool_addresses", (*AppendRemotePoolAddresses)(nil), + }, + { + "set_chain_rate_limit", (*SetChainRateLimit)(nil), + }, + { + "set_rate_limit_admin", (*SetRateLimitAdmin)(nil), + }, + { + "delete_chain_config", (*DeleteChainConfig)(nil), + }, + { + "configure_allow_list", (*ConfigureAllowList)(nil), + }, + { + "remove_from_allow_list", (*RemoveFromAllowList)(nil), + }, + { + "release_or_mint_tokens", (*ReleaseOrMintTokens)(nil), + }, + { + "lock_or_burn_tokens", (*LockOrBurnTokens)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/testing_utils.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/testing_utils.go new file mode 100644 index 0000000000..625dab3afa --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/burnmint_token_pool/types.go b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/types.go new file mode 100644 index 0000000000..a175c0488f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/burnmint_token_pool/types.go @@ -0,0 +1,3 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package burnmint_token_pool diff --git a/chains/solana/gobindings/v1_6_1/ccip_common/accounts.go b/chains/solana/gobindings/v1_6_1/ccip_common/accounts.go new file mode 100644 index 0000000000..04bdf43871 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_common/accounts.go @@ -0,0 +1,117 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_common + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type TokenAdminRegistry struct { + Version uint8 + Administrator ag_solanago.PublicKey + PendingAdministrator ag_solanago.PublicKey + LookupTable ag_solanago.PublicKey + WritableIndexes [2]ag_binary.Uint128 + Mint ag_solanago.PublicKey + SupportsAutoDerivation bool +} + +var TokenAdminRegistryDiscriminator = [8]byte{70, 92, 207, 200, 76, 17, 57, 114} + +func (obj TokenAdminRegistry) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(TokenAdminRegistryDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Administrator` param: + err = encoder.Encode(obj.Administrator) + if err != nil { + return err + } + // Serialize `PendingAdministrator` param: + err = encoder.Encode(obj.PendingAdministrator) + if err != nil { + return err + } + // Serialize `LookupTable` param: + err = encoder.Encode(obj.LookupTable) + if err != nil { + return err + } + // Serialize `WritableIndexes` param: + err = encoder.Encode(obj.WritableIndexes) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `SupportsAutoDerivation` param: + err = encoder.Encode(obj.SupportsAutoDerivation) + if err != nil { + return err + } + return nil +} + +func (obj *TokenAdminRegistry) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(TokenAdminRegistryDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[70 92 207 200 76 17 57 114]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Administrator`: + err = decoder.Decode(&obj.Administrator) + if err != nil { + return err + } + // Deserialize `PendingAdministrator`: + err = decoder.Decode(&obj.PendingAdministrator) + if err != nil { + return err + } + // Deserialize `LookupTable`: + err = decoder.Decode(&obj.LookupTable) + if err != nil { + return err + } + // Deserialize `WritableIndexes`: + err = decoder.Decode(&obj.WritableIndexes) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `SupportsAutoDerivation`: + err = decoder.Decode(&obj.SupportsAutoDerivation) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_common/instructions.go b/chains/solana/gobindings/v1_6_1/ccip_common/instructions.go new file mode 100644 index 0000000000..fbcb20b7e8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_common/instructions.go @@ -0,0 +1,109 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_common + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "CcipCommon" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var () + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{}, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_common/testing_utils.go b/chains/solana/gobindings/v1_6_1/ccip_common/testing_utils.go new file mode 100644 index 0000000000..e9af70a86e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_common/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_common + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_common/types.go b/chains/solana/gobindings/v1_6_1/ccip_common/types.go new file mode 100644 index 0000000000..faf24642c7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_common/types.go @@ -0,0 +1,3 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_common diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership.go new file mode 100644 index 0000000000..9a3ae1ea19 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership.go @@ -0,0 +1,124 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Accepts the ownership of the router by the proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for accepting ownership. +// The new owner must be a signer of the transaction. +type AcceptOwnership struct { + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *AcceptOwnership) SetConfigAccount(config ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AcceptOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership_test.go new file mode 100644 index 0000000000..37c0bed56a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain.go new file mode 100644 index 0000000000..ee7439eb1f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain.go @@ -0,0 +1,215 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Adds a new source chain selector with its config to the offramp. +// +// The Admin needs to add any new chain supported. +// When adding a new chain, the Admin needs to specify if it's enabled or not. +// +// # Arguments +type AddSourceChain struct { + NewChainSelector *uint64 + SourceChainConfig *SourceChainConfig + + // [0] = [WRITE] sourceChain + // ··········· Adding a chain selector implies initializing the state for a new chain + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddSourceChainInstructionBuilder creates a new `AddSourceChain` instruction builder. +func NewAddSourceChainInstructionBuilder() *AddSourceChain { + nd := &AddSourceChain{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetNewChainSelector sets the "newChainSelector" parameter. +func (inst *AddSourceChain) SetNewChainSelector(newChainSelector uint64) *AddSourceChain { + inst.NewChainSelector = &newChainSelector + return inst +} + +// SetSourceChainConfig sets the "sourceChainConfig" parameter. +func (inst *AddSourceChain) SetSourceChainConfig(sourceChainConfig SourceChainConfig) *AddSourceChain { + inst.SourceChainConfig = &sourceChainConfig + return inst +} + +// SetSourceChainAccount sets the "sourceChain" account. +// Adding a chain selector implies initializing the state for a new chain +func (inst *AddSourceChain) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *AddSourceChain { + inst.AccountMetaSlice[0] = ag_solanago.Meta(sourceChain).WRITE() + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +// Adding a chain selector implies initializing the state for a new chain +func (inst *AddSourceChain) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *AddSourceChain) SetConfigAccount(config ag_solanago.PublicKey) *AddSourceChain { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddSourceChain) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddSourceChain) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddSourceChain { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddSourceChain) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddSourceChain) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddSourceChain { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddSourceChain) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AddSourceChain) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddSourceChain, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddSourceChain) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddSourceChain) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewChainSelector == nil { + return errors.New("NewChainSelector parameter is not set") + } + if inst.SourceChainConfig == nil { + return errors.New("SourceChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddSourceChain) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddSourceChain")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" NewChainSelector", *inst.NewChainSelector)) + paramsBranch.Child(ag_format.Param("SourceChainConfig", *inst.SourceChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" sourceChain", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AddSourceChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewChainSelector` param: + err = encoder.Encode(obj.NewChainSelector) + if err != nil { + return err + } + // Serialize `SourceChainConfig` param: + err = encoder.Encode(obj.SourceChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *AddSourceChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewChainSelector`: + err = decoder.Decode(&obj.NewChainSelector) + if err != nil { + return err + } + // Deserialize `SourceChainConfig`: + err = decoder.Decode(&obj.SourceChainConfig) + if err != nil { + return err + } + return nil +} + +// NewAddSourceChainInstruction declares a new AddSourceChain instruction with the provided parameters and accounts. +func NewAddSourceChainInstruction( + // Parameters: + newChainSelector uint64, + sourceChainConfig SourceChainConfig, + // Accounts: + sourceChain ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddSourceChain { + return NewAddSourceChainInstructionBuilder(). + SetNewChainSelector(newChainSelector). + SetSourceChainConfig(sourceChainConfig). + SetSourceChainAccount(sourceChain). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain_test.go new file mode 100644 index 0000000000..0c809edbe6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/AddSourceChain_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddSourceChain(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddSourceChain"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddSourceChain) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddSourceChain) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport.go new file mode 100644 index 0000000000..4d53feb327 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport.go @@ -0,0 +1,297 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initializes and/or inserts a chunk of report data to an execution report buffer. +// +// When execution reports are too large to fit in a single transaction, they can be chopped +// up in chunks first (as a special case, one chunk is also acceptable), and pre-buffered +// via multiple calls to this instruction. +// +// There's no need to pre-initialize the buffer: all chunks can be sent concurrently, and the +// first one to arrive will initialize the buffer. +// +// To benefit from buffering, the eventual call to `execute` or `manually_execute` must +// include an additional `remaining_account` with the PDA derived from +// ["execution_report_buffer", , ]. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for buffering. +// * `buffer_id` - An arbitrary buffer id defined by the caller (could be the message_id). Max 32 bytes. +// * `report_length` - Total length in bytes of the execution report. +// * `chunk` - The specific chunk to add to the buffer. Chunk must have a consistent size, except +// the last one in the buffer, which may be smaller. +// * `chunk_index` - The index of this chunk. +// * `num_chunks` - The total number of chunks in the report. +type BufferExecutionReport struct { + BufferId *[]byte + ReportLength *uint32 + Chunk *[]byte + ChunkIndex *uint8 + NumChunks *uint8 + + // [0] = [WRITE] executionReportBuffer + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewBufferExecutionReportInstructionBuilder creates a new `BufferExecutionReport` instruction builder. +func NewBufferExecutionReportInstructionBuilder() *BufferExecutionReport { + nd := &BufferExecutionReport{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetBufferId sets the "bufferId" parameter. +func (inst *BufferExecutionReport) SetBufferId(bufferId []byte) *BufferExecutionReport { + inst.BufferId = &bufferId + return inst +} + +// SetReportLength sets the "reportLength" parameter. +func (inst *BufferExecutionReport) SetReportLength(reportLength uint32) *BufferExecutionReport { + inst.ReportLength = &reportLength + return inst +} + +// SetChunk sets the "chunk" parameter. +func (inst *BufferExecutionReport) SetChunk(chunk []byte) *BufferExecutionReport { + inst.Chunk = &chunk + return inst +} + +// SetChunkIndex sets the "chunkIndex" parameter. +func (inst *BufferExecutionReport) SetChunkIndex(chunkIndex uint8) *BufferExecutionReport { + inst.ChunkIndex = &chunkIndex + return inst +} + +// SetNumChunks sets the "numChunks" parameter. +func (inst *BufferExecutionReport) SetNumChunks(numChunks uint8) *BufferExecutionReport { + inst.NumChunks = &numChunks + return inst +} + +// SetExecutionReportBufferAccount sets the "executionReportBuffer" account. +func (inst *BufferExecutionReport) SetExecutionReportBufferAccount(executionReportBuffer ag_solanago.PublicKey) *BufferExecutionReport { + inst.AccountMetaSlice[0] = ag_solanago.Meta(executionReportBuffer).WRITE() + return inst +} + +// GetExecutionReportBufferAccount gets the "executionReportBuffer" account. +func (inst *BufferExecutionReport) GetExecutionReportBufferAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *BufferExecutionReport) SetConfigAccount(config ag_solanago.PublicKey) *BufferExecutionReport { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *BufferExecutionReport) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *BufferExecutionReport) SetAuthorityAccount(authority ag_solanago.PublicKey) *BufferExecutionReport { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *BufferExecutionReport) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *BufferExecutionReport) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *BufferExecutionReport { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *BufferExecutionReport) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst BufferExecutionReport) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_BufferExecutionReport, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst BufferExecutionReport) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *BufferExecutionReport) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.BufferId == nil { + return errors.New("BufferId parameter is not set") + } + if inst.ReportLength == nil { + return errors.New("ReportLength parameter is not set") + } + if inst.Chunk == nil { + return errors.New("Chunk parameter is not set") + } + if inst.ChunkIndex == nil { + return errors.New("ChunkIndex parameter is not set") + } + if inst.NumChunks == nil { + return errors.New("NumChunks parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.ExecutionReportBuffer is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *BufferExecutionReport) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("BufferExecutionReport")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" BufferId", *inst.BufferId)) + paramsBranch.Child(ag_format.Param("ReportLength", *inst.ReportLength)) + paramsBranch.Child(ag_format.Param(" Chunk", *inst.Chunk)) + paramsBranch.Child(ag_format.Param(" ChunkIndex", *inst.ChunkIndex)) + paramsBranch.Child(ag_format.Param(" NumChunks", *inst.NumChunks)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("executionReportBuffer", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj BufferExecutionReport) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `BufferId` param: + err = encoder.Encode(obj.BufferId) + if err != nil { + return err + } + // Serialize `ReportLength` param: + err = encoder.Encode(obj.ReportLength) + if err != nil { + return err + } + // Serialize `Chunk` param: + err = encoder.Encode(obj.Chunk) + if err != nil { + return err + } + // Serialize `ChunkIndex` param: + err = encoder.Encode(obj.ChunkIndex) + if err != nil { + return err + } + // Serialize `NumChunks` param: + err = encoder.Encode(obj.NumChunks) + if err != nil { + return err + } + return nil +} +func (obj *BufferExecutionReport) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `BufferId`: + err = decoder.Decode(&obj.BufferId) + if err != nil { + return err + } + // Deserialize `ReportLength`: + err = decoder.Decode(&obj.ReportLength) + if err != nil { + return err + } + // Deserialize `Chunk`: + err = decoder.Decode(&obj.Chunk) + if err != nil { + return err + } + // Deserialize `ChunkIndex`: + err = decoder.Decode(&obj.ChunkIndex) + if err != nil { + return err + } + // Deserialize `NumChunks`: + err = decoder.Decode(&obj.NumChunks) + if err != nil { + return err + } + return nil +} + +// NewBufferExecutionReportInstruction declares a new BufferExecutionReport instruction with the provided parameters and accounts. +func NewBufferExecutionReportInstruction( + // Parameters: + bufferId []byte, + reportLength uint32, + chunk []byte, + chunkIndex uint8, + numChunks uint8, + // Accounts: + executionReportBuffer ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *BufferExecutionReport { + return NewBufferExecutionReportInstructionBuilder(). + SetBufferId(bufferId). + SetReportLength(reportLength). + SetChunk(chunk). + SetChunkIndex(chunkIndex). + SetNumChunks(numChunks). + SetExecutionReportBufferAccount(executionReportBuffer). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport_test.go new file mode 100644 index 0000000000..a9bb4baf5a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/BufferExecutionReport_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_BufferExecutionReport(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("BufferExecutionReport"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(BufferExecutionReport) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(BufferExecutionReport) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount.go new file mode 100644 index 0000000000..2481ab5b50 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount.go @@ -0,0 +1,264 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// CloseCommitReportAccount is the `closeCommitReportAccount` instruction. +type CloseCommitReportAccount struct { + SourceChainSelector *uint64 + Root *[]byte + + // [0] = [] config + // + // [1] = [WRITE] commitReport + // + // [2] = [] referenceAddresses + // + // [3] = [] wsolMint + // + // [4] = [WRITE] feeTokenReceiver + // + // [5] = [] feeBillingSigner + // + // [6] = [] tokenProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCloseCommitReportAccountInstructionBuilder creates a new `CloseCommitReportAccount` instruction builder. +func NewCloseCommitReportAccountInstructionBuilder() *CloseCommitReportAccount { + nd := &CloseCommitReportAccount{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetSourceChainSelector sets the "sourceChainSelector" parameter. +func (inst *CloseCommitReportAccount) SetSourceChainSelector(sourceChainSelector uint64) *CloseCommitReportAccount { + inst.SourceChainSelector = &sourceChainSelector + return inst +} + +// SetRoot sets the "root" parameter. +func (inst *CloseCommitReportAccount) SetRoot(root []byte) *CloseCommitReportAccount { + inst.Root = &root + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CloseCommitReportAccount) SetConfigAccount(config ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CloseCommitReportAccount) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetCommitReportAccount sets the "commitReport" account. +func (inst *CloseCommitReportAccount) SetCommitReportAccount(commitReport ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[1] = ag_solanago.Meta(commitReport).WRITE() + return inst +} + +// GetCommitReportAccount gets the "commitReport" account. +func (inst *CloseCommitReportAccount) GetCommitReportAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *CloseCommitReportAccount) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[2] = ag_solanago.Meta(referenceAddresses) + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *CloseCommitReportAccount) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetWsolMintAccount sets the "wsolMint" account. +func (inst *CloseCommitReportAccount) SetWsolMintAccount(wsolMint ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[3] = ag_solanago.Meta(wsolMint) + return inst +} + +// GetWsolMintAccount gets the "wsolMint" account. +func (inst *CloseCommitReportAccount) GetWsolMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeTokenReceiverAccount sets the "feeTokenReceiver" account. +func (inst *CloseCommitReportAccount) SetFeeTokenReceiverAccount(feeTokenReceiver ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeTokenReceiver).WRITE() + return inst +} + +// GetFeeTokenReceiverAccount gets the "feeTokenReceiver" account. +func (inst *CloseCommitReportAccount) GetFeeTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *CloseCommitReportAccount) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *CloseCommitReportAccount) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *CloseCommitReportAccount) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *CloseCommitReportAccount { + inst.AccountMetaSlice[6] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *CloseCommitReportAccount) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst CloseCommitReportAccount) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CloseCommitReportAccount, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CloseCommitReportAccount) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CloseCommitReportAccount) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SourceChainSelector == nil { + return errors.New("SourceChainSelector parameter is not set") + } + if inst.Root == nil { + return errors.New("Root parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.CommitReport is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.WsolMint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeTokenReceiver is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.TokenProgram is not set") + } + } + return nil +} + +func (inst *CloseCommitReportAccount) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CloseCommitReportAccount")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SourceChainSelector", *inst.SourceChainSelector)) + paramsBranch.Child(ag_format.Param(" Root", *inst.Root)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" commitReport", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("referenceAddresses", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" wsolMint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feeTokenReceiver", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeBillingSigner", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj CloseCommitReportAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `Root` param: + err = encoder.Encode(obj.Root) + if err != nil { + return err + } + return nil +} +func (obj *CloseCommitReportAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `Root`: + err = decoder.Decode(&obj.Root) + if err != nil { + return err + } + return nil +} + +// NewCloseCommitReportAccountInstruction declares a new CloseCommitReportAccount instruction with the provided parameters and accounts. +func NewCloseCommitReportAccountInstruction( + // Parameters: + sourceChainSelector uint64, + root []byte, + // Accounts: + config ag_solanago.PublicKey, + commitReport ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + wsolMint ag_solanago.PublicKey, + feeTokenReceiver ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey) *CloseCommitReportAccount { + return NewCloseCommitReportAccountInstructionBuilder(). + SetSourceChainSelector(sourceChainSelector). + SetRoot(root). + SetConfigAccount(config). + SetCommitReportAccount(commitReport). + SetReferenceAddressesAccount(referenceAddresses). + SetWsolMintAccount(wsolMint). + SetFeeTokenReceiverAccount(feeTokenReceiver). + SetFeeBillingSignerAccount(feeBillingSigner). + SetTokenProgramAccount(tokenProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount_test.go new file mode 100644 index 0000000000..626fa3028c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseCommitReportAccount_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CloseCommitReportAccount(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CloseCommitReportAccount"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CloseCommitReportAccount) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CloseCommitReportAccount) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer.go new file mode 100644 index 0000000000..1f063df49c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer.go @@ -0,0 +1,188 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Closes the execution report buffer to reclaim funds. +// +// Note this is only necessary when aborting a buffered transaction, or when a mistake +// was made when buffering data. The buffer account will otherwise automatically close +// and return funds to the caller whenever buffered execution succeeds. +type CloseExecutionReportBuffer struct { + BufferId *[]byte + + // [0] = [WRITE] executionReportBuffer + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCloseExecutionReportBufferInstructionBuilder creates a new `CloseExecutionReportBuffer` instruction builder. +func NewCloseExecutionReportBufferInstructionBuilder() *CloseExecutionReportBuffer { + nd := &CloseExecutionReportBuffer{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetBufferId sets the "bufferId" parameter. +func (inst *CloseExecutionReportBuffer) SetBufferId(bufferId []byte) *CloseExecutionReportBuffer { + inst.BufferId = &bufferId + return inst +} + +// SetExecutionReportBufferAccount sets the "executionReportBuffer" account. +func (inst *CloseExecutionReportBuffer) SetExecutionReportBufferAccount(executionReportBuffer ag_solanago.PublicKey) *CloseExecutionReportBuffer { + inst.AccountMetaSlice[0] = ag_solanago.Meta(executionReportBuffer).WRITE() + return inst +} + +// GetExecutionReportBufferAccount gets the "executionReportBuffer" account. +func (inst *CloseExecutionReportBuffer) GetExecutionReportBufferAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *CloseExecutionReportBuffer) SetConfigAccount(config ag_solanago.PublicKey) *CloseExecutionReportBuffer { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CloseExecutionReportBuffer) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CloseExecutionReportBuffer) SetAuthorityAccount(authority ag_solanago.PublicKey) *CloseExecutionReportBuffer { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CloseExecutionReportBuffer) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CloseExecutionReportBuffer) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CloseExecutionReportBuffer { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CloseExecutionReportBuffer) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst CloseExecutionReportBuffer) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CloseExecutionReportBuffer, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CloseExecutionReportBuffer) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CloseExecutionReportBuffer) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.BufferId == nil { + return errors.New("BufferId parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.ExecutionReportBuffer is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *CloseExecutionReportBuffer) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CloseExecutionReportBuffer")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("BufferId", *inst.BufferId)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("executionReportBuffer", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj CloseExecutionReportBuffer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `BufferId` param: + err = encoder.Encode(obj.BufferId) + if err != nil { + return err + } + return nil +} +func (obj *CloseExecutionReportBuffer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `BufferId`: + err = decoder.Decode(&obj.BufferId) + if err != nil { + return err + } + return nil +} + +// NewCloseExecutionReportBufferInstruction declares a new CloseExecutionReportBuffer instruction with the provided parameters and accounts. +func NewCloseExecutionReportBufferInstruction( + // Parameters: + bufferId []byte, + // Accounts: + executionReportBuffer ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *CloseExecutionReportBuffer { + return NewCloseExecutionReportBufferInstructionBuilder(). + SetBufferId(bufferId). + SetExecutionReportBufferAccount(executionReportBuffer). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer_test.go new file mode 100644 index 0000000000..0049296004 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CloseExecutionReportBuffer_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CloseExecutionReportBuffer(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CloseExecutionReportBuffer"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CloseExecutionReportBuffer) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CloseExecutionReportBuffer) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit.go new file mode 100644 index 0000000000..43cdff9a14 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit.go @@ -0,0 +1,492 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Off Ramp Flow // +// Commits a report to the router, containing a Merkle Root. +// +// The method name needs to be commit with Anchor encoding. +// +// This function is called by the OffChain when committing one Report to the SVM Router. +// In this Flow only one report is sent, the Commit Report. This is different as EVM does, +// this is because here all the chain state is stored in one account per Merkle Tree Root. +// So, to avoid having to send a dynamic size array of accounts, in this message only one Commit Report Account is sent. +// This message validates the signatures of the report and stores the Merkle Root in the Commit Report Account. +// The Report must contain an interval of messages, and the min of them must be the next sequence number expected. +// The max size of the interval is 64. +// This message emits two events: CommitReportAccepted and Transmitted. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the commit. +// * `report_context_byte_words` - consists of: +// * report_context_byte_words[0]: ConfigDigest +// * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number +// * `raw_report` - The serialized commit input report, single merkle root with RMN signatures and price updates +// * `rs` - slice of R components of signatures +// * `ss` - slice of S components of signatures +// * `raw_vs` - array of V components of signatures +type Commit struct { + ReportContextByteWords *[2][32]uint8 + RawReport *[]byte + Rs *[][32]uint8 + Ss *[][32]uint8 + RawVs *[32]uint8 + + // [0] = [] config + // + // [1] = [] referenceAddresses + // + // [2] = [WRITE] sourceChain + // + // [3] = [WRITE] commitReport + // + // [4] = [WRITE, SIGNER] authority + // + // [5] = [] systemProgram + // + // [6] = [] sysvarInstructions + // + // [7] = [] feeBillingSigner + // + // [8] = [] feeQuoter + // + // [9] = [] feeQuoterAllowedPriceUpdater + // ··········· so that it can authorize the call made by this offramp + // + // [10] = [] feeQuoterConfig + // + // [11] = [] rmnRemote + // + // [12] = [] rmnRemoteCurses + // + // [13] = [] rmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCommitInstructionBuilder creates a new `Commit` instruction builder. +func NewCommitInstructionBuilder() *Commit { + nd := &Commit{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 14), + } + return nd +} + +// SetReportContextByteWords sets the "reportContextByteWords" parameter. +func (inst *Commit) SetReportContextByteWords(reportContextByteWords [2][32]uint8) *Commit { + inst.ReportContextByteWords = &reportContextByteWords + return inst +} + +// SetRawReport sets the "rawReport" parameter. +func (inst *Commit) SetRawReport(rawReport []byte) *Commit { + inst.RawReport = &rawReport + return inst +} + +// SetRs sets the "rs" parameter. +func (inst *Commit) SetRs(rs [][32]uint8) *Commit { + inst.Rs = &rs + return inst +} + +// SetSs sets the "ss" parameter. +func (inst *Commit) SetSs(ss [][32]uint8) *Commit { + inst.Ss = &ss + return inst +} + +// SetRawVs sets the "rawVs" parameter. +func (inst *Commit) SetRawVs(rawVs [32]uint8) *Commit { + inst.RawVs = &rawVs + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Commit) SetConfigAccount(config ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Commit) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *Commit) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[1] = ag_solanago.Meta(referenceAddresses) + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *Commit) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSourceChainAccount sets the "sourceChain" account. +func (inst *Commit) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[2] = ag_solanago.Meta(sourceChain).WRITE() + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +func (inst *Commit) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetCommitReportAccount sets the "commitReport" account. +func (inst *Commit) SetCommitReportAccount(commitReport ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[3] = ag_solanago.Meta(commitReport).WRITE() + return inst +} + +// GetCommitReportAccount gets the "commitReport" account. +func (inst *Commit) GetCommitReportAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Commit) SetAuthorityAccount(authority ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Commit) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Commit) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[5] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Commit) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetSysvarInstructionsAccount sets the "sysvarInstructions" account. +func (inst *Commit) SetSysvarInstructionsAccount(sysvarInstructions ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[6] = ag_solanago.Meta(sysvarInstructions) + return inst +} + +// GetSysvarInstructionsAccount gets the "sysvarInstructions" account. +func (inst *Commit) GetSysvarInstructionsAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *Commit) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[7] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *Commit) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +func (inst *Commit) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[8] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +func (inst *Commit) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetFeeQuoterAllowedPriceUpdaterAccount sets the "feeQuoterAllowedPriceUpdater" account. +// so that it can authorize the call made by this offramp +func (inst *Commit) SetFeeQuoterAllowedPriceUpdaterAccount(feeQuoterAllowedPriceUpdater ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[9] = ag_solanago.Meta(feeQuoterAllowedPriceUpdater) + return inst +} + +// GetFeeQuoterAllowedPriceUpdaterAccount gets the "feeQuoterAllowedPriceUpdater" account. +// so that it can authorize the call made by this offramp +func (inst *Commit) GetFeeQuoterAllowedPriceUpdaterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +func (inst *Commit) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[10] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +func (inst *Commit) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *Commit) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *Commit) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *Commit) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[12] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *Commit) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *Commit) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *Commit { + inst.AccountMetaSlice[13] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *Commit) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +func (inst Commit) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Commit, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Commit) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Commit) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReportContextByteWords == nil { + return errors.New("ReportContextByteWords parameter is not set") + } + if inst.RawReport == nil { + return errors.New("RawReport parameter is not set") + } + if inst.Rs == nil { + return errors.New("Rs parameter is not set") + } + if inst.Ss == nil { + return errors.New("Ss parameter is not set") + } + if inst.RawVs == nil { + return errors.New("RawVs parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.CommitReport is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.SysvarInstructions is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.FeeQuoterAllowedPriceUpdater is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *Commit) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Commit")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReportContextByteWords", *inst.ReportContextByteWords)) + paramsBranch.Child(ag_format.Param(" RawReport", *inst.RawReport)) + paramsBranch.Child(ag_format.Param(" Rs", *inst.Rs)) + paramsBranch.Child(ag_format.Param(" Ss", *inst.Ss)) + paramsBranch.Child(ag_format.Param(" RawVs", *inst.RawVs)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=14]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" referenceAddresses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" sourceChain", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" commitReport", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" sysvarInstructions", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" feeBillingSigner", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta("feeQuoterAllowedPriceUpdater", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[13])) + }) + }) + }) +} + +func (obj Commit) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReportContextByteWords` param: + err = encoder.Encode(obj.ReportContextByteWords) + if err != nil { + return err + } + // Serialize `RawReport` param: + err = encoder.Encode(obj.RawReport) + if err != nil { + return err + } + // Serialize `Rs` param: + err = encoder.Encode(obj.Rs) + if err != nil { + return err + } + // Serialize `Ss` param: + err = encoder.Encode(obj.Ss) + if err != nil { + return err + } + // Serialize `RawVs` param: + err = encoder.Encode(obj.RawVs) + if err != nil { + return err + } + return nil +} +func (obj *Commit) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReportContextByteWords`: + err = decoder.Decode(&obj.ReportContextByteWords) + if err != nil { + return err + } + // Deserialize `RawReport`: + err = decoder.Decode(&obj.RawReport) + if err != nil { + return err + } + // Deserialize `Rs`: + err = decoder.Decode(&obj.Rs) + if err != nil { + return err + } + // Deserialize `Ss`: + err = decoder.Decode(&obj.Ss) + if err != nil { + return err + } + // Deserialize `RawVs`: + err = decoder.Decode(&obj.RawVs) + if err != nil { + return err + } + return nil +} + +// NewCommitInstruction declares a new Commit instruction with the provided parameters and accounts. +func NewCommitInstruction( + // Parameters: + reportContextByteWords [2][32]uint8, + rawReport []byte, + rs [][32]uint8, + ss [][32]uint8, + rawVs [32]uint8, + // Accounts: + config ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + sourceChain ag_solanago.PublicKey, + commitReport ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + sysvarInstructions ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterAllowedPriceUpdater ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey) *Commit { + return NewCommitInstructionBuilder(). + SetReportContextByteWords(reportContextByteWords). + SetRawReport(rawReport). + SetRs(rs). + SetSs(ss). + SetRawVs(rawVs). + SetConfigAccount(config). + SetReferenceAddressesAccount(referenceAddresses). + SetSourceChainAccount(sourceChain). + SetCommitReportAccount(commitReport). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetSysvarInstructionsAccount(sysvarInstructions). + SetFeeBillingSignerAccount(feeBillingSigner). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterAllowedPriceUpdaterAccount(feeQuoterAllowedPriceUpdater). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly.go new file mode 100644 index 0000000000..6fdd569046 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly.go @@ -0,0 +1,448 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Commits a report to the router, with price updates only. +// +// The method name needs to be commit with Anchor encoding. +// +// This function is called by the OffChain when committing one Report to the SVM Router, +// containing only price updates and no merkle root. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the commit. +// * `report_context_byte_words` - consists of: +// * report_context_byte_words[0]: ConfigDigest +// * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number +// * `raw_report` - The serialized commit input report containing the price updates, +// with no merkle root. +// * `rs` - slice of R components of signatures +// * `ss` - slice of S components of signatures +// * `raw_vs` - array of V components of signatures +type CommitPriceOnly struct { + ReportContextByteWords *[2][32]uint8 + RawReport *[]byte + Rs *[][32]uint8 + Ss *[][32]uint8 + RawVs *[32]uint8 + + // [0] = [] config + // + // [1] = [] referenceAddresses + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] sysvarInstructions + // + // [5] = [] feeBillingSigner + // + // [6] = [] feeQuoter + // + // [7] = [] feeQuoterAllowedPriceUpdater + // ··········· so that it can authorize the call made by this offramp + // + // [8] = [] feeQuoterConfig + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCommitPriceOnlyInstructionBuilder creates a new `CommitPriceOnly` instruction builder. +func NewCommitPriceOnlyInstructionBuilder() *CommitPriceOnly { + nd := &CommitPriceOnly{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 12), + } + return nd +} + +// SetReportContextByteWords sets the "reportContextByteWords" parameter. +func (inst *CommitPriceOnly) SetReportContextByteWords(reportContextByteWords [2][32]uint8) *CommitPriceOnly { + inst.ReportContextByteWords = &reportContextByteWords + return inst +} + +// SetRawReport sets the "rawReport" parameter. +func (inst *CommitPriceOnly) SetRawReport(rawReport []byte) *CommitPriceOnly { + inst.RawReport = &rawReport + return inst +} + +// SetRs sets the "rs" parameter. +func (inst *CommitPriceOnly) SetRs(rs [][32]uint8) *CommitPriceOnly { + inst.Rs = &rs + return inst +} + +// SetSs sets the "ss" parameter. +func (inst *CommitPriceOnly) SetSs(ss [][32]uint8) *CommitPriceOnly { + inst.Ss = &ss + return inst +} + +// SetRawVs sets the "rawVs" parameter. +func (inst *CommitPriceOnly) SetRawVs(rawVs [32]uint8) *CommitPriceOnly { + inst.RawVs = &rawVs + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CommitPriceOnly) SetConfigAccount(config ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CommitPriceOnly) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *CommitPriceOnly) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[1] = ag_solanago.Meta(referenceAddresses) + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *CommitPriceOnly) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CommitPriceOnly) SetAuthorityAccount(authority ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CommitPriceOnly) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CommitPriceOnly) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CommitPriceOnly) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSysvarInstructionsAccount sets the "sysvarInstructions" account. +func (inst *CommitPriceOnly) SetSysvarInstructionsAccount(sysvarInstructions ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[4] = ag_solanago.Meta(sysvarInstructions) + return inst +} + +// GetSysvarInstructionsAccount gets the "sysvarInstructions" account. +func (inst *CommitPriceOnly) GetSysvarInstructionsAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *CommitPriceOnly) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *CommitPriceOnly) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +func (inst *CommitPriceOnly) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[6] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +func (inst *CommitPriceOnly) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetFeeQuoterAllowedPriceUpdaterAccount sets the "feeQuoterAllowedPriceUpdater" account. +// so that it can authorize the call made by this offramp +func (inst *CommitPriceOnly) SetFeeQuoterAllowedPriceUpdaterAccount(feeQuoterAllowedPriceUpdater ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[7] = ag_solanago.Meta(feeQuoterAllowedPriceUpdater) + return inst +} + +// GetFeeQuoterAllowedPriceUpdaterAccount gets the "feeQuoterAllowedPriceUpdater" account. +// so that it can authorize the call made by this offramp +func (inst *CommitPriceOnly) GetFeeQuoterAllowedPriceUpdaterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +func (inst *CommitPriceOnly) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[8] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +func (inst *CommitPriceOnly) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *CommitPriceOnly) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *CommitPriceOnly) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *CommitPriceOnly) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *CommitPriceOnly) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *CommitPriceOnly) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *CommitPriceOnly { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *CommitPriceOnly) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +func (inst CommitPriceOnly) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CommitPriceOnly, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CommitPriceOnly) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CommitPriceOnly) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReportContextByteWords == nil { + return errors.New("ReportContextByteWords parameter is not set") + } + if inst.RawReport == nil { + return errors.New("RawReport parameter is not set") + } + if inst.Rs == nil { + return errors.New("Rs parameter is not set") + } + if inst.Ss == nil { + return errors.New("Ss parameter is not set") + } + if inst.RawVs == nil { + return errors.New("RawVs parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SysvarInstructions is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.FeeQuoterAllowedPriceUpdater is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *CommitPriceOnly) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CommitPriceOnly")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReportContextByteWords", *inst.ReportContextByteWords)) + paramsBranch.Child(ag_format.Param(" RawReport", *inst.RawReport)) + paramsBranch.Child(ag_format.Param(" Rs", *inst.Rs)) + paramsBranch.Child(ag_format.Param(" Ss", *inst.Ss)) + paramsBranch.Child(ag_format.Param(" RawVs", *inst.RawVs)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=12]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" referenceAddresses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" sysvarInstructions", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeBillingSigner", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta("feeQuoterAllowedPriceUpdater", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[11])) + }) + }) + }) +} + +func (obj CommitPriceOnly) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReportContextByteWords` param: + err = encoder.Encode(obj.ReportContextByteWords) + if err != nil { + return err + } + // Serialize `RawReport` param: + err = encoder.Encode(obj.RawReport) + if err != nil { + return err + } + // Serialize `Rs` param: + err = encoder.Encode(obj.Rs) + if err != nil { + return err + } + // Serialize `Ss` param: + err = encoder.Encode(obj.Ss) + if err != nil { + return err + } + // Serialize `RawVs` param: + err = encoder.Encode(obj.RawVs) + if err != nil { + return err + } + return nil +} +func (obj *CommitPriceOnly) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReportContextByteWords`: + err = decoder.Decode(&obj.ReportContextByteWords) + if err != nil { + return err + } + // Deserialize `RawReport`: + err = decoder.Decode(&obj.RawReport) + if err != nil { + return err + } + // Deserialize `Rs`: + err = decoder.Decode(&obj.Rs) + if err != nil { + return err + } + // Deserialize `Ss`: + err = decoder.Decode(&obj.Ss) + if err != nil { + return err + } + // Deserialize `RawVs`: + err = decoder.Decode(&obj.RawVs) + if err != nil { + return err + } + return nil +} + +// NewCommitPriceOnlyInstruction declares a new CommitPriceOnly instruction with the provided parameters and accounts. +func NewCommitPriceOnlyInstruction( + // Parameters: + reportContextByteWords [2][32]uint8, + rawReport []byte, + rs [][32]uint8, + ss [][32]uint8, + rawVs [32]uint8, + // Accounts: + config ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + sysvarInstructions ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterAllowedPriceUpdater ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey) *CommitPriceOnly { + return NewCommitPriceOnlyInstructionBuilder(). + SetReportContextByteWords(reportContextByteWords). + SetRawReport(rawReport). + SetRs(rs). + SetSs(ss). + SetRawVs(rawVs). + SetConfigAccount(config). + SetReferenceAddressesAccount(referenceAddresses). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetSysvarInstructionsAccount(sysvarInstructions). + SetFeeBillingSignerAccount(feeBillingSigner). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterAllowedPriceUpdaterAccount(feeQuoterAllowedPriceUpdater). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly_test.go new file mode 100644 index 0000000000..53248580db --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/CommitPriceOnly_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CommitPriceOnly(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CommitPriceOnly"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CommitPriceOnly) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CommitPriceOnly) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit_test.go new file mode 100644 index 0000000000..51b484b88d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Commit_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Commit(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Commit"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Commit) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Commit) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute.go new file mode 100644 index 0000000000..e86e272796 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute.go @@ -0,0 +1,187 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Automatically derives all acounts required to call `ccip_execute`. +// +// This method receives the bare minimum amount of information needed to construct +// the entire account list to execute a transaction, and builds it iteratively +// over the course of multiple calls. +// +// The return type contains: +// +// * `accounts_to_save`: The caller must append these accounts to a list they maintain. +// When complete, this list will contain all accounts needed to call `ccip_execute`. +// * `ask_again_with`: When `next_stage` is not empty, the caller must call `derive_accounts_execute` +// again, including exactly these accounts as the `remaining_accounts`. +// * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_execute`. +// * `current_stage`: A string describing the current stage of the derivation process. When the stage +// is "TokenTransferStaticAccounts//0", it means the `accounts_to_save` block in this response contains +// all accounts relating to the Nth token being transferred. Use this information to construct +// the `token_indexes` vector that `execute` requires. +// * `next_stage`: If nonempty, this means the instruction must get called again with this value +// as the `stage` argument. +// +// Therefore, and starting with an empty `remaining_accounts` list, the caller must repeteadly +// call `derive_accounts_execute` until `next_stage` is returned empty. +// +// # Arguments +// +// * `ctx`: Context containing only the offramp config. +// * `stage`: Requested derivation stage. Pass "Start" the first time, then for each subsequent +// call, pass the value returned in `response.next_stage` until empty. +// * `params`: +// * `execute_caller`: Public key of the account that will sign the call to `ccip_execute`. +// * `message_accounts`: If the transaction involves messaging, the message accounts. +// * `source_chain_selector`: CCIP chain selector for the source chain. +// * `mints_of_transferred_token`: List of all token mints for tokens being transferred (i.e. +// the entries in `report.message.token_amounts.destination_address`.) +// * `merkle_root`: Merkle root as per the commit report. +// * `buffer_id`: If the execution will be buffered, the buffer id that will be used by the +// `execute_caller`: If the execution will not be buffered, this should be empty. +// * `token_receiver`: Receiver of token transfers, if any (i.e. report.message.token_receiver) +type DeriveAccountsExecute struct { + Params *DeriveAccountsExecuteParams + Stage *string + + // [0] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsExecuteInstructionBuilder creates a new `DeriveAccountsExecute` instruction builder. +func NewDeriveAccountsExecuteInstructionBuilder() *DeriveAccountsExecute { + nd := &DeriveAccountsExecute{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetParams sets the "params" parameter. +func (inst *DeriveAccountsExecute) SetParams(params DeriveAccountsExecuteParams) *DeriveAccountsExecute { + inst.Params = ¶ms + return inst +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsExecute) SetStage(stage string) *DeriveAccountsExecute { + inst.Stage = &stage + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *DeriveAccountsExecute) SetConfigAccount(config ag_solanago.PublicKey) *DeriveAccountsExecute { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *DeriveAccountsExecute) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst DeriveAccountsExecute) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsExecute, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsExecute) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsExecute) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Params == nil { + return errors.New("Params parameter is not set") + } + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *DeriveAccountsExecute) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsExecute")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Params", *inst.Params)) + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("config", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj DeriveAccountsExecute) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Params` param: + err = encoder.Encode(obj.Params) + if err != nil { + return err + } + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsExecute) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Params`: + err = decoder.Decode(&obj.Params) + if err != nil { + return err + } + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsExecuteInstruction declares a new DeriveAccountsExecute instruction with the provided parameters and accounts. +func NewDeriveAccountsExecuteInstruction( + // Parameters: + params DeriveAccountsExecuteParams, + stage string, + // Accounts: + config ag_solanago.PublicKey) *DeriveAccountsExecute { + return NewDeriveAccountsExecuteInstructionBuilder(). + SetParams(params). + SetStage(stage). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute_test.go new file mode 100644 index 0000000000..0f67af2558 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/DeriveAccountsExecute_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsExecute(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsExecute"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsExecute) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsExecute) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector.go new file mode 100644 index 0000000000..25a595c20c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Disables the source chain selector. +// +// The Admin is the only one able to disable the chain selector as source. This method is thought of as an emergency kill-switch. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for disabling the chain selector. +// * `source_chain_selector` - The source chain selector to be disabled. +type DisableSourceChainSelector struct { + SourceChainSelector *uint64 + + // [0] = [WRITE] sourceChain + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDisableSourceChainSelectorInstructionBuilder creates a new `DisableSourceChainSelector` instruction builder. +func NewDisableSourceChainSelectorInstructionBuilder() *DisableSourceChainSelector { + nd := &DisableSourceChainSelector{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetSourceChainSelector sets the "sourceChainSelector" parameter. +func (inst *DisableSourceChainSelector) SetSourceChainSelector(sourceChainSelector uint64) *DisableSourceChainSelector { + inst.SourceChainSelector = &sourceChainSelector + return inst +} + +// SetSourceChainAccount sets the "sourceChain" account. +func (inst *DisableSourceChainSelector) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *DisableSourceChainSelector { + inst.AccountMetaSlice[0] = ag_solanago.Meta(sourceChain).WRITE() + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +func (inst *DisableSourceChainSelector) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *DisableSourceChainSelector) SetConfigAccount(config ag_solanago.PublicKey) *DisableSourceChainSelector { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *DisableSourceChainSelector) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DisableSourceChainSelector) SetAuthorityAccount(authority ag_solanago.PublicKey) *DisableSourceChainSelector { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DisableSourceChainSelector) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst DisableSourceChainSelector) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DisableSourceChainSelector, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DisableSourceChainSelector) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DisableSourceChainSelector) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SourceChainSelector == nil { + return errors.New("SourceChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *DisableSourceChainSelector) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DisableSourceChainSelector")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SourceChainSelector", *inst.SourceChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("sourceChain", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj DisableSourceChainSelector) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *DisableSourceChainSelector) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + return nil +} + +// NewDisableSourceChainSelectorInstruction declares a new DisableSourceChainSelector instruction with the provided parameters and accounts. +func NewDisableSourceChainSelectorInstruction( + // Parameters: + sourceChainSelector uint64, + // Accounts: + sourceChain ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *DisableSourceChainSelector { + return NewDisableSourceChainSelectorInstructionBuilder(). + SetSourceChainSelector(sourceChainSelector). + SetSourceChainAccount(sourceChain). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector_test.go new file mode 100644 index 0000000000..374da332ab --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/DisableSourceChainSelector_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DisableSourceChainSelector(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DisableSourceChainSelector"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DisableSourceChainSelector) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DisableSourceChainSelector) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute.go new file mode 100644 index 0000000000..efc7f1d189 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute.go @@ -0,0 +1,413 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Executes a message on the destination chain. +// +// The method name needs to be execute with Anchor encoding. +// +// This function is called by the OffChain when executing one Report to the SVM Router. +// In this Flow only one message is sent, the Execution Report. This is different as EVM does, +// this is because there is no try/catch mechanism to allow batch execution. +// This message validates that the Merkle Tree Proof of the given message is correct and is stored in the Commit Report Account. +// The message must be untouched to be executed. +// This message emits the event ExecutionStateChanged with the new state of the message. +// Finally, executes the CPI instruction to the receiver program in the ccip_receive message. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the execute. +// * `raw_execution_report` - the serialized execution report containing only one message and proofs +// * `report_context_byte_words` - report_context after execution_report to match context for manually execute (proper decoding order) +// * consists of: +// * report_context_byte_words[0]: ConfigDigest +// * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number +type Execute struct { + RawExecutionReport *[]byte + ReportContextByteWords *[2][32]uint8 + TokenIndexes *[]byte + + // [0] = [] config + // + // [1] = [] referenceAddresses + // + // [2] = [] sourceChain + // + // [3] = [WRITE] commitReport + // + // [4] = [] offramp + // + // [5] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp. This is just used + // ··········· so that token pools and receivers can then check that the caller is an actual offramp that + // ··········· has been registered in the router as such for that source chain. + // + // [6] = [WRITE, SIGNER] authority + // + // [7] = [] systemProgram + // + // [8] = [] sysvarInstructions + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewExecuteInstructionBuilder creates a new `Execute` instruction builder. +func NewExecuteInstructionBuilder() *Execute { + nd := &Execute{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 12), + } + return nd +} + +// SetRawExecutionReport sets the "rawExecutionReport" parameter. +func (inst *Execute) SetRawExecutionReport(rawExecutionReport []byte) *Execute { + inst.RawExecutionReport = &rawExecutionReport + return inst +} + +// SetReportContextByteWords sets the "reportContextByteWords" parameter. +func (inst *Execute) SetReportContextByteWords(reportContextByteWords [2][32]uint8) *Execute { + inst.ReportContextByteWords = &reportContextByteWords + return inst +} + +// SetTokenIndexes sets the "tokenIndexes" parameter. +func (inst *Execute) SetTokenIndexes(tokenIndexes []byte) *Execute { + inst.TokenIndexes = &tokenIndexes + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Execute) SetConfigAccount(config ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Execute) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *Execute) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[1] = ag_solanago.Meta(referenceAddresses) + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *Execute) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSourceChainAccount sets the "sourceChain" account. +func (inst *Execute) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[2] = ag_solanago.Meta(sourceChain) + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +func (inst *Execute) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetCommitReportAccount sets the "commitReport" account. +func (inst *Execute) SetCommitReportAccount(commitReport ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[3] = ag_solanago.Meta(commitReport).WRITE() + return inst +} + +// GetCommitReportAccount gets the "commitReport" account. +func (inst *Execute) GetCommitReportAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetOfframpAccount sets the "offramp" account. +func (inst *Execute) SetOfframpAccount(offramp ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[4] = ag_solanago.Meta(offramp) + return inst +} + +// GetOfframpAccount gets the "offramp" account. +func (inst *Execute) GetOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp. This is just used +// so that token pools and receivers can then check that the caller is an actual offramp that +// has been registered in the router as such for that source chain. +func (inst *Execute) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[5] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp. This is just used +// so that token pools and receivers can then check that the caller is an actual offramp that +// has been registered in the router as such for that source chain. +func (inst *Execute) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Execute) SetAuthorityAccount(authority ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Execute) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Execute) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[7] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Execute) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetSysvarInstructionsAccount sets the "sysvarInstructions" account. +func (inst *Execute) SetSysvarInstructionsAccount(sysvarInstructions ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[8] = ag_solanago.Meta(sysvarInstructions) + return inst +} + +// GetSysvarInstructionsAccount gets the "sysvarInstructions" account. +func (inst *Execute) GetSysvarInstructionsAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *Execute) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *Execute) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *Execute) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *Execute) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *Execute) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *Execute { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *Execute) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +func (inst Execute) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Execute, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Execute) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Execute) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RawExecutionReport == nil { + return errors.New("RawExecutionReport parameter is not set") + } + if inst.ReportContextByteWords == nil { + return errors.New("ReportContextByteWords parameter is not set") + } + if inst.TokenIndexes == nil { + return errors.New("TokenIndexes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.CommitReport is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Offramp is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.SysvarInstructions is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *Execute) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Execute")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" RawExecutionReport", *inst.RawExecutionReport)) + paramsBranch.Child(ag_format.Param("ReportContextByteWords", *inst.ReportContextByteWords)) + paramsBranch.Child(ag_format.Param(" TokenIndexes", *inst.TokenIndexes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=12]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("referenceAddresses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" sourceChain", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" commitReport", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" offramp", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("sysvarInstructions", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[11])) + }) + }) + }) +} + +func (obj Execute) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RawExecutionReport` param: + err = encoder.Encode(obj.RawExecutionReport) + if err != nil { + return err + } + // Serialize `ReportContextByteWords` param: + err = encoder.Encode(obj.ReportContextByteWords) + if err != nil { + return err + } + // Serialize `TokenIndexes` param: + err = encoder.Encode(obj.TokenIndexes) + if err != nil { + return err + } + return nil +} +func (obj *Execute) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RawExecutionReport`: + err = decoder.Decode(&obj.RawExecutionReport) + if err != nil { + return err + } + // Deserialize `ReportContextByteWords`: + err = decoder.Decode(&obj.ReportContextByteWords) + if err != nil { + return err + } + // Deserialize `TokenIndexes`: + err = decoder.Decode(&obj.TokenIndexes) + if err != nil { + return err + } + return nil +} + +// NewExecuteInstruction declares a new Execute instruction with the provided parameters and accounts. +func NewExecuteInstruction( + // Parameters: + rawExecutionReport []byte, + reportContextByteWords [2][32]uint8, + tokenIndexes []byte, + // Accounts: + config ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + sourceChain ag_solanago.PublicKey, + commitReport ag_solanago.PublicKey, + offramp ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + sysvarInstructions ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey) *Execute { + return NewExecuteInstructionBuilder(). + SetRawExecutionReport(rawExecutionReport). + SetReportContextByteWords(reportContextByteWords). + SetTokenIndexes(tokenIndexes). + SetConfigAccount(config). + SetReferenceAddressesAccount(referenceAddresses). + SetSourceChainAccount(sourceChain). + SetCommitReportAccount(commitReport). + SetOfframpAccount(offramp). + SetAllowedOfframpAccount(allowedOfframp). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetSysvarInstructionsAccount(sysvarInstructions). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute_test.go new file mode 100644 index 0000000000..e7025f6392 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Execute_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Execute(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Execute"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Execute) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Execute) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize.go new file mode 100644 index 0000000000..2c0aa18c95 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize.go @@ -0,0 +1,277 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialization Flow // +// Initializes the CCIP Offramp, except for the config account (due to stack size limitations). +// +// The initialization of the Offramp is responsibility of Admin, nothing more than calling these +// initialization methods should be done first. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for initialization. +type Initialize struct { + + // [0] = [WRITE] referenceAddresses + // + // [1] = [] router + // + // [2] = [] feeQuoter + // + // [3] = [] rmnRemote + // + // [4] = [] offrampLookupTable + // + // [5] = [WRITE] state + // + // [6] = [WRITE, SIGNER] authority + // + // [7] = [] systemProgram + // + // [8] = [] program + // + // [9] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 10), + } + return nd +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *Initialize) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(referenceAddresses).WRITE() + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *Initialize) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetRouterAccount sets the "router" account. +func (inst *Initialize) SetRouterAccount(router ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(router) + return inst +} + +// GetRouterAccount gets the "router" account. +func (inst *Initialize) GetRouterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +func (inst *Initialize) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +func (inst *Initialize) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *Initialize) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *Initialize) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetOfframpLookupTableAccount sets the "offrampLookupTable" account. +func (inst *Initialize) SetOfframpLookupTableAccount(offrampLookupTable ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(offrampLookupTable) + return inst +} + +// GetOfframpLookupTableAccount gets the "offrampLookupTable" account. +func (inst *Initialize) GetOfframpLookupTableAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[7] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[8] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[9] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Router is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.OfframpLookupTable is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=10]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("referenceAddresses", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" router", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("offrampLookupTable", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[9])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Accounts: + referenceAddresses ag_solanago.PublicKey, + router ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + offrampLookupTable ag_solanago.PublicKey, + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetReferenceAddressesAccount(referenceAddresses). + SetRouterAccount(router). + SetFeeQuoterAccount(feeQuoter). + SetRmnRemoteAccount(rmnRemote). + SetOfframpLookupTableAccount(offrampLookupTable). + SetStateAccount(state). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig.go new file mode 100644 index 0000000000..73b385c776 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig.go @@ -0,0 +1,235 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initializes the CCIP Offramp Config account. +// +// The initialization of the Offramp is responsibility of Admin, nothing more than calling these +// initialization methods should be done first. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for initialization of the config. +// * `svm_chain_selector` - The chain selector for SVM. +// * `enable_execution_after` - The minimum amount of time required between a message has been committed and can be manually executed. +type InitializeConfig struct { + SvmChainSelector *uint64 + EnableExecutionAfter *int64 + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeConfigInstructionBuilder creates a new `InitializeConfig` instruction builder. +func NewInitializeConfigInstructionBuilder() *InitializeConfig { + nd := &InitializeConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetSvmChainSelector sets the "svmChainSelector" parameter. +func (inst *InitializeConfig) SetSvmChainSelector(svmChainSelector uint64) *InitializeConfig { + inst.SvmChainSelector = &svmChainSelector + return inst +} + +// SetEnableExecutionAfter sets the "enableExecutionAfter" parameter. +func (inst *InitializeConfig) SetEnableExecutionAfter(enableExecutionAfter int64) *InitializeConfig { + inst.EnableExecutionAfter = &enableExecutionAfter + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *InitializeConfig) SetConfigAccount(config ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *InitializeConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitializeConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitializeConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitializeConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitializeConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *InitializeConfig) SetProgramAccount(program ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *InitializeConfig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *InitializeConfig) SetProgramDataAccount(programData ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *InitializeConfig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst InitializeConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitializeConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitializeConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitializeConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SvmChainSelector == nil { + return errors.New("SvmChainSelector parameter is not set") + } + if inst.EnableExecutionAfter == nil { + return errors.New("EnableExecutionAfter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *InitializeConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitializeConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" SvmChainSelector", *inst.SvmChainSelector)) + paramsBranch.Child(ag_format.Param("EnableExecutionAfter", *inst.EnableExecutionAfter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj InitializeConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SvmChainSelector` param: + err = encoder.Encode(obj.SvmChainSelector) + if err != nil { + return err + } + // Serialize `EnableExecutionAfter` param: + err = encoder.Encode(obj.EnableExecutionAfter) + if err != nil { + return err + } + return nil +} +func (obj *InitializeConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SvmChainSelector`: + err = decoder.Decode(&obj.SvmChainSelector) + if err != nil { + return err + } + // Deserialize `EnableExecutionAfter`: + err = decoder.Decode(&obj.EnableExecutionAfter) + if err != nil { + return err + } + return nil +} + +// NewInitializeConfigInstruction declares a new InitializeConfig instruction with the provided parameters and accounts. +func NewInitializeConfigInstruction( + // Parameters: + svmChainSelector uint64, + enableExecutionAfter int64, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *InitializeConfig { + return NewInitializeConfigInstructionBuilder(). + SetSvmChainSelector(svmChainSelector). + SetEnableExecutionAfter(enableExecutionAfter). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig_test.go new file mode 100644 index 0000000000..9e274c3375 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/InitializeConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitializeConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitializeConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitializeConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitializeConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize_test.go new file mode 100644 index 0000000000..56ca8db46d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute.go new file mode 100644 index 0000000000..bbb9809f8a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute.go @@ -0,0 +1,380 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Manually executes a report to the router. +// +// When a message is not being executed, then the user can trigger the execution manually. +// No verification over the transmitter, but the message needs to be in some commit report. +// It validates that the required time has passed since the commit and then executes the report. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the execution. +// * `raw_execution_report` - The serialized execution report containing the message and proofs. +type ManuallyExecute struct { + RawExecutionReport *[]byte + TokenIndexes *[]byte + + // [0] = [] config + // + // [1] = [] referenceAddresses + // + // [2] = [] sourceChain + // + // [3] = [WRITE] commitReport + // + // [4] = [] offramp + // + // [5] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp. This is just used + // ··········· so that token pools and receivers can then check that the caller is an actual offramp that + // ··········· has been registered in the router as such for that source chain. + // + // [6] = [WRITE, SIGNER] authority + // + // [7] = [] systemProgram + // + // [8] = [] sysvarInstructions + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewManuallyExecuteInstructionBuilder creates a new `ManuallyExecute` instruction builder. +func NewManuallyExecuteInstructionBuilder() *ManuallyExecute { + nd := &ManuallyExecute{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 12), + } + return nd +} + +// SetRawExecutionReport sets the "rawExecutionReport" parameter. +func (inst *ManuallyExecute) SetRawExecutionReport(rawExecutionReport []byte) *ManuallyExecute { + inst.RawExecutionReport = &rawExecutionReport + return inst +} + +// SetTokenIndexes sets the "tokenIndexes" parameter. +func (inst *ManuallyExecute) SetTokenIndexes(tokenIndexes []byte) *ManuallyExecute { + inst.TokenIndexes = &tokenIndexes + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *ManuallyExecute) SetConfigAccount(config ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *ManuallyExecute) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *ManuallyExecute) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[1] = ag_solanago.Meta(referenceAddresses) + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *ManuallyExecute) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSourceChainAccount sets the "sourceChain" account. +func (inst *ManuallyExecute) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[2] = ag_solanago.Meta(sourceChain) + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +func (inst *ManuallyExecute) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetCommitReportAccount sets the "commitReport" account. +func (inst *ManuallyExecute) SetCommitReportAccount(commitReport ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[3] = ag_solanago.Meta(commitReport).WRITE() + return inst +} + +// GetCommitReportAccount gets the "commitReport" account. +func (inst *ManuallyExecute) GetCommitReportAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetOfframpAccount sets the "offramp" account. +func (inst *ManuallyExecute) SetOfframpAccount(offramp ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[4] = ag_solanago.Meta(offramp) + return inst +} + +// GetOfframpAccount gets the "offramp" account. +func (inst *ManuallyExecute) GetOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp. This is just used +// so that token pools and receivers can then check that the caller is an actual offramp that +// has been registered in the router as such for that source chain. +func (inst *ManuallyExecute) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[5] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp. This is just used +// so that token pools and receivers can then check that the caller is an actual offramp that +// has been registered in the router as such for that source chain. +func (inst *ManuallyExecute) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ManuallyExecute) SetAuthorityAccount(authority ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ManuallyExecute) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ManuallyExecute) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[7] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ManuallyExecute) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetSysvarInstructionsAccount sets the "sysvarInstructions" account. +func (inst *ManuallyExecute) SetSysvarInstructionsAccount(sysvarInstructions ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[8] = ag_solanago.Meta(sysvarInstructions) + return inst +} + +// GetSysvarInstructionsAccount gets the "sysvarInstructions" account. +func (inst *ManuallyExecute) GetSysvarInstructionsAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *ManuallyExecute) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *ManuallyExecute) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *ManuallyExecute) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *ManuallyExecute) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *ManuallyExecute) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *ManuallyExecute { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *ManuallyExecute) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +func (inst ManuallyExecute) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ManuallyExecute, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ManuallyExecute) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ManuallyExecute) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RawExecutionReport == nil { + return errors.New("RawExecutionReport parameter is not set") + } + if inst.TokenIndexes == nil { + return errors.New("TokenIndexes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.CommitReport is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Offramp is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.SysvarInstructions is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *ManuallyExecute) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ManuallyExecute")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RawExecutionReport", *inst.RawExecutionReport)) + paramsBranch.Child(ag_format.Param(" TokenIndexes", *inst.TokenIndexes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=12]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("referenceAddresses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" sourceChain", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" commitReport", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" offramp", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("sysvarInstructions", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[11])) + }) + }) + }) +} + +func (obj ManuallyExecute) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RawExecutionReport` param: + err = encoder.Encode(obj.RawExecutionReport) + if err != nil { + return err + } + // Serialize `TokenIndexes` param: + err = encoder.Encode(obj.TokenIndexes) + if err != nil { + return err + } + return nil +} +func (obj *ManuallyExecute) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RawExecutionReport`: + err = decoder.Decode(&obj.RawExecutionReport) + if err != nil { + return err + } + // Deserialize `TokenIndexes`: + err = decoder.Decode(&obj.TokenIndexes) + if err != nil { + return err + } + return nil +} + +// NewManuallyExecuteInstruction declares a new ManuallyExecute instruction with the provided parameters and accounts. +func NewManuallyExecuteInstruction( + // Parameters: + rawExecutionReport []byte, + tokenIndexes []byte, + // Accounts: + config ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + sourceChain ag_solanago.PublicKey, + commitReport ag_solanago.PublicKey, + offramp ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + sysvarInstructions ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey) *ManuallyExecute { + return NewManuallyExecuteInstructionBuilder(). + SetRawExecutionReport(rawExecutionReport). + SetTokenIndexes(tokenIndexes). + SetConfigAccount(config). + SetReferenceAddressesAccount(referenceAddresses). + SetSourceChainAccount(sourceChain). + SetCommitReportAccount(commitReport). + SetOfframpAccount(offramp). + SetAllowedOfframpAccount(allowedOfframp). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetSysvarInstructionsAccount(sysvarInstructions). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute_test.go new file mode 100644 index 0000000000..7618c40d5a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/ManuallyExecute_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ManuallyExecute(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ManuallyExecute"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ManuallyExecute) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ManuallyExecute) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion.go new file mode 100644 index 0000000000..24231ecbe8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion.go @@ -0,0 +1,154 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the default code version to be used. This is then used by the slim routing layer to determine +// which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `code_version` - The new code version to be set as default. +type SetDefaultCodeVersion struct { + CodeVersion *CodeVersion + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetDefaultCodeVersionInstructionBuilder creates a new `SetDefaultCodeVersion` instruction builder. +func NewSetDefaultCodeVersionInstructionBuilder() *SetDefaultCodeVersion { + nd := &SetDefaultCodeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetCodeVersion sets the "codeVersion" parameter. +func (inst *SetDefaultCodeVersion) SetCodeVersion(codeVersion CodeVersion) *SetDefaultCodeVersion { + inst.CodeVersion = &codeVersion + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetDefaultCodeVersion) SetConfigAccount(config ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetDefaultCodeVersion) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetDefaultCodeVersion) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetDefaultCodeVersion) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetDefaultCodeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetDefaultCodeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetDefaultCodeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetDefaultCodeVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.CodeVersion == nil { + return errors.New("CodeVersion parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetDefaultCodeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetDefaultCodeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("CodeVersion", *inst.CodeVersion)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetDefaultCodeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `CodeVersion` param: + err = encoder.Encode(obj.CodeVersion) + if err != nil { + return err + } + return nil +} +func (obj *SetDefaultCodeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `CodeVersion`: + err = decoder.Decode(&obj.CodeVersion) + if err != nil { + return err + } + return nil +} + +// NewSetDefaultCodeVersionInstruction declares a new SetDefaultCodeVersion instruction with the provided parameters and accounts. +func NewSetDefaultCodeVersionInstruction( + // Parameters: + codeVersion CodeVersion, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + return NewSetDefaultCodeVersionInstructionBuilder(). + SetCodeVersion(codeVersion). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion_test.go new file mode 100644 index 0000000000..d6e00cd0c4 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetDefaultCodeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetDefaultCodeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetDefaultCodeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetDefaultCodeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetDefaultCodeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig.go new file mode 100644 index 0000000000..c2d3e5ad9b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig.go @@ -0,0 +1,243 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the OCR configuration. +// Only CCIP Admin can set the OCR configuration. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for setting the OCR configuration. +// * `plugin_type` - The type of OCR plugin [0: Commit, 1: Execution]. +// * `config_info` - The OCR configuration information. +// * `signers` - The list of signers. +// * `transmitters` - The list of transmitters. +type SetOcrConfig struct { + PluginType *OcrPluginType + ConfigInfo *Ocr3ConfigInfo + Signers *[][20]uint8 + Transmitters *[]ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE] state + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetOcrConfigInstructionBuilder creates a new `SetOcrConfig` instruction builder. +func NewSetOcrConfigInstructionBuilder() *SetOcrConfig { + nd := &SetOcrConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetPluginType sets the "pluginType" parameter. +func (inst *SetOcrConfig) SetPluginType(pluginType OcrPluginType) *SetOcrConfig { + inst.PluginType = &pluginType + return inst +} + +// SetConfigInfo sets the "configInfo" parameter. +func (inst *SetOcrConfig) SetConfigInfo(configInfo Ocr3ConfigInfo) *SetOcrConfig { + inst.ConfigInfo = &configInfo + return inst +} + +// SetSigners sets the "signers" parameter. +func (inst *SetOcrConfig) SetSigners(signers [][20]uint8) *SetOcrConfig { + inst.Signers = &signers + return inst +} + +// SetTransmitters sets the "transmitters" parameter. +func (inst *SetOcrConfig) SetTransmitters(transmitters []ag_solanago.PublicKey) *SetOcrConfig { + inst.Transmitters = &transmitters + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetOcrConfig) SetConfigAccount(config ag_solanago.PublicKey) *SetOcrConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetOcrConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetStateAccount sets the "state" account. +func (inst *SetOcrConfig) SetStateAccount(state ag_solanago.PublicKey) *SetOcrConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetOcrConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetOcrConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetOcrConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetOcrConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetOcrConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetOcrConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetOcrConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetOcrConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.PluginType == nil { + return errors.New("PluginType parameter is not set") + } + if inst.ConfigInfo == nil { + return errors.New("ConfigInfo parameter is not set") + } + if inst.Signers == nil { + return errors.New("Signers parameter is not set") + } + if inst.Transmitters == nil { + return errors.New("Transmitters parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetOcrConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetOcrConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" PluginType", *inst.PluginType)) + paramsBranch.Child(ag_format.Param(" ConfigInfo", *inst.ConfigInfo)) + paramsBranch.Child(ag_format.Param(" Signers", *inst.Signers)) + paramsBranch.Child(ag_format.Param("Transmitters", *inst.Transmitters)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetOcrConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PluginType` param: + err = encoder.Encode(obj.PluginType) + if err != nil { + return err + } + // Serialize `ConfigInfo` param: + err = encoder.Encode(obj.ConfigInfo) + if err != nil { + return err + } + // Serialize `Signers` param: + err = encoder.Encode(obj.Signers) + if err != nil { + return err + } + // Serialize `Transmitters` param: + err = encoder.Encode(obj.Transmitters) + if err != nil { + return err + } + return nil +} +func (obj *SetOcrConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PluginType`: + err = decoder.Decode(&obj.PluginType) + if err != nil { + return err + } + // Deserialize `ConfigInfo`: + err = decoder.Decode(&obj.ConfigInfo) + if err != nil { + return err + } + // Deserialize `Signers`: + err = decoder.Decode(&obj.Signers) + if err != nil { + return err + } + // Deserialize `Transmitters`: + err = decoder.Decode(&obj.Transmitters) + if err != nil { + return err + } + return nil +} + +// NewSetOcrConfigInstruction declares a new SetOcrConfig instruction with the provided parameters and accounts. +func NewSetOcrConfigInstruction( + // Parameters: + pluginType OcrPluginType, + configInfo Ocr3ConfigInfo, + signers [][20]uint8, + transmitters []ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetOcrConfig { + return NewSetOcrConfigInstructionBuilder(). + SetPluginType(pluginType). + SetConfigInfo(configInfo). + SetSigners(signers). + SetTransmitters(transmitters). + SetConfigAccount(config). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig_test.go new file mode 100644 index 0000000000..48186ce868 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/SetOcrConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetOcrConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetOcrConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetOcrConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetOcrConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership.go new file mode 100644 index 0000000000..5e0669696e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership.go @@ -0,0 +1,153 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Transfers the ownership of the router to a new proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer. +// * `proposed_owner` - The public key of the new proposed owner. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *TransferOwnership) SetConfigAccount(config ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *TransferOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership_test.go new file mode 100644 index 0000000000..6327b832a9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion.go new file mode 100644 index 0000000000..fd6e1401f6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion_test.go new file mode 100644 index 0000000000..c515735a15 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter.go new file mode 100644 index 0000000000..424e488a4a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter.go @@ -0,0 +1,154 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the minimum amount of time required between a message being committed and when it can be manually executed. +// +// This is part of the OffRamp Configuration for SVM. +// The Admin is the only one able to update this config. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `new_enable_manual_execution_after` - The new minimum amount of time required. +type UpdateEnableManualExecutionAfter struct { + NewEnableManualExecutionAfter *int64 + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateEnableManualExecutionAfterInstructionBuilder creates a new `UpdateEnableManualExecutionAfter` instruction builder. +func NewUpdateEnableManualExecutionAfterInstructionBuilder() *UpdateEnableManualExecutionAfter { + nd := &UpdateEnableManualExecutionAfter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetNewEnableManualExecutionAfter sets the "newEnableManualExecutionAfter" parameter. +func (inst *UpdateEnableManualExecutionAfter) SetNewEnableManualExecutionAfter(newEnableManualExecutionAfter int64) *UpdateEnableManualExecutionAfter { + inst.NewEnableManualExecutionAfter = &newEnableManualExecutionAfter + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateEnableManualExecutionAfter) SetConfigAccount(config ag_solanago.PublicKey) *UpdateEnableManualExecutionAfter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateEnableManualExecutionAfter) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateEnableManualExecutionAfter) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateEnableManualExecutionAfter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateEnableManualExecutionAfter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst UpdateEnableManualExecutionAfter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateEnableManualExecutionAfter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateEnableManualExecutionAfter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateEnableManualExecutionAfter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewEnableManualExecutionAfter == nil { + return errors.New("NewEnableManualExecutionAfter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateEnableManualExecutionAfter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateEnableManualExecutionAfter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewEnableManualExecutionAfter", *inst.NewEnableManualExecutionAfter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj UpdateEnableManualExecutionAfter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewEnableManualExecutionAfter` param: + err = encoder.Encode(obj.NewEnableManualExecutionAfter) + if err != nil { + return err + } + return nil +} +func (obj *UpdateEnableManualExecutionAfter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewEnableManualExecutionAfter`: + err = decoder.Decode(&obj.NewEnableManualExecutionAfter) + if err != nil { + return err + } + return nil +} + +// NewUpdateEnableManualExecutionAfterInstruction declares a new UpdateEnableManualExecutionAfter instruction with the provided parameters and accounts. +func NewUpdateEnableManualExecutionAfterInstruction( + // Parameters: + newEnableManualExecutionAfter int64, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateEnableManualExecutionAfter { + return NewUpdateEnableManualExecutionAfterInstructionBuilder(). + SetNewEnableManualExecutionAfter(newEnableManualExecutionAfter). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter_test.go new file mode 100644 index 0000000000..0491a430d6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateEnableManualExecutionAfter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateEnableManualExecutionAfter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateEnableManualExecutionAfter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateEnableManualExecutionAfter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateEnableManualExecutionAfter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses.go new file mode 100644 index 0000000000..37712ea4b8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses.go @@ -0,0 +1,244 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates reference addresses in the offramp contract, such as +// the CCIP router, Fee Quoter, and the Offramp Lookup Table. +// Only the Admin may update these addresses. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the reference addresses. +// * `router` - The router address to be set. +// * `fee_quoter` - The fee_quoter address to be set. +// * `offramp_lookup_table` - The offramp_lookup_table address to be set. +// * `rmn_remote` - The rmn_remote address to be set. +type UpdateReferenceAddresses struct { + Router *ag_solanago.PublicKey + FeeQuoter *ag_solanago.PublicKey + OfframpLookupTable *ag_solanago.PublicKey + RmnRemote *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] referenceAddresses + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateReferenceAddressesInstructionBuilder creates a new `UpdateReferenceAddresses` instruction builder. +func NewUpdateReferenceAddressesInstructionBuilder() *UpdateReferenceAddresses { + nd := &UpdateReferenceAddresses{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRouter sets the "router" parameter. +func (inst *UpdateReferenceAddresses) SetRouter(router ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.Router = &router + return inst +} + +// SetFeeQuoter sets the "feeQuoter" parameter. +func (inst *UpdateReferenceAddresses) SetFeeQuoter(feeQuoter ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.FeeQuoter = &feeQuoter + return inst +} + +// SetOfframpLookupTable sets the "offrampLookupTable" parameter. +func (inst *UpdateReferenceAddresses) SetOfframpLookupTable(offrampLookupTable ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.OfframpLookupTable = &offrampLookupTable + return inst +} + +// SetRmnRemote sets the "rmnRemote" parameter. +func (inst *UpdateReferenceAddresses) SetRmnRemote(rmnRemote ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.RmnRemote = &rmnRemote + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateReferenceAddresses) SetConfigAccount(config ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateReferenceAddresses) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetReferenceAddressesAccount sets the "referenceAddresses" account. +func (inst *UpdateReferenceAddresses) SetReferenceAddressesAccount(referenceAddresses ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.AccountMetaSlice[1] = ag_solanago.Meta(referenceAddresses).WRITE() + return inst +} + +// GetReferenceAddressesAccount gets the "referenceAddresses" account. +func (inst *UpdateReferenceAddresses) GetReferenceAddressesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateReferenceAddresses) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateReferenceAddresses { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateReferenceAddresses) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateReferenceAddresses) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateReferenceAddresses, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateReferenceAddresses) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateReferenceAddresses) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Router == nil { + return errors.New("Router parameter is not set") + } + if inst.FeeQuoter == nil { + return errors.New("FeeQuoter parameter is not set") + } + if inst.OfframpLookupTable == nil { + return errors.New("OfframpLookupTable parameter is not set") + } + if inst.RmnRemote == nil { + return errors.New("RmnRemote parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ReferenceAddresses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateReferenceAddresses) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateReferenceAddresses")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Router", *inst.Router)) + paramsBranch.Child(ag_format.Param(" FeeQuoter", *inst.FeeQuoter)) + paramsBranch.Child(ag_format.Param("OfframpLookupTable", *inst.OfframpLookupTable)) + paramsBranch.Child(ag_format.Param(" RmnRemote", *inst.RmnRemote)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("referenceAddresses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateReferenceAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `FeeQuoter` param: + err = encoder.Encode(obj.FeeQuoter) + if err != nil { + return err + } + // Serialize `OfframpLookupTable` param: + err = encoder.Encode(obj.OfframpLookupTable) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} +func (obj *UpdateReferenceAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `FeeQuoter`: + err = decoder.Decode(&obj.FeeQuoter) + if err != nil { + return err + } + // Deserialize `OfframpLookupTable`: + err = decoder.Decode(&obj.OfframpLookupTable) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +// NewUpdateReferenceAddressesInstruction declares a new UpdateReferenceAddresses instruction with the provided parameters and accounts. +func NewUpdateReferenceAddressesInstruction( + // Parameters: + router ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + offrampLookupTable ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + referenceAddresses ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateReferenceAddresses { + return NewUpdateReferenceAddressesInstructionBuilder(). + SetRouter(router). + SetFeeQuoter(feeQuoter). + SetOfframpLookupTable(offrampLookupTable). + SetRmnRemote(rmnRemote). + SetConfigAccount(config). + SetReferenceAddressesAccount(referenceAddresses). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses_test.go new file mode 100644 index 0000000000..6f4aaf5c44 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateReferenceAddresses_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateReferenceAddresses(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateReferenceAddresses"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateReferenceAddresses) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateReferenceAddresses) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig.go new file mode 100644 index 0000000000..57fdcec2df --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig.go @@ -0,0 +1,196 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the configuration of the source chain selector. +// +// The Admin is the only one able to update the source chain config. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the chain selector. +// * `source_chain_selector` - The source chain selector to be updated. +// * `source_chain_config` - The new configuration for the source chain. +type UpdateSourceChainConfig struct { + SourceChainSelector *uint64 + SourceChainConfig *SourceChainConfig + + // [0] = [WRITE] sourceChain + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateSourceChainConfigInstructionBuilder creates a new `UpdateSourceChainConfig` instruction builder. +func NewUpdateSourceChainConfigInstructionBuilder() *UpdateSourceChainConfig { + nd := &UpdateSourceChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetSourceChainSelector sets the "sourceChainSelector" parameter. +func (inst *UpdateSourceChainConfig) SetSourceChainSelector(sourceChainSelector uint64) *UpdateSourceChainConfig { + inst.SourceChainSelector = &sourceChainSelector + return inst +} + +// SetSourceChainConfig sets the "sourceChainConfig" parameter. +func (inst *UpdateSourceChainConfig) SetSourceChainConfig(sourceChainConfig SourceChainConfig) *UpdateSourceChainConfig { + inst.SourceChainConfig = &sourceChainConfig + return inst +} + +// SetSourceChainAccount sets the "sourceChain" account. +func (inst *UpdateSourceChainConfig) SetSourceChainAccount(sourceChain ag_solanago.PublicKey) *UpdateSourceChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(sourceChain).WRITE() + return inst +} + +// GetSourceChainAccount gets the "sourceChain" account. +func (inst *UpdateSourceChainConfig) GetSourceChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateSourceChainConfig) SetConfigAccount(config ag_solanago.PublicKey) *UpdateSourceChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateSourceChainConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateSourceChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateSourceChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateSourceChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateSourceChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateSourceChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateSourceChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateSourceChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SourceChainSelector == nil { + return errors.New("SourceChainSelector parameter is not set") + } + if inst.SourceChainConfig == nil { + return errors.New("SourceChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.SourceChain is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateSourceChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateSourceChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SourceChainSelector", *inst.SourceChainSelector)) + paramsBranch.Child(ag_format.Param(" SourceChainConfig", *inst.SourceChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("sourceChain", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateSourceChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `SourceChainConfig` param: + err = encoder.Encode(obj.SourceChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *UpdateSourceChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `SourceChainConfig`: + err = decoder.Decode(&obj.SourceChainConfig) + if err != nil { + return err + } + return nil +} + +// NewUpdateSourceChainConfigInstruction declares a new UpdateSourceChainConfig instruction with the provided parameters and accounts. +func NewUpdateSourceChainConfigInstruction( + // Parameters: + sourceChainSelector uint64, + sourceChainConfig SourceChainConfig, + // Accounts: + sourceChain ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateSourceChainConfig { + return NewUpdateSourceChainConfigInstructionBuilder(). + SetSourceChainSelector(sourceChainSelector). + SetSourceChainConfig(sourceChainConfig). + SetSourceChainAccount(sourceChain). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig_test.go new file mode 100644 index 0000000000..ce8e633717 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSourceChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateSourceChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateSourceChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateSourceChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateSourceChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector.go new file mode 100644 index 0000000000..84039b48eb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector.go @@ -0,0 +1,153 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the SVM chain selector in the offramp configuration. +// +// This method should only be used if there was an error with the initial configuration or if the solana chain selector changes. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `new_chain_selector` - The new chain selector for SVM. +type UpdateSvmChainSelector struct { + NewChainSelector *uint64 + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateSvmChainSelectorInstructionBuilder creates a new `UpdateSvmChainSelector` instruction builder. +func NewUpdateSvmChainSelectorInstructionBuilder() *UpdateSvmChainSelector { + nd := &UpdateSvmChainSelector{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetNewChainSelector sets the "newChainSelector" parameter. +func (inst *UpdateSvmChainSelector) SetNewChainSelector(newChainSelector uint64) *UpdateSvmChainSelector { + inst.NewChainSelector = &newChainSelector + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateSvmChainSelector) SetConfigAccount(config ag_solanago.PublicKey) *UpdateSvmChainSelector { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateSvmChainSelector) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateSvmChainSelector) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateSvmChainSelector { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateSvmChainSelector) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst UpdateSvmChainSelector) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateSvmChainSelector, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateSvmChainSelector) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateSvmChainSelector) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewChainSelector == nil { + return errors.New("NewChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateSvmChainSelector) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateSvmChainSelector")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewChainSelector", *inst.NewChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj UpdateSvmChainSelector) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewChainSelector` param: + err = encoder.Encode(obj.NewChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *UpdateSvmChainSelector) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewChainSelector`: + err = decoder.Decode(&obj.NewChainSelector) + if err != nil { + return err + } + return nil +} + +// NewUpdateSvmChainSelectorInstruction declares a new UpdateSvmChainSelector instruction with the provided parameters and accounts. +func NewUpdateSvmChainSelectorInstruction( + // Parameters: + newChainSelector uint64, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateSvmChainSelector { + return NewUpdateSvmChainSelectorInstructionBuilder(). + SetNewChainSelector(newChainSelector). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector_test.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector_test.go new file mode 100644 index 0000000000..588bf15b66 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/UpdateSvmChainSelector_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateSvmChainSelector(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateSvmChainSelector"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateSvmChainSelector) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateSvmChainSelector) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/accounts.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/accounts.go new file mode 100644 index 0000000000..57589a0367 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/accounts.go @@ -0,0 +1,547 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type Config struct { + Version uint8 + DefaultCodeVersion uint8 + Padding0 [6]uint8 + SvmChainSelector uint64 + EnableManualExecutionAfter int64 + Padding1 [8]uint8 + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + Padding2 [8]uint8 + Ocr3 [2]Ocr3Config +} + +var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} + +func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `DefaultCodeVersion` param: + err = encoder.Encode(obj.DefaultCodeVersion) + if err != nil { + return err + } + // Serialize `Padding0` param: + err = encoder.Encode(obj.Padding0) + if err != nil { + return err + } + // Serialize `SvmChainSelector` param: + err = encoder.Encode(obj.SvmChainSelector) + if err != nil { + return err + } + // Serialize `EnableManualExecutionAfter` param: + err = encoder.Encode(obj.EnableManualExecutionAfter) + if err != nil { + return err + } + // Serialize `Padding1` param: + err = encoder.Encode(obj.Padding1) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `Padding2` param: + err = encoder.Encode(obj.Padding2) + if err != nil { + return err + } + // Serialize `Ocr3` param: + err = encoder.Encode(obj.Ocr3) + if err != nil { + return err + } + return nil +} + +func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[155 12 170 224 30 250 204 130]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `DefaultCodeVersion`: + err = decoder.Decode(&obj.DefaultCodeVersion) + if err != nil { + return err + } + // Deserialize `Padding0`: + err = decoder.Decode(&obj.Padding0) + if err != nil { + return err + } + // Deserialize `SvmChainSelector`: + err = decoder.Decode(&obj.SvmChainSelector) + if err != nil { + return err + } + // Deserialize `EnableManualExecutionAfter`: + err = decoder.Decode(&obj.EnableManualExecutionAfter) + if err != nil { + return err + } + // Deserialize `Padding1`: + err = decoder.Decode(&obj.Padding1) + if err != nil { + return err + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `Padding2`: + err = decoder.Decode(&obj.Padding2) + if err != nil { + return err + } + // Deserialize `Ocr3`: + err = decoder.Decode(&obj.Ocr3) + if err != nil { + return err + } + return nil +} + +type ReferenceAddresses struct { + Version uint8 + Router ag_solanago.PublicKey + FeeQuoter ag_solanago.PublicKey + OfframpLookupTable ag_solanago.PublicKey + RmnRemote ag_solanago.PublicKey +} + +var ReferenceAddressesDiscriminator = [8]byte{99, 5, 216, 212, 250, 75, 74, 12} + +func (obj ReferenceAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ReferenceAddressesDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `FeeQuoter` param: + err = encoder.Encode(obj.FeeQuoter) + if err != nil { + return err + } + // Serialize `OfframpLookupTable` param: + err = encoder.Encode(obj.OfframpLookupTable) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +func (obj *ReferenceAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ReferenceAddressesDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[99 5 216 212 250 75 74 12]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `FeeQuoter`: + err = decoder.Decode(&obj.FeeQuoter) + if err != nil { + return err + } + // Deserialize `OfframpLookupTable`: + err = decoder.Decode(&obj.OfframpLookupTable) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +type GlobalState struct { + LatestPriceSequenceNumber uint64 +} + +var GlobalStateDiscriminator = [8]byte{163, 46, 74, 168, 216, 123, 133, 98} + +func (obj GlobalState) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(GlobalStateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `LatestPriceSequenceNumber` param: + err = encoder.Encode(obj.LatestPriceSequenceNumber) + if err != nil { + return err + } + return nil +} + +func (obj *GlobalState) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(GlobalStateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[163 46 74 168 216 123 133 98]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `LatestPriceSequenceNumber`: + err = decoder.Decode(&obj.LatestPriceSequenceNumber) + if err != nil { + return err + } + return nil +} + +type ExecutionReportBuffer struct { + Version uint8 + ChunkBitmap uint64 + NumChunks uint8 + ChunkLength uint32 + Data []byte +} + +var ExecutionReportBufferDiscriminator = [8]byte{34, 31, 166, 249, 72, 98, 246, 232} + +func (obj ExecutionReportBuffer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ExecutionReportBufferDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChunkBitmap` param: + err = encoder.Encode(obj.ChunkBitmap) + if err != nil { + return err + } + // Serialize `NumChunks` param: + err = encoder.Encode(obj.NumChunks) + if err != nil { + return err + } + // Serialize `ChunkLength` param: + err = encoder.Encode(obj.ChunkLength) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + return nil +} + +func (obj *ExecutionReportBuffer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ExecutionReportBufferDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[34 31 166 249 72 98 246 232]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChunkBitmap`: + err = decoder.Decode(&obj.ChunkBitmap) + if err != nil { + return err + } + // Deserialize `NumChunks`: + err = decoder.Decode(&obj.NumChunks) + if err != nil { + return err + } + // Deserialize `ChunkLength`: + err = decoder.Decode(&obj.ChunkLength) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + return nil +} + +type SourceChain struct { + Version uint8 + ChainSelector uint64 + State SourceChainState + Config SourceChainConfig +} + +var SourceChainDiscriminator = [8]byte{242, 235, 220, 98, 252, 121, 191, 216} + +func (obj SourceChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(SourceChainDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `State` param: + err = encoder.Encode(obj.State) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *SourceChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(SourceChainDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[242 235 220 98 252 121 191 216]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `State`: + err = decoder.Decode(&obj.State) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type CommitReport struct { + Version uint8 + ChainSelector uint64 + MerkleRoot [32]uint8 + Timestamp int64 + MinMsgNr uint64 + MaxMsgNr uint64 + ExecutionStates ag_binary.Uint128 +} + +var CommitReportDiscriminator = [8]byte{46, 231, 247, 231, 174, 68, 34, 26} + +func (obj CommitReport) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(CommitReportDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `MerkleRoot` param: + err = encoder.Encode(obj.MerkleRoot) + if err != nil { + return err + } + // Serialize `Timestamp` param: + err = encoder.Encode(obj.Timestamp) + if err != nil { + return err + } + // Serialize `MinMsgNr` param: + err = encoder.Encode(obj.MinMsgNr) + if err != nil { + return err + } + // Serialize `MaxMsgNr` param: + err = encoder.Encode(obj.MaxMsgNr) + if err != nil { + return err + } + // Serialize `ExecutionStates` param: + err = encoder.Encode(obj.ExecutionStates) + if err != nil { + return err + } + return nil +} + +func (obj *CommitReport) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(CommitReportDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[46 231 247 231 174 68 34 26]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `MerkleRoot`: + err = decoder.Decode(&obj.MerkleRoot) + if err != nil { + return err + } + // Deserialize `Timestamp`: + err = decoder.Decode(&obj.Timestamp) + if err != nil { + return err + } + // Deserialize `MinMsgNr`: + err = decoder.Decode(&obj.MinMsgNr) + if err != nil { + return err + } + // Deserialize `MaxMsgNr`: + err = decoder.Decode(&obj.MaxMsgNr) + if err != nil { + return err + } + // Deserialize `ExecutionStates`: + err = decoder.Decode(&obj.ExecutionStates) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/instructions.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/instructions.go new file mode 100644 index 0000000000..d4b874af69 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/instructions.go @@ -0,0 +1,504 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "CcipOfframp" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + // Initialization Flow // + // Initializes the CCIP Offramp, except for the config account (due to stack size limitations). + // + // The initialization of the Offramp is responsibility of Admin, nothing more than calling these + // initialization methods should be done first. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for initialization. + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Initializes the CCIP Offramp Config account. + // + // The initialization of the Offramp is responsibility of Admin, nothing more than calling these + // initialization methods should be done first. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for initialization of the config. + // * `svm_chain_selector` - The chain selector for SVM. + // * `enable_execution_after` - The minimum amount of time required between a message has been committed and can be manually executed. + Instruction_InitializeConfig = ag_binary.TypeID([8]byte{208, 127, 21, 1, 194, 190, 196, 70}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + // Transfers the ownership of the router to a new proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer. + // * `proposed_owner` - The public key of the new proposed owner. + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + // Accepts the ownership of the router by the proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for accepting ownership. + // The new owner must be a signer of the transaction. + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + // Sets the default code version to be used. This is then used by the slim routing layer to determine + // which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `code_version` - The new code version to be set as default. + Instruction_SetDefaultCodeVersion = ag_binary.TypeID([8]byte{47, 151, 233, 254, 121, 82, 206, 152}) + + // Updates reference addresses in the offramp contract, such as + // the CCIP router, Fee Quoter, and the Offramp Lookup Table. + // Only the Admin may update these addresses. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the reference addresses. + // * `router` - The router address to be set. + // * `fee_quoter` - The fee_quoter address to be set. + // * `offramp_lookup_table` - The offramp_lookup_table address to be set. + // * `rmn_remote` - The rmn_remote address to be set. + Instruction_UpdateReferenceAddresses = ag_binary.TypeID([8]byte{119, 179, 218, 249, 217, 184, 181, 9}) + + // Adds a new source chain selector with its config to the offramp. + // + // The Admin needs to add any new chain supported. + // When adding a new chain, the Admin needs to specify if it's enabled or not. + // + // # Arguments + Instruction_AddSourceChain = ag_binary.TypeID([8]byte{26, 58, 148, 88, 190, 27, 2, 144}) + + // Disables the source chain selector. + // + // The Admin is the only one able to disable the chain selector as source. This method is thought of as an emergency kill-switch. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for disabling the chain selector. + // * `source_chain_selector` - The source chain selector to be disabled. + Instruction_DisableSourceChainSelector = ag_binary.TypeID([8]byte{58, 101, 54, 252, 248, 31, 226, 121}) + + // Updates the configuration of the source chain selector. + // + // The Admin is the only one able to update the source chain config. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the chain selector. + // * `source_chain_selector` - The source chain selector to be updated. + // * `source_chain_config` - The new configuration for the source chain. + Instruction_UpdateSourceChainConfig = ag_binary.TypeID([8]byte{52, 85, 37, 124, 209, 140, 181, 104}) + + // Updates the SVM chain selector in the offramp configuration. + // + // This method should only be used if there was an error with the initial configuration or if the solana chain selector changes. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `new_chain_selector` - The new chain selector for SVM. + Instruction_UpdateSvmChainSelector = ag_binary.TypeID([8]byte{164, 212, 71, 101, 166, 113, 26, 93}) + + // Updates the minimum amount of time required between a message being committed and when it can be manually executed. + // + // This is part of the OffRamp Configuration for SVM. + // The Admin is the only one able to update this config. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `new_enable_manual_execution_after` - The new minimum amount of time required. + Instruction_UpdateEnableManualExecutionAfter = ag_binary.TypeID([8]byte{157, 236, 73, 92, 84, 197, 152, 105}) + + // Sets the OCR configuration. + // Only CCIP Admin can set the OCR configuration. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for setting the OCR configuration. + // * `plugin_type` - The type of OCR plugin [0: Commit, 1: Execution]. + // * `config_info` - The OCR configuration information. + // * `signers` - The list of signers. + // * `transmitters` - The list of transmitters. + Instruction_SetOcrConfig = ag_binary.TypeID([8]byte{4, 131, 107, 110, 250, 158, 244, 200}) + + // Off Ramp Flow // + // Commits a report to the router, containing a Merkle Root. + // + // The method name needs to be commit with Anchor encoding. + // + // This function is called by the OffChain when committing one Report to the SVM Router. + // In this Flow only one report is sent, the Commit Report. This is different as EVM does, + // this is because here all the chain state is stored in one account per Merkle Tree Root. + // So, to avoid having to send a dynamic size array of accounts, in this message only one Commit Report Account is sent. + // This message validates the signatures of the report and stores the Merkle Root in the Commit Report Account. + // The Report must contain an interval of messages, and the min of them must be the next sequence number expected. + // The max size of the interval is 64. + // This message emits two events: CommitReportAccepted and Transmitted. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the commit. + // * `report_context_byte_words` - consists of: + // * report_context_byte_words[0]: ConfigDigest + // * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number + // * `raw_report` - The serialized commit input report, single merkle root with RMN signatures and price updates + // * `rs` - slice of R components of signatures + // * `ss` - slice of S components of signatures + // * `raw_vs` - array of V components of signatures + Instruction_Commit = ag_binary.TypeID([8]byte{223, 140, 142, 165, 229, 208, 156, 74}) + + // Commits a report to the router, with price updates only. + // + // The method name needs to be commit with Anchor encoding. + // + // This function is called by the OffChain when committing one Report to the SVM Router, + // containing only price updates and no merkle root. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the commit. + // * `report_context_byte_words` - consists of: + // * report_context_byte_words[0]: ConfigDigest + // * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number + // * `raw_report` - The serialized commit input report containing the price updates, + // with no merkle root. + // * `rs` - slice of R components of signatures + // * `ss` - slice of S components of signatures + // * `raw_vs` - array of V components of signatures + Instruction_CommitPriceOnly = ag_binary.TypeID([8]byte{186, 145, 195, 227, 207, 211, 226, 134}) + + // Executes a message on the destination chain. + // + // The method name needs to be execute with Anchor encoding. + // + // This function is called by the OffChain when executing one Report to the SVM Router. + // In this Flow only one message is sent, the Execution Report. This is different as EVM does, + // this is because there is no try/catch mechanism to allow batch execution. + // This message validates that the Merkle Tree Proof of the given message is correct and is stored in the Commit Report Account. + // The message must be untouched to be executed. + // This message emits the event ExecutionStateChanged with the new state of the message. + // Finally, executes the CPI instruction to the receiver program in the ccip_receive message. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the execute. + // * `raw_execution_report` - the serialized execution report containing only one message and proofs + // * `report_context_byte_words` - report_context after execution_report to match context for manually execute (proper decoding order) + // * consists of: + // * report_context_byte_words[0]: ConfigDigest + // * report_context_byte_words[1]: 24 byte padding, 8 byte sequence number + Instruction_Execute = ag_binary.TypeID([8]byte{130, 221, 242, 154, 13, 193, 189, 29}) + + // Manually executes a report to the router. + // + // When a message is not being executed, then the user can trigger the execution manually. + // No verification over the transmitter, but the message needs to be in some commit report. + // It validates that the required time has passed since the commit and then executes the report. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the execution. + // * `raw_execution_report` - The serialized execution report containing the message and proofs. + Instruction_ManuallyExecute = ag_binary.TypeID([8]byte{238, 219, 224, 11, 226, 248, 47, 192}) + + // Initializes and/or inserts a chunk of report data to an execution report buffer. + // + // When execution reports are too large to fit in a single transaction, they can be chopped + // up in chunks first (as a special case, one chunk is also acceptable), and pre-buffered + // via multiple calls to this instruction. + // + // There's no need to pre-initialize the buffer: all chunks can be sent concurrently, and the + // first one to arrive will initialize the buffer. + // + // To benefit from buffering, the eventual call to `execute` or `manually_execute` must + // include an additional `remaining_account` with the PDA derived from + // ["execution_report_buffer", , ]. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for buffering. + // * `buffer_id` - An arbitrary buffer id defined by the caller (could be the message_id). Max 32 bytes. + // * `report_length` - Total length in bytes of the execution report. + // * `chunk` - The specific chunk to add to the buffer. Chunk must have a consistent size, except + // the last one in the buffer, which may be smaller. + // * `chunk_index` - The index of this chunk. + // * `num_chunks` - The total number of chunks in the report. + Instruction_BufferExecutionReport = ag_binary.TypeID([8]byte{35, 202, 252, 220, 2, 82, 189, 23}) + + // Closes the execution report buffer to reclaim funds. + // + // Note this is only necessary when aborting a buffered transaction, or when a mistake + // was made when buffering data. The buffer account will otherwise automatically close + // and return funds to the caller whenever buffered execution succeeds. + Instruction_CloseExecutionReportBuffer = ag_binary.TypeID([8]byte{0, 16, 4, 246, 238, 95, 223, 31}) + + // Automatically derives all acounts required to call `ccip_execute`. + // + // This method receives the bare minimum amount of information needed to construct + // the entire account list to execute a transaction, and builds it iteratively + // over the course of multiple calls. + // + // The return type contains: + // + // * `accounts_to_save`: The caller must append these accounts to a list they maintain. + // When complete, this list will contain all accounts needed to call `ccip_execute`. + // * `ask_again_with`: When `next_stage` is not empty, the caller must call `derive_accounts_execute` + // again, including exactly these accounts as the `remaining_accounts`. + // * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_execute`. + // * `current_stage`: A string describing the current stage of the derivation process. When the stage + // is "TokenTransferStaticAccounts//0", it means the `accounts_to_save` block in this response contains + // all accounts relating to the Nth token being transferred. Use this information to construct + // the `token_indexes` vector that `execute` requires. + // * `next_stage`: If nonempty, this means the instruction must get called again with this value + // as the `stage` argument. + // + // Therefore, and starting with an empty `remaining_accounts` list, the caller must repeteadly + // call `derive_accounts_execute` until `next_stage` is returned empty. + // + // # Arguments + // + // * `ctx`: Context containing only the offramp config. + // * `stage`: Requested derivation stage. Pass "Start" the first time, then for each subsequent + // call, pass the value returned in `response.next_stage` until empty. + // * `params`: + // * `execute_caller`: Public key of the account that will sign the call to `ccip_execute`. + // * `message_accounts`: If the transaction involves messaging, the message accounts. + // * `source_chain_selector`: CCIP chain selector for the source chain. + // * `mints_of_transferred_token`: List of all token mints for tokens being transferred (i.e. + // the entries in `report.message.token_amounts.destination_address`.) + // * `merkle_root`: Merkle root as per the commit report. + // * `buffer_id`: If the execution will be buffered, the buffer id that will be used by the + // `execute_caller`: If the execution will not be buffered, this should be empty. + // * `token_receiver`: Receiver of token transfers, if any (i.e. report.message.token_receiver) + Instruction_DeriveAccountsExecute = ag_binary.TypeID([8]byte{119, 242, 51, 244, 183, 138, 179, 159}) + + Instruction_CloseCommitReportAccount = ag_binary.TypeID([8]byte{109, 145, 129, 64, 226, 172, 61, 106}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_InitializeConfig: + return "InitializeConfig" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetDefaultCodeVersion: + return "SetDefaultCodeVersion" + case Instruction_UpdateReferenceAddresses: + return "UpdateReferenceAddresses" + case Instruction_AddSourceChain: + return "AddSourceChain" + case Instruction_DisableSourceChainSelector: + return "DisableSourceChainSelector" + case Instruction_UpdateSourceChainConfig: + return "UpdateSourceChainConfig" + case Instruction_UpdateSvmChainSelector: + return "UpdateSvmChainSelector" + case Instruction_UpdateEnableManualExecutionAfter: + return "UpdateEnableManualExecutionAfter" + case Instruction_SetOcrConfig: + return "SetOcrConfig" + case Instruction_Commit: + return "Commit" + case Instruction_CommitPriceOnly: + return "CommitPriceOnly" + case Instruction_Execute: + return "Execute" + case Instruction_ManuallyExecute: + return "ManuallyExecute" + case Instruction_BufferExecutionReport: + return "BufferExecutionReport" + case Instruction_CloseExecutionReportBuffer: + return "CloseExecutionReportBuffer" + case Instruction_DeriveAccountsExecute: + return "DeriveAccountsExecute" + case Instruction_CloseCommitReportAccount: + return "CloseCommitReportAccount" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "initialize_config", (*InitializeConfig)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_default_code_version", (*SetDefaultCodeVersion)(nil), + }, + { + "update_reference_addresses", (*UpdateReferenceAddresses)(nil), + }, + { + "add_source_chain", (*AddSourceChain)(nil), + }, + { + "disable_source_chain_selector", (*DisableSourceChainSelector)(nil), + }, + { + "update_source_chain_config", (*UpdateSourceChainConfig)(nil), + }, + { + "update_svm_chain_selector", (*UpdateSvmChainSelector)(nil), + }, + { + "update_enable_manual_execution_after", (*UpdateEnableManualExecutionAfter)(nil), + }, + { + "set_ocr_config", (*SetOcrConfig)(nil), + }, + { + "commit", (*Commit)(nil), + }, + { + "commit_price_only", (*CommitPriceOnly)(nil), + }, + { + "execute", (*Execute)(nil), + }, + { + "manually_execute", (*ManuallyExecute)(nil), + }, + { + "buffer_execution_report", (*BufferExecutionReport)(nil), + }, + { + "close_execution_report_buffer", (*CloseExecutionReportBuffer)(nil), + }, + { + "derive_accounts_execute", (*DeriveAccountsExecute)(nil), + }, + { + "close_commit_report_account", (*CloseCommitReportAccount)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/testing_utils.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/testing_utils.go new file mode 100644 index 0000000000..46cfc40151 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_offramp/types.go b/chains/solana/gobindings/v1_6_1/ccip_offramp/types.go new file mode 100644 index 0000000000..a05b189f4a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_offramp/types.go @@ -0,0 +1,1279 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_offramp + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type CommitInput struct { + PriceUpdates PriceUpdates + MerkleRoot *MerkleRoot `bin:"optional"` + RmnSignatures [][64]uint8 +} + +func (obj CommitInput) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PriceUpdates` param: + err = encoder.Encode(obj.PriceUpdates) + if err != nil { + return err + } + // Serialize `MerkleRoot` param (optional): + { + if obj.MerkleRoot == nil { + err = encoder.WriteBool(false) + if err != nil { + return err + } + } else { + err = encoder.WriteBool(true) + if err != nil { + return err + } + err = encoder.Encode(obj.MerkleRoot) + if err != nil { + return err + } + } + } + // Serialize `RmnSignatures` param: + err = encoder.Encode(obj.RmnSignatures) + if err != nil { + return err + } + return nil +} + +func (obj *CommitInput) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PriceUpdates`: + err = decoder.Decode(&obj.PriceUpdates) + if err != nil { + return err + } + // Deserialize `MerkleRoot` (optional): + { + ok, err := decoder.ReadBool() + if err != nil { + return err + } + if ok { + err = decoder.Decode(&obj.MerkleRoot) + if err != nil { + return err + } + } + } + // Deserialize `RmnSignatures`: + err = decoder.Decode(&obj.RmnSignatures) + if err != nil { + return err + } + return nil +} + +type PriceUpdates struct { + TokenPriceUpdates []TokenPriceUpdate + GasPriceUpdates []GasPriceUpdate +} + +func (obj PriceUpdates) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenPriceUpdates` param: + err = encoder.Encode(obj.TokenPriceUpdates) + if err != nil { + return err + } + // Serialize `GasPriceUpdates` param: + err = encoder.Encode(obj.GasPriceUpdates) + if err != nil { + return err + } + return nil +} + +func (obj *PriceUpdates) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenPriceUpdates`: + err = decoder.Decode(&obj.TokenPriceUpdates) + if err != nil { + return err + } + // Deserialize `GasPriceUpdates`: + err = decoder.Decode(&obj.GasPriceUpdates) + if err != nil { + return err + } + return nil +} + +type TokenPriceUpdate struct { + SourceToken ag_solanago.PublicKey + UsdPerToken [28]uint8 +} + +func (obj TokenPriceUpdate) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceToken` param: + err = encoder.Encode(obj.SourceToken) + if err != nil { + return err + } + // Serialize `UsdPerToken` param: + err = encoder.Encode(obj.UsdPerToken) + if err != nil { + return err + } + return nil +} + +func (obj *TokenPriceUpdate) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceToken`: + err = decoder.Decode(&obj.SourceToken) + if err != nil { + return err + } + // Deserialize `UsdPerToken`: + err = decoder.Decode(&obj.UsdPerToken) + if err != nil { + return err + } + return nil +} + +type GasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas [28]uint8 +} + +func (obj GasPriceUpdate) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `UsdPerUnitGas` param: + err = encoder.Encode(obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +func (obj *GasPriceUpdate) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `UsdPerUnitGas`: + err = decoder.Decode(&obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +type MerkleRoot struct { + SourceChainSelector uint64 + OnRampAddress []byte + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]uint8 +} + +func (obj MerkleRoot) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `OnRampAddress` param: + err = encoder.Encode(obj.OnRampAddress) + if err != nil { + return err + } + // Serialize `MinSeqNr` param: + err = encoder.Encode(obj.MinSeqNr) + if err != nil { + return err + } + // Serialize `MaxSeqNr` param: + err = encoder.Encode(obj.MaxSeqNr) + if err != nil { + return err + } + // Serialize `MerkleRoot` param: + err = encoder.Encode(obj.MerkleRoot) + if err != nil { + return err + } + return nil +} + +func (obj *MerkleRoot) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `OnRampAddress`: + err = decoder.Decode(&obj.OnRampAddress) + if err != nil { + return err + } + // Deserialize `MinSeqNr`: + err = decoder.Decode(&obj.MinSeqNr) + if err != nil { + return err + } + // Deserialize `MaxSeqNr`: + err = decoder.Decode(&obj.MaxSeqNr) + if err != nil { + return err + } + // Deserialize `MerkleRoot`: + err = decoder.Decode(&obj.MerkleRoot) + if err != nil { + return err + } + return nil +} + +type ConfigOcrPluginType struct { + Discriminant uint8 +} + +func (obj ConfigOcrPluginType) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Discriminant` param: + err = encoder.Encode(obj.Discriminant) + if err != nil { + return err + } + return nil +} + +func (obj *ConfigOcrPluginType) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Discriminant`: + err = decoder.Decode(&obj.Discriminant) + if err != nil { + return err + } + return nil +} + +type ExecutionReportSingleChain struct { + SourceChainSelector uint64 + Message Any2SVMRampMessage + OffchainTokenData [][]byte + Proofs [][32]uint8 +} + +func (obj ExecutionReportSingleChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + // Serialize `OffchainTokenData` param: + err = encoder.Encode(obj.OffchainTokenData) + if err != nil { + return err + } + // Serialize `Proofs` param: + err = encoder.Encode(obj.Proofs) + if err != nil { + return err + } + return nil +} + +func (obj *ExecutionReportSingleChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + // Deserialize `OffchainTokenData`: + err = decoder.Decode(&obj.OffchainTokenData) + if err != nil { + return err + } + // Deserialize `Proofs`: + err = decoder.Decode(&obj.Proofs) + if err != nil { + return err + } + return nil +} + +type RampMessageHeader struct { + MessageId [32]uint8 + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +func (obj RampMessageHeader) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MessageId` param: + err = encoder.Encode(obj.MessageId) + if err != nil { + return err + } + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `SequenceNumber` param: + err = encoder.Encode(obj.SequenceNumber) + if err != nil { + return err + } + // Serialize `Nonce` param: + err = encoder.Encode(obj.Nonce) + if err != nil { + return err + } + return nil +} + +func (obj *RampMessageHeader) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MessageId`: + err = decoder.Decode(&obj.MessageId) + if err != nil { + return err + } + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `SequenceNumber`: + err = decoder.Decode(&obj.SequenceNumber) + if err != nil { + return err + } + // Deserialize `Nonce`: + err = decoder.Decode(&obj.Nonce) + if err != nil { + return err + } + return nil +} + +type Any2SVMRampExtraArgs struct { + ComputeUnits uint32 + IsWritableBitmap uint64 +} + +func (obj Any2SVMRampExtraArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ComputeUnits` param: + err = encoder.Encode(obj.ComputeUnits) + if err != nil { + return err + } + // Serialize `IsWritableBitmap` param: + err = encoder.Encode(obj.IsWritableBitmap) + if err != nil { + return err + } + return nil +} + +func (obj *Any2SVMRampExtraArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ComputeUnits`: + err = decoder.Decode(&obj.ComputeUnits) + if err != nil { + return err + } + // Deserialize `IsWritableBitmap`: + err = decoder.Decode(&obj.IsWritableBitmap) + if err != nil { + return err + } + return nil +} + +type Any2SVMRampMessage struct { + Header RampMessageHeader + Sender []byte + Data []byte + TokenReceiver ag_solanago.PublicKey + TokenAmounts []Any2SVMTokenTransfer + ExtraArgs Any2SVMRampExtraArgs +} + +func (obj Any2SVMRampMessage) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Header` param: + err = encoder.Encode(obj.Header) + if err != nil { + return err + } + // Serialize `Sender` param: + err = encoder.Encode(obj.Sender) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + // Serialize `TokenReceiver` param: + err = encoder.Encode(obj.TokenReceiver) + if err != nil { + return err + } + // Serialize `TokenAmounts` param: + err = encoder.Encode(obj.TokenAmounts) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +func (obj *Any2SVMRampMessage) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Header`: + err = decoder.Decode(&obj.Header) + if err != nil { + return err + } + // Deserialize `Sender`: + err = decoder.Decode(&obj.Sender) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + // Deserialize `TokenReceiver`: + err = decoder.Decode(&obj.TokenReceiver) + if err != nil { + return err + } + // Deserialize `TokenAmounts`: + err = decoder.Decode(&obj.TokenAmounts) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +type Any2SVMTokenTransfer struct { + SourcePoolAddress []byte + DestTokenAddress ag_solanago.PublicKey + DestGasAmount uint32 + ExtraData []byte + Amount CrossChainAmount +} + +func (obj Any2SVMTokenTransfer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourcePoolAddress` param: + err = encoder.Encode(obj.SourcePoolAddress) + if err != nil { + return err + } + // Serialize `DestTokenAddress` param: + err = encoder.Encode(obj.DestTokenAddress) + if err != nil { + return err + } + // Serialize `DestGasAmount` param: + err = encoder.Encode(obj.DestGasAmount) + if err != nil { + return err + } + // Serialize `ExtraData` param: + err = encoder.Encode(obj.ExtraData) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} + +func (obj *Any2SVMTokenTransfer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourcePoolAddress`: + err = decoder.Decode(&obj.SourcePoolAddress) + if err != nil { + return err + } + // Deserialize `DestTokenAddress`: + err = decoder.Decode(&obj.DestTokenAddress) + if err != nil { + return err + } + // Deserialize `DestGasAmount`: + err = decoder.Decode(&obj.DestGasAmount) + if err != nil { + return err + } + // Deserialize `ExtraData`: + err = decoder.Decode(&obj.ExtraData) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +type SVMTokenAmount struct { + Token ag_solanago.PublicKey + Amount uint64 +} + +func (obj SVMTokenAmount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} + +func (obj *SVMTokenAmount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +type CrossChainAmount struct { + LeBytes [32]uint8 +} + +func (obj CrossChainAmount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LeBytes` param: + err = encoder.Encode(obj.LeBytes) + if err != nil { + return err + } + return nil +} + +func (obj *CrossChainAmount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LeBytes`: + err = decoder.Decode(&obj.LeBytes) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsExecuteParams struct { + ExecuteCaller ag_solanago.PublicKey + TokenReceiver ag_solanago.PublicKey + TokenTransfers []TokenTransferAndOffchainData + MessageAccounts []CcipAccountMeta + SourceChainSelector uint64 + OriginalSender []byte + MerkleRoot [32]uint8 + BufferId []byte +} + +func (obj DeriveAccountsExecuteParams) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ExecuteCaller` param: + err = encoder.Encode(obj.ExecuteCaller) + if err != nil { + return err + } + // Serialize `TokenReceiver` param: + err = encoder.Encode(obj.TokenReceiver) + if err != nil { + return err + } + // Serialize `TokenTransfers` param: + err = encoder.Encode(obj.TokenTransfers) + if err != nil { + return err + } + // Serialize `MessageAccounts` param: + err = encoder.Encode(obj.MessageAccounts) + if err != nil { + return err + } + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `OriginalSender` param: + err = encoder.Encode(obj.OriginalSender) + if err != nil { + return err + } + // Serialize `MerkleRoot` param: + err = encoder.Encode(obj.MerkleRoot) + if err != nil { + return err + } + // Serialize `BufferId` param: + err = encoder.Encode(obj.BufferId) + if err != nil { + return err + } + return nil +} + +func (obj *DeriveAccountsExecuteParams) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ExecuteCaller`: + err = decoder.Decode(&obj.ExecuteCaller) + if err != nil { + return err + } + // Deserialize `TokenReceiver`: + err = decoder.Decode(&obj.TokenReceiver) + if err != nil { + return err + } + // Deserialize `TokenTransfers`: + err = decoder.Decode(&obj.TokenTransfers) + if err != nil { + return err + } + // Deserialize `MessageAccounts`: + err = decoder.Decode(&obj.MessageAccounts) + if err != nil { + return err + } + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `OriginalSender`: + err = decoder.Decode(&obj.OriginalSender) + if err != nil { + return err + } + // Deserialize `MerkleRoot`: + err = decoder.Decode(&obj.MerkleRoot) + if err != nil { + return err + } + // Deserialize `BufferId`: + err = decoder.Decode(&obj.BufferId) + if err != nil { + return err + } + return nil +} + +type TokenTransferAndOffchainData struct { + Transfer Any2SVMTokenTransfer + Data []byte +} + +func (obj TokenTransferAndOffchainData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Transfer` param: + err = encoder.Encode(obj.Transfer) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + return nil +} + +func (obj *TokenTransferAndOffchainData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Transfer`: + err = decoder.Decode(&obj.Transfer) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsResponse struct { + // If this vector is not empty, you must call the `derive_` method again including + // exactly these accounts as the `remaining_accounts` field. + AskAgainWith []CcipAccountMeta + + // You must append these accounts at the end of a separate list. When `next_stage` + // is finally empty, this separate list will contain all the accounts to use for the + // instruction of interest. + AccountsToSave []CcipAccountMeta + + // Append these look up tables at the end of a list. It will contain all LUTs + // that the instruction of interest can use. + LookUpTablesToSave []ag_solanago.PublicKey + + // Identifies the derivation stage. + CurrentStage string + + // Identifies the next derivation stage. If empty, the derivation is complete. + NextStage string +} + +func (obj DeriveAccountsResponse) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `AskAgainWith` param: + err = encoder.Encode(obj.AskAgainWith) + if err != nil { + return err + } + // Serialize `AccountsToSave` param: + err = encoder.Encode(obj.AccountsToSave) + if err != nil { + return err + } + // Serialize `LookUpTablesToSave` param: + err = encoder.Encode(obj.LookUpTablesToSave) + if err != nil { + return err + } + // Serialize `CurrentStage` param: + err = encoder.Encode(obj.CurrentStage) + if err != nil { + return err + } + // Serialize `NextStage` param: + err = encoder.Encode(obj.NextStage) + if err != nil { + return err + } + return nil +} + +func (obj *DeriveAccountsResponse) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `AskAgainWith`: + err = decoder.Decode(&obj.AskAgainWith) + if err != nil { + return err + } + // Deserialize `AccountsToSave`: + err = decoder.Decode(&obj.AccountsToSave) + if err != nil { + return err + } + // Deserialize `LookUpTablesToSave`: + err = decoder.Decode(&obj.LookUpTablesToSave) + if err != nil { + return err + } + // Deserialize `CurrentStage`: + err = decoder.Decode(&obj.CurrentStage) + if err != nil { + return err + } + // Deserialize `NextStage`: + err = decoder.Decode(&obj.NextStage) + if err != nil { + return err + } + return nil +} + +type CcipAccountMeta struct { + Pubkey ag_solanago.PublicKey + IsSigner bool + IsWritable bool +} + +func (obj CcipAccountMeta) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Pubkey` param: + err = encoder.Encode(obj.Pubkey) + if err != nil { + return err + } + // Serialize `IsSigner` param: + err = encoder.Encode(obj.IsSigner) + if err != nil { + return err + } + // Serialize `IsWritable` param: + err = encoder.Encode(obj.IsWritable) + if err != nil { + return err + } + return nil +} + +func (obj *CcipAccountMeta) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Pubkey`: + err = decoder.Decode(&obj.Pubkey) + if err != nil { + return err + } + // Deserialize `IsSigner`: + err = decoder.Decode(&obj.IsSigner) + if err != nil { + return err + } + // Deserialize `IsWritable`: + err = decoder.Decode(&obj.IsWritable) + if err != nil { + return err + } + return nil +} + +type Ocr3ConfigInfo struct { + ConfigDigest [32]uint8 + F uint8 + N uint8 + IsSignatureVerificationEnabled uint8 +} + +func (obj Ocr3ConfigInfo) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ConfigDigest` param: + err = encoder.Encode(obj.ConfigDigest) + if err != nil { + return err + } + // Serialize `F` param: + err = encoder.Encode(obj.F) + if err != nil { + return err + } + // Serialize `N` param: + err = encoder.Encode(obj.N) + if err != nil { + return err + } + // Serialize `IsSignatureVerificationEnabled` param: + err = encoder.Encode(obj.IsSignatureVerificationEnabled) + if err != nil { + return err + } + return nil +} + +func (obj *Ocr3ConfigInfo) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ConfigDigest`: + err = decoder.Decode(&obj.ConfigDigest) + if err != nil { + return err + } + // Deserialize `F`: + err = decoder.Decode(&obj.F) + if err != nil { + return err + } + // Deserialize `N`: + err = decoder.Decode(&obj.N) + if err != nil { + return err + } + // Deserialize `IsSignatureVerificationEnabled`: + err = decoder.Decode(&obj.IsSignatureVerificationEnabled) + if err != nil { + return err + } + return nil +} + +type Ocr3Config struct { + PluginType ConfigOcrPluginType + ConfigInfo Ocr3ConfigInfo + Signers [16][20]uint8 + Transmitters [16][32]uint8 +} + +func (obj Ocr3Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PluginType` param: + err = encoder.Encode(obj.PluginType) + if err != nil { + return err + } + // Serialize `ConfigInfo` param: + err = encoder.Encode(obj.ConfigInfo) + if err != nil { + return err + } + // Serialize `Signers` param: + err = encoder.Encode(obj.Signers) + if err != nil { + return err + } + // Serialize `Transmitters` param: + err = encoder.Encode(obj.Transmitters) + if err != nil { + return err + } + return nil +} + +func (obj *Ocr3Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PluginType`: + err = decoder.Decode(&obj.PluginType) + if err != nil { + return err + } + // Deserialize `ConfigInfo`: + err = decoder.Decode(&obj.ConfigInfo) + if err != nil { + return err + } + // Deserialize `Signers`: + err = decoder.Decode(&obj.Signers) + if err != nil { + return err + } + // Deserialize `Transmitters`: + err = decoder.Decode(&obj.Transmitters) + if err != nil { + return err + } + return nil +} + +type SourceChainConfig struct { + IsEnabled bool + IsRmnVerificationDisabled bool + LaneCodeVersion CodeVersion + OnRamp OnRampAddress +} + +func (obj SourceChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `IsEnabled` param: + err = encoder.Encode(obj.IsEnabled) + if err != nil { + return err + } + // Serialize `IsRmnVerificationDisabled` param: + err = encoder.Encode(obj.IsRmnVerificationDisabled) + if err != nil { + return err + } + // Serialize `LaneCodeVersion` param: + err = encoder.Encode(obj.LaneCodeVersion) + if err != nil { + return err + } + // Serialize `OnRamp` param: + err = encoder.Encode(obj.OnRamp) + if err != nil { + return err + } + return nil +} + +func (obj *SourceChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `IsEnabled`: + err = decoder.Decode(&obj.IsEnabled) + if err != nil { + return err + } + // Deserialize `IsRmnVerificationDisabled`: + err = decoder.Decode(&obj.IsRmnVerificationDisabled) + if err != nil { + return err + } + // Deserialize `LaneCodeVersion`: + err = decoder.Decode(&obj.LaneCodeVersion) + if err != nil { + return err + } + // Deserialize `OnRamp`: + err = decoder.Decode(&obj.OnRamp) + if err != nil { + return err + } + return nil +} + +type OnRampAddress struct { + Bytes [64]uint8 + Len uint32 +} + +func (obj OnRampAddress) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Bytes` param: + err = encoder.Encode(obj.Bytes) + if err != nil { + return err + } + // Serialize `Len` param: + err = encoder.Encode(obj.Len) + if err != nil { + return err + } + return nil +} + +func (obj *OnRampAddress) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Bytes`: + err = decoder.Decode(&obj.Bytes) + if err != nil { + return err + } + // Deserialize `Len`: + err = decoder.Decode(&obj.Len) + if err != nil { + return err + } + return nil +} + +type SourceChainState struct { + MinSeqNr uint64 +} + +func (obj SourceChainState) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MinSeqNr` param: + err = encoder.Encode(obj.MinSeqNr) + if err != nil { + return err + } + return nil +} + +func (obj *SourceChainState) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MinSeqNr`: + err = decoder.Decode(&obj.MinSeqNr) + if err != nil { + return err + } + return nil +} + +type OcrPluginType ag_binary.BorshEnum + +const ( + Commit_OcrPluginType OcrPluginType = iota + Execution_OcrPluginType +) + +func (value OcrPluginType) String() string { + switch value { + case Commit_OcrPluginType: + return "Commit" + case Execution_OcrPluginType: + return "Execution" + default: + return "" + } +} + +type DeriveAccountsExecuteStage interface { + isDeriveAccountsExecuteStage() +} + +type deriveAccountsExecuteStageContainer struct { + Enum ag_binary.BorshEnum `borsh_enum:"true"` + Start Start + FinishMainAccountList FinishMainAccountList + RetrieveTokenLUTs RetrieveTokenLUTs + RetrievePoolPrograms RetrievePoolPrograms + TokenTransferStaticAccounts TokenTransferStaticAccounts + NestedTokenDerive NestedTokenDerive +} + +type Start uint8 + +func (obj Start) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *Start) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *Start) isDeriveAccountsExecuteStage() {} + +type FinishMainAccountList uint8 + +func (obj FinishMainAccountList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *FinishMainAccountList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *FinishMainAccountList) isDeriveAccountsExecuteStage() {} + +type RetrieveTokenLUTs uint8 + +func (obj RetrieveTokenLUTs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *RetrieveTokenLUTs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *RetrieveTokenLUTs) isDeriveAccountsExecuteStage() {} + +type RetrievePoolPrograms uint8 + +func (obj RetrievePoolPrograms) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *RetrievePoolPrograms) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *RetrievePoolPrograms) isDeriveAccountsExecuteStage() {} + +type TokenTransferStaticAccounts struct { + Token uint32 + Page uint32 +} + +func (obj TokenTransferStaticAccounts) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Page` param: + err = encoder.Encode(obj.Page) + if err != nil { + return err + } + return nil +} + +func (obj *TokenTransferStaticAccounts) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Page`: + err = decoder.Decode(&obj.Page) + if err != nil { + return err + } + return nil +} + +func (_ *TokenTransferStaticAccounts) isDeriveAccountsExecuteStage() {} + +type NestedTokenDerive struct { + Token uint32 + TokenSubstage string +} + +func (obj NestedTokenDerive) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `TokenSubstage` param: + err = encoder.Encode(obj.TokenSubstage) + if err != nil { + return err + } + return nil +} + +func (obj *NestedTokenDerive) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `TokenSubstage`: + err = decoder.Decode(&obj.TokenSubstage) + if err != nil { + return err + } + return nil +} + +func (_ *NestedTokenDerive) isDeriveAccountsExecuteStage() {} + +type MessageExecutionState ag_binary.BorshEnum + +const ( + Untouched_MessageExecutionState MessageExecutionState = iota + InProgress_MessageExecutionState + Success_MessageExecutionState + Failure_MessageExecutionState +) + +func (value MessageExecutionState) String() string { + switch value { + case Untouched_MessageExecutionState: + return "Untouched" + case InProgress_MessageExecutionState: + return "InProgress" + case Success_MessageExecutionState: + return "Success" + case Failure_MessageExecutionState: + return "Failure" + default: + return "" + } +} + +type CodeVersion ag_binary.BorshEnum + +const ( + Default_CodeVersion CodeVersion = iota + V1_CodeVersion +) + +func (value CodeVersion) String() string { + switch value { + case Default_CodeVersion: + return "Default" + case V1_CodeVersion: + return "V1" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry.go b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry.go new file mode 100644 index 0000000000..bbd59e8a9c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry.go @@ -0,0 +1,162 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Accepts the admin role of the token admin registry. +// +// The Pending Admin must call this function to accept the admin role of the Token Admin Registry. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for accepting the admin role. +// * `mint` - The public key of the token mint. +type AcceptAdminRoleTokenAdminRegistry struct { + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptAdminRoleTokenAdminRegistryInstructionBuilder creates a new `AcceptAdminRoleTokenAdminRegistry` instruction builder. +func NewAcceptAdminRoleTokenAdminRegistryInstructionBuilder() *AcceptAdminRoleTokenAdminRegistry { + nd := &AcceptAdminRoleTokenAdminRegistry{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) SetConfigAccount(config ag_solanago.PublicKey) *AcceptAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *AcceptAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) SetMintAccount(mint ag_solanago.PublicKey) *AcceptAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptAdminRoleTokenAdminRegistry) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AcceptAdminRoleTokenAdminRegistry) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptAdminRoleTokenAdminRegistry, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptAdminRoleTokenAdminRegistry) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptAdminRoleTokenAdminRegistry) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptAdminRoleTokenAdminRegistry) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptAdminRoleTokenAdminRegistry")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AcceptAdminRoleTokenAdminRegistry) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptAdminRoleTokenAdminRegistry) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptAdminRoleTokenAdminRegistryInstruction declares a new AcceptAdminRoleTokenAdminRegistry instruction with the provided parameters and accounts. +func NewAcceptAdminRoleTokenAdminRegistryInstruction( + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptAdminRoleTokenAdminRegistry { + return NewAcceptAdminRoleTokenAdminRegistryInstructionBuilder(). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry_test.go new file mode 100644 index 0000000000..44baeb8e00 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptAdminRoleTokenAdminRegistry_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptAdminRoleTokenAdminRegistry(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptAdminRoleTokenAdminRegistry"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptAdminRoleTokenAdminRegistry) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptAdminRoleTokenAdminRegistry) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership.go new file mode 100644 index 0000000000..867fe4c62e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership.go @@ -0,0 +1,124 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Accepts the ownership of the router by the proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for accepting ownership. +// The new owner must be a signer of the transaction. +type AcceptOwnership struct { + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *AcceptOwnership) SetConfigAccount(config ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AcceptOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership_test.go new file mode 100644 index 0000000000..da475cd5d2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector.go b/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector.go new file mode 100644 index 0000000000..23060ea030 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector.go @@ -0,0 +1,218 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Adds a new chain selector to the router. +// +// The Admin needs to add any new chain supported (this means both OnRamp and OffRamp). +// When adding a new chain, the Admin needs to specify if it's enabled or not. +// They may enable only source, or only destination, or neither, or both. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for adding the chain selector. +// * `new_chain_selector` - The new chain selector to be added. +// * `source_chain_config` - The configuration for the chain as source. +// * `dest_chain_config` - The configuration for the chain as destination. +type AddChainSelector struct { + NewChainSelector *uint64 + DestChainConfig *DestChainConfig + + // [0] = [WRITE] destChainState + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddChainSelectorInstructionBuilder creates a new `AddChainSelector` instruction builder. +func NewAddChainSelectorInstructionBuilder() *AddChainSelector { + nd := &AddChainSelector{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetNewChainSelector sets the "newChainSelector" parameter. +func (inst *AddChainSelector) SetNewChainSelector(newChainSelector uint64) *AddChainSelector { + inst.NewChainSelector = &newChainSelector + return inst +} + +// SetDestChainConfig sets the "destChainConfig" parameter. +func (inst *AddChainSelector) SetDestChainConfig(destChainConfig DestChainConfig) *AddChainSelector { + inst.DestChainConfig = &destChainConfig + return inst +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *AddChainSelector) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *AddChainSelector { + inst.AccountMetaSlice[0] = ag_solanago.Meta(destChainState).WRITE() + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *AddChainSelector) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *AddChainSelector) SetConfigAccount(config ag_solanago.PublicKey) *AddChainSelector { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddChainSelector) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddChainSelector) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddChainSelector { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddChainSelector) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddChainSelector) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddChainSelector { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddChainSelector) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AddChainSelector) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddChainSelector, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddChainSelector) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddChainSelector) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewChainSelector == nil { + return errors.New("NewChainSelector parameter is not set") + } + if inst.DestChainConfig == nil { + return errors.New("DestChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddChainSelector) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddChainSelector")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewChainSelector", *inst.NewChainSelector)) + paramsBranch.Child(ag_format.Param(" DestChainConfig", *inst.DestChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("destChainState", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AddChainSelector) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewChainSelector` param: + err = encoder.Encode(obj.NewChainSelector) + if err != nil { + return err + } + // Serialize `DestChainConfig` param: + err = encoder.Encode(obj.DestChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *AddChainSelector) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewChainSelector`: + err = decoder.Decode(&obj.NewChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainConfig`: + err = decoder.Decode(&obj.DestChainConfig) + if err != nil { + return err + } + return nil +} + +// NewAddChainSelectorInstruction declares a new AddChainSelector instruction with the provided parameters and accounts. +func NewAddChainSelectorInstruction( + // Parameters: + newChainSelector uint64, + destChainConfig DestChainConfig, + // Accounts: + destChainState ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddChainSelector { + return NewAddChainSelectorInstructionBuilder(). + SetNewChainSelector(newChainSelector). + SetDestChainConfig(destChainConfig). + SetDestChainStateAccount(destChainState). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector_test.go new file mode 100644 index 0000000000..8398360f7f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AddChainSelector_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddChainSelector(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddChainSelector"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddChainSelector) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddChainSelector) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp.go b/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp.go new file mode 100644 index 0000000000..cd53d1fe2e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp.go @@ -0,0 +1,215 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Add an offramp address to the list of offramps allowed by the router, for a +// particular source chain. External users will check this list before accepting +// a `ccip_receive` CPI. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for this operation. +// * `source_chain_selector` - The source chain for the offramp's lane. +// * `offramp` - The offramp's address. +type AddOfframp struct { + SourceChainSelector *uint64 + Offramp *ag_solanago.PublicKey + + // [0] = [WRITE] allowedOfframp + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddOfframpInstructionBuilder creates a new `AddOfframp` instruction builder. +func NewAddOfframpInstructionBuilder() *AddOfframp { + nd := &AddOfframp{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSourceChainSelector sets the "sourceChainSelector" parameter. +func (inst *AddOfframp) SetSourceChainSelector(sourceChainSelector uint64) *AddOfframp { + inst.SourceChainSelector = &sourceChainSelector + return inst +} + +// SetOfframp sets the "offramp" parameter. +func (inst *AddOfframp) SetOfframp(offramp ag_solanago.PublicKey) *AddOfframp { + inst.Offramp = &offramp + return inst +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +func (inst *AddOfframp) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *AddOfframp { + inst.AccountMetaSlice[0] = ag_solanago.Meta(allowedOfframp).WRITE() + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +func (inst *AddOfframp) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *AddOfframp) SetConfigAccount(config ag_solanago.PublicKey) *AddOfframp { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddOfframp) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddOfframp) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddOfframp { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddOfframp) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddOfframp) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddOfframp { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddOfframp) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AddOfframp) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddOfframp, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddOfframp) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddOfframp) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SourceChainSelector == nil { + return errors.New("SourceChainSelector parameter is not set") + } + if inst.Offramp == nil { + return errors.New("Offramp parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddOfframp) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddOfframp")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SourceChainSelector", *inst.SourceChainSelector)) + paramsBranch.Child(ag_format.Param(" Offramp", *inst.Offramp)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("allowedOfframp", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AddOfframp) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `Offramp` param: + err = encoder.Encode(obj.Offramp) + if err != nil { + return err + } + return nil +} +func (obj *AddOfframp) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `Offramp`: + err = decoder.Decode(&obj.Offramp) + if err != nil { + return err + } + return nil +} + +// NewAddOfframpInstruction declares a new AddOfframp instruction with the provided parameters and accounts. +func NewAddOfframpInstruction( + // Parameters: + sourceChainSelector uint64, + offramp ag_solanago.PublicKey, + // Accounts: + allowedOfframp ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddOfframp { + return NewAddOfframpInstructionBuilder(). + SetSourceChainSelector(sourceChainSelector). + SetOfframp(offramp). + SetAllowedOfframpAccount(allowedOfframp). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp_test.go new file mode 100644 index 0000000000..e839e32f0c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/AddOfframp_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddOfframp(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddOfframp"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddOfframp) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddOfframp) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain.go b/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain.go new file mode 100644 index 0000000000..9cf22e4432 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Bumps the CCIP version for a destination chain. +// This effectively just resets the sequence number of the destination chain state. +// If there had been a previous rollback, on re-upgrade the sequence number will resume from where it was +// prior to the rollback. +// +// # Arguments +// * `ctx` - The context containing the accounts required for the bump. +// * `dest_chain_selector` - The destination chain selector to bump version for. +type BumpCcipVersionForDestChain struct { + DestChainSelector *uint64 + + // [0] = [WRITE] destChainState + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewBumpCcipVersionForDestChainInstructionBuilder creates a new `BumpCcipVersionForDestChain` instruction builder. +func NewBumpCcipVersionForDestChainInstructionBuilder() *BumpCcipVersionForDestChain { + nd := &BumpCcipVersionForDestChain{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *BumpCcipVersionForDestChain) SetDestChainSelector(destChainSelector uint64) *BumpCcipVersionForDestChain { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *BumpCcipVersionForDestChain) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *BumpCcipVersionForDestChain { + inst.AccountMetaSlice[0] = ag_solanago.Meta(destChainState).WRITE() + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *BumpCcipVersionForDestChain) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *BumpCcipVersionForDestChain) SetConfigAccount(config ag_solanago.PublicKey) *BumpCcipVersionForDestChain { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *BumpCcipVersionForDestChain) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *BumpCcipVersionForDestChain) SetAuthorityAccount(authority ag_solanago.PublicKey) *BumpCcipVersionForDestChain { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *BumpCcipVersionForDestChain) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst BumpCcipVersionForDestChain) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_BumpCcipVersionForDestChain, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst BumpCcipVersionForDestChain) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *BumpCcipVersionForDestChain) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *BumpCcipVersionForDestChain) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("BumpCcipVersionForDestChain")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("destChainState", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj BumpCcipVersionForDestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *BumpCcipVersionForDestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + return nil +} + +// NewBumpCcipVersionForDestChainInstruction declares a new BumpCcipVersionForDestChain instruction with the provided parameters and accounts. +func NewBumpCcipVersionForDestChainInstruction( + // Parameters: + destChainSelector uint64, + // Accounts: + destChainState ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *BumpCcipVersionForDestChain { + return NewBumpCcipVersionForDestChainInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetDestChainStateAccount(destChainState). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain_test.go new file mode 100644 index 0000000000..b7fb4a139d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/BumpCcipVersionForDestChain_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_BumpCcipVersionForDestChain(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("BumpCcipVersionForDestChain"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(BumpCcipVersionForDestChain) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(BumpCcipVersionForDestChain) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator.go new file mode 100644 index 0000000000..4659423905 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator.go @@ -0,0 +1,208 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Overrides the pending admin of the Token Admin Registry +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for registration. +// * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. +type CcipAdminOverridePendingAdministrator struct { + TokenAdminRegistryAdmin *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCcipAdminOverridePendingAdministratorInstructionBuilder creates a new `CcipAdminOverridePendingAdministrator` instruction builder. +func NewCcipAdminOverridePendingAdministratorInstructionBuilder() *CcipAdminOverridePendingAdministrator { + nd := &CcipAdminOverridePendingAdministrator{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetTokenAdminRegistryAdmin sets the "tokenAdminRegistryAdmin" parameter. +func (inst *CcipAdminOverridePendingAdministrator) SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.TokenAdminRegistryAdmin = &tokenAdminRegistryAdmin + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CcipAdminOverridePendingAdministrator) SetConfigAccount(config ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CcipAdminOverridePendingAdministrator) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *CcipAdminOverridePendingAdministrator) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *CcipAdminOverridePendingAdministrator) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *CcipAdminOverridePendingAdministrator) SetMintAccount(mint ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *CcipAdminOverridePendingAdministrator) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CcipAdminOverridePendingAdministrator) SetAuthorityAccount(authority ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CcipAdminOverridePendingAdministrator) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CcipAdminOverridePendingAdministrator) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CcipAdminOverridePendingAdministrator) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst CcipAdminOverridePendingAdministrator) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CcipAdminOverridePendingAdministrator, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CcipAdminOverridePendingAdministrator) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CcipAdminOverridePendingAdministrator) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TokenAdminRegistryAdmin == nil { + return errors.New("TokenAdminRegistryAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *CcipAdminOverridePendingAdministrator) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CcipAdminOverridePendingAdministrator")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("TokenAdminRegistryAdmin", *inst.TokenAdminRegistryAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj CcipAdminOverridePendingAdministrator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenAdminRegistryAdmin` param: + err = encoder.Encode(obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} +func (obj *CcipAdminOverridePendingAdministrator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenAdminRegistryAdmin`: + err = decoder.Decode(&obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} + +// NewCcipAdminOverridePendingAdministratorInstruction declares a new CcipAdminOverridePendingAdministrator instruction with the provided parameters and accounts. +func NewCcipAdminOverridePendingAdministratorInstruction( + // Parameters: + tokenAdminRegistryAdmin ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *CcipAdminOverridePendingAdministrator { + return NewCcipAdminOverridePendingAdministratorInstructionBuilder(). + SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator_test.go new file mode 100644 index 0000000000..98bb79453c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminOverridePendingAdministrator_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CcipAdminOverridePendingAdministrator(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CcipAdminOverridePendingAdministrator"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CcipAdminOverridePendingAdministrator) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CcipAdminOverridePendingAdministrator) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator.go new file mode 100644 index 0000000000..443eb2829d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator.go @@ -0,0 +1,209 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Token Admin Registry // +// Registers the Token Admin Registry via the CCIP Admin +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for registration. +// * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. +type CcipAdminProposeAdministrator struct { + TokenAdminRegistryAdmin *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCcipAdminProposeAdministratorInstructionBuilder creates a new `CcipAdminProposeAdministrator` instruction builder. +func NewCcipAdminProposeAdministratorInstructionBuilder() *CcipAdminProposeAdministrator { + nd := &CcipAdminProposeAdministrator{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetTokenAdminRegistryAdmin sets the "tokenAdminRegistryAdmin" parameter. +func (inst *CcipAdminProposeAdministrator) SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.TokenAdminRegistryAdmin = &tokenAdminRegistryAdmin + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CcipAdminProposeAdministrator) SetConfigAccount(config ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CcipAdminProposeAdministrator) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *CcipAdminProposeAdministrator) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *CcipAdminProposeAdministrator) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *CcipAdminProposeAdministrator) SetMintAccount(mint ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *CcipAdminProposeAdministrator) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CcipAdminProposeAdministrator) SetAuthorityAccount(authority ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CcipAdminProposeAdministrator) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CcipAdminProposeAdministrator) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CcipAdminProposeAdministrator) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst CcipAdminProposeAdministrator) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CcipAdminProposeAdministrator, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CcipAdminProposeAdministrator) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CcipAdminProposeAdministrator) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TokenAdminRegistryAdmin == nil { + return errors.New("TokenAdminRegistryAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *CcipAdminProposeAdministrator) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CcipAdminProposeAdministrator")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("TokenAdminRegistryAdmin", *inst.TokenAdminRegistryAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj CcipAdminProposeAdministrator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenAdminRegistryAdmin` param: + err = encoder.Encode(obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} +func (obj *CcipAdminProposeAdministrator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenAdminRegistryAdmin`: + err = decoder.Decode(&obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} + +// NewCcipAdminProposeAdministratorInstruction declares a new CcipAdminProposeAdministrator instruction with the provided parameters and accounts. +func NewCcipAdminProposeAdministratorInstruction( + // Parameters: + tokenAdminRegistryAdmin ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *CcipAdminProposeAdministrator { + return NewCcipAdminProposeAdministratorInstructionBuilder(). + SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator_test.go new file mode 100644 index 0000000000..d74b245da4 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipAdminProposeAdministrator_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CcipAdminProposeAdministrator(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CcipAdminProposeAdministrator"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CcipAdminProposeAdministrator) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CcipAdminProposeAdministrator) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend.go new file mode 100644 index 0000000000..addcc7f610 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend.go @@ -0,0 +1,519 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// On Ramp Flow // +// Sends a message to the destination chain. +// +// Request a message to be sent to the destination chain. +// The method name needs to be ccip_send with Anchor encoding. +// This function is called by the CCIP Sender Contract (or final user) to send a message to the CCIP Router. +// The message will be sent to the receiver on the destination chain selector. +// This message emits the event CCIPMessageSent with all the necessary data to be retrieved by the OffChain Code +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for sending the message. +// * `dest_chain_selector` - The chain selector for the destination chain. +// * `message` - The message to be sent. The size limit of data is 256 bytes. +// * `token_indexes` - Indices into the remaining accounts vector where the subslice for a token begins. +type CcipSend struct { + DestChainSelector *uint64 + Message *SVM2AnyMessage + TokenIndexes *[]byte + + // [0] = [] config + // + // [1] = [WRITE] destChainState + // + // [2] = [WRITE] nonce + // ··········· CHECK this represents the PDA where the message counters are stored. As it may be initialized or not, + // ··········· and it may be in it's v1 or v2 form, it is an UncheckedAccount and the code handles all cases manually. + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + // + // [5] = [] feeTokenProgram + // + // [6] = [] feeTokenMint + // + // [7] = [] feeTokenUserAssociatedAccount + // ··········· If paying with native SOL, this must be the zero address. + // + // [8] = [WRITE] feeTokenReceiver + // + // [9] = [] feeBillingSigner + // + // [10] = [] feeQuoter + // + // [11] = [] feeQuoterConfig + // + // [12] = [] feeQuoterDestChain + // + // [13] = [] feeQuoterBillingTokenConfig + // + // [14] = [] feeQuoterLinkTokenConfig + // + // [15] = [] rmnRemote + // + // [16] = [] rmnRemoteCurses + // + // [17] = [] rmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCcipSendInstructionBuilder creates a new `CcipSend` instruction builder. +func NewCcipSendInstructionBuilder() *CcipSend { + nd := &CcipSend{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 18), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *CcipSend) SetDestChainSelector(destChainSelector uint64) *CcipSend { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetMessage sets the "message" parameter. +func (inst *CcipSend) SetMessage(message SVM2AnyMessage) *CcipSend { + inst.Message = &message + return inst +} + +// SetTokenIndexes sets the "tokenIndexes" parameter. +func (inst *CcipSend) SetTokenIndexes(tokenIndexes []byte) *CcipSend { + inst.TokenIndexes = &tokenIndexes + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CcipSend) SetConfigAccount(config ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CcipSend) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *CcipSend) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChainState).WRITE() + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *CcipSend) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetNonceAccount sets the "nonce" account. +// CHECK this represents the PDA where the message counters are stored. As it may be initialized or not, +// and it may be in it's v1 or v2 form, it is an UncheckedAccount and the code handles all cases manually. +func (inst *CcipSend) SetNonceAccount(nonce ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[2] = ag_solanago.Meta(nonce).WRITE() + return inst +} + +// GetNonceAccount gets the "nonce" account. +// CHECK this represents the PDA where the message counters are stored. As it may be initialized or not, +// and it may be in it's v1 or v2 form, it is an UncheckedAccount and the code handles all cases manually. +func (inst *CcipSend) GetNonceAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CcipSend) SetAuthorityAccount(authority ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CcipSend) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CcipSend) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CcipSend) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeTokenProgramAccount sets the "feeTokenProgram" account. +func (inst *CcipSend) SetFeeTokenProgramAccount(feeTokenProgram ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeTokenProgram) + return inst +} + +// GetFeeTokenProgramAccount gets the "feeTokenProgram" account. +func (inst *CcipSend) GetFeeTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *CcipSend) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[6] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *CcipSend) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetFeeTokenUserAssociatedAccountAccount sets the "feeTokenUserAssociatedAccount" account. +// If paying with native SOL, this must be the zero address. +func (inst *CcipSend) SetFeeTokenUserAssociatedAccountAccount(feeTokenUserAssociatedAccount ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[7] = ag_solanago.Meta(feeTokenUserAssociatedAccount) + return inst +} + +// GetFeeTokenUserAssociatedAccountAccount gets the "feeTokenUserAssociatedAccount" account. +// If paying with native SOL, this must be the zero address. +func (inst *CcipSend) GetFeeTokenUserAssociatedAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetFeeTokenReceiverAccount sets the "feeTokenReceiver" account. +func (inst *CcipSend) SetFeeTokenReceiverAccount(feeTokenReceiver ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[8] = ag_solanago.Meta(feeTokenReceiver).WRITE() + return inst +} + +// GetFeeTokenReceiverAccount gets the "feeTokenReceiver" account. +func (inst *CcipSend) GetFeeTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *CcipSend) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[9] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *CcipSend) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +func (inst *CcipSend) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[10] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +func (inst *CcipSend) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +func (inst *CcipSend) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[11] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +func (inst *CcipSend) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetFeeQuoterDestChainAccount sets the "feeQuoterDestChain" account. +func (inst *CcipSend) SetFeeQuoterDestChainAccount(feeQuoterDestChain ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[12] = ag_solanago.Meta(feeQuoterDestChain) + return inst +} + +// GetFeeQuoterDestChainAccount gets the "feeQuoterDestChain" account. +func (inst *CcipSend) GetFeeQuoterDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetFeeQuoterBillingTokenConfigAccount sets the "feeQuoterBillingTokenConfig" account. +func (inst *CcipSend) SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[13] = ag_solanago.Meta(feeQuoterBillingTokenConfig) + return inst +} + +// GetFeeQuoterBillingTokenConfigAccount gets the "feeQuoterBillingTokenConfig" account. +func (inst *CcipSend) GetFeeQuoterBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +// SetFeeQuoterLinkTokenConfigAccount sets the "feeQuoterLinkTokenConfig" account. +func (inst *CcipSend) SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[14] = ag_solanago.Meta(feeQuoterLinkTokenConfig) + return inst +} + +// GetFeeQuoterLinkTokenConfigAccount gets the "feeQuoterLinkTokenConfig" account. +func (inst *CcipSend) GetFeeQuoterLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[14] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *CcipSend) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[15] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *CcipSend) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[15] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *CcipSend) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[16] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *CcipSend) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[16] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *CcipSend) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[17] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *CcipSend) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[17] +} + +func (inst CcipSend) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CcipSend, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CcipSend) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CcipSend) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + if inst.Message == nil { + return errors.New("Message parameter is not set") + } + if inst.TokenIndexes == nil { + return errors.New("TokenIndexes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Nonce is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeTokenProgram is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.FeeTokenUserAssociatedAccount is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.FeeTokenReceiver is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.FeeQuoterDestChain is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.FeeQuoterBillingTokenConfig is not set") + } + if inst.AccountMetaSlice[14] == nil { + return errors.New("accounts.FeeQuoterLinkTokenConfig is not set") + } + if inst.AccountMetaSlice[15] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[16] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[17] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *CcipSend) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CcipSend")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + paramsBranch.Child(ag_format.Param(" Message", *inst.Message)) + paramsBranch.Child(ag_format.Param(" TokenIndexes", *inst.TokenIndexes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=18]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" destChainState", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" nonce", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeTokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" feeTokenUserAssociated", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" feeTokenReceiver", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" feeBillingSigner", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" feeQuoterDestChain", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta("feeQuoterBillingTokenConfig", inst.AccountMetaSlice[13])) + accountsBranch.Child(ag_format.Meta(" feeQuoterLinkTokenConfig", inst.AccountMetaSlice[14])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[15])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[16])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[17])) + }) + }) + }) +} + +func (obj CcipSend) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + // Serialize `TokenIndexes` param: + err = encoder.Encode(obj.TokenIndexes) + if err != nil { + return err + } + return nil +} +func (obj *CcipSend) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + // Deserialize `TokenIndexes`: + err = decoder.Decode(&obj.TokenIndexes) + if err != nil { + return err + } + return nil +} + +// NewCcipSendInstruction declares a new CcipSend instruction with the provided parameters and accounts. +func NewCcipSendInstruction( + // Parameters: + destChainSelector uint64, + message SVM2AnyMessage, + tokenIndexes []byte, + // Accounts: + config ag_solanago.PublicKey, + destChainState ag_solanago.PublicKey, + nonce ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + feeTokenProgram ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + feeTokenUserAssociatedAccount ag_solanago.PublicKey, + feeTokenReceiver ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + feeQuoterDestChain ag_solanago.PublicKey, + feeQuoterBillingTokenConfig ag_solanago.PublicKey, + feeQuoterLinkTokenConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey) *CcipSend { + return NewCcipSendInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetMessage(message). + SetTokenIndexes(tokenIndexes). + SetConfigAccount(config). + SetDestChainStateAccount(destChainState). + SetNonceAccount(nonce). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetFeeTokenProgramAccount(feeTokenProgram). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenUserAssociatedAccountAccount(feeTokenUserAssociatedAccount). + SetFeeTokenReceiverAccount(feeTokenReceiver). + SetFeeBillingSignerAccount(feeBillingSigner). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetFeeQuoterDestChainAccount(feeQuoterDestChain). + SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig). + SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend_test.go new file mode 100644 index 0000000000..a9f819342c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/CcipSend_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CcipSend(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CcipSend"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CcipSend) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CcipSend) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend.go b/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend.go new file mode 100644 index 0000000000..fcde84805e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend.go @@ -0,0 +1,182 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Automatically derives all accounts required to call `ccip_send`. +// +// This method receives the bare minimum amount of information needed to construct +// the entire account list to send a transaction, and builds it iteratively +// over the course of multiple calls. +// +// The return type contains: +// +// * `accounts_to_save`: The caller must append these accounts to a list they maintain. +// When complete, this list will contain all accounts needed to call `ccip_send`. +// * `ask_again_with`: When `next_stage` is not empty, the caller must call `derive_accounts_ccip_send` +// again, including exactly these accounts as the `remaining_accounts`. +// * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_send`. +// * `current_stage`: A string describing the current stage of the derivation process. When the stage +// is "TokenTransferStaticAccounts//0", it means the `accounts_to_save` block in this response contains +// all accounts relating to the Nth token being transferred. Use this information to construct +// the `token_indexes` vector that `ccip_send` requires. +// * `next_stage`: If nonempty, this means the instruction must get called again with this value +// as the `stage` argument. +// +// Therefore, and starting with an empty `remaining_accounts` list, the caller must repeatedly +// call `derive_accounts_ccip_send` until `next_stage` is returned empty. +// +// # Arguments +// +// * `ctx`: Context containing only the config. +// * `stage`: Requested derivation stage. Pass "Start" the first time, then for each subsequent +// call, pass the value returned in `response.next_stage` until empty. +// * `params`: +// * `ccip_send_caller`: Public key of the account that will sign the call to `ccip_send`. +// * `dest_chain_selector`: CCIP chain selector for the dest chain. +// * `fee_token_mint`: The mint address for the token used for fees. Pubkey::default() if native SOL. +// * `mints_of_transferred_token`: List of all token mints for tokens being transferred. +type DeriveAccountsCcipSend struct { + Params *DeriveAccountsCcipSendParams + Stage *string + + // [0] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsCcipSendInstructionBuilder creates a new `DeriveAccountsCcipSend` instruction builder. +func NewDeriveAccountsCcipSendInstructionBuilder() *DeriveAccountsCcipSend { + nd := &DeriveAccountsCcipSend{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetParams sets the "params" parameter. +func (inst *DeriveAccountsCcipSend) SetParams(params DeriveAccountsCcipSendParams) *DeriveAccountsCcipSend { + inst.Params = ¶ms + return inst +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsCcipSend) SetStage(stage string) *DeriveAccountsCcipSend { + inst.Stage = &stage + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *DeriveAccountsCcipSend) SetConfigAccount(config ag_solanago.PublicKey) *DeriveAccountsCcipSend { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *DeriveAccountsCcipSend) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst DeriveAccountsCcipSend) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsCcipSend, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsCcipSend) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsCcipSend) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Params == nil { + return errors.New("Params parameter is not set") + } + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *DeriveAccountsCcipSend) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsCcipSend")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Params", *inst.Params)) + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("config", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj DeriveAccountsCcipSend) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Params` param: + err = encoder.Encode(obj.Params) + if err != nil { + return err + } + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsCcipSend) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Params`: + err = decoder.Decode(&obj.Params) + if err != nil { + return err + } + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsCcipSendInstruction declares a new DeriveAccountsCcipSend instruction with the provided parameters and accounts. +func NewDeriveAccountsCcipSendInstruction( + // Parameters: + params DeriveAccountsCcipSendParams, + stage string, + // Accounts: + config ag_solanago.PublicKey) *DeriveAccountsCcipSend { + return NewDeriveAccountsCcipSendInstructionBuilder(). + SetParams(params). + SetStage(stage). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend_test.go new file mode 100644 index 0000000000..21c038682d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/DeriveAccountsCcipSend_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsCcipSend(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsCcipSend"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsCcipSend) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsCcipSend) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/GetFee.go b/chains/solana/gobindings/v1_6_1/ccip_router/GetFee.go new file mode 100644 index 0000000000..835353ecbd --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/GetFee.go @@ -0,0 +1,273 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Queries the onramp for the fee required to send a message. +// +// This call is permissionless. Note it does not verify whether there's a curse active +// in order to avoid the RMN CPI overhead. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for obtaining the message fee. +// * `dest_chain_selector` - The chain selector for the destination chain. +// * `message` - The message to be sent. The size limit of data is 256 bytes. +type GetFee struct { + DestChainSelector *uint64 + Message *SVM2AnyMessage + + // [0] = [] config + // + // [1] = [] destChainState + // + // [2] = [] feeQuoter + // + // [3] = [] feeQuoterConfig + // + // [4] = [] feeQuoterDestChain + // + // [5] = [] feeQuoterBillingTokenConfig + // + // [6] = [] feeQuoterLinkTokenConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewGetFeeInstructionBuilder creates a new `GetFee` instruction builder. +func NewGetFeeInstructionBuilder() *GetFee { + nd := &GetFee{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *GetFee) SetDestChainSelector(destChainSelector uint64) *GetFee { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetMessage sets the "message" parameter. +func (inst *GetFee) SetMessage(message SVM2AnyMessage) *GetFee { + inst.Message = &message + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *GetFee) SetConfigAccount(config ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *GetFee) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *GetFee) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChainState) + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *GetFee) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +func (inst *GetFee) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[2] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +func (inst *GetFee) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +func (inst *GetFee) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[3] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +func (inst *GetFee) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeQuoterDestChainAccount sets the "feeQuoterDestChain" account. +func (inst *GetFee) SetFeeQuoterDestChainAccount(feeQuoterDestChain ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeQuoterDestChain) + return inst +} + +// GetFeeQuoterDestChainAccount gets the "feeQuoterDestChain" account. +func (inst *GetFee) GetFeeQuoterDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeQuoterBillingTokenConfigAccount sets the "feeQuoterBillingTokenConfig" account. +func (inst *GetFee) SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeQuoterBillingTokenConfig) + return inst +} + +// GetFeeQuoterBillingTokenConfigAccount gets the "feeQuoterBillingTokenConfig" account. +func (inst *GetFee) GetFeeQuoterBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetFeeQuoterLinkTokenConfigAccount sets the "feeQuoterLinkTokenConfig" account. +func (inst *GetFee) SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[6] = ag_solanago.Meta(feeQuoterLinkTokenConfig) + return inst +} + +// GetFeeQuoterLinkTokenConfigAccount gets the "feeQuoterLinkTokenConfig" account. +func (inst *GetFee) GetFeeQuoterLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst GetFee) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_GetFee, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst GetFee) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *GetFee) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + if inst.Message == nil { + return errors.New("Message parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeQuoterDestChain is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeQuoterBillingTokenConfig is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.FeeQuoterLinkTokenConfig is not set") + } + } + return nil +} + +func (inst *GetFee) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("GetFee")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + paramsBranch.Child(ag_format.Param(" Message", *inst.Message)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" destChainState", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feeQuoterDestChain", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta("feeQuoterBillingTokenConfig", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" feeQuoterLinkTokenConfig", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj GetFee) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + return nil +} +func (obj *GetFee) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + return nil +} + +// NewGetFeeInstruction declares a new GetFee instruction with the provided parameters and accounts. +func NewGetFeeInstruction( + // Parameters: + destChainSelector uint64, + message SVM2AnyMessage, + // Accounts: + config ag_solanago.PublicKey, + destChainState ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + feeQuoterDestChain ag_solanago.PublicKey, + feeQuoterBillingTokenConfig ag_solanago.PublicKey, + feeQuoterLinkTokenConfig ag_solanago.PublicKey) *GetFee { + return NewGetFeeInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetMessage(message). + SetConfigAccount(config). + SetDestChainStateAccount(destChainState). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetFeeQuoterDestChainAccount(feeQuoterDestChain). + SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig). + SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/GetFee_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/GetFee_test.go new file mode 100644 index 0000000000..5798cb0848 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/GetFee_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_GetFee(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("GetFee"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(GetFee) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(GetFee) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/Initialize.go b/chains/solana/gobindings/v1_6_1/ccip_router/Initialize.go new file mode 100644 index 0000000000..cf4f865e09 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/Initialize.go @@ -0,0 +1,307 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialization Flow // +// Initializes the CCIP Router. +// +// The initialization of the Router is responsibility of Admin, nothing more than calling this method should be done first. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for initialization. +// * `svm_chain_selector` - The chain selector for SVM. +// * `fee_aggregator` - The public key of the fee aggregator. +// * `fee_quoter` - The public key of the fee quoter. +// * `link_token_mint` - The public key of the LINK token mint. +// * `rmn_remote` - The public key of the RMN remote. +type Initialize struct { + SvmChainSelector *uint64 + FeeAggregator *ag_solanago.PublicKey + FeeQuoter *ag_solanago.PublicKey + LinkTokenMint *ag_solanago.PublicKey + RmnRemote *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetSvmChainSelector sets the "svmChainSelector" parameter. +func (inst *Initialize) SetSvmChainSelector(svmChainSelector uint64) *Initialize { + inst.SvmChainSelector = &svmChainSelector + return inst +} + +// SetFeeAggregator sets the "feeAggregator" parameter. +func (inst *Initialize) SetFeeAggregator(feeAggregator ag_solanago.PublicKey) *Initialize { + inst.FeeAggregator = &feeAggregator + return inst +} + +// SetFeeQuoter sets the "feeQuoter" parameter. +func (inst *Initialize) SetFeeQuoter(feeQuoter ag_solanago.PublicKey) *Initialize { + inst.FeeQuoter = &feeQuoter + return inst +} + +// SetLinkTokenMint sets the "linkTokenMint" parameter. +func (inst *Initialize) SetLinkTokenMint(linkTokenMint ag_solanago.PublicKey) *Initialize { + inst.LinkTokenMint = &linkTokenMint + return inst +} + +// SetRmnRemote sets the "rmnRemote" parameter. +func (inst *Initialize) SetRmnRemote(rmnRemote ag_solanago.PublicKey) *Initialize { + inst.RmnRemote = &rmnRemote + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SvmChainSelector == nil { + return errors.New("SvmChainSelector parameter is not set") + } + if inst.FeeAggregator == nil { + return errors.New("FeeAggregator parameter is not set") + } + if inst.FeeQuoter == nil { + return errors.New("FeeQuoter parameter is not set") + } + if inst.LinkTokenMint == nil { + return errors.New("LinkTokenMint parameter is not set") + } + if inst.RmnRemote == nil { + return errors.New("RmnRemote parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SvmChainSelector", *inst.SvmChainSelector)) + paramsBranch.Child(ag_format.Param(" FeeAggregator", *inst.FeeAggregator)) + paramsBranch.Child(ag_format.Param(" FeeQuoter", *inst.FeeQuoter)) + paramsBranch.Child(ag_format.Param(" LinkTokenMint", *inst.LinkTokenMint)) + paramsBranch.Child(ag_format.Param(" RmnRemote", *inst.RmnRemote)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SvmChainSelector` param: + err = encoder.Encode(obj.SvmChainSelector) + if err != nil { + return err + } + // Serialize `FeeAggregator` param: + err = encoder.Encode(obj.FeeAggregator) + if err != nil { + return err + } + // Serialize `FeeQuoter` param: + err = encoder.Encode(obj.FeeQuoter) + if err != nil { + return err + } + // Serialize `LinkTokenMint` param: + err = encoder.Encode(obj.LinkTokenMint) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SvmChainSelector`: + err = decoder.Decode(&obj.SvmChainSelector) + if err != nil { + return err + } + // Deserialize `FeeAggregator`: + err = decoder.Decode(&obj.FeeAggregator) + if err != nil { + return err + } + // Deserialize `FeeQuoter`: + err = decoder.Decode(&obj.FeeQuoter) + if err != nil { + return err + } + // Deserialize `LinkTokenMint`: + err = decoder.Decode(&obj.LinkTokenMint) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Parameters: + svmChainSelector uint64, + feeAggregator ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + linkTokenMint ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetSvmChainSelector(svmChainSelector). + SetFeeAggregator(feeAggregator). + SetFeeQuoter(feeQuoter). + SetLinkTokenMint(linkTokenMint). + SetRmnRemote(rmnRemote). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/Initialize_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/Initialize_test.go new file mode 100644 index 0000000000..51eed3384b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator.go b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator.go new file mode 100644 index 0000000000..679509f5b5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator.go @@ -0,0 +1,208 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Overrides the pending admin of the Token Admin Registry by the token owner +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for registration. +// * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. +type OwnerOverridePendingAdministrator struct { + TokenAdminRegistryAdmin *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewOwnerOverridePendingAdministratorInstructionBuilder creates a new `OwnerOverridePendingAdministrator` instruction builder. +func NewOwnerOverridePendingAdministratorInstructionBuilder() *OwnerOverridePendingAdministrator { + nd := &OwnerOverridePendingAdministrator{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetTokenAdminRegistryAdmin sets the "tokenAdminRegistryAdmin" parameter. +func (inst *OwnerOverridePendingAdministrator) SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.TokenAdminRegistryAdmin = &tokenAdminRegistryAdmin + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *OwnerOverridePendingAdministrator) SetConfigAccount(config ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *OwnerOverridePendingAdministrator) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *OwnerOverridePendingAdministrator) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *OwnerOverridePendingAdministrator) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *OwnerOverridePendingAdministrator) SetMintAccount(mint ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *OwnerOverridePendingAdministrator) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *OwnerOverridePendingAdministrator) SetAuthorityAccount(authority ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *OwnerOverridePendingAdministrator) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *OwnerOverridePendingAdministrator) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *OwnerOverridePendingAdministrator) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst OwnerOverridePendingAdministrator) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_OwnerOverridePendingAdministrator, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst OwnerOverridePendingAdministrator) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *OwnerOverridePendingAdministrator) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TokenAdminRegistryAdmin == nil { + return errors.New("TokenAdminRegistryAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *OwnerOverridePendingAdministrator) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("OwnerOverridePendingAdministrator")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("TokenAdminRegistryAdmin", *inst.TokenAdminRegistryAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj OwnerOverridePendingAdministrator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenAdminRegistryAdmin` param: + err = encoder.Encode(obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} +func (obj *OwnerOverridePendingAdministrator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenAdminRegistryAdmin`: + err = decoder.Decode(&obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} + +// NewOwnerOverridePendingAdministratorInstruction declares a new OwnerOverridePendingAdministrator instruction with the provided parameters and accounts. +func NewOwnerOverridePendingAdministratorInstruction( + // Parameters: + tokenAdminRegistryAdmin ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *OwnerOverridePendingAdministrator { + return NewOwnerOverridePendingAdministratorInstructionBuilder(). + SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator_test.go new file mode 100644 index 0000000000..3c0d2dd542 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerOverridePendingAdministrator_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_OwnerOverridePendingAdministrator(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("OwnerOverridePendingAdministrator"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(OwnerOverridePendingAdministrator) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(OwnerOverridePendingAdministrator) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator.go b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator.go new file mode 100644 index 0000000000..dd9f8c90b1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator.go @@ -0,0 +1,210 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Registers the Token Admin Registry by the token owner. +// +// The Authority of the Mint Token can claim the registry of the token. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for registration. +// * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. +type OwnerProposeAdministrator struct { + TokenAdminRegistryAdmin *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewOwnerProposeAdministratorInstructionBuilder creates a new `OwnerProposeAdministrator` instruction builder. +func NewOwnerProposeAdministratorInstructionBuilder() *OwnerProposeAdministrator { + nd := &OwnerProposeAdministrator{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetTokenAdminRegistryAdmin sets the "tokenAdminRegistryAdmin" parameter. +func (inst *OwnerProposeAdministrator) SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.TokenAdminRegistryAdmin = &tokenAdminRegistryAdmin + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *OwnerProposeAdministrator) SetConfigAccount(config ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *OwnerProposeAdministrator) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *OwnerProposeAdministrator) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *OwnerProposeAdministrator) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *OwnerProposeAdministrator) SetMintAccount(mint ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *OwnerProposeAdministrator) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *OwnerProposeAdministrator) SetAuthorityAccount(authority ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *OwnerProposeAdministrator) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *OwnerProposeAdministrator) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *OwnerProposeAdministrator { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *OwnerProposeAdministrator) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst OwnerProposeAdministrator) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_OwnerProposeAdministrator, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst OwnerProposeAdministrator) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *OwnerProposeAdministrator) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TokenAdminRegistryAdmin == nil { + return errors.New("TokenAdminRegistryAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *OwnerProposeAdministrator) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("OwnerProposeAdministrator")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("TokenAdminRegistryAdmin", *inst.TokenAdminRegistryAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj OwnerProposeAdministrator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenAdminRegistryAdmin` param: + err = encoder.Encode(obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} +func (obj *OwnerProposeAdministrator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenAdminRegistryAdmin`: + err = decoder.Decode(&obj.TokenAdminRegistryAdmin) + if err != nil { + return err + } + return nil +} + +// NewOwnerProposeAdministratorInstruction declares a new OwnerProposeAdministrator instruction with the provided parameters and accounts. +func NewOwnerProposeAdministratorInstruction( + // Parameters: + tokenAdminRegistryAdmin ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *OwnerProposeAdministrator { + return NewOwnerProposeAdministratorInstructionBuilder(). + SetTokenAdminRegistryAdmin(tokenAdminRegistryAdmin). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator_test.go new file mode 100644 index 0000000000..b4c16971a1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/OwnerProposeAdministrator_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_OwnerProposeAdministrator(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("OwnerProposeAdministrator"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(OwnerProposeAdministrator) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(OwnerProposeAdministrator) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp.go b/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp.go new file mode 100644 index 0000000000..1d57366e00 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp.go @@ -0,0 +1,215 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Remove an offramp address from the list of offramps allowed by the router, for a +// particular source chain. External users will check this list before accepting +// a `ccip_receive` CPI. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for this operation. +// * `source_chain_selector` - The source chain for the offramp's lane. +// * `offramp` - The offramp's address. +type RemoveOfframp struct { + SourceChainSelector *uint64 + Offramp *ag_solanago.PublicKey + + // [0] = [WRITE] allowedOfframp + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemoveOfframpInstructionBuilder creates a new `RemoveOfframp` instruction builder. +func NewRemoveOfframpInstructionBuilder() *RemoveOfframp { + nd := &RemoveOfframp{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSourceChainSelector sets the "sourceChainSelector" parameter. +func (inst *RemoveOfframp) SetSourceChainSelector(sourceChainSelector uint64) *RemoveOfframp { + inst.SourceChainSelector = &sourceChainSelector + return inst +} + +// SetOfframp sets the "offramp" parameter. +func (inst *RemoveOfframp) SetOfframp(offramp ag_solanago.PublicKey) *RemoveOfframp { + inst.Offramp = &offramp + return inst +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +func (inst *RemoveOfframp) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *RemoveOfframp { + inst.AccountMetaSlice[0] = ag_solanago.Meta(allowedOfframp).WRITE() + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +func (inst *RemoveOfframp) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *RemoveOfframp) SetConfigAccount(config ag_solanago.PublicKey) *RemoveOfframp { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *RemoveOfframp) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemoveOfframp) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemoveOfframp { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemoveOfframp) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemoveOfframp) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemoveOfframp { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemoveOfframp) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemoveOfframp) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemoveOfframp, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemoveOfframp) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemoveOfframp) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SourceChainSelector == nil { + return errors.New("SourceChainSelector parameter is not set") + } + if inst.Offramp == nil { + return errors.New("Offramp parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemoveOfframp) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemoveOfframp")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SourceChainSelector", *inst.SourceChainSelector)) + paramsBranch.Child(ag_format.Param(" Offramp", *inst.Offramp)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("allowedOfframp", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemoveOfframp) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `Offramp` param: + err = encoder.Encode(obj.Offramp) + if err != nil { + return err + } + return nil +} +func (obj *RemoveOfframp) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `Offramp`: + err = decoder.Decode(&obj.Offramp) + if err != nil { + return err + } + return nil +} + +// NewRemoveOfframpInstruction declares a new RemoveOfframp instruction with the provided parameters and accounts. +func NewRemoveOfframpInstruction( + // Parameters: + sourceChainSelector uint64, + offramp ag_solanago.PublicKey, + // Accounts: + allowedOfframp ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemoveOfframp { + return NewRemoveOfframpInstructionBuilder(). + SetSourceChainSelector(sourceChainSelector). + SetOfframp(offramp). + SetAllowedOfframpAccount(allowedOfframp). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp_test.go new file mode 100644 index 0000000000..70a88e1e50 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/RemoveOfframp_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemoveOfframp(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemoveOfframp"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemoveOfframp) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemoveOfframp) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain.go b/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain.go new file mode 100644 index 0000000000..cfff2908b9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Rolls back the CCIP version for a destination chain. +// This effectively just restores the old version's sequence number of the destination chain state. +// We only support 1 consecutive rollback. If a rollback has occurred for that lane, the version can't +// be rolled back again without bumping the version first. +// +// # Arguments +// * `ctx` - The context containing the accounts required for the rollback. +// * `dest_chain_selector` - The destination chain selector to rollback the version for. +type RollbackCcipVersionForDestChain struct { + DestChainSelector *uint64 + + // [0] = [WRITE] destChainState + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRollbackCcipVersionForDestChainInstructionBuilder creates a new `RollbackCcipVersionForDestChain` instruction builder. +func NewRollbackCcipVersionForDestChainInstructionBuilder() *RollbackCcipVersionForDestChain { + nd := &RollbackCcipVersionForDestChain{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *RollbackCcipVersionForDestChain) SetDestChainSelector(destChainSelector uint64) *RollbackCcipVersionForDestChain { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *RollbackCcipVersionForDestChain) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *RollbackCcipVersionForDestChain { + inst.AccountMetaSlice[0] = ag_solanago.Meta(destChainState).WRITE() + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *RollbackCcipVersionForDestChain) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *RollbackCcipVersionForDestChain) SetConfigAccount(config ag_solanago.PublicKey) *RollbackCcipVersionForDestChain { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *RollbackCcipVersionForDestChain) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RollbackCcipVersionForDestChain) SetAuthorityAccount(authority ag_solanago.PublicKey) *RollbackCcipVersionForDestChain { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RollbackCcipVersionForDestChain) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst RollbackCcipVersionForDestChain) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RollbackCcipVersionForDestChain, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RollbackCcipVersionForDestChain) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RollbackCcipVersionForDestChain) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *RollbackCcipVersionForDestChain) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RollbackCcipVersionForDestChain")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("destChainState", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj RollbackCcipVersionForDestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *RollbackCcipVersionForDestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + return nil +} + +// NewRollbackCcipVersionForDestChainInstruction declares a new RollbackCcipVersionForDestChain instruction with the provided parameters and accounts. +func NewRollbackCcipVersionForDestChainInstruction( + // Parameters: + destChainSelector uint64, + // Accounts: + destChainState ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *RollbackCcipVersionForDestChain { + return NewRollbackCcipVersionForDestChainInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetDestChainStateAccount(destChainState). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain_test.go new file mode 100644 index 0000000000..eb12fb16a2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/RollbackCcipVersionForDestChain_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RollbackCcipVersionForDestChain(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RollbackCcipVersionForDestChain"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RollbackCcipVersionForDestChain) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RollbackCcipVersionForDestChain) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion.go new file mode 100644 index 0000000000..062b8c7276 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion.go @@ -0,0 +1,174 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Config // +// Sets the default code version to be used. This is then used by the slim routing layer to determine +// which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `code_version` - The new code version to be set as default. +type SetDefaultCodeVersion struct { + CodeVersion *CodeVersion + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetDefaultCodeVersionInstructionBuilder creates a new `SetDefaultCodeVersion` instruction builder. +func NewSetDefaultCodeVersionInstructionBuilder() *SetDefaultCodeVersion { + nd := &SetDefaultCodeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetCodeVersion sets the "codeVersion" parameter. +func (inst *SetDefaultCodeVersion) SetCodeVersion(codeVersion CodeVersion) *SetDefaultCodeVersion { + inst.CodeVersion = &codeVersion + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetDefaultCodeVersion) SetConfigAccount(config ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetDefaultCodeVersion) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetDefaultCodeVersion) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetDefaultCodeVersion) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetDefaultCodeVersion) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetDefaultCodeVersion) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetDefaultCodeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetDefaultCodeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetDefaultCodeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetDefaultCodeVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.CodeVersion == nil { + return errors.New("CodeVersion parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetDefaultCodeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetDefaultCodeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("CodeVersion", *inst.CodeVersion)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetDefaultCodeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `CodeVersion` param: + err = encoder.Encode(obj.CodeVersion) + if err != nil { + return err + } + return nil +} +func (obj *SetDefaultCodeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `CodeVersion`: + err = decoder.Decode(&obj.CodeVersion) + if err != nil { + return err + } + return nil +} + +// NewSetDefaultCodeVersionInstruction declares a new SetDefaultCodeVersion instruction with the provided parameters and accounts. +func NewSetDefaultCodeVersionInstruction( + // Parameters: + codeVersion CodeVersion, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetDefaultCodeVersion { + return NewSetDefaultCodeVersionInstructionBuilder(). + SetCodeVersion(codeVersion). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion_test.go new file mode 100644 index 0000000000..9461372540 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetDefaultCodeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetDefaultCodeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetDefaultCodeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetDefaultCodeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetDefaultCodeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint.go new file mode 100644 index 0000000000..3f4742d869 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the address of the LINK token mint. +// The Admin is the only one able to set it. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `link_token_mint` - The new address of the LINK token mint. +type SetLinkTokenMint struct { + LinkTokenMint *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetLinkTokenMintInstructionBuilder creates a new `SetLinkTokenMint` instruction builder. +func NewSetLinkTokenMintInstructionBuilder() *SetLinkTokenMint { + nd := &SetLinkTokenMint{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetLinkTokenMint sets the "linkTokenMint" parameter. +func (inst *SetLinkTokenMint) SetLinkTokenMint(linkTokenMint ag_solanago.PublicKey) *SetLinkTokenMint { + inst.LinkTokenMint = &linkTokenMint + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetLinkTokenMint) SetConfigAccount(config ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetLinkTokenMint) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetLinkTokenMint) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetLinkTokenMint) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetLinkTokenMint) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetLinkTokenMint) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetLinkTokenMint) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetLinkTokenMint, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetLinkTokenMint) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetLinkTokenMint) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.LinkTokenMint == nil { + return errors.New("LinkTokenMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetLinkTokenMint) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetLinkTokenMint")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("LinkTokenMint", *inst.LinkTokenMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetLinkTokenMint) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LinkTokenMint` param: + err = encoder.Encode(obj.LinkTokenMint) + if err != nil { + return err + } + return nil +} +func (obj *SetLinkTokenMint) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LinkTokenMint`: + err = decoder.Decode(&obj.LinkTokenMint) + if err != nil { + return err + } + return nil +} + +// NewSetLinkTokenMintInstruction declares a new SetLinkTokenMint instruction with the provided parameters and accounts. +func NewSetLinkTokenMintInstruction( + // Parameters: + linkTokenMint ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetLinkTokenMint { + return NewSetLinkTokenMintInstructionBuilder(). + SetLinkTokenMint(linkTokenMint). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint_test.go new file mode 100644 index 0000000000..cbc7ffc3b7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetLinkTokenMint_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetLinkTokenMint(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetLinkTokenMint"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetLinkTokenMint) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetLinkTokenMint) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetPool.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetPool.go new file mode 100644 index 0000000000..f063e3f24b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetPool.go @@ -0,0 +1,210 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the pool lookup table for a given token mint. +// +// The administrator of the token admin registry can set the pool lookup table for a given token mint. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for setting the pool. +// * `writable_indexes` - a bit map of the indexes of the accounts in lookup table that are writable +type SetPool struct { + WritableIndexes *[]byte + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [] poolLookuptable + // + // [4] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetPoolInstructionBuilder creates a new `SetPool` instruction builder. +func NewSetPoolInstructionBuilder() *SetPool { + nd := &SetPool{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetWritableIndexes sets the "writableIndexes" parameter. +func (inst *SetPool) SetWritableIndexes(writableIndexes []byte) *SetPool { + inst.WritableIndexes = &writableIndexes + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetPool) SetConfigAccount(config ag_solanago.PublicKey) *SetPool { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetPool) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *SetPool) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *SetPool { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *SetPool) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetPool) SetMintAccount(mint ag_solanago.PublicKey) *SetPool { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetPool) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetPoolLookuptableAccount sets the "poolLookuptable" account. +func (inst *SetPool) SetPoolLookuptableAccount(poolLookuptable ag_solanago.PublicKey) *SetPool { + inst.AccountMetaSlice[3] = ag_solanago.Meta(poolLookuptable) + return inst +} + +// GetPoolLookuptableAccount gets the "poolLookuptable" account. +func (inst *SetPool) GetPoolLookuptableAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetPool) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetPool { + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetPool) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetPool) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetPool, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetPool) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetPool) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.WritableIndexes == nil { + return errors.New("WritableIndexes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.PoolLookuptable is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetPool) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetPool")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("WritableIndexes", *inst.WritableIndexes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" poolLookuptable", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetPool) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `WritableIndexes` param: + err = encoder.Encode(obj.WritableIndexes) + if err != nil { + return err + } + return nil +} +func (obj *SetPool) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `WritableIndexes`: + err = decoder.Decode(&obj.WritableIndexes) + if err != nil { + return err + } + return nil +} + +// NewSetPoolInstruction declares a new SetPool instruction with the provided parameters and accounts. +func NewSetPoolInstruction( + // Parameters: + writableIndexes []byte, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolLookuptable ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetPool { + return NewSetPoolInstructionBuilder(). + SetWritableIndexes(writableIndexes). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetPoolLookuptableAccount(poolLookuptable). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation.go new file mode 100644 index 0000000000..6d01747762 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation.go @@ -0,0 +1,196 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Edits the pool config flags for a given token mint. +// +// The administrator of the token admin registry is the only one allowed to invoke this. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for setting the pool. +// * `mint` - The mint of the pool to be edited. +// * `supports_auto_derivation` - A boolean flag indicating whether the pool supports auto-derivation of accounts. +type SetPoolSupportsAutoDerivation struct { + Mint *ag_solanago.PublicKey + SupportsAutoDerivation *bool + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetPoolSupportsAutoDerivationInstructionBuilder creates a new `SetPoolSupportsAutoDerivation` instruction builder. +func NewSetPoolSupportsAutoDerivationInstructionBuilder() *SetPoolSupportsAutoDerivation { + nd := &SetPoolSupportsAutoDerivation{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *SetPoolSupportsAutoDerivation) SetMint(mint ag_solanago.PublicKey) *SetPoolSupportsAutoDerivation { + inst.Mint = &mint + return inst +} + +// SetSupportsAutoDerivation sets the "supportsAutoDerivation" parameter. +func (inst *SetPoolSupportsAutoDerivation) SetSupportsAutoDerivation(supportsAutoDerivation bool) *SetPoolSupportsAutoDerivation { + inst.SupportsAutoDerivation = &supportsAutoDerivation + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetPoolSupportsAutoDerivation) SetConfigAccount(config ag_solanago.PublicKey) *SetPoolSupportsAutoDerivation { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetPoolSupportsAutoDerivation) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *SetPoolSupportsAutoDerivation) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *SetPoolSupportsAutoDerivation { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *SetPoolSupportsAutoDerivation) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetPoolSupportsAutoDerivation) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetPoolSupportsAutoDerivation { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetPoolSupportsAutoDerivation) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetPoolSupportsAutoDerivation) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetPoolSupportsAutoDerivation, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetPoolSupportsAutoDerivation) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetPoolSupportsAutoDerivation) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.SupportsAutoDerivation == nil { + return errors.New("SupportsAutoDerivation parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetPoolSupportsAutoDerivation) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetPoolSupportsAutoDerivation")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param("SupportsAutoDerivation", *inst.SupportsAutoDerivation)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetPoolSupportsAutoDerivation) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `SupportsAutoDerivation` param: + err = encoder.Encode(obj.SupportsAutoDerivation) + if err != nil { + return err + } + return nil +} +func (obj *SetPoolSupportsAutoDerivation) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `SupportsAutoDerivation`: + err = decoder.Decode(&obj.SupportsAutoDerivation) + if err != nil { + return err + } + return nil +} + +// NewSetPoolSupportsAutoDerivationInstruction declares a new SetPoolSupportsAutoDerivation instruction with the provided parameters and accounts. +func NewSetPoolSupportsAutoDerivationInstruction( + // Parameters: + mint ag_solanago.PublicKey, + supportsAutoDerivation bool, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetPoolSupportsAutoDerivation { + return NewSetPoolSupportsAutoDerivationInstructionBuilder(). + SetMint(mint). + SetSupportsAutoDerivation(supportsAutoDerivation). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation_test.go new file mode 100644 index 0000000000..1d8d6b12b5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetPoolSupportsAutoDerivation_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetPoolSupportsAutoDerivation(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetPoolSupportsAutoDerivation"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetPoolSupportsAutoDerivation) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetPoolSupportsAutoDerivation) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/SetPool_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/SetPool_test.go new file mode 100644 index 0000000000..249513a25b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/SetPool_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetPool(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetPool"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetPool) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetPool) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry.go b/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry.go new file mode 100644 index 0000000000..a59e89d49c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry.go @@ -0,0 +1,192 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Transfers the admin role of the token admin registry to a new admin. +// +// Only the Admin can transfer the Admin Role of the Token Admin Registry, this setups the Pending Admin and then it's their responsibility to accept the role. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer. +// * `mint` - The public key of the token mint. +// * `new_admin` - The public key of the new admin. +type TransferAdminRoleTokenAdminRegistry struct { + NewAdmin *ag_solanago.PublicKey + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferAdminRoleTokenAdminRegistryInstructionBuilder creates a new `TransferAdminRoleTokenAdminRegistry` instruction builder. +func NewTransferAdminRoleTokenAdminRegistryInstructionBuilder() *TransferAdminRoleTokenAdminRegistry { + nd := &TransferAdminRoleTokenAdminRegistry{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetNewAdmin sets the "newAdmin" parameter. +func (inst *TransferAdminRoleTokenAdminRegistry) SetNewAdmin(newAdmin ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + inst.NewAdmin = &newAdmin + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *TransferAdminRoleTokenAdminRegistry) SetConfigAccount(config ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *TransferAdminRoleTokenAdminRegistry) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +func (inst *TransferAdminRoleTokenAdminRegistry) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +func (inst *TransferAdminRoleTokenAdminRegistry) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferAdminRoleTokenAdminRegistry) SetMintAccount(mint ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferAdminRoleTokenAdminRegistry) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferAdminRoleTokenAdminRegistry) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferAdminRoleTokenAdminRegistry) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst TransferAdminRoleTokenAdminRegistry) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferAdminRoleTokenAdminRegistry, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferAdminRoleTokenAdminRegistry) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferAdminRoleTokenAdminRegistry) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewAdmin == nil { + return errors.New("NewAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferAdminRoleTokenAdminRegistry) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferAdminRoleTokenAdminRegistry")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewAdmin", *inst.NewAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj TransferAdminRoleTokenAdminRegistry) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewAdmin` param: + err = encoder.Encode(obj.NewAdmin) + if err != nil { + return err + } + return nil +} +func (obj *TransferAdminRoleTokenAdminRegistry) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewAdmin`: + err = decoder.Decode(&obj.NewAdmin) + if err != nil { + return err + } + return nil +} + +// NewTransferAdminRoleTokenAdminRegistryInstruction declares a new TransferAdminRoleTokenAdminRegistry instruction with the provided parameters and accounts. +func NewTransferAdminRoleTokenAdminRegistryInstruction( + // Parameters: + newAdmin ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferAdminRoleTokenAdminRegistry { + return NewTransferAdminRoleTokenAdminRegistryInstructionBuilder(). + SetNewAdmin(newAdmin). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry_test.go new file mode 100644 index 0000000000..e52c1a9983 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TransferAdminRoleTokenAdminRegistry_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferAdminRoleTokenAdminRegistry(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferAdminRoleTokenAdminRegistry"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferAdminRoleTokenAdminRegistry) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferAdminRoleTokenAdminRegistry) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership.go new file mode 100644 index 0000000000..eefb6bc39f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership.go @@ -0,0 +1,153 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Transfers the ownership of the router to a new proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer. +// * `proposed_owner` - The public key of the new proposed owner. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *TransferOwnership) SetConfigAccount(config ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *TransferOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership_test.go new file mode 100644 index 0000000000..38ea4ea34f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion.go b/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion.go new file mode 100644 index 0000000000..8bf4433804 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion_test.go new file mode 100644 index 0000000000..9c621b9ded --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig.go new file mode 100644 index 0000000000..c5ec2e48f6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig.go @@ -0,0 +1,215 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the configuration of the destination chain selector. +// +// The Admin is the only one able to update the destination chain config. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the chain selector. +// * `dest_chain_selector` - The destination chain selector to be updated. +// * `dest_chain_config` - The new configuration for the destination chain. +type UpdateDestChainConfig struct { + DestChainSelector *uint64 + DestChainConfig *DestChainConfig + + // [0] = [WRITE] destChainState + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDestChainConfigInstructionBuilder creates a new `UpdateDestChainConfig` instruction builder. +func NewUpdateDestChainConfigInstructionBuilder() *UpdateDestChainConfig { + nd := &UpdateDestChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *UpdateDestChainConfig) SetDestChainSelector(destChainSelector uint64) *UpdateDestChainConfig { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetDestChainConfig sets the "destChainConfig" parameter. +func (inst *UpdateDestChainConfig) SetDestChainConfig(destChainConfig DestChainConfig) *UpdateDestChainConfig { + inst.DestChainConfig = &destChainConfig + return inst +} + +// SetDestChainStateAccount sets the "destChainState" account. +func (inst *UpdateDestChainConfig) SetDestChainStateAccount(destChainState ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(destChainState).WRITE() + return inst +} + +// GetDestChainStateAccount gets the "destChainState" account. +func (inst *UpdateDestChainConfig) GetDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDestChainConfig) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDestChainConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDestChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDestChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpdateDestChainConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpdateDestChainConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateDestChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDestChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDestChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDestChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + if inst.DestChainConfig == nil { + return errors.New("DestChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.DestChainState is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpdateDestChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDestChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + paramsBranch.Child(ag_format.Param(" DestChainConfig", *inst.DestChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("destChainState", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateDestChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `DestChainConfig` param: + err = encoder.Encode(obj.DestChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDestChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainConfig`: + err = decoder.Decode(&obj.DestChainConfig) + if err != nil { + return err + } + return nil +} + +// NewUpdateDestChainConfigInstruction declares a new UpdateDestChainConfig instruction with the provided parameters and accounts. +func NewUpdateDestChainConfigInstruction( + // Parameters: + destChainSelector uint64, + destChainConfig DestChainConfig, + // Accounts: + destChainState ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpdateDestChainConfig { + return NewUpdateDestChainConfigInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetDestChainConfig(destChainConfig). + SetDestChainStateAccount(destChainState). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig_test.go new file mode 100644 index 0000000000..7057c39c2c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateDestChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDestChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDestChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDestChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDestChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator.go new file mode 100644 index 0000000000..4508d99e02 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the fee aggregator in the router configuration. +// The Admin is the only one able to update the fee aggregator. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `fee_aggregator` - The new fee aggregator address (ATAs will be derived for it for each token). +type UpdateFeeAggregator struct { + FeeAggregator *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateFeeAggregatorInstructionBuilder creates a new `UpdateFeeAggregator` instruction builder. +func NewUpdateFeeAggregatorInstructionBuilder() *UpdateFeeAggregator { + nd := &UpdateFeeAggregator{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetFeeAggregator sets the "feeAggregator" parameter. +func (inst *UpdateFeeAggregator) SetFeeAggregator(feeAggregator ag_solanago.PublicKey) *UpdateFeeAggregator { + inst.FeeAggregator = &feeAggregator + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateFeeAggregator) SetConfigAccount(config ag_solanago.PublicKey) *UpdateFeeAggregator { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateFeeAggregator) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateFeeAggregator) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateFeeAggregator { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateFeeAggregator) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpdateFeeAggregator) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpdateFeeAggregator { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpdateFeeAggregator) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateFeeAggregator) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateFeeAggregator, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateFeeAggregator) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateFeeAggregator) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.FeeAggregator == nil { + return errors.New("FeeAggregator parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpdateFeeAggregator) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateFeeAggregator")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("FeeAggregator", *inst.FeeAggregator)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateFeeAggregator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `FeeAggregator` param: + err = encoder.Encode(obj.FeeAggregator) + if err != nil { + return err + } + return nil +} +func (obj *UpdateFeeAggregator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `FeeAggregator`: + err = decoder.Decode(&obj.FeeAggregator) + if err != nil { + return err + } + return nil +} + +// NewUpdateFeeAggregatorInstruction declares a new UpdateFeeAggregator instruction with the provided parameters and accounts. +func NewUpdateFeeAggregatorInstruction( + // Parameters: + feeAggregator ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpdateFeeAggregator { + return NewUpdateFeeAggregatorInstructionBuilder(). + SetFeeAggregator(feeAggregator). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator_test.go new file mode 100644 index 0000000000..df96554626 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateFeeAggregator_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateFeeAggregator(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateFeeAggregator"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateFeeAggregator) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateFeeAggregator) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote.go new file mode 100644 index 0000000000..0463a36de6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the RMN remote program in the router configuration. +// The Admin is the only one able to update the RMN remote program. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `rmn_remote,` - The new RMN remote address. +type UpdateRmnRemote struct { + RmnRemote *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateRmnRemoteInstructionBuilder creates a new `UpdateRmnRemote` instruction builder. +func NewUpdateRmnRemoteInstructionBuilder() *UpdateRmnRemote { + nd := &UpdateRmnRemote{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRmnRemote sets the "rmnRemote" parameter. +func (inst *UpdateRmnRemote) SetRmnRemote(rmnRemote ag_solanago.PublicKey) *UpdateRmnRemote { + inst.RmnRemote = &rmnRemote + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateRmnRemote) SetConfigAccount(config ag_solanago.PublicKey) *UpdateRmnRemote { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateRmnRemote) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateRmnRemote) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateRmnRemote { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateRmnRemote) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpdateRmnRemote) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpdateRmnRemote { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpdateRmnRemote) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateRmnRemote) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateRmnRemote, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateRmnRemote) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateRmnRemote) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnRemote == nil { + return errors.New("RmnRemote parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpdateRmnRemote) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateRmnRemote")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnRemote", *inst.RmnRemote)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateRmnRemote) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} +func (obj *UpdateRmnRemote) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +// NewUpdateRmnRemoteInstruction declares a new UpdateRmnRemote instruction with the provided parameters and accounts. +func NewUpdateRmnRemoteInstruction( + // Parameters: + rmnRemote ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpdateRmnRemote { + return NewUpdateRmnRemoteInstructionBuilder(). + SetRmnRemote(rmnRemote). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote_test.go new file mode 100644 index 0000000000..de90060db9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateRmnRemote_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateRmnRemote(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateRmnRemote"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateRmnRemote) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateRmnRemote) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector.go new file mode 100644 index 0000000000..9add09286e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the SVM chain selector in the router configuration. +// +// This method should only be used if there was an error with the initial configuration or if the solana chain selector changes. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `new_chain_selector` - The new chain selector for SVM. +type UpdateSvmChainSelector struct { + NewChainSelector *uint64 + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateSvmChainSelectorInstructionBuilder creates a new `UpdateSvmChainSelector` instruction builder. +func NewUpdateSvmChainSelectorInstructionBuilder() *UpdateSvmChainSelector { + nd := &UpdateSvmChainSelector{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetNewChainSelector sets the "newChainSelector" parameter. +func (inst *UpdateSvmChainSelector) SetNewChainSelector(newChainSelector uint64) *UpdateSvmChainSelector { + inst.NewChainSelector = &newChainSelector + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateSvmChainSelector) SetConfigAccount(config ag_solanago.PublicKey) *UpdateSvmChainSelector { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateSvmChainSelector) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateSvmChainSelector) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateSvmChainSelector { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateSvmChainSelector) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpdateSvmChainSelector) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpdateSvmChainSelector { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpdateSvmChainSelector) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateSvmChainSelector) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateSvmChainSelector, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateSvmChainSelector) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateSvmChainSelector) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewChainSelector == nil { + return errors.New("NewChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpdateSvmChainSelector) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateSvmChainSelector")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewChainSelector", *inst.NewChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateSvmChainSelector) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewChainSelector` param: + err = encoder.Encode(obj.NewChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *UpdateSvmChainSelector) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewChainSelector`: + err = decoder.Decode(&obj.NewChainSelector) + if err != nil { + return err + } + return nil +} + +// NewUpdateSvmChainSelectorInstruction declares a new UpdateSvmChainSelector instruction with the provided parameters and accounts. +func NewUpdateSvmChainSelectorInstruction( + // Parameters: + newChainSelector uint64, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpdateSvmChainSelector { + return NewUpdateSvmChainSelectorInstructionBuilder(). + SetNewChainSelector(newChainSelector). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector_test.go new file mode 100644 index 0000000000..dd98dda374 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpdateSvmChainSelector_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateSvmChainSelector(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateSvmChainSelector"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateSvmChainSelector) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateSvmChainSelector) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1.go new file mode 100644 index 0000000000..98c67e0014 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1.go @@ -0,0 +1,187 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Upgrades the Token Admin Registry from version 1 to the current version. +// +// Anyone may invoke this method, as the upgrade has safe defaults for any new value, +// and those can then be changed by the Token Admin Registry Admin via separate instructions. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the upgrade. +type UpgradeTokenAdminRegistryFromV1 struct { + + // [0] = [] config + // + // [1] = [WRITE] tokenAdminRegistry + // ··········· types Anchor would attempt to deserialize the data _before_ realloc'ing it, which would fail. + // ··········· The code will load it and realloc it to the new size manually, and migrate its data. + // + // [2] = [] mint + // + // [3] = [WRITE, SIGNER] authority + // + // [4] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpgradeTokenAdminRegistryFromV1InstructionBuilder creates a new `UpgradeTokenAdminRegistryFromV1` instruction builder. +func NewUpgradeTokenAdminRegistryFromV1InstructionBuilder() *UpgradeTokenAdminRegistryFromV1 { + nd := &UpgradeTokenAdminRegistryFromV1{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *UpgradeTokenAdminRegistryFromV1) SetConfigAccount(config ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpgradeTokenAdminRegistryFromV1) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenAdminRegistryAccount sets the "tokenAdminRegistry" account. +// types Anchor would attempt to deserialize the data _before_ realloc'ing it, which would fail. +// The code will load it and realloc it to the new size manually, and migrate its data. +func (inst *UpgradeTokenAdminRegistryFromV1) SetTokenAdminRegistryAccount(tokenAdminRegistry ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenAdminRegistry).WRITE() + return inst +} + +// GetTokenAdminRegistryAccount gets the "tokenAdminRegistry" account. +// types Anchor would attempt to deserialize the data _before_ realloc'ing it, which would fail. +// The code will load it and realloc it to the new size manually, and migrate its data. +func (inst *UpgradeTokenAdminRegistryFromV1) GetTokenAdminRegistryAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *UpgradeTokenAdminRegistryFromV1) SetMintAccount(mint ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *UpgradeTokenAdminRegistryFromV1) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpgradeTokenAdminRegistryFromV1) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpgradeTokenAdminRegistryFromV1) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpgradeTokenAdminRegistryFromV1) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + inst.AccountMetaSlice[4] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpgradeTokenAdminRegistryFromV1) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst UpgradeTokenAdminRegistryFromV1) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpgradeTokenAdminRegistryFromV1, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpgradeTokenAdminRegistryFromV1) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpgradeTokenAdminRegistryFromV1) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenAdminRegistry is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpgradeTokenAdminRegistryFromV1) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpgradeTokenAdminRegistryFromV1")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenAdminRegistry", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj UpgradeTokenAdminRegistryFromV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *UpgradeTokenAdminRegistryFromV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewUpgradeTokenAdminRegistryFromV1Instruction declares a new UpgradeTokenAdminRegistryFromV1 instruction with the provided parameters and accounts. +func NewUpgradeTokenAdminRegistryFromV1Instruction( + // Accounts: + config ag_solanago.PublicKey, + tokenAdminRegistry ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpgradeTokenAdminRegistryFromV1 { + return NewUpgradeTokenAdminRegistryFromV1InstructionBuilder(). + SetConfigAccount(config). + SetTokenAdminRegistryAccount(tokenAdminRegistry). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1_test.go new file mode 100644 index 0000000000..34a23bb29f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/UpgradeTokenAdminRegistryFromV1_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpgradeTokenAdminRegistryFromV1(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpgradeTokenAdminRegistryFromV1"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpgradeTokenAdminRegistryFromV1) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpgradeTokenAdminRegistryFromV1) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds.go b/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds.go new file mode 100644 index 0000000000..46a2774870 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds.go @@ -0,0 +1,272 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Billing // +// Transfers the accumulated billed fees in a particular token to an arbitrary token account. +// Only the CCIP Admin can withdraw billed funds. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer of billed fees. +// * `transfer_all` - A flag indicating whether to transfer all the accumulated fees in that token or not. +// * `desired_amount` - The amount to transfer. If `transfer_all` is true, this value must be 0. +type WithdrawBilledFunds struct { + TransferAll *bool + DesiredAmount *uint64 + + // [0] = [] feeTokenMint + // + // [1] = [WRITE] feeTokenAccum + // + // [2] = [WRITE] recipient + // + // [3] = [] tokenProgram + // + // [4] = [] feeBillingSigner + // + // [5] = [] config + // + // [6] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewWithdrawBilledFundsInstructionBuilder creates a new `WithdrawBilledFunds` instruction builder. +func NewWithdrawBilledFundsInstructionBuilder() *WithdrawBilledFunds { + nd := &WithdrawBilledFunds{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetTransferAll sets the "transferAll" parameter. +func (inst *WithdrawBilledFunds) SetTransferAll(transferAll bool) *WithdrawBilledFunds { + inst.TransferAll = &transferAll + return inst +} + +// SetDesiredAmount sets the "desiredAmount" parameter. +func (inst *WithdrawBilledFunds) SetDesiredAmount(desiredAmount uint64) *WithdrawBilledFunds { + inst.DesiredAmount = &desiredAmount + return inst +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *WithdrawBilledFunds) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[0] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *WithdrawBilledFunds) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetFeeTokenAccumAccount sets the "feeTokenAccum" account. +func (inst *WithdrawBilledFunds) SetFeeTokenAccumAccount(feeTokenAccum ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[1] = ag_solanago.Meta(feeTokenAccum).WRITE() + return inst +} + +// GetFeeTokenAccumAccount gets the "feeTokenAccum" account. +func (inst *WithdrawBilledFunds) GetFeeTokenAccumAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetRecipientAccount sets the "recipient" account. +func (inst *WithdrawBilledFunds) SetRecipientAccount(recipient ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[2] = ag_solanago.Meta(recipient).WRITE() + return inst +} + +// GetRecipientAccount gets the "recipient" account. +func (inst *WithdrawBilledFunds) GetRecipientAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *WithdrawBilledFunds) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *WithdrawBilledFunds) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *WithdrawBilledFunds) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *WithdrawBilledFunds) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetConfigAccount sets the "config" account. +func (inst *WithdrawBilledFunds) SetConfigAccount(config ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[5] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *WithdrawBilledFunds) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *WithdrawBilledFunds) SetAuthorityAccount(authority ag_solanago.PublicKey) *WithdrawBilledFunds { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *WithdrawBilledFunds) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst WithdrawBilledFunds) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_WithdrawBilledFunds, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst WithdrawBilledFunds) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *WithdrawBilledFunds) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TransferAll == nil { + return errors.New("TransferAll parameter is not set") + } + if inst.DesiredAmount == nil { + return errors.New("DesiredAmount parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.FeeTokenAccum is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Recipient is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *WithdrawBilledFunds) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("WithdrawBilledFunds")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" TransferAll", *inst.TransferAll)) + paramsBranch.Child(ag_format.Param("DesiredAmount", *inst.DesiredAmount)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" feeTokenAccum", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" recipient", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("feeBillingSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj WithdrawBilledFunds) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TransferAll` param: + err = encoder.Encode(obj.TransferAll) + if err != nil { + return err + } + // Serialize `DesiredAmount` param: + err = encoder.Encode(obj.DesiredAmount) + if err != nil { + return err + } + return nil +} +func (obj *WithdrawBilledFunds) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TransferAll`: + err = decoder.Decode(&obj.TransferAll) + if err != nil { + return err + } + // Deserialize `DesiredAmount`: + err = decoder.Decode(&obj.DesiredAmount) + if err != nil { + return err + } + return nil +} + +// NewWithdrawBilledFundsInstruction declares a new WithdrawBilledFunds instruction with the provided parameters and accounts. +func NewWithdrawBilledFundsInstruction( + // Parameters: + transferAll bool, + desiredAmount uint64, + // Accounts: + feeTokenMint ag_solanago.PublicKey, + feeTokenAccum ag_solanago.PublicKey, + recipient ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *WithdrawBilledFunds { + return NewWithdrawBilledFundsInstructionBuilder(). + SetTransferAll(transferAll). + SetDesiredAmount(desiredAmount). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenAccumAccount(feeTokenAccum). + SetRecipientAccount(recipient). + SetTokenProgramAccount(tokenProgram). + SetFeeBillingSignerAccount(feeBillingSigner). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds_test.go b/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds_test.go new file mode 100644 index 0000000000..3969dac23b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/WithdrawBilledFunds_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_WithdrawBilledFunds(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("WithdrawBilledFunds"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(WithdrawBilledFunds) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(WithdrawBilledFunds) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/accounts.go b/chains/solana/gobindings/v1_6_1/ccip_router/accounts.go new file mode 100644 index 0000000000..f8a20b48e7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/accounts.go @@ -0,0 +1,308 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type AllowedOfframp struct{} + +var AllowedOfframpDiscriminator = [8]byte{247, 97, 179, 16, 207, 36, 236, 132} + +func (obj AllowedOfframp) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(AllowedOfframpDiscriminator[:], false) + if err != nil { + return err + } + return nil +} + +func (obj *AllowedOfframp) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(AllowedOfframpDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[247 97 179 16 207 36 236 132]", + fmt.Sprint(discriminator[:])) + } + } + return nil +} + +type Config struct { + Version uint8 + DefaultCodeVersion CodeVersion + SvmChainSelector uint64 + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + FeeQuoter ag_solanago.PublicKey + RmnRemote ag_solanago.PublicKey + LinkTokenMint ag_solanago.PublicKey + FeeAggregator ag_solanago.PublicKey +} + +var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} + +func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `DefaultCodeVersion` param: + err = encoder.Encode(obj.DefaultCodeVersion) + if err != nil { + return err + } + // Serialize `SvmChainSelector` param: + err = encoder.Encode(obj.SvmChainSelector) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `FeeQuoter` param: + err = encoder.Encode(obj.FeeQuoter) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + // Serialize `LinkTokenMint` param: + err = encoder.Encode(obj.LinkTokenMint) + if err != nil { + return err + } + // Serialize `FeeAggregator` param: + err = encoder.Encode(obj.FeeAggregator) + if err != nil { + return err + } + return nil +} + +func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[155 12 170 224 30 250 204 130]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `DefaultCodeVersion`: + err = decoder.Decode(&obj.DefaultCodeVersion) + if err != nil { + return err + } + // Deserialize `SvmChainSelector`: + err = decoder.Decode(&obj.SvmChainSelector) + if err != nil { + return err + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `FeeQuoter`: + err = decoder.Decode(&obj.FeeQuoter) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + // Deserialize `LinkTokenMint`: + err = decoder.Decode(&obj.LinkTokenMint) + if err != nil { + return err + } + // Deserialize `FeeAggregator`: + err = decoder.Decode(&obj.FeeAggregator) + if err != nil { + return err + } + return nil +} + +type DestChain struct { + Version uint8 + ChainSelector uint64 + State DestChainState + Config DestChainConfig +} + +var DestChainDiscriminator = [8]byte{77, 18, 241, 132, 212, 54, 218, 16} + +func (obj DestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(DestChainDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `State` param: + err = encoder.Encode(obj.State) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *DestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(DestChainDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[77 18 241 132 212 54 218 16]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `State`: + err = decoder.Decode(&obj.State) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type Nonce struct { + Version uint8 + OrderedNonce uint64 + TotalNonce uint64 +} + +var NonceDiscriminator = [8]byte{143, 197, 147, 95, 106, 165, 50, 43} + +func (obj Nonce) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(NonceDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `OrderedNonce` param: + err = encoder.Encode(obj.OrderedNonce) + if err != nil { + return err + } + // Serialize `TotalNonce` param: + err = encoder.Encode(obj.TotalNonce) + if err != nil { + return err + } + return nil +} + +func (obj *Nonce) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(NonceDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[143 197 147 95 106 165 50 43]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `OrderedNonce`: + err = decoder.Decode(&obj.OrderedNonce) + if err != nil { + return err + } + // Deserialize `TotalNonce`: + err = decoder.Decode(&obj.TotalNonce) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/instructions.go b/chains/solana/gobindings/v1_6_1/ccip_router/instructions.go new file mode 100644 index 0000000000..b1e1f2947e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/instructions.go @@ -0,0 +1,578 @@ +// The `ccip_router` module contains the implementation of the Cross-Chain Interoperability Protocol (CCIP) Router. +// +// This is the Collapsed Router Program for CCIP. +// As it's upgradable persisting the same program id, there is no need to have an indirection of a Proxy Program. +// This Router handles the OnRamp flow of the CCIP Messages. +// +// NOTE to devs: This file however should contain *no logic*, only the entrypoints to the different versioned modules, +// thus making it easier to ensure later on that logic can be changed during upgrades without affecting the interface. +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "CcipRouter" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + // Initialization Flow // + // Initializes the CCIP Router. + // + // The initialization of the Router is responsibility of Admin, nothing more than calling this method should be done first. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for initialization. + // * `svm_chain_selector` - The chain selector for SVM. + // * `fee_aggregator` - The public key of the fee aggregator. + // * `fee_quoter` - The public key of the fee quoter. + // * `link_token_mint` - The public key of the LINK token mint. + // * `rmn_remote` - The public key of the RMN remote. + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + // Transfers the ownership of the router to a new proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer. + // * `proposed_owner` - The public key of the new proposed owner. + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + // Accepts the ownership of the router by the proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for accepting ownership. + // The new owner must be a signer of the transaction. + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + // Config // + // Sets the default code version to be used. This is then used by the slim routing layer to determine + // which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `code_version` - The new code version to be set as default. + Instruction_SetDefaultCodeVersion = ag_binary.TypeID([8]byte{47, 151, 233, 254, 121, 82, 206, 152}) + + // Sets the address of the LINK token mint. + // The Admin is the only one able to set it. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `link_token_mint` - The new address of the LINK token mint. + Instruction_SetLinkTokenMint = ag_binary.TypeID([8]byte{190, 216, 49, 254, 200, 81, 12, 17}) + + // Updates the fee aggregator in the router configuration. + // The Admin is the only one able to update the fee aggregator. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `fee_aggregator` - The new fee aggregator address (ATAs will be derived for it for each token). + Instruction_UpdateFeeAggregator = ag_binary.TypeID([8]byte{85, 112, 115, 60, 22, 95, 230, 56}) + + // Updates the RMN remote program in the router configuration. + // The Admin is the only one able to update the RMN remote program. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `rmn_remote,` - The new RMN remote address. + Instruction_UpdateRmnRemote = ag_binary.TypeID([8]byte{66, 12, 215, 147, 14, 176, 55, 214}) + + // Adds a new chain selector to the router. + // + // The Admin needs to add any new chain supported (this means both OnRamp and OffRamp). + // When adding a new chain, the Admin needs to specify if it's enabled or not. + // They may enable only source, or only destination, or neither, or both. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for adding the chain selector. + // * `new_chain_selector` - The new chain selector to be added. + // * `source_chain_config` - The configuration for the chain as source. + // * `dest_chain_config` - The configuration for the chain as destination. + Instruction_AddChainSelector = ag_binary.TypeID([8]byte{28, 60, 171, 0, 195, 113, 56, 7}) + + // Updates the configuration of the destination chain selector. + // + // The Admin is the only one able to update the destination chain config. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the chain selector. + // * `dest_chain_selector` - The destination chain selector to be updated. + // * `dest_chain_config` - The new configuration for the destination chain. + Instruction_UpdateDestChainConfig = ag_binary.TypeID([8]byte{215, 122, 81, 22, 190, 58, 219, 13}) + + // Add an offramp address to the list of offramps allowed by the router, for a + // particular source chain. External users will check this list before accepting + // a `ccip_receive` CPI. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for this operation. + // * `source_chain_selector` - The source chain for the offramp's lane. + // * `offramp` - The offramp's address. + Instruction_AddOfframp = ag_binary.TypeID([8]byte{164, 255, 154, 96, 204, 239, 24, 2}) + + // Remove an offramp address from the list of offramps allowed by the router, for a + // particular source chain. External users will check this list before accepting + // a `ccip_receive` CPI. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for this operation. + // * `source_chain_selector` - The source chain for the offramp's lane. + // * `offramp` - The offramp's address. + Instruction_RemoveOfframp = ag_binary.TypeID([8]byte{252, 152, 51, 170, 241, 13, 199, 8}) + + // Updates the SVM chain selector in the router configuration. + // + // This method should only be used if there was an error with the initial configuration or if the solana chain selector changes. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `new_chain_selector` - The new chain selector for SVM. + Instruction_UpdateSvmChainSelector = ag_binary.TypeID([8]byte{164, 212, 71, 101, 166, 113, 26, 93}) + + // Bumps the CCIP version for a destination chain. + // This effectively just resets the sequence number of the destination chain state. + // If there had been a previous rollback, on re-upgrade the sequence number will resume from where it was + // prior to the rollback. + // + // # Arguments + // * `ctx` - The context containing the accounts required for the bump. + // * `dest_chain_selector` - The destination chain selector to bump version for. + Instruction_BumpCcipVersionForDestChain = ag_binary.TypeID([8]byte{120, 25, 6, 201, 42, 224, 235, 187}) + + // Rolls back the CCIP version for a destination chain. + // This effectively just restores the old version's sequence number of the destination chain state. + // We only support 1 consecutive rollback. If a rollback has occurred for that lane, the version can't + // be rolled back again without bumping the version first. + // + // # Arguments + // * `ctx` - The context containing the accounts required for the rollback. + // * `dest_chain_selector` - The destination chain selector to rollback the version for. + Instruction_RollbackCcipVersionForDestChain = ag_binary.TypeID([8]byte{95, 107, 33, 138, 26, 57, 154, 110}) + + // Token Admin Registry // + // Registers the Token Admin Registry via the CCIP Admin + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for registration. + // * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. + Instruction_CcipAdminProposeAdministrator = ag_binary.TypeID([8]byte{218, 37, 139, 107, 142, 228, 51, 219}) + + // Overrides the pending admin of the Token Admin Registry + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for registration. + // * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. + Instruction_CcipAdminOverridePendingAdministrator = ag_binary.TypeID([8]byte{163, 206, 164, 199, 248, 92, 36, 46}) + + // Registers the Token Admin Registry by the token owner. + // + // The Authority of the Mint Token can claim the registry of the token. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for registration. + // * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. + Instruction_OwnerProposeAdministrator = ag_binary.TypeID([8]byte{175, 81, 160, 246, 206, 132, 18, 22}) + + // Overrides the pending admin of the Token Admin Registry by the token owner + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for registration. + // * `token_admin_registry_admin` - The public key of the token admin registry admin to propose. + Instruction_OwnerOverridePendingAdministrator = ag_binary.TypeID([8]byte{230, 111, 134, 149, 203, 168, 118, 201}) + + // Accepts the admin role of the token admin registry. + // + // The Pending Admin must call this function to accept the admin role of the Token Admin Registry. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for accepting the admin role. + // * `mint` - The public key of the token mint. + Instruction_AcceptAdminRoleTokenAdminRegistry = ag_binary.TypeID([8]byte{106, 240, 16, 173, 137, 213, 163, 246}) + + // Transfers the admin role of the token admin registry to a new admin. + // + // Only the Admin can transfer the Admin Role of the Token Admin Registry, this setups the Pending Admin and then it's their responsibility to accept the role. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer. + // * `mint` - The public key of the token mint. + // * `new_admin` - The public key of the new admin. + Instruction_TransferAdminRoleTokenAdminRegistry = ag_binary.TypeID([8]byte{178, 98, 203, 181, 203, 107, 106, 14}) + + // Edits the pool config flags for a given token mint. + // + // The administrator of the token admin registry is the only one allowed to invoke this. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for setting the pool. + // * `mint` - The mint of the pool to be edited. + // * `supports_auto_derivation` - A boolean flag indicating whether the pool supports auto-derivation of accounts. + Instruction_SetPoolSupportsAutoDerivation = ag_binary.TypeID([8]byte{197, 227, 67, 153, 75, 20, 234, 139}) + + // Upgrades the Token Admin Registry from version 1 to the current version. + // + // Anyone may invoke this method, as the upgrade has safe defaults for any new value, + // and those can then be changed by the Token Admin Registry Admin via separate instructions. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the upgrade. + Instruction_UpgradeTokenAdminRegistryFromV1 = ag_binary.TypeID([8]byte{124, 26, 79, 44, 190, 150, 213, 49}) + + // Sets the pool lookup table for a given token mint. + // + // The administrator of the token admin registry can set the pool lookup table for a given token mint. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for setting the pool. + // * `writable_indexes` - a bit map of the indexes of the accounts in lookup table that are writable + Instruction_SetPool = ag_binary.TypeID([8]byte{119, 30, 14, 180, 115, 225, 167, 238}) + + // Billing // + // Transfers the accumulated billed fees in a particular token to an arbitrary token account. + // Only the CCIP Admin can withdraw billed funds. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer of billed fees. + // * `transfer_all` - A flag indicating whether to transfer all the accumulated fees in that token or not. + // * `desired_amount` - The amount to transfer. If `transfer_all` is true, this value must be 0. + Instruction_WithdrawBilledFunds = ag_binary.TypeID([8]byte{16, 116, 73, 38, 77, 232, 6, 28}) + + // On Ramp Flow // + // Sends a message to the destination chain. + // + // Request a message to be sent to the destination chain. + // The method name needs to be ccip_send with Anchor encoding. + // This function is called by the CCIP Sender Contract (or final user) to send a message to the CCIP Router. + // The message will be sent to the receiver on the destination chain selector. + // This message emits the event CCIPMessageSent with all the necessary data to be retrieved by the OffChain Code + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for sending the message. + // * `dest_chain_selector` - The chain selector for the destination chain. + // * `message` - The message to be sent. The size limit of data is 256 bytes. + // * `token_indexes` - Indices into the remaining accounts vector where the subslice for a token begins. + Instruction_CcipSend = ag_binary.TypeID([8]byte{108, 216, 134, 191, 249, 234, 33, 84}) + + // Queries the onramp for the fee required to send a message. + // + // This call is permissionless. Note it does not verify whether there's a curse active + // in order to avoid the RMN CPI overhead. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for obtaining the message fee. + // * `dest_chain_selector` - The chain selector for the destination chain. + // * `message` - The message to be sent. The size limit of data is 256 bytes. + Instruction_GetFee = ag_binary.TypeID([8]byte{115, 195, 235, 161, 25, 219, 60, 29}) + + // Automatically derives all accounts required to call `ccip_send`. + // + // This method receives the bare minimum amount of information needed to construct + // the entire account list to send a transaction, and builds it iteratively + // over the course of multiple calls. + // + // The return type contains: + // + // * `accounts_to_save`: The caller must append these accounts to a list they maintain. + // When complete, this list will contain all accounts needed to call `ccip_send`. + // * `ask_again_with`: When `next_stage` is not empty, the caller must call `derive_accounts_ccip_send` + // again, including exactly these accounts as the `remaining_accounts`. + // * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_send`. + // * `current_stage`: A string describing the current stage of the derivation process. When the stage + // is "TokenTransferStaticAccounts//0", it means the `accounts_to_save` block in this response contains + // all accounts relating to the Nth token being transferred. Use this information to construct + // the `token_indexes` vector that `ccip_send` requires. + // * `next_stage`: If nonempty, this means the instruction must get called again with this value + // as the `stage` argument. + // + // Therefore, and starting with an empty `remaining_accounts` list, the caller must repeatedly + // call `derive_accounts_ccip_send` until `next_stage` is returned empty. + // + // # Arguments + // + // * `ctx`: Context containing only the config. + // * `stage`: Requested derivation stage. Pass "Start" the first time, then for each subsequent + // call, pass the value returned in `response.next_stage` until empty. + // * `params`: + // * `ccip_send_caller`: Public key of the account that will sign the call to `ccip_send`. + // * `dest_chain_selector`: CCIP chain selector for the dest chain. + // * `fee_token_mint`: The mint address for the token used for fees. Pubkey::default() if native SOL. + // * `mints_of_transferred_token`: List of all token mints for tokens being transferred. + Instruction_DeriveAccountsCcipSend = ag_binary.TypeID([8]byte{251, 176, 50, 26, 193, 231, 156, 242}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetDefaultCodeVersion: + return "SetDefaultCodeVersion" + case Instruction_SetLinkTokenMint: + return "SetLinkTokenMint" + case Instruction_UpdateFeeAggregator: + return "UpdateFeeAggregator" + case Instruction_UpdateRmnRemote: + return "UpdateRmnRemote" + case Instruction_AddChainSelector: + return "AddChainSelector" + case Instruction_UpdateDestChainConfig: + return "UpdateDestChainConfig" + case Instruction_AddOfframp: + return "AddOfframp" + case Instruction_RemoveOfframp: + return "RemoveOfframp" + case Instruction_UpdateSvmChainSelector: + return "UpdateSvmChainSelector" + case Instruction_BumpCcipVersionForDestChain: + return "BumpCcipVersionForDestChain" + case Instruction_RollbackCcipVersionForDestChain: + return "RollbackCcipVersionForDestChain" + case Instruction_CcipAdminProposeAdministrator: + return "CcipAdminProposeAdministrator" + case Instruction_CcipAdminOverridePendingAdministrator: + return "CcipAdminOverridePendingAdministrator" + case Instruction_OwnerProposeAdministrator: + return "OwnerProposeAdministrator" + case Instruction_OwnerOverridePendingAdministrator: + return "OwnerOverridePendingAdministrator" + case Instruction_AcceptAdminRoleTokenAdminRegistry: + return "AcceptAdminRoleTokenAdminRegistry" + case Instruction_TransferAdminRoleTokenAdminRegistry: + return "TransferAdminRoleTokenAdminRegistry" + case Instruction_SetPoolSupportsAutoDerivation: + return "SetPoolSupportsAutoDerivation" + case Instruction_UpgradeTokenAdminRegistryFromV1: + return "UpgradeTokenAdminRegistryFromV1" + case Instruction_SetPool: + return "SetPool" + case Instruction_WithdrawBilledFunds: + return "WithdrawBilledFunds" + case Instruction_CcipSend: + return "CcipSend" + case Instruction_GetFee: + return "GetFee" + case Instruction_DeriveAccountsCcipSend: + return "DeriveAccountsCcipSend" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_default_code_version", (*SetDefaultCodeVersion)(nil), + }, + { + "set_link_token_mint", (*SetLinkTokenMint)(nil), + }, + { + "update_fee_aggregator", (*UpdateFeeAggregator)(nil), + }, + { + "update_rmn_remote", (*UpdateRmnRemote)(nil), + }, + { + "add_chain_selector", (*AddChainSelector)(nil), + }, + { + "update_dest_chain_config", (*UpdateDestChainConfig)(nil), + }, + { + "add_offramp", (*AddOfframp)(nil), + }, + { + "remove_offramp", (*RemoveOfframp)(nil), + }, + { + "update_svm_chain_selector", (*UpdateSvmChainSelector)(nil), + }, + { + "bump_ccip_version_for_dest_chain", (*BumpCcipVersionForDestChain)(nil), + }, + { + "rollback_ccip_version_for_dest_chain", (*RollbackCcipVersionForDestChain)(nil), + }, + { + "ccip_admin_propose_administrator", (*CcipAdminProposeAdministrator)(nil), + }, + { + "ccip_admin_override_pending_administrator", (*CcipAdminOverridePendingAdministrator)(nil), + }, + { + "owner_propose_administrator", (*OwnerProposeAdministrator)(nil), + }, + { + "owner_override_pending_administrator", (*OwnerOverridePendingAdministrator)(nil), + }, + { + "accept_admin_role_token_admin_registry", (*AcceptAdminRoleTokenAdminRegistry)(nil), + }, + { + "transfer_admin_role_token_admin_registry", (*TransferAdminRoleTokenAdminRegistry)(nil), + }, + { + "set_pool_supports_auto_derivation", (*SetPoolSupportsAutoDerivation)(nil), + }, + { + "upgrade_token_admin_registry_from_v1", (*UpgradeTokenAdminRegistryFromV1)(nil), + }, + { + "set_pool", (*SetPool)(nil), + }, + { + "withdraw_billed_funds", (*WithdrawBilledFunds)(nil), + }, + { + "ccip_send", (*CcipSend)(nil), + }, + { + "get_fee", (*GetFee)(nil), + }, + { + "derive_accounts_ccip_send", (*DeriveAccountsCcipSend)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/testing_utils.go b/chains/solana/gobindings/v1_6_1/ccip_router/testing_utils.go new file mode 100644 index 0000000000..aaecdf49ba --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/ccip_router/types.go b/chains/solana/gobindings/v1_6_1/ccip_router/types.go new file mode 100644 index 0000000000..44bcc70fb7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ccip_router/types.go @@ -0,0 +1,841 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ccip_router + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type RampMessageHeader struct { + MessageId [32]uint8 + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +func (obj RampMessageHeader) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MessageId` param: + err = encoder.Encode(obj.MessageId) + if err != nil { + return err + } + // Serialize `SourceChainSelector` param: + err = encoder.Encode(obj.SourceChainSelector) + if err != nil { + return err + } + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `SequenceNumber` param: + err = encoder.Encode(obj.SequenceNumber) + if err != nil { + return err + } + // Serialize `Nonce` param: + err = encoder.Encode(obj.Nonce) + if err != nil { + return err + } + return nil +} + +func (obj *RampMessageHeader) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MessageId`: + err = decoder.Decode(&obj.MessageId) + if err != nil { + return err + } + // Deserialize `SourceChainSelector`: + err = decoder.Decode(&obj.SourceChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `SequenceNumber`: + err = decoder.Decode(&obj.SequenceNumber) + if err != nil { + return err + } + // Deserialize `Nonce`: + err = decoder.Decode(&obj.Nonce) + if err != nil { + return err + } + return nil +} + +type SVM2AnyRampMessage struct { + Header RampMessageHeader + Sender ag_solanago.PublicKey + Data []byte + Receiver []byte + ExtraArgs []byte + FeeToken ag_solanago.PublicKey + TokenAmounts []SVM2AnyTokenTransfer + FeeTokenAmount CrossChainAmount + FeeValueJuels CrossChainAmount +} + +func (obj SVM2AnyRampMessage) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Header` param: + err = encoder.Encode(obj.Header) + if err != nil { + return err + } + // Serialize `Sender` param: + err = encoder.Encode(obj.Sender) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + // Serialize `Receiver` param: + err = encoder.Encode(obj.Receiver) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + // Serialize `FeeToken` param: + err = encoder.Encode(obj.FeeToken) + if err != nil { + return err + } + // Serialize `TokenAmounts` param: + err = encoder.Encode(obj.TokenAmounts) + if err != nil { + return err + } + // Serialize `FeeTokenAmount` param: + err = encoder.Encode(obj.FeeTokenAmount) + if err != nil { + return err + } + // Serialize `FeeValueJuels` param: + err = encoder.Encode(obj.FeeValueJuels) + if err != nil { + return err + } + return nil +} + +func (obj *SVM2AnyRampMessage) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Header`: + err = decoder.Decode(&obj.Header) + if err != nil { + return err + } + // Deserialize `Sender`: + err = decoder.Decode(&obj.Sender) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + // Deserialize `Receiver`: + err = decoder.Decode(&obj.Receiver) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + // Deserialize `FeeToken`: + err = decoder.Decode(&obj.FeeToken) + if err != nil { + return err + } + // Deserialize `TokenAmounts`: + err = decoder.Decode(&obj.TokenAmounts) + if err != nil { + return err + } + // Deserialize `FeeTokenAmount`: + err = decoder.Decode(&obj.FeeTokenAmount) + if err != nil { + return err + } + // Deserialize `FeeValueJuels`: + err = decoder.Decode(&obj.FeeValueJuels) + if err != nil { + return err + } + return nil +} + +type SVM2AnyTokenTransfer struct { + SourcePoolAddress ag_solanago.PublicKey + DestTokenAddress []byte + ExtraData []byte + Amount CrossChainAmount + DestExecData []byte +} + +func (obj SVM2AnyTokenTransfer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourcePoolAddress` param: + err = encoder.Encode(obj.SourcePoolAddress) + if err != nil { + return err + } + // Serialize `DestTokenAddress` param: + err = encoder.Encode(obj.DestTokenAddress) + if err != nil { + return err + } + // Serialize `ExtraData` param: + err = encoder.Encode(obj.ExtraData) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `DestExecData` param: + err = encoder.Encode(obj.DestExecData) + if err != nil { + return err + } + return nil +} + +func (obj *SVM2AnyTokenTransfer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourcePoolAddress`: + err = decoder.Decode(&obj.SourcePoolAddress) + if err != nil { + return err + } + // Deserialize `DestTokenAddress`: + err = decoder.Decode(&obj.DestTokenAddress) + if err != nil { + return err + } + // Deserialize `ExtraData`: + err = decoder.Decode(&obj.ExtraData) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `DestExecData`: + err = decoder.Decode(&obj.DestExecData) + if err != nil { + return err + } + return nil +} + +type SVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []SVMTokenAmount + FeeToken ag_solanago.PublicKey + ExtraArgs []byte +} + +func (obj SVM2AnyMessage) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Receiver` param: + err = encoder.Encode(obj.Receiver) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + // Serialize `TokenAmounts` param: + err = encoder.Encode(obj.TokenAmounts) + if err != nil { + return err + } + // Serialize `FeeToken` param: + err = encoder.Encode(obj.FeeToken) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +func (obj *SVM2AnyMessage) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Receiver`: + err = decoder.Decode(&obj.Receiver) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + // Deserialize `TokenAmounts`: + err = decoder.Decode(&obj.TokenAmounts) + if err != nil { + return err + } + // Deserialize `FeeToken`: + err = decoder.Decode(&obj.FeeToken) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +type SVMTokenAmount struct { + Token ag_solanago.PublicKey + Amount uint64 +} + +func (obj SVMTokenAmount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} + +func (obj *SVMTokenAmount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +type CrossChainAmount struct { + LeBytes [32]uint8 +} + +func (obj CrossChainAmount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LeBytes` param: + err = encoder.Encode(obj.LeBytes) + if err != nil { + return err + } + return nil +} + +func (obj *CrossChainAmount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LeBytes`: + err = decoder.Decode(&obj.LeBytes) + if err != nil { + return err + } + return nil +} + +type GetFeeResult struct { + Amount uint64 + Juels ag_binary.Uint128 + Token ag_solanago.PublicKey +} + +func (obj GetFeeResult) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `Juels` param: + err = encoder.Encode(obj.Juels) + if err != nil { + return err + } + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + return nil +} + +func (obj *GetFeeResult) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `Juels`: + err = decoder.Decode(&obj.Juels) + if err != nil { + return err + } + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + return nil +} + +type DestChainState struct { + SequenceNumber uint64 + SequenceNumberToRestore uint64 + RestoreOnAction RestoreOnAction +} + +func (obj DestChainState) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SequenceNumber` param: + err = encoder.Encode(obj.SequenceNumber) + if err != nil { + return err + } + // Serialize `SequenceNumberToRestore` param: + err = encoder.Encode(obj.SequenceNumberToRestore) + if err != nil { + return err + } + // Serialize `RestoreOnAction` param: + err = encoder.Encode(obj.RestoreOnAction) + if err != nil { + return err + } + return nil +} + +func (obj *DestChainState) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SequenceNumber`: + err = decoder.Decode(&obj.SequenceNumber) + if err != nil { + return err + } + // Deserialize `SequenceNumberToRestore`: + err = decoder.Decode(&obj.SequenceNumberToRestore) + if err != nil { + return err + } + // Deserialize `RestoreOnAction`: + err = decoder.Decode(&obj.RestoreOnAction) + if err != nil { + return err + } + return nil +} + +type DestChainConfig struct { + LaneCodeVersion CodeVersion + AllowedSenders []ag_solanago.PublicKey + AllowListEnabled bool +} + +func (obj DestChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LaneCodeVersion` param: + err = encoder.Encode(obj.LaneCodeVersion) + if err != nil { + return err + } + // Serialize `AllowedSenders` param: + err = encoder.Encode(obj.AllowedSenders) + if err != nil { + return err + } + // Serialize `AllowListEnabled` param: + err = encoder.Encode(obj.AllowListEnabled) + if err != nil { + return err + } + return nil +} + +func (obj *DestChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LaneCodeVersion`: + err = decoder.Decode(&obj.LaneCodeVersion) + if err != nil { + return err + } + // Deserialize `AllowedSenders`: + err = decoder.Decode(&obj.AllowedSenders) + if err != nil { + return err + } + // Deserialize `AllowListEnabled`: + err = decoder.Decode(&obj.AllowListEnabled) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsResponse struct { + // If this vector is not empty, you must call the `derive_` method again including + // exactly these accounts as the `remaining_accounts` field. + AskAgainWith []CcipAccountMeta + + // You must append these accounts at the end of a separate list. When `next_stage` + // is finally empty, this separate list will contain all the accounts to use for the + // instruction of interest. + AccountsToSave []CcipAccountMeta + + // Append these look up tables at the end of a list. It will contain all LUTs + // that the instruction of interest can use. + LookUpTablesToSave []ag_solanago.PublicKey + + // Identifies the derivation stage. + CurrentStage string + + // Identifies the next derivation stage. If empty, the derivation is complete. + NextStage string +} + +func (obj DeriveAccountsResponse) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `AskAgainWith` param: + err = encoder.Encode(obj.AskAgainWith) + if err != nil { + return err + } + // Serialize `AccountsToSave` param: + err = encoder.Encode(obj.AccountsToSave) + if err != nil { + return err + } + // Serialize `LookUpTablesToSave` param: + err = encoder.Encode(obj.LookUpTablesToSave) + if err != nil { + return err + } + // Serialize `CurrentStage` param: + err = encoder.Encode(obj.CurrentStage) + if err != nil { + return err + } + // Serialize `NextStage` param: + err = encoder.Encode(obj.NextStage) + if err != nil { + return err + } + return nil +} + +func (obj *DeriveAccountsResponse) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `AskAgainWith`: + err = decoder.Decode(&obj.AskAgainWith) + if err != nil { + return err + } + // Deserialize `AccountsToSave`: + err = decoder.Decode(&obj.AccountsToSave) + if err != nil { + return err + } + // Deserialize `LookUpTablesToSave`: + err = decoder.Decode(&obj.LookUpTablesToSave) + if err != nil { + return err + } + // Deserialize `CurrentStage`: + err = decoder.Decode(&obj.CurrentStage) + if err != nil { + return err + } + // Deserialize `NextStage`: + err = decoder.Decode(&obj.NextStage) + if err != nil { + return err + } + return nil +} + +type CcipAccountMeta struct { + Pubkey ag_solanago.PublicKey + IsSigner bool + IsWritable bool +} + +func (obj CcipAccountMeta) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Pubkey` param: + err = encoder.Encode(obj.Pubkey) + if err != nil { + return err + } + // Serialize `IsSigner` param: + err = encoder.Encode(obj.IsSigner) + if err != nil { + return err + } + // Serialize `IsWritable` param: + err = encoder.Encode(obj.IsWritable) + if err != nil { + return err + } + return nil +} + +func (obj *CcipAccountMeta) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Pubkey`: + err = decoder.Decode(&obj.Pubkey) + if err != nil { + return err + } + // Deserialize `IsSigner`: + err = decoder.Decode(&obj.IsSigner) + if err != nil { + return err + } + // Deserialize `IsWritable`: + err = decoder.Decode(&obj.IsWritable) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsCcipSendParams struct { + DestChainSelector uint64 + CcipSendCaller ag_solanago.PublicKey + Message SVM2AnyMessage +} + +func (obj DeriveAccountsCcipSendParams) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `CcipSendCaller` param: + err = encoder.Encode(obj.CcipSendCaller) + if err != nil { + return err + } + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + return nil +} + +func (obj *DeriveAccountsCcipSendParams) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `CcipSendCaller`: + err = decoder.Decode(&obj.CcipSendCaller) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + return nil +} + +type DeriveAccountsCcipSendStage interface { + isDeriveAccountsCcipSendStage() +} + +type deriveAccountsCcipSendStageContainer struct { + Enum ag_binary.BorshEnum `borsh_enum:"true"` + Start Start + FinishMainAccountList FinishMainAccountList + RetrieveTokenLUTs RetrieveTokenLUTs + RetrievePoolPrograms RetrievePoolPrograms + TokenTransferStaticAccounts TokenTransferStaticAccounts + NestedTokenDerive NestedTokenDerive +} + +type Start uint8 + +func (obj Start) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *Start) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *Start) isDeriveAccountsCcipSendStage() {} + +type FinishMainAccountList uint8 + +func (obj FinishMainAccountList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *FinishMainAccountList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *FinishMainAccountList) isDeriveAccountsCcipSendStage() {} + +type RetrieveTokenLUTs uint8 + +func (obj RetrieveTokenLUTs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *RetrieveTokenLUTs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *RetrieveTokenLUTs) isDeriveAccountsCcipSendStage() {} + +type RetrievePoolPrograms uint8 + +func (obj RetrievePoolPrograms) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} + +func (obj *RetrievePoolPrograms) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +func (_ *RetrievePoolPrograms) isDeriveAccountsCcipSendStage() {} + +type TokenTransferStaticAccounts struct { + Token uint32 + Page uint32 +} + +func (obj TokenTransferStaticAccounts) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Page` param: + err = encoder.Encode(obj.Page) + if err != nil { + return err + } + return nil +} + +func (obj *TokenTransferStaticAccounts) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Page`: + err = decoder.Decode(&obj.Page) + if err != nil { + return err + } + return nil +} + +func (_ *TokenTransferStaticAccounts) isDeriveAccountsCcipSendStage() {} + +type NestedTokenDerive struct { + Token uint32 + TokenSubstage string +} + +func (obj NestedTokenDerive) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `TokenSubstage` param: + err = encoder.Encode(obj.TokenSubstage) + if err != nil { + return err + } + return nil +} + +func (obj *NestedTokenDerive) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `TokenSubstage`: + err = decoder.Decode(&obj.TokenSubstage) + if err != nil { + return err + } + return nil +} + +func (_ *NestedTokenDerive) isDeriveAccountsCcipSendStage() {} + +type CodeVersion ag_binary.BorshEnum + +const ( + Default_CodeVersion CodeVersion = iota + V1_CodeVersion +) + +func (value CodeVersion) String() string { + switch value { + case Default_CodeVersion: + return "Default" + case V1_CodeVersion: + return "V1" + default: + return "" + } +} + +type RestoreOnAction ag_binary.BorshEnum + +const ( + None_RestoreOnAction RestoreOnAction = iota + Upgrade_RestoreOnAction + Rollback_RestoreOnAction +) + +func (value RestoreOnAction) String() string { + switch value { + case None_RestoreOnAction: + return "None" + case Upgrade_RestoreOnAction: + return "Upgrade" + case Rollback_RestoreOnAction: + return "Rollback" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership.go new file mode 100644 index 0000000000..ba260ccb13 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership.go @@ -0,0 +1,136 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AcceptOwnership is the `acceptOwnership` instruction. +type AcceptOwnership struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *AcceptOwnership) SetMintAccount(mint ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *AcceptOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership_test.go new file mode 100644 index 0000000000..e5bdb90d1e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses.go new file mode 100644 index 0000000000..609db6d193 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AppendRemotePoolAddresses is the `appendRemotePoolAddresses` instruction. +type AppendRemotePoolAddresses struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Addresses *[]RemoteAddress + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAppendRemotePoolAddressesInstructionBuilder creates a new `AppendRemotePoolAddresses` instruction builder. +func NewAppendRemotePoolAddressesInstructionBuilder() *AppendRemotePoolAddresses { + nd := &AppendRemotePoolAddresses{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *AppendRemotePoolAddresses) SetRemoteChainSelector(remoteChainSelector uint64) *AppendRemotePoolAddresses { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *AppendRemotePoolAddresses) SetMint(mint ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.Mint = &mint + return inst +} + +// SetAddresses sets the "addresses" parameter. +func (inst *AppendRemotePoolAddresses) SetAddresses(addresses []RemoteAddress) *AppendRemotePoolAddresses { + inst.Addresses = &addresses + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *AppendRemotePoolAddresses) SetStateAccount(state ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AppendRemotePoolAddresses) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AppendRemotePoolAddresses) SetAuthorityAccount(authority ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AppendRemotePoolAddresses) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AppendRemotePoolAddresses) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AppendRemotePoolAddresses, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AppendRemotePoolAddresses) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AppendRemotePoolAddresses) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Addresses == nil { + return errors.New("Addresses parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AppendRemotePoolAddresses) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AppendRemotePoolAddresses")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Addresses", *inst.Addresses)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AppendRemotePoolAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Addresses` param: + err = encoder.Encode(obj.Addresses) + if err != nil { + return err + } + return nil +} +func (obj *AppendRemotePoolAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Addresses`: + err = decoder.Decode(&obj.Addresses) + if err != nil { + return err + } + return nil +} + +// NewAppendRemotePoolAddressesInstruction declares a new AppendRemotePoolAddresses instruction with the provided parameters and accounts. +func NewAppendRemotePoolAddressesInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + addresses []RemoteAddress, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + return NewAppendRemotePoolAddressesInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetAddresses(addresses). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses_test.go new file mode 100644 index 0000000000..075ed562cb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/AppendRemotePoolAddresses_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AppendRemotePoolAddresses(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AppendRemotePoolAddresses"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AppendRemotePoolAddresses) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AppendRemotePoolAddresses) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList.go new file mode 100644 index 0000000000..2c73fc854e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList.go @@ -0,0 +1,207 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ConfigureAllowList is the `configureAllowList` instruction. +type ConfigureAllowList struct { + Add *[]ag_solanago.PublicKey + Enabled *bool + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewConfigureAllowListInstructionBuilder creates a new `ConfigureAllowList` instruction builder. +func NewConfigureAllowListInstructionBuilder() *ConfigureAllowList { + nd := &ConfigureAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetAdd sets the "add" parameter. +func (inst *ConfigureAllowList) SetAdd(add []ag_solanago.PublicKey) *ConfigureAllowList { + inst.Add = &add + return inst +} + +// SetEnabled sets the "enabled" parameter. +func (inst *ConfigureAllowList) SetEnabled(enabled bool) *ConfigureAllowList { + inst.Enabled = &enabled + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ConfigureAllowList) SetStateAccount(state ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ConfigureAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *ConfigureAllowList) SetMintAccount(mint ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ConfigureAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ConfigureAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ConfigureAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ConfigureAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ConfigureAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst ConfigureAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ConfigureAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ConfigureAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ConfigureAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Add == nil { + return errors.New("Add parameter is not set") + } + if inst.Enabled == nil { + return errors.New("Enabled parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *ConfigureAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ConfigureAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Add", *inst.Add)) + paramsBranch.Child(ag_format.Param("Enabled", *inst.Enabled)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj ConfigureAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Add` param: + err = encoder.Encode(obj.Add) + if err != nil { + return err + } + // Serialize `Enabled` param: + err = encoder.Encode(obj.Enabled) + if err != nil { + return err + } + return nil +} +func (obj *ConfigureAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Add`: + err = decoder.Decode(&obj.Add) + if err != nil { + return err + } + // Deserialize `Enabled`: + err = decoder.Decode(&obj.Enabled) + if err != nil { + return err + } + return nil +} + +// NewConfigureAllowListInstruction declares a new ConfigureAllowList instruction with the provided parameters and accounts. +func NewConfigureAllowListInstruction( + // Parameters: + add []ag_solanago.PublicKey, + enabled bool, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + return NewConfigureAllowListInstructionBuilder(). + SetAdd(add). + SetEnabled(enabled). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList_test.go new file mode 100644 index 0000000000..f4c8614623 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ConfigureAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ConfigureAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ConfigureAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ConfigureAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ConfigureAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig.go new file mode 100644 index 0000000000..c0e8c63c59 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig.go @@ -0,0 +1,188 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeleteChainConfig is the `deleteChainConfig` instruction. +type DeleteChainConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeleteChainConfigInstructionBuilder creates a new `DeleteChainConfig` instruction builder. +func NewDeleteChainConfigInstructionBuilder() *DeleteChainConfig { + nd := &DeleteChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *DeleteChainConfig) SetRemoteChainSelector(remoteChainSelector uint64) *DeleteChainConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *DeleteChainConfig) SetMint(mint ag_solanago.PublicKey) *DeleteChainConfig { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *DeleteChainConfig) SetStateAccount(state ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *DeleteChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *DeleteChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *DeleteChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DeleteChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DeleteChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst DeleteChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeleteChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeleteChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeleteChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *DeleteChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeleteChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj DeleteChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *DeleteChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewDeleteChainConfigInstruction declares a new DeleteChainConfig instruction with the provided parameters and accounts. +func NewDeleteChainConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *DeleteChainConfig { + return NewDeleteChainConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig_test.go new file mode 100644 index 0000000000..72f4dc9b47 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeleteChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeleteChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeleteChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeleteChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeleteChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens.go new file mode 100644 index 0000000000..23a7975490 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens.go @@ -0,0 +1,130 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeriveAccountsLockOrBurnTokens is the `deriveAccountsLockOrBurnTokens` instruction. +type DeriveAccountsLockOrBurnTokens struct { + Stage *string + LockOrBurn *LockOrBurnInV1 + + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsLockOrBurnTokensInstructionBuilder creates a new `DeriveAccountsLockOrBurnTokens` instruction builder. +func NewDeriveAccountsLockOrBurnTokensInstructionBuilder() *DeriveAccountsLockOrBurnTokens { + nd := &DeriveAccountsLockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 0), + } + return nd +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsLockOrBurnTokens) SetStage(stage string) *DeriveAccountsLockOrBurnTokens { + inst.Stage = &stage + return inst +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *DeriveAccountsLockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *DeriveAccountsLockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +func (inst DeriveAccountsLockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsLockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsLockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsLockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + } + return nil +} + +func (inst *DeriveAccountsLockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsLockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=0]").ParentFunc(func(accountsBranch ag_treeout.Branches) {}) + }) + }) +} + +func (obj DeriveAccountsLockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsLockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsLockOrBurnTokensInstruction declares a new DeriveAccountsLockOrBurnTokens instruction with the provided parameters and accounts. +func NewDeriveAccountsLockOrBurnTokensInstruction( + // Parameters: + stage string, + lockOrBurn LockOrBurnInV1) *DeriveAccountsLockOrBurnTokens { + return NewDeriveAccountsLockOrBurnTokensInstructionBuilder(). + SetStage(stage). + SetLockOrBurn(lockOrBurn) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens_test.go new file mode 100644 index 0000000000..efb8976494 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsLockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsLockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsLockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsLockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsLockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens.go new file mode 100644 index 0000000000..12ee4ad133 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens.go @@ -0,0 +1,130 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeriveAccountsReleaseOrMintTokens is the `deriveAccountsReleaseOrMintTokens` instruction. +type DeriveAccountsReleaseOrMintTokens struct { + Stage *string + ReleaseOrMint *ReleaseOrMintInV1 + + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsReleaseOrMintTokensInstructionBuilder creates a new `DeriveAccountsReleaseOrMintTokens` instruction builder. +func NewDeriveAccountsReleaseOrMintTokensInstructionBuilder() *DeriveAccountsReleaseOrMintTokens { + nd := &DeriveAccountsReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 0), + } + return nd +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsReleaseOrMintTokens) SetStage(stage string) *DeriveAccountsReleaseOrMintTokens { + inst.Stage = &stage + return inst +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *DeriveAccountsReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *DeriveAccountsReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +func (inst DeriveAccountsReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + } + return nil +} + +func (inst *DeriveAccountsReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=0]").ParentFunc(func(accountsBranch ag_treeout.Branches) {}) + }) + }) +} + +func (obj DeriveAccountsReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsReleaseOrMintTokensInstruction declares a new DeriveAccountsReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewDeriveAccountsReleaseOrMintTokensInstruction( + // Parameters: + stage string, + releaseOrMint ReleaseOrMintInV1) *DeriveAccountsReleaseOrMintTokens { + return NewDeriveAccountsReleaseOrMintTokensInstructionBuilder(). + SetStage(stage). + SetReleaseOrMint(releaseOrMint) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..4f397e13ba --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/DeriveAccountsReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig.go new file mode 100644 index 0000000000..1c83a7751f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// EditChainRemoteConfig is the `editChainRemoteConfig` instruction. +type EditChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewEditChainRemoteConfigInstructionBuilder creates a new `EditChainRemoteConfig` instruction builder. +func NewEditChainRemoteConfigInstructionBuilder() *EditChainRemoteConfig { + nd := &EditChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *EditChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *EditChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *EditChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *EditChainRemoteConfig) SetCfg(cfg RemoteConfig) *EditChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *EditChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *EditChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *EditChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *EditChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *EditChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *EditChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *EditChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *EditChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst EditChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_EditChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst EditChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *EditChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *EditChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("EditChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj EditChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *EditChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewEditChainRemoteConfigInstruction declares a new EditChainRemoteConfig instruction with the provided parameters and accounts. +func NewEditChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + return NewEditChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp.go new file mode 100644 index 0000000000..ade4fe9fb5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp.go @@ -0,0 +1,211 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// EditChainRemoteConfigCctp is the `editChainRemoteConfigCctp` instruction. +type EditChainRemoteConfigCctp struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *CctpChain + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewEditChainRemoteConfigCctpInstructionBuilder creates a new `EditChainRemoteConfigCctp` instruction builder. +func NewEditChainRemoteConfigCctpInstructionBuilder() *EditChainRemoteConfigCctp { + nd := &EditChainRemoteConfigCctp{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *EditChainRemoteConfigCctp) SetRemoteChainSelector(remoteChainSelector uint64) *EditChainRemoteConfigCctp { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *EditChainRemoteConfigCctp) SetMint(mint ag_solanago.PublicKey) *EditChainRemoteConfigCctp { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *EditChainRemoteConfigCctp) SetCfg(cfg CctpChain) *EditChainRemoteConfigCctp { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *EditChainRemoteConfigCctp) SetStateAccount(state ag_solanago.PublicKey) *EditChainRemoteConfigCctp { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *EditChainRemoteConfigCctp) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *EditChainRemoteConfigCctp) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *EditChainRemoteConfigCctp { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *EditChainRemoteConfigCctp) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *EditChainRemoteConfigCctp) SetAuthorityAccount(authority ag_solanago.PublicKey) *EditChainRemoteConfigCctp { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *EditChainRemoteConfigCctp) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst EditChainRemoteConfigCctp) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_EditChainRemoteConfigCctp, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst EditChainRemoteConfigCctp) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *EditChainRemoteConfigCctp) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *EditChainRemoteConfigCctp) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("EditChainRemoteConfigCctp")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj EditChainRemoteConfigCctp) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *EditChainRemoteConfigCctp) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewEditChainRemoteConfigCctpInstruction declares a new EditChainRemoteConfigCctp instruction with the provided parameters and accounts. +func NewEditChainRemoteConfigCctpInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg CctpChain, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *EditChainRemoteConfigCctp { + return NewEditChainRemoteConfigCctpInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp_test.go new file mode 100644 index 0000000000..619f78fd80 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfigCctp_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_EditChainRemoteConfigCctp(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("EditChainRemoteConfigCctp"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(EditChainRemoteConfigCctp) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(EditChainRemoteConfigCctp) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig_test.go new file mode 100644 index 0000000000..8c250d1551 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/EditChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_EditChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("EditChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(EditChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(EditChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig.go new file mode 100644 index 0000000000..91e7570b97 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitChainRemoteConfig is the `initChainRemoteConfig` instruction. +type InitChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitChainRemoteConfigInstructionBuilder creates a new `InitChainRemoteConfig` instruction builder. +func NewInitChainRemoteConfigInstructionBuilder() *InitChainRemoteConfig { + nd := &InitChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *InitChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *InitChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *InitChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *InitChainRemoteConfig) SetCfg(cfg RemoteConfig) *InitChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *InitChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *InitChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst InitChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *InitChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj InitChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *InitChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewInitChainRemoteConfigInstruction declares a new InitChainRemoteConfig instruction with the provided parameters and accounts. +func NewInitChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + return NewInitChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig_test.go new file mode 100644 index 0000000000..73b1872a6e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig.go new file mode 100644 index 0000000000..28158d8029 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig.go @@ -0,0 +1,174 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitGlobalConfig is the `initGlobalConfig` instruction. +type InitGlobalConfig struct { + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitGlobalConfigInstructionBuilder creates a new `InitGlobalConfig` instruction builder. +func NewInitGlobalConfigInstructionBuilder() *InitGlobalConfig { + nd := &InitGlobalConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *InitGlobalConfig) SetConfigAccount(config ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *InitGlobalConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitGlobalConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitGlobalConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitGlobalConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitGlobalConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *InitGlobalConfig) SetProgramAccount(program ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *InitGlobalConfig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *InitGlobalConfig) SetProgramDataAccount(programData ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *InitGlobalConfig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst InitGlobalConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitGlobalConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitGlobalConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitGlobalConfig) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *InitGlobalConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitGlobalConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj InitGlobalConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *InitGlobalConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitGlobalConfigInstruction declares a new InitGlobalConfig instruction with the provided parameters and accounts. +func NewInitGlobalConfigInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *InitGlobalConfig { + return NewInitGlobalConfigInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig_test.go new file mode 100644 index 0000000000..0deffbd759 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/InitGlobalConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitGlobalConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitGlobalConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitGlobalConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitGlobalConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize.go new file mode 100644 index 0000000000..c519ef894d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize.go @@ -0,0 +1,264 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + Router *ag_solanago.PublicKey + RmnRemote *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + // + // [6] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetRouter sets the "router" parameter. +func (inst *Initialize) SetRouter(router ag_solanago.PublicKey) *Initialize { + inst.Router = &router + return inst +} + +// SetRmnRemote sets the "rmnRemote" parameter. +func (inst *Initialize) SetRmnRemote(rmnRemote ag_solanago.PublicKey) *Initialize { + inst.RmnRemote = &rmnRemote + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *Initialize) SetMintAccount(mint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *Initialize) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[6] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Router == nil { + return errors.New("Router parameter is not set") + } + if inst.RmnRemote == nil { + return errors.New("RmnRemote parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Router", *inst.Router)) + paramsBranch.Child(ag_format.Param("RmnRemote", *inst.RmnRemote)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Parameters: + router ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey, + config ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetRouter(router). + SetRmnRemote(rmnRemote). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize_test.go new file mode 100644 index 0000000000..de90a0ac05 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens.go new file mode 100644 index 0000000000..64106d4693 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens.go @@ -0,0 +1,552 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// LockOrBurnTokens is the `lockOrBurnTokens` instruction. +type LockOrBurnTokens struct { + LockOrBurn *LockOrBurnInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] state + // + // [2] = [] tokenProgram + // + // [3] = [WRITE] mint + // + // [4] = [WRITE] poolSigner + // ··········· hold a balance to pay for the rent of initializing the CCTP MessageSentEvent account + // + // [5] = [WRITE] poolTokenAccount + // + // [6] = [] rmnRemote + // + // [7] = [] rmnRemoteCurses + // + // [8] = [] rmnRemoteConfig + // + // [9] = [] chainConfig + // + // [10] = [WRITE] cctpMessageTransmitterAccount + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [11] = [] cctpTokenMessengerMinter + // ··········· CHECK this is CCTP's TokenMessengerMinter program, which + // ··········· is invoked by this program. + // + // [12] = [] systemProgram + // + // [13] = [] cctpMessageTransmitter + // ··········· CHECK this is CCTP's MessageTransmitter program, which + // ··········· is invoked transitively by CCTP's TokenMessengerMinter, + // ··········· which in turn is invoked explicitly by this program. + // + // [14] = [] cctpTokenMessengerAccount + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [15] = [] cctpTokenMinterAccount + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [16] = [WRITE] cctpLocalToken + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [17] = [] cctpEventAuthority + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [18] = [] cctpAuthorityPda + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [19] = [] cctpRemoteTokenMessengerKey + // ··········· CHECK this is not read by the pool, just forwarded to CCTP + // + // [20] = [WRITE] cctpMessageSentEvent + // ··········· CHECK this is the account in which CCTP will store the event. It is not a PDA of CCTP, + // ··········· but CCTP will initialize it and become the owner for it. + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewLockOrBurnTokensInstructionBuilder creates a new `LockOrBurnTokens` instruction builder. +func NewLockOrBurnTokensInstructionBuilder() *LockOrBurnTokens { + nd := &LockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 21), + } + return nd +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *LockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *LockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *LockOrBurnTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *LockOrBurnTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetStateAccount sets the "state" account. +func (inst *LockOrBurnTokens) SetStateAccount(state ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *LockOrBurnTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *LockOrBurnTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *LockOrBurnTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMintAccount sets the "mint" account. +func (inst *LockOrBurnTokens) SetMintAccount(mint ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *LockOrBurnTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +// hold a balance to pay for the rent of initializing the CCTP MessageSentEvent account +func (inst *LockOrBurnTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolSigner).WRITE() + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +// hold a balance to pay for the rent of initializing the CCTP MessageSentEvent account +func (inst *LockOrBurnTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *LockOrBurnTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *LockOrBurnTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *LockOrBurnTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(chainConfig) + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *LockOrBurnTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetCctpMessageTransmitterAccountAccount sets the "cctpMessageTransmitterAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpMessageTransmitterAccountAccount(cctpMessageTransmitterAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[10] = ag_solanago.Meta(cctpMessageTransmitterAccount).WRITE() + return inst +} + +// GetCctpMessageTransmitterAccountAccount gets the "cctpMessageTransmitterAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpMessageTransmitterAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetCctpTokenMessengerMinterAccount sets the "cctpTokenMessengerMinter" account. +// CHECK this is CCTP's TokenMessengerMinter program, which +// is invoked by this program. +func (inst *LockOrBurnTokens) SetCctpTokenMessengerMinterAccount(cctpTokenMessengerMinter ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[11] = ag_solanago.Meta(cctpTokenMessengerMinter) + return inst +} + +// GetCctpTokenMessengerMinterAccount gets the "cctpTokenMessengerMinter" account. +// CHECK this is CCTP's TokenMessengerMinter program, which +// is invoked by this program. +func (inst *LockOrBurnTokens) GetCctpTokenMessengerMinterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *LockOrBurnTokens) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[12] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *LockOrBurnTokens) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetCctpMessageTransmitterAccount sets the "cctpMessageTransmitter" account. +// CHECK this is CCTP's MessageTransmitter program, which +// is invoked transitively by CCTP's TokenMessengerMinter, +// which in turn is invoked explicitly by this program. +func (inst *LockOrBurnTokens) SetCctpMessageTransmitterAccount(cctpMessageTransmitter ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[13] = ag_solanago.Meta(cctpMessageTransmitter) + return inst +} + +// GetCctpMessageTransmitterAccount gets the "cctpMessageTransmitter" account. +// CHECK this is CCTP's MessageTransmitter program, which +// is invoked transitively by CCTP's TokenMessengerMinter, +// which in turn is invoked explicitly by this program. +func (inst *LockOrBurnTokens) GetCctpMessageTransmitterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +// SetCctpTokenMessengerAccountAccount sets the "cctpTokenMessengerAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpTokenMessengerAccountAccount(cctpTokenMessengerAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[14] = ag_solanago.Meta(cctpTokenMessengerAccount) + return inst +} + +// GetCctpTokenMessengerAccountAccount gets the "cctpTokenMessengerAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpTokenMessengerAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[14] +} + +// SetCctpTokenMinterAccountAccount sets the "cctpTokenMinterAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpTokenMinterAccountAccount(cctpTokenMinterAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[15] = ag_solanago.Meta(cctpTokenMinterAccount) + return inst +} + +// GetCctpTokenMinterAccountAccount gets the "cctpTokenMinterAccount" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpTokenMinterAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[15] +} + +// SetCctpLocalTokenAccount sets the "cctpLocalToken" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpLocalTokenAccount(cctpLocalToken ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[16] = ag_solanago.Meta(cctpLocalToken).WRITE() + return inst +} + +// GetCctpLocalTokenAccount gets the "cctpLocalToken" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpLocalTokenAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[16] +} + +// SetCctpEventAuthorityAccount sets the "cctpEventAuthority" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpEventAuthorityAccount(cctpEventAuthority ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[17] = ag_solanago.Meta(cctpEventAuthority) + return inst +} + +// GetCctpEventAuthorityAccount gets the "cctpEventAuthority" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpEventAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[17] +} + +// SetCctpAuthorityPdaAccount sets the "cctpAuthorityPda" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpAuthorityPdaAccount(cctpAuthorityPda ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[18] = ag_solanago.Meta(cctpAuthorityPda) + return inst +} + +// GetCctpAuthorityPdaAccount gets the "cctpAuthorityPda" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpAuthorityPdaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[18] +} + +// SetCctpRemoteTokenMessengerKeyAccount sets the "cctpRemoteTokenMessengerKey" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) SetCctpRemoteTokenMessengerKeyAccount(cctpRemoteTokenMessengerKey ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[19] = ag_solanago.Meta(cctpRemoteTokenMessengerKey) + return inst +} + +// GetCctpRemoteTokenMessengerKeyAccount gets the "cctpRemoteTokenMessengerKey" account. +// CHECK this is not read by the pool, just forwarded to CCTP +func (inst *LockOrBurnTokens) GetCctpRemoteTokenMessengerKeyAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[19] +} + +// SetCctpMessageSentEventAccount sets the "cctpMessageSentEvent" account. +// CHECK this is the account in which CCTP will store the event. It is not a PDA of CCTP, +// but CCTP will initialize it and become the owner for it. +func (inst *LockOrBurnTokens) SetCctpMessageSentEventAccount(cctpMessageSentEvent ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[20] = ag_solanago.Meta(cctpMessageSentEvent).WRITE() + return inst +} + +// GetCctpMessageSentEventAccount gets the "cctpMessageSentEvent" account. +// CHECK this is the account in which CCTP will store the event. It is not a PDA of CCTP, +// but CCTP will initialize it and become the owner for it. +func (inst *LockOrBurnTokens) GetCctpMessageSentEventAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[20] +} + +func (inst LockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_LockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst LockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *LockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.CctpMessageTransmitterAccount is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.CctpTokenMessengerMinter is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.CctpMessageTransmitter is not set") + } + if inst.AccountMetaSlice[14] == nil { + return errors.New("accounts.CctpTokenMessengerAccount is not set") + } + if inst.AccountMetaSlice[15] == nil { + return errors.New("accounts.CctpTokenMinterAccount is not set") + } + if inst.AccountMetaSlice[16] == nil { + return errors.New("accounts.CctpLocalToken is not set") + } + if inst.AccountMetaSlice[17] == nil { + return errors.New("accounts.CctpEventAuthority is not set") + } + if inst.AccountMetaSlice[18] == nil { + return errors.New("accounts.CctpAuthorityPda is not set") + } + if inst.AccountMetaSlice[19] == nil { + return errors.New("accounts.CctpRemoteTokenMessengerKey is not set") + } + if inst.AccountMetaSlice[20] == nil { + return errors.New("accounts.CctpMessageSentEvent is not set") + } + } + return nil +} + +func (inst *LockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("LockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=21]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" cctpMessageTransmitter", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" cctpTokenMessengerMinter", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" cctpMessageTransmitter", inst.AccountMetaSlice[13])) + accountsBranch.Child(ag_format.Meta(" cctpTokenMessenger", inst.AccountMetaSlice[14])) + accountsBranch.Child(ag_format.Meta(" cctpTokenMinter", inst.AccountMetaSlice[15])) + accountsBranch.Child(ag_format.Meta(" cctpLocalToken", inst.AccountMetaSlice[16])) + accountsBranch.Child(ag_format.Meta(" cctpEventAuthority", inst.AccountMetaSlice[17])) + accountsBranch.Child(ag_format.Meta(" cctpAuthorityPda", inst.AccountMetaSlice[18])) + accountsBranch.Child(ag_format.Meta("cctpRemoteTokenMessengerKey", inst.AccountMetaSlice[19])) + accountsBranch.Child(ag_format.Meta(" cctpMessageSentEvent", inst.AccountMetaSlice[20])) + }) + }) + }) +} + +func (obj LockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *LockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewLockOrBurnTokensInstruction declares a new LockOrBurnTokens instruction with the provided parameters and accounts. +func NewLockOrBurnTokensInstruction( + // Parameters: + lockOrBurn LockOrBurnInV1, + // Accounts: + authority ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + cctpMessageTransmitterAccount ag_solanago.PublicKey, + cctpTokenMessengerMinter ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + cctpMessageTransmitter ag_solanago.PublicKey, + cctpTokenMessengerAccount ag_solanago.PublicKey, + cctpTokenMinterAccount ag_solanago.PublicKey, + cctpLocalToken ag_solanago.PublicKey, + cctpEventAuthority ag_solanago.PublicKey, + cctpAuthorityPda ag_solanago.PublicKey, + cctpRemoteTokenMessengerKey ag_solanago.PublicKey, + cctpMessageSentEvent ag_solanago.PublicKey) *LockOrBurnTokens { + return NewLockOrBurnTokensInstructionBuilder(). + SetLockOrBurn(lockOrBurn). + SetAuthorityAccount(authority). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetChainConfigAccount(chainConfig). + SetCctpMessageTransmitterAccountAccount(cctpMessageTransmitterAccount). + SetCctpTokenMessengerMinterAccount(cctpTokenMessengerMinter). + SetSystemProgramAccount(systemProgram). + SetCctpMessageTransmitterAccount(cctpMessageTransmitter). + SetCctpTokenMessengerAccountAccount(cctpTokenMessengerAccount). + SetCctpTokenMinterAccountAccount(cctpTokenMinterAccount). + SetCctpLocalTokenAccount(cctpLocalToken). + SetCctpEventAuthorityAccount(cctpEventAuthority). + SetCctpAuthorityPdaAccount(cctpAuthorityPda). + SetCctpRemoteTokenMessengerKeyAccount(cctpRemoteTokenMessengerKey). + SetCctpMessageSentEventAccount(cctpMessageSentEvent) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens_test.go new file mode 100644 index 0000000000..5841a14718 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/LockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_LockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("LockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(LockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(LockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount.go new file mode 100644 index 0000000000..3de3d87fbe --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount.go @@ -0,0 +1,333 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ReclaimEventAccount is the `reclaimEventAccount` instruction. +type ReclaimEventAccount struct { + Mint *ag_solanago.PublicKey + OriginalSender *ag_solanago.PublicKey + RemoteChainSelector *uint64 + MsgNonce *uint64 + Attestation *[]byte + + // [0] = [] state + // + // [1] = [WRITE] poolSigner + // + // [2] = [WRITE] messageSentEventAccount + // + // [3] = [WRITE] messageTransmitter + // + // [4] = [] cctpMessageTransmitter + // + // [5] = [WRITE, SIGNER] authority + // + // [6] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReclaimEventAccountInstructionBuilder creates a new `ReclaimEventAccount` instruction builder. +func NewReclaimEventAccountInstructionBuilder() *ReclaimEventAccount { + nd := &ReclaimEventAccount{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *ReclaimEventAccount) SetMint(mint ag_solanago.PublicKey) *ReclaimEventAccount { + inst.Mint = &mint + return inst +} + +// SetOriginalSender sets the "originalSender" parameter. +func (inst *ReclaimEventAccount) SetOriginalSender(originalSender ag_solanago.PublicKey) *ReclaimEventAccount { + inst.OriginalSender = &originalSender + return inst +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *ReclaimEventAccount) SetRemoteChainSelector(remoteChainSelector uint64) *ReclaimEventAccount { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMsgNonce sets the "msgNonce" parameter. +func (inst *ReclaimEventAccount) SetMsgNonce(msgNonce uint64) *ReclaimEventAccount { + inst.MsgNonce = &msgNonce + return inst +} + +// SetAttestation sets the "attestation" parameter. +func (inst *ReclaimEventAccount) SetAttestation(attestation []byte) *ReclaimEventAccount { + inst.Attestation = &attestation + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ReclaimEventAccount) SetStateAccount(state ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReclaimEventAccount) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReclaimEventAccount) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[1] = ag_solanago.Meta(poolSigner).WRITE() + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReclaimEventAccount) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMessageSentEventAccountAccount sets the "messageSentEventAccount" account. +func (inst *ReclaimEventAccount) SetMessageSentEventAccountAccount(messageSentEventAccount ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[2] = ag_solanago.Meta(messageSentEventAccount).WRITE() + return inst +} + +// GetMessageSentEventAccountAccount gets the "messageSentEventAccount" account. +func (inst *ReclaimEventAccount) GetMessageSentEventAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMessageTransmitterAccount sets the "messageTransmitter" account. +func (inst *ReclaimEventAccount) SetMessageTransmitterAccount(messageTransmitter ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[3] = ag_solanago.Meta(messageTransmitter).WRITE() + return inst +} + +// GetMessageTransmitterAccount gets the "messageTransmitter" account. +func (inst *ReclaimEventAccount) GetMessageTransmitterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetCctpMessageTransmitterAccount sets the "cctpMessageTransmitter" account. +func (inst *ReclaimEventAccount) SetCctpMessageTransmitterAccount(cctpMessageTransmitter ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[4] = ag_solanago.Meta(cctpMessageTransmitter) + return inst +} + +// GetCctpMessageTransmitterAccount gets the "cctpMessageTransmitter" account. +func (inst *ReclaimEventAccount) GetCctpMessageTransmitterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReclaimEventAccount) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[5] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReclaimEventAccount) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ReclaimEventAccount) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ReclaimEventAccount { + inst.AccountMetaSlice[6] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ReclaimEventAccount) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst ReclaimEventAccount) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReclaimEventAccount, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReclaimEventAccount) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReclaimEventAccount) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.OriginalSender == nil { + return errors.New("OriginalSender parameter is not set") + } + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.MsgNonce == nil { + return errors.New("MsgNonce parameter is not set") + } + if inst.Attestation == nil { + return errors.New("Attestation parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.MessageSentEventAccount is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.MessageTransmitter is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.CctpMessageTransmitter is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *ReclaimEventAccount) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReclaimEventAccount")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" OriginalSender", *inst.OriginalSender)) + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" MsgNonce", *inst.MsgNonce)) + paramsBranch.Child(ag_format.Param(" Attestation", *inst.Attestation)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" messageSentEvent", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" messageTransmitter", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("cctpMessageTransmitter", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj ReclaimEventAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `OriginalSender` param: + err = encoder.Encode(obj.OriginalSender) + if err != nil { + return err + } + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `MsgNonce` param: + err = encoder.Encode(obj.MsgNonce) + if err != nil { + return err + } + // Serialize `Attestation` param: + err = encoder.Encode(obj.Attestation) + if err != nil { + return err + } + return nil +} +func (obj *ReclaimEventAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `OriginalSender`: + err = decoder.Decode(&obj.OriginalSender) + if err != nil { + return err + } + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `MsgNonce`: + err = decoder.Decode(&obj.MsgNonce) + if err != nil { + return err + } + // Deserialize `Attestation`: + err = decoder.Decode(&obj.Attestation) + if err != nil { + return err + } + return nil +} + +// NewReclaimEventAccountInstruction declares a new ReclaimEventAccount instruction with the provided parameters and accounts. +func NewReclaimEventAccountInstruction( + // Parameters: + mint ag_solanago.PublicKey, + originalSender ag_solanago.PublicKey, + remoteChainSelector uint64, + msgNonce uint64, + attestation []byte, + // Accounts: + state ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + messageSentEventAccount ag_solanago.PublicKey, + messageTransmitter ag_solanago.PublicKey, + cctpMessageTransmitter ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *ReclaimEventAccount { + return NewReclaimEventAccountInstructionBuilder(). + SetMint(mint). + SetOriginalSender(originalSender). + SetRemoteChainSelector(remoteChainSelector). + SetMsgNonce(msgNonce). + SetAttestation(attestation). + SetStateAccount(state). + SetPoolSignerAccount(poolSigner). + SetMessageSentEventAccountAccount(messageSentEventAccount). + SetMessageTransmitterAccount(messageTransmitter). + SetCctpMessageTransmitterAccount(cctpMessageTransmitter). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount_test.go new file mode 100644 index 0000000000..a9713fa826 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimEventAccount_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReclaimEventAccount(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReclaimEventAccount"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReclaimEventAccount) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReclaimEventAccount) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds.go new file mode 100644 index 0000000000..9086f149b8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds.go @@ -0,0 +1,232 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns an amount of SOL from the pool signer account to the designated +// fund reclaimer. There are three entities involved: +// +// * `owner`: can configure the reclaimer and fund manager. +// * `fund_manager`: can execute this instruction. +// * `fund_reclaim_destination`: receives the funds. +// +// The resulting funds on the PDA cannot drop below `minimum_signer_funds`. +type ReclaimFunds struct { + Amount *uint64 + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE] poolSigner + // + // [3] = [WRITE] fundReclaimDestination + // ··········· to be a particular fund reclaimer + // + // [4] = [WRITE, SIGNER] authority + // + // [5] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReclaimFundsInstructionBuilder creates a new `ReclaimFunds` instruction builder. +func NewReclaimFundsInstructionBuilder() *ReclaimFunds { + nd := &ReclaimFunds{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + } + return nd +} + +// SetAmount sets the "amount" parameter. +func (inst *ReclaimFunds) SetAmount(amount uint64) *ReclaimFunds { + inst.Amount = &amount + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ReclaimFunds) SetStateAccount(state ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReclaimFunds) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *ReclaimFunds) SetMintAccount(mint ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ReclaimFunds) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReclaimFunds) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[2] = ag_solanago.Meta(poolSigner).WRITE() + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReclaimFunds) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetFundReclaimDestinationAccount sets the "fundReclaimDestination" account. +// to be a particular fund reclaimer +func (inst *ReclaimFunds) SetFundReclaimDestinationAccount(fundReclaimDestination ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[3] = ag_solanago.Meta(fundReclaimDestination).WRITE() + return inst +} + +// GetFundReclaimDestinationAccount gets the "fundReclaimDestination" account. +// to be a particular fund reclaimer +func (inst *ReclaimFunds) GetFundReclaimDestinationAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReclaimFunds) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReclaimFunds) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ReclaimFunds) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ReclaimFunds { + inst.AccountMetaSlice[5] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ReclaimFunds) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +func (inst ReclaimFunds) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReclaimFunds, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReclaimFunds) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReclaimFunds) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Amount == nil { + return errors.New("Amount parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.FundReclaimDestination is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *ReclaimFunds) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReclaimFunds")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Amount", *inst.Amount)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("fundReclaimDestination", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[5])) + }) + }) + }) +} + +func (obj ReclaimFunds) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} +func (obj *ReclaimFunds) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +// NewReclaimFundsInstruction declares a new ReclaimFunds instruction with the provided parameters and accounts. +func NewReclaimFundsInstruction( + // Parameters: + amount uint64, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + fundReclaimDestination ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *ReclaimFunds { + return NewReclaimFundsInstructionBuilder(). + SetAmount(amount). + SetStateAccount(state). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetFundReclaimDestinationAccount(fundReclaimDestination). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds_test.go new file mode 100644 index 0000000000..0f7d7552ba --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReclaimFunds_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReclaimFunds(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReclaimFunds"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReclaimFunds) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReclaimFunds) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens.go new file mode 100644 index 0000000000..9981c3343a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens.go @@ -0,0 +1,367 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ReleaseOrMintTokens is the `releaseOrMintTokens` instruction. +type ReleaseOrMintTokens struct { + ReleaseOrMint *ReleaseOrMintInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] offrampProgram + // ··········· CHECK offramp program: exists only to derive the allowed offramp PDA + // ··········· and the authority PDA. + // + // [2] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp + // + // [3] = [] state + // + // [4] = [] tokenProgram + // + // [5] = [WRITE] mint + // + // [6] = [WRITE] poolSigner + // + // [7] = [WRITE] poolTokenAccount + // + // [8] = [] chainConfig + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + // + // [12] = [WRITE] receiverTokenAccount + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReleaseOrMintTokensInstructionBuilder creates a new `ReleaseOrMintTokens` instruction builder. +func NewReleaseOrMintTokensInstructionBuilder() *ReleaseOrMintTokens { + nd := &ReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 13), + } + return nd +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *ReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *ReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReleaseOrMintTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReleaseOrMintTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetOfframpProgramAccount sets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) SetOfframpProgramAccount(offrampProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(offrampProgram) + return inst +} + +// GetOfframpProgramAccount gets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) GetOfframpProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetStateAccount sets the "state" account. +func (inst *ReleaseOrMintTokens) SetStateAccount(state ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReleaseOrMintTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetMintAccount sets the "mint" account. +func (inst *ReleaseOrMintTokens) SetMintAccount(mint ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ReleaseOrMintTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(poolSigner).WRITE() + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(chainConfig) + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetReceiverTokenAccountAccount sets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetReceiverTokenAccountAccount(receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[12] = ag_solanago.Meta(receiverTokenAccount).WRITE() + return inst +} + +// GetReceiverTokenAccountAccount gets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetReceiverTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +func (inst ReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.OfframpProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.ReceiverTokenAccount is not set") + } + } + return nil +} + +func (inst *ReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" offrampProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" receiverToken", inst.AccountMetaSlice[12])) + }) + }) + }) +} + +func (obj ReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *ReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewReleaseOrMintTokensInstruction declares a new ReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewReleaseOrMintTokensInstruction( + // Parameters: + releaseOrMint ReleaseOrMintInV1, + // Accounts: + authority ag_solanago.PublicKey, + offrampProgram ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + return NewReleaseOrMintTokensInstructionBuilder(). + SetReleaseOrMint(releaseOrMint). + SetAuthorityAccount(authority). + SetOfframpProgramAccount(offrampProgram). + SetAllowedOfframpAccount(allowedOfframp). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetChainConfigAccount(chainConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetReceiverTokenAccountAccount(receiverTokenAccount) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..1c1908a4ad --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/ReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList.go new file mode 100644 index 0000000000..8c617d9d09 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// RemoveFromAllowList is the `removeFromAllowList` instruction. +type RemoveFromAllowList struct { + Remove *[]ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemoveFromAllowListInstructionBuilder creates a new `RemoveFromAllowList` instruction builder. +func NewRemoveFromAllowListInstructionBuilder() *RemoveFromAllowList { + nd := &RemoveFromAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemove sets the "remove" parameter. +func (inst *RemoveFromAllowList) SetRemove(remove []ag_solanago.PublicKey) *RemoveFromAllowList { + inst.Remove = &remove + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *RemoveFromAllowList) SetStateAccount(state ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *RemoveFromAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *RemoveFromAllowList) SetMintAccount(mint ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *RemoveFromAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemoveFromAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemoveFromAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemoveFromAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemoveFromAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemoveFromAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemoveFromAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemoveFromAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemoveFromAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Remove == nil { + return errors.New("Remove parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemoveFromAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemoveFromAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Remove", *inst.Remove)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemoveFromAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Remove` param: + err = encoder.Encode(obj.Remove) + if err != nil { + return err + } + return nil +} +func (obj *RemoveFromAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Remove`: + err = decoder.Decode(&obj.Remove) + if err != nil { + return err + } + return nil +} + +// NewRemoveFromAllowListInstruction declares a new RemoveFromAllowList instruction with the provided parameters and accounts. +func NewRemoveFromAllowListInstruction( + // Parameters: + remove []ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + return NewRemoveFromAllowListInstructionBuilder(). + SetRemove(remove). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList_test.go new file mode 100644 index 0000000000..9a3b54174d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/RemoveFromAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemoveFromAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemoveFromAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemoveFromAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemoveFromAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit.go new file mode 100644 index 0000000000..533dd63a60 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit.go @@ -0,0 +1,234 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetChainRateLimit is the `setChainRateLimit` instruction. +type SetChainRateLimit struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Inbound *RateLimitConfig + Outbound *RateLimitConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetChainRateLimitInstructionBuilder creates a new `SetChainRateLimit` instruction builder. +func NewSetChainRateLimitInstructionBuilder() *SetChainRateLimit { + nd := &SetChainRateLimit{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *SetChainRateLimit) SetRemoteChainSelector(remoteChainSelector uint64) *SetChainRateLimit { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *SetChainRateLimit) SetMint(mint ag_solanago.PublicKey) *SetChainRateLimit { + inst.Mint = &mint + return inst +} + +// SetInbound sets the "inbound" parameter. +func (inst *SetChainRateLimit) SetInbound(inbound RateLimitConfig) *SetChainRateLimit { + inst.Inbound = &inbound + return inst +} + +// SetOutbound sets the "outbound" parameter. +func (inst *SetChainRateLimit) SetOutbound(outbound RateLimitConfig) *SetChainRateLimit { + inst.Outbound = &outbound + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetChainRateLimit) SetStateAccount(state ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetChainRateLimit) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *SetChainRateLimit) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *SetChainRateLimit) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetChainRateLimit) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetChainRateLimit) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetChainRateLimit) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetChainRateLimit, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetChainRateLimit) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetChainRateLimit) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Inbound == nil { + return errors.New("Inbound parameter is not set") + } + if inst.Outbound == nil { + return errors.New("Outbound parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetChainRateLimit) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetChainRateLimit")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Inbound", *inst.Inbound)) + paramsBranch.Child(ag_format.Param(" Outbound", *inst.Outbound)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetChainRateLimit) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Inbound` param: + err = encoder.Encode(obj.Inbound) + if err != nil { + return err + } + // Serialize `Outbound` param: + err = encoder.Encode(obj.Outbound) + if err != nil { + return err + } + return nil +} +func (obj *SetChainRateLimit) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Inbound`: + err = decoder.Decode(&obj.Inbound) + if err != nil { + return err + } + // Deserialize `Outbound`: + err = decoder.Decode(&obj.Outbound) + if err != nil { + return err + } + return nil +} + +// NewSetChainRateLimitInstruction declares a new SetChainRateLimit instruction with the provided parameters and accounts. +func NewSetChainRateLimitInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + inbound RateLimitConfig, + outbound RateLimitConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetChainRateLimit { + return NewSetChainRateLimitInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetInbound(inbound). + SetOutbound(outbound). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit_test.go new file mode 100644 index 0000000000..933920fee0 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetChainRateLimit_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetChainRateLimit(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetChainRateLimit"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetChainRateLimit) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetChainRateLimit) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager.go new file mode 100644 index 0000000000..3bac99c88c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetFundManager is the `setFundManager` instruction. +type SetFundManager struct { + FundManager *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetFundManagerInstructionBuilder creates a new `SetFundManager` instruction builder. +func NewSetFundManagerInstructionBuilder() *SetFundManager { + nd := &SetFundManager{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetFundManager sets the "fundManager" parameter. +func (inst *SetFundManager) SetFundManager(fundManager ag_solanago.PublicKey) *SetFundManager { + inst.FundManager = &fundManager + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetFundManager) SetStateAccount(state ag_solanago.PublicKey) *SetFundManager { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetFundManager) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetFundManager) SetMintAccount(mint ag_solanago.PublicKey) *SetFundManager { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetFundManager) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetFundManager) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetFundManager { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetFundManager) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetFundManager) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetFundManager, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetFundManager) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetFundManager) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.FundManager == nil { + return errors.New("FundManager parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetFundManager) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetFundManager")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("FundManager", *inst.FundManager)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetFundManager) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `FundManager` param: + err = encoder.Encode(obj.FundManager) + if err != nil { + return err + } + return nil +} +func (obj *SetFundManager) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `FundManager`: + err = decoder.Decode(&obj.FundManager) + if err != nil { + return err + } + return nil +} + +// NewSetFundManagerInstruction declares a new SetFundManager instruction with the provided parameters and accounts. +func NewSetFundManagerInstruction( + // Parameters: + fundManager ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetFundManager { + return NewSetFundManagerInstructionBuilder(). + SetFundManager(fundManager). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager_test.go new file mode 100644 index 0000000000..624d2b7db2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundManager_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetFundManager(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetFundManager"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetFundManager) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetFundManager) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination.go new file mode 100644 index 0000000000..86f70a7b4c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetFundReclaimDestination is the `setFundReclaimDestination` instruction. +type SetFundReclaimDestination struct { + FundReclaimDestination *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetFundReclaimDestinationInstructionBuilder creates a new `SetFundReclaimDestination` instruction builder. +func NewSetFundReclaimDestinationInstructionBuilder() *SetFundReclaimDestination { + nd := &SetFundReclaimDestination{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetFundReclaimDestination sets the "fundReclaimDestination" parameter. +func (inst *SetFundReclaimDestination) SetFundReclaimDestination(fundReclaimDestination ag_solanago.PublicKey) *SetFundReclaimDestination { + inst.FundReclaimDestination = &fundReclaimDestination + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetFundReclaimDestination) SetStateAccount(state ag_solanago.PublicKey) *SetFundReclaimDestination { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetFundReclaimDestination) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetFundReclaimDestination) SetMintAccount(mint ag_solanago.PublicKey) *SetFundReclaimDestination { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetFundReclaimDestination) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetFundReclaimDestination) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetFundReclaimDestination { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetFundReclaimDestination) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetFundReclaimDestination) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetFundReclaimDestination, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetFundReclaimDestination) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetFundReclaimDestination) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.FundReclaimDestination == nil { + return errors.New("FundReclaimDestination parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetFundReclaimDestination) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetFundReclaimDestination")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("FundReclaimDestination", *inst.FundReclaimDestination)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetFundReclaimDestination) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `FundReclaimDestination` param: + err = encoder.Encode(obj.FundReclaimDestination) + if err != nil { + return err + } + return nil +} +func (obj *SetFundReclaimDestination) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `FundReclaimDestination`: + err = decoder.Decode(&obj.FundReclaimDestination) + if err != nil { + return err + } + return nil +} + +// NewSetFundReclaimDestinationInstruction declares a new SetFundReclaimDestination instruction with the provided parameters and accounts. +func NewSetFundReclaimDestinationInstruction( + // Parameters: + fundReclaimDestination ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetFundReclaimDestination { + return NewSetFundReclaimDestinationInstructionBuilder(). + SetFundReclaimDestination(fundReclaimDestination). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination_test.go new file mode 100644 index 0000000000..f645720b7f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetFundReclaimDestination_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetFundReclaimDestination(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetFundReclaimDestination"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetFundReclaimDestination) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetFundReclaimDestination) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds.go new file mode 100644 index 0000000000..26a665c2d7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetMinimumSignerFunds is the `setMinimumSignerFunds` instruction. +type SetMinimumSignerFunds struct { + Amount *uint64 + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetMinimumSignerFundsInstructionBuilder creates a new `SetMinimumSignerFunds` instruction builder. +func NewSetMinimumSignerFundsInstructionBuilder() *SetMinimumSignerFunds { + nd := &SetMinimumSignerFunds{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetAmount sets the "amount" parameter. +func (inst *SetMinimumSignerFunds) SetAmount(amount uint64) *SetMinimumSignerFunds { + inst.Amount = &amount + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetMinimumSignerFunds) SetStateAccount(state ag_solanago.PublicKey) *SetMinimumSignerFunds { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetMinimumSignerFunds) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetMinimumSignerFunds) SetMintAccount(mint ag_solanago.PublicKey) *SetMinimumSignerFunds { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetMinimumSignerFunds) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetMinimumSignerFunds) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetMinimumSignerFunds { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetMinimumSignerFunds) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetMinimumSignerFunds) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetMinimumSignerFunds, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetMinimumSignerFunds) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetMinimumSignerFunds) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Amount == nil { + return errors.New("Amount parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetMinimumSignerFunds) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetMinimumSignerFunds")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Amount", *inst.Amount)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetMinimumSignerFunds) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} +func (obj *SetMinimumSignerFunds) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +// NewSetMinimumSignerFundsInstruction declares a new SetMinimumSignerFunds instruction with the provided parameters and accounts. +func NewSetMinimumSignerFundsInstruction( + // Parameters: + amount uint64, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetMinimumSignerFunds { + return NewSetMinimumSignerFundsInstructionBuilder(). + SetAmount(amount). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds_test.go new file mode 100644 index 0000000000..09b9340252 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetMinimumSignerFunds_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetMinimumSignerFunds(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetMinimumSignerFunds"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetMinimumSignerFunds) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetMinimumSignerFunds) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin.go new file mode 100644 index 0000000000..3df8b12a84 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin.go @@ -0,0 +1,169 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRateLimitAdmin is the `setRateLimitAdmin` instruction. +type SetRateLimitAdmin struct { + Mint *ag_solanago.PublicKey + NewRateLimitAdmin *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRateLimitAdminInstructionBuilder creates a new `SetRateLimitAdmin` instruction builder. +func NewSetRateLimitAdminInstructionBuilder() *SetRateLimitAdmin { + nd := &SetRateLimitAdmin{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *SetRateLimitAdmin) SetMint(mint ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.Mint = &mint + return inst +} + +// SetNewRateLimitAdmin sets the "newRateLimitAdmin" parameter. +func (inst *SetRateLimitAdmin) SetNewRateLimitAdmin(newRateLimitAdmin ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.NewRateLimitAdmin = &newRateLimitAdmin + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRateLimitAdmin) SetStateAccount(state ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRateLimitAdmin) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRateLimitAdmin) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRateLimitAdmin) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetRateLimitAdmin) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRateLimitAdmin, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRateLimitAdmin) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRateLimitAdmin) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.NewRateLimitAdmin == nil { + return errors.New("NewRateLimitAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRateLimitAdmin) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRateLimitAdmin")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param("NewRateLimitAdmin", *inst.NewRateLimitAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetRateLimitAdmin) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `NewRateLimitAdmin` param: + err = encoder.Encode(obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} +func (obj *SetRateLimitAdmin) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `NewRateLimitAdmin`: + err = decoder.Decode(&obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} + +// NewSetRateLimitAdminInstruction declares a new SetRateLimitAdmin instruction with the provided parameters and accounts. +func NewSetRateLimitAdminInstruction( + // Parameters: + mint ag_solanago.PublicKey, + newRateLimitAdmin ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRateLimitAdmin { + return NewSetRateLimitAdminInstructionBuilder(). + SetMint(mint). + SetNewRateLimitAdmin(newRateLimitAdmin). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin_test.go new file mode 100644 index 0000000000..de7f4580af --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRateLimitAdmin_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRateLimitAdmin(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRateLimitAdmin"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRateLimitAdmin) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRateLimitAdmin) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn.go new file mode 100644 index 0000000000..e9f66c6673 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRmn is the `setRmn` instruction. +type SetRmn struct { + RmnAddress *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRmnInstructionBuilder creates a new `SetRmn` instruction builder. +func NewSetRmnInstructionBuilder() *SetRmn { + nd := &SetRmn{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *SetRmn) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *SetRmn { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRmn) SetStateAccount(state ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRmn) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRmn) SetMintAccount(mint ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRmn) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRmn) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRmn) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRmn) SetProgramAccount(program ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRmn) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRmn) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRmn) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRmn) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRmn, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRmn) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRmn) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRmn) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRmn")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRmn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *SetRmn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewSetRmnInstruction declares a new SetRmn instruction with the provided parameters and accounts. +func NewSetRmnInstruction( + // Parameters: + rmnAddress ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRmn { + return NewSetRmnInstructionBuilder(). + SetRmnAddress(rmnAddress). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn_test.go new file mode 100644 index 0000000000..b8c433a53b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRmn_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRmn(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRmn"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRmn) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRmn) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter.go new file mode 100644 index 0000000000..606aa04600 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRouter is the `setRouter` instruction. +type SetRouter struct { + NewRouter *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRouterInstructionBuilder creates a new `SetRouter` instruction builder. +func NewSetRouterInstructionBuilder() *SetRouter { + nd := &SetRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetNewRouter sets the "newRouter" parameter. +func (inst *SetRouter) SetNewRouter(newRouter ag_solanago.PublicKey) *SetRouter { + inst.NewRouter = &newRouter + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRouter) SetStateAccount(state ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRouter) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRouter) SetMintAccount(mint ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRouter) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRouter) SetProgramAccount(program ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRouter) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRouter) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRouter) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewRouter == nil { + return errors.New("NewRouter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewRouter", *inst.NewRouter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewRouter` param: + err = encoder.Encode(obj.NewRouter) + if err != nil { + return err + } + return nil +} +func (obj *SetRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewRouter`: + err = decoder.Decode(&obj.NewRouter) + if err != nil { + return err + } + return nil +} + +// NewSetRouterInstruction declares a new SetRouter instruction with the provided parameters and accounts. +func NewSetRouterInstruction( + // Parameters: + newRouter ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRouter { + return NewSetRouterInstructionBuilder(). + SetNewRouter(newRouter). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter_test.go new file mode 100644 index 0000000000..0fc6ea884c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/SetRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership.go new file mode 100644 index 0000000000..0f1690f50b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferOwnership is the `transferOwnership` instruction. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferOwnership) SetMintAccount(mint ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership_test.go new file mode 100644 index 0000000000..9a8bb2a981 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion.go new file mode 100644 index 0000000000..e26ee180db --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion.go @@ -0,0 +1,80 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 0), + } + return nd +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=0]").ParentFunc(func(accountsBranch ag_treeout.Branches) {}) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction() *TypeVersion { + return NewTypeVersionInstructionBuilder() +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion_test.go new file mode 100644 index 0000000000..cc064cc842 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/accounts.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/accounts.go new file mode 100644 index 0000000000..37bd8d39ca --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/accounts.go @@ -0,0 +1,178 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +type State struct { + Version uint8 + Config BaseConfig + Funding FundingConfig +} + +var StateDiscriminator = [8]byte{216, 146, 107, 94, 104, 75, 182, 177} + +func (obj State) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(StateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + // Serialize `Funding` param: + err = encoder.Encode(obj.Funding) + if err != nil { + return err + } + return nil +} + +func (obj *State) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(StateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[216 146 107 94 104 75 182 177]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + // Deserialize `Funding`: + err = decoder.Decode(&obj.Funding) + if err != nil { + return err + } + return nil +} + +type PoolConfig struct { + Version uint8 +} + +var PoolConfigDiscriminator = [8]byte{26, 108, 14, 123, 116, 230, 129, 43} + +func (obj PoolConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(PoolConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + return nil +} + +func (obj *PoolConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(PoolConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[26 108 14 123 116 230 129 43]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + return nil +} + +type ChainConfig struct { + Version uint8 + Base BaseChain + Cctp CctpChain +} + +var ChainConfigDiscriminator = [8]byte{13, 177, 233, 141, 212, 29, 148, 56} + +func (obj ChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ChainConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Base` param: + err = encoder.Encode(obj.Base) + if err != nil { + return err + } + // Serialize `Cctp` param: + err = encoder.Encode(obj.Cctp) + if err != nil { + return err + } + return nil +} + +func (obj *ChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ChainConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[13 177 233 141 212 29 148 56]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Base`: + err = decoder.Decode(&obj.Base) + if err != nil { + return err + } + // Deserialize `Cctp`: + err = decoder.Decode(&obj.Cctp) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/alias.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/alias.go new file mode 100644 index 0000000000..81f8186449 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/alias.go @@ -0,0 +1,19 @@ +package cctp_token_pool // revive:disable-line:var-naming + +import ( + base "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/base_token_pool" +) + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type RemoteAddress = base.RemoteAddress +type RemoteConfig = base.RemoteConfig +type LockOrBurnInV1 = base.LockOrBurnInV1 +type LockOrBurnOutV1 = base.LockOrBurnOutV1 +type ReleaseOrMintInV1 = base.ReleaseOrMintInV1 +type ReleaseOrMintOutV1 = base.ReleaseOrMintOutV1 +type RateLimitConfig = base.RateLimitConfig +type BaseConfig = base.BaseConfig +type BaseChain = base.BaseChain +type DeriveAccountsResponse = base.DeriveAccountsResponse diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/instructions.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/instructions.go new file mode 100644 index 0000000000..15050da1a5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/instructions.go @@ -0,0 +1,298 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "CctpTokenPool" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_InitGlobalConfig = ag_binary.TypeID([8]byte{140, 136, 214, 48, 87, 0, 120, 255}) + + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + Instruction_SetFundManager = ag_binary.TypeID([8]byte{120, 5, 18, 143, 165, 103, 181, 139}) + + Instruction_SetMinimumSignerFunds = ag_binary.TypeID([8]byte{142, 36, 82, 253, 191, 111, 114, 53}) + + Instruction_SetFundReclaimDestination = ag_binary.TypeID([8]byte{81, 6, 71, 218, 85, 141, 95, 162}) + + Instruction_SetRouter = ag_binary.TypeID([8]byte{236, 248, 107, 200, 151, 160, 44, 250}) + + Instruction_SetRmn = ag_binary.TypeID([8]byte{252, 89, 60, 179, 198, 54, 169, 120}) + + Instruction_InitChainRemoteConfig = ag_binary.TypeID([8]byte{21, 150, 133, 36, 2, 116, 199, 129}) + + Instruction_EditChainRemoteConfig = ag_binary.TypeID([8]byte{149, 112, 186, 72, 116, 217, 159, 175}) + + Instruction_EditChainRemoteConfigCctp = ag_binary.TypeID([8]byte{5, 215, 79, 193, 234, 35, 15, 87}) + + Instruction_AppendRemotePoolAddresses = ag_binary.TypeID([8]byte{172, 57, 83, 55, 70, 112, 26, 197}) + + Instruction_SetChainRateLimit = ag_binary.TypeID([8]byte{188, 188, 161, 37, 100, 249, 123, 170}) + + Instruction_SetRateLimitAdmin = ag_binary.TypeID([8]byte{21, 182, 126, 128, 31, 241, 37, 34}) + + Instruction_DeleteChainConfig = ag_binary.TypeID([8]byte{241, 159, 142, 210, 64, 173, 77, 179}) + + Instruction_ConfigureAllowList = ag_binary.TypeID([8]byte{18, 180, 102, 187, 209, 0, 130, 191}) + + Instruction_RemoveFromAllowList = ag_binary.TypeID([8]byte{44, 46, 123, 213, 40, 11, 107, 18}) + + Instruction_ReleaseOrMintTokens = ag_binary.TypeID([8]byte{92, 100, 150, 198, 252, 63, 164, 228}) + + Instruction_LockOrBurnTokens = ag_binary.TypeID([8]byte{114, 161, 94, 29, 147, 25, 232, 191}) + + Instruction_ReclaimEventAccount = ag_binary.TypeID([8]byte{94, 198, 180, 159, 131, 236, 15, 174}) + + // Returns an amount of SOL from the pool signer account to the designated + // fund reclaimer. There are three entities involved: + // + // * `owner`: can configure the reclaimer and fund manager. + // * `fund_manager`: can execute this instruction. + // * `fund_reclaim_destination`: receives the funds. + // + // The resulting funds on the PDA cannot drop below `minimum_signer_funds`. + Instruction_ReclaimFunds = ag_binary.TypeID([8]byte{38, 246, 147, 248, 43, 41, 43, 198}) + + Instruction_DeriveAccountsReleaseOrMintTokens = ag_binary.TypeID([8]byte{40, 91, 244, 228, 0, 2, 51, 238}) + + Instruction_DeriveAccountsLockOrBurnTokens = ag_binary.TypeID([8]byte{20, 237, 184, 4, 166, 153, 108, 174}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_InitGlobalConfig: + return "InitGlobalConfig" + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetFundManager: + return "SetFundManager" + case Instruction_SetMinimumSignerFunds: + return "SetMinimumSignerFunds" + case Instruction_SetFundReclaimDestination: + return "SetFundReclaimDestination" + case Instruction_SetRouter: + return "SetRouter" + case Instruction_SetRmn: + return "SetRmn" + case Instruction_InitChainRemoteConfig: + return "InitChainRemoteConfig" + case Instruction_EditChainRemoteConfig: + return "EditChainRemoteConfig" + case Instruction_EditChainRemoteConfigCctp: + return "EditChainRemoteConfigCctp" + case Instruction_AppendRemotePoolAddresses: + return "AppendRemotePoolAddresses" + case Instruction_SetChainRateLimit: + return "SetChainRateLimit" + case Instruction_SetRateLimitAdmin: + return "SetRateLimitAdmin" + case Instruction_DeleteChainConfig: + return "DeleteChainConfig" + case Instruction_ConfigureAllowList: + return "ConfigureAllowList" + case Instruction_RemoveFromAllowList: + return "RemoveFromAllowList" + case Instruction_ReleaseOrMintTokens: + return "ReleaseOrMintTokens" + case Instruction_LockOrBurnTokens: + return "LockOrBurnTokens" + case Instruction_ReclaimEventAccount: + return "ReclaimEventAccount" + case Instruction_ReclaimFunds: + return "ReclaimFunds" + case Instruction_DeriveAccountsReleaseOrMintTokens: + return "DeriveAccountsReleaseOrMintTokens" + case Instruction_DeriveAccountsLockOrBurnTokens: + return "DeriveAccountsLockOrBurnTokens" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "init_global_config", (*InitGlobalConfig)(nil), + }, + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_fund_manager", (*SetFundManager)(nil), + }, + { + "set_minimum_signer_funds", (*SetMinimumSignerFunds)(nil), + }, + { + "set_fund_reclaim_destination", (*SetFundReclaimDestination)(nil), + }, + { + "set_router", (*SetRouter)(nil), + }, + { + "set_rmn", (*SetRmn)(nil), + }, + { + "init_chain_remote_config", (*InitChainRemoteConfig)(nil), + }, + { + "edit_chain_remote_config", (*EditChainRemoteConfig)(nil), + }, + { + "edit_chain_remote_config_cctp", (*EditChainRemoteConfigCctp)(nil), + }, + { + "append_remote_pool_addresses", (*AppendRemotePoolAddresses)(nil), + }, + { + "set_chain_rate_limit", (*SetChainRateLimit)(nil), + }, + { + "set_rate_limit_admin", (*SetRateLimitAdmin)(nil), + }, + { + "delete_chain_config", (*DeleteChainConfig)(nil), + }, + { + "configure_allow_list", (*ConfigureAllowList)(nil), + }, + { + "remove_from_allow_list", (*RemoveFromAllowList)(nil), + }, + { + "release_or_mint_tokens", (*ReleaseOrMintTokens)(nil), + }, + { + "lock_or_burn_tokens", (*LockOrBurnTokens)(nil), + }, + { + "reclaim_event_account", (*ReclaimEventAccount)(nil), + }, + { + "reclaim_funds", (*ReclaimFunds)(nil), + }, + { + "derive_accounts_release_or_mint_tokens", (*DeriveAccountsReleaseOrMintTokens)(nil), + }, + { + "derive_accounts_lock_or_burn_tokens", (*DeriveAccountsLockOrBurnTokens)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/testing_utils.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/testing_utils.go new file mode 100644 index 0000000000..0568726811 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/cctp_token_pool/types.go b/chains/solana/gobindings/v1_6_1/cctp_token_pool/types.go new file mode 100644 index 0000000000..15cb38d9fc --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/cctp_token_pool/types.go @@ -0,0 +1,231 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package cctp_token_pool + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type CctpMessage struct { + Data []byte +} + +func (obj CctpMessage) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + return nil +} + +func (obj *CctpMessage) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + return nil +} + +type MessageAndAttestation struct { + Message CctpMessage + Attestation []byte +} + +func (obj MessageAndAttestation) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + // Serialize `Attestation` param: + err = encoder.Encode(obj.Attestation) + if err != nil { + return err + } + return nil +} + +func (obj *MessageAndAttestation) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + // Deserialize `Attestation`: + err = decoder.Decode(&obj.Attestation) + if err != nil { + return err + } + return nil +} + +type DepositForBurnWithCallerParams struct { + Amount uint64 + DestinationDomain uint32 + MintRecipient ag_solanago.PublicKey + DestinationCaller ag_solanago.PublicKey +} + +func (obj DepositForBurnWithCallerParams) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `DestinationDomain` param: + err = encoder.Encode(obj.DestinationDomain) + if err != nil { + return err + } + // Serialize `MintRecipient` param: + err = encoder.Encode(obj.MintRecipient) + if err != nil { + return err + } + // Serialize `DestinationCaller` param: + err = encoder.Encode(obj.DestinationCaller) + if err != nil { + return err + } + return nil +} + +func (obj *DepositForBurnWithCallerParams) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `DestinationDomain`: + err = decoder.Decode(&obj.DestinationDomain) + if err != nil { + return err + } + // Deserialize `MintRecipient`: + err = decoder.Decode(&obj.MintRecipient) + if err != nil { + return err + } + // Deserialize `DestinationCaller`: + err = decoder.Decode(&obj.DestinationCaller) + if err != nil { + return err + } + return nil +} + +type FundingConfig struct { + Manager ag_solanago.PublicKey + ReclaimDestination ag_solanago.PublicKey + MinimumSignerFunds uint64 +} + +func (obj FundingConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Manager` param: + err = encoder.Encode(obj.Manager) + if err != nil { + return err + } + // Serialize `ReclaimDestination` param: + err = encoder.Encode(obj.ReclaimDestination) + if err != nil { + return err + } + // Serialize `MinimumSignerFunds` param: + err = encoder.Encode(obj.MinimumSignerFunds) + if err != nil { + return err + } + return nil +} + +func (obj *FundingConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Manager`: + err = decoder.Decode(&obj.Manager) + if err != nil { + return err + } + // Deserialize `ReclaimDestination`: + err = decoder.Decode(&obj.ReclaimDestination) + if err != nil { + return err + } + // Deserialize `MinimumSignerFunds`: + err = decoder.Decode(&obj.MinimumSignerFunds) + if err != nil { + return err + } + return nil +} + +type CctpChain struct { + DomainId uint32 + DestinationCaller ag_solanago.PublicKey +} + +func (obj CctpChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DomainId` param: + err = encoder.Encode(obj.DomainId) + if err != nil { + return err + } + // Serialize `DestinationCaller` param: + err = encoder.Encode(obj.DestinationCaller) + if err != nil { + return err + } + return nil +} + +func (obj *CctpChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DomainId`: + err = decoder.Decode(&obj.DomainId) + if err != nil { + return err + } + // Deserialize `DestinationCaller`: + err = decoder.Decode(&obj.DestinationCaller) + if err != nil { + return err + } + return nil +} + +type OnrampDeriveStage ag_binary.BorshEnum + +const ( + RetrieveChainConfig_OnrampDeriveStage OnrampDeriveStage = iota + BuildDynamicAccounts_OnrampDeriveStage +) + +func (value OnrampDeriveStage) String() string { + switch value { + case RetrieveChainConfig_OnrampDeriveStage: + return "RetrieveChainConfig" + case BuildDynamicAccounts_OnrampDeriveStage: + return "BuildDynamicAccounts" + default: + return "" + } +} + +type OfframpDeriveStage ag_binary.BorshEnum + +const ( + RetrieveChainConfig_OfframpDeriveStage OfframpDeriveStage = iota + BuildDynamicAccounts_OfframpDeriveStage +) + +func (value OfframpDeriveStage) String() string { + switch value { + case RetrieveChainConfig_OfframpDeriveStage: + return "RetrieveChainConfig" + case BuildDynamicAccounts_OfframpDeriveStage: + return "BuildDynamicAccounts" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership.go new file mode 100644 index 0000000000..55fcccb068 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership.go @@ -0,0 +1,117 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AcceptOwnership is the `acceptOwnership` instruction. +type AcceptOwnership struct { + + // [0] = [WRITE] state + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership_test.go new file mode 100644 index 0000000000..402942e936 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend.go new file mode 100644 index 0000000000..540c77d8b3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend.go @@ -0,0 +1,637 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// CcipSend is the `ccipSend` instruction. +type CcipSend struct { + DestChainSelector *uint64 + TokenAmounts *[]SVMTokenAmount + Data *[]byte + FeeToken *ag_solanago.PublicKey + TokenIndexes *[]byte + + // [0] = [] state + // + // [1] = [] chainConfig + // + // [2] = [WRITE] ccipSender + // + // [3] = [WRITE] authorityFeeTokenAta + // + // [4] = [SIGNER] authority + // + // [5] = [] systemProgram + // + // [6] = [] ccipRouter + // + // [7] = [] ccipConfig + // + // [8] = [WRITE] ccipDestChainState + // + // [9] = [WRITE] ccipSenderNonce + // + // [10] = [] ccipFeeTokenProgram + // + // [11] = [] ccipFeeTokenMint + // + // [12] = [WRITE] ccipFeeTokenUserAta + // + // [13] = [WRITE] ccipFeeTokenReceiver + // + // [14] = [] ccipFeeBillingSigner + // + // [15] = [] ccipFeeQuoter + // + // [16] = [] ccipFeeQuoterConfig + // + // [17] = [] ccipFeeQuoterDestChain + // + // [18] = [] ccipFeeQuoterBillingTokenConfig + // + // [19] = [] ccipFeeQuoterLinkTokenConfig + // + // [20] = [] ccipRmnRemote + // + // [21] = [] ccipRmnRemoteCurses + // + // [22] = [] ccipRmnRemoteConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCcipSendInstructionBuilder creates a new `CcipSend` instruction builder. +func NewCcipSendInstructionBuilder() *CcipSend { + nd := &CcipSend{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 23), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *CcipSend) SetDestChainSelector(destChainSelector uint64) *CcipSend { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetTokenAmounts sets the "tokenAmounts" parameter. +func (inst *CcipSend) SetTokenAmounts(tokenAmounts []SVMTokenAmount) *CcipSend { + inst.TokenAmounts = &tokenAmounts + return inst +} + +// SetData sets the "data" parameter. +func (inst *CcipSend) SetData(data []byte) *CcipSend { + inst.Data = &data + return inst +} + +// SetFeeToken sets the "feeToken" parameter. +func (inst *CcipSend) SetFeeToken(feeToken ag_solanago.PublicKey) *CcipSend { + inst.FeeToken = &feeToken + return inst +} + +// SetTokenIndexes sets the "tokenIndexes" parameter. +func (inst *CcipSend) SetTokenIndexes(tokenIndexes []byte) *CcipSend { + inst.TokenIndexes = &tokenIndexes + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *CcipSend) SetStateAccount(state ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *CcipSend) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *CcipSend) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig) + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *CcipSend) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetCcipSenderAccount sets the "ccipSender" account. +func (inst *CcipSend) SetCcipSenderAccount(ccipSender ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[2] = ag_solanago.Meta(ccipSender).WRITE() + return inst +} + +// GetCcipSenderAccount gets the "ccipSender" account. +func (inst *CcipSend) GetCcipSenderAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetAuthorityFeeTokenAtaAccount sets the "authorityFeeTokenAta" account. +func (inst *CcipSend) SetAuthorityFeeTokenAtaAccount(authorityFeeTokenAta ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[3] = ag_solanago.Meta(authorityFeeTokenAta).WRITE() + return inst +} + +// GetAuthorityFeeTokenAtaAccount gets the "authorityFeeTokenAta" account. +func (inst *CcipSend) GetAuthorityFeeTokenAtaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CcipSend) SetAuthorityAccount(authority ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CcipSend) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CcipSend) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[5] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CcipSend) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetCcipRouterAccount sets the "ccipRouter" account. +func (inst *CcipSend) SetCcipRouterAccount(ccipRouter ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[6] = ag_solanago.Meta(ccipRouter) + return inst +} + +// GetCcipRouterAccount gets the "ccipRouter" account. +func (inst *CcipSend) GetCcipRouterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetCcipConfigAccount sets the "ccipConfig" account. +func (inst *CcipSend) SetCcipConfigAccount(ccipConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[7] = ag_solanago.Meta(ccipConfig) + return inst +} + +// GetCcipConfigAccount gets the "ccipConfig" account. +func (inst *CcipSend) GetCcipConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetCcipDestChainStateAccount sets the "ccipDestChainState" account. +func (inst *CcipSend) SetCcipDestChainStateAccount(ccipDestChainState ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[8] = ag_solanago.Meta(ccipDestChainState).WRITE() + return inst +} + +// GetCcipDestChainStateAccount gets the "ccipDestChainState" account. +func (inst *CcipSend) GetCcipDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetCcipSenderNonceAccount sets the "ccipSenderNonce" account. +func (inst *CcipSend) SetCcipSenderNonceAccount(ccipSenderNonce ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[9] = ag_solanago.Meta(ccipSenderNonce).WRITE() + return inst +} + +// GetCcipSenderNonceAccount gets the "ccipSenderNonce" account. +func (inst *CcipSend) GetCcipSenderNonceAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetCcipFeeTokenProgramAccount sets the "ccipFeeTokenProgram" account. +func (inst *CcipSend) SetCcipFeeTokenProgramAccount(ccipFeeTokenProgram ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[10] = ag_solanago.Meta(ccipFeeTokenProgram) + return inst +} + +// GetCcipFeeTokenProgramAccount gets the "ccipFeeTokenProgram" account. +func (inst *CcipSend) GetCcipFeeTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetCcipFeeTokenMintAccount sets the "ccipFeeTokenMint" account. +func (inst *CcipSend) SetCcipFeeTokenMintAccount(ccipFeeTokenMint ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[11] = ag_solanago.Meta(ccipFeeTokenMint) + return inst +} + +// GetCcipFeeTokenMintAccount gets the "ccipFeeTokenMint" account. +func (inst *CcipSend) GetCcipFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetCcipFeeTokenUserAtaAccount sets the "ccipFeeTokenUserAta" account. +func (inst *CcipSend) SetCcipFeeTokenUserAtaAccount(ccipFeeTokenUserAta ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[12] = ag_solanago.Meta(ccipFeeTokenUserAta).WRITE() + return inst +} + +// GetCcipFeeTokenUserAtaAccount gets the "ccipFeeTokenUserAta" account. +func (inst *CcipSend) GetCcipFeeTokenUserAtaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetCcipFeeTokenReceiverAccount sets the "ccipFeeTokenReceiver" account. +func (inst *CcipSend) SetCcipFeeTokenReceiverAccount(ccipFeeTokenReceiver ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[13] = ag_solanago.Meta(ccipFeeTokenReceiver).WRITE() + return inst +} + +// GetCcipFeeTokenReceiverAccount gets the "ccipFeeTokenReceiver" account. +func (inst *CcipSend) GetCcipFeeTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +// SetCcipFeeBillingSignerAccount sets the "ccipFeeBillingSigner" account. +func (inst *CcipSend) SetCcipFeeBillingSignerAccount(ccipFeeBillingSigner ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[14] = ag_solanago.Meta(ccipFeeBillingSigner) + return inst +} + +// GetCcipFeeBillingSignerAccount gets the "ccipFeeBillingSigner" account. +func (inst *CcipSend) GetCcipFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[14] +} + +// SetCcipFeeQuoterAccount sets the "ccipFeeQuoter" account. +func (inst *CcipSend) SetCcipFeeQuoterAccount(ccipFeeQuoter ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[15] = ag_solanago.Meta(ccipFeeQuoter) + return inst +} + +// GetCcipFeeQuoterAccount gets the "ccipFeeQuoter" account. +func (inst *CcipSend) GetCcipFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[15] +} + +// SetCcipFeeQuoterConfigAccount sets the "ccipFeeQuoterConfig" account. +func (inst *CcipSend) SetCcipFeeQuoterConfigAccount(ccipFeeQuoterConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[16] = ag_solanago.Meta(ccipFeeQuoterConfig) + return inst +} + +// GetCcipFeeQuoterConfigAccount gets the "ccipFeeQuoterConfig" account. +func (inst *CcipSend) GetCcipFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[16] +} + +// SetCcipFeeQuoterDestChainAccount sets the "ccipFeeQuoterDestChain" account. +func (inst *CcipSend) SetCcipFeeQuoterDestChainAccount(ccipFeeQuoterDestChain ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[17] = ag_solanago.Meta(ccipFeeQuoterDestChain) + return inst +} + +// GetCcipFeeQuoterDestChainAccount gets the "ccipFeeQuoterDestChain" account. +func (inst *CcipSend) GetCcipFeeQuoterDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[17] +} + +// SetCcipFeeQuoterBillingTokenConfigAccount sets the "ccipFeeQuoterBillingTokenConfig" account. +func (inst *CcipSend) SetCcipFeeQuoterBillingTokenConfigAccount(ccipFeeQuoterBillingTokenConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[18] = ag_solanago.Meta(ccipFeeQuoterBillingTokenConfig) + return inst +} + +// GetCcipFeeQuoterBillingTokenConfigAccount gets the "ccipFeeQuoterBillingTokenConfig" account. +func (inst *CcipSend) GetCcipFeeQuoterBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[18] +} + +// SetCcipFeeQuoterLinkTokenConfigAccount sets the "ccipFeeQuoterLinkTokenConfig" account. +func (inst *CcipSend) SetCcipFeeQuoterLinkTokenConfigAccount(ccipFeeQuoterLinkTokenConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[19] = ag_solanago.Meta(ccipFeeQuoterLinkTokenConfig) + return inst +} + +// GetCcipFeeQuoterLinkTokenConfigAccount gets the "ccipFeeQuoterLinkTokenConfig" account. +func (inst *CcipSend) GetCcipFeeQuoterLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[19] +} + +// SetCcipRmnRemoteAccount sets the "ccipRmnRemote" account. +func (inst *CcipSend) SetCcipRmnRemoteAccount(ccipRmnRemote ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[20] = ag_solanago.Meta(ccipRmnRemote) + return inst +} + +// GetCcipRmnRemoteAccount gets the "ccipRmnRemote" account. +func (inst *CcipSend) GetCcipRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[20] +} + +// SetCcipRmnRemoteCursesAccount sets the "ccipRmnRemoteCurses" account. +func (inst *CcipSend) SetCcipRmnRemoteCursesAccount(ccipRmnRemoteCurses ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[21] = ag_solanago.Meta(ccipRmnRemoteCurses) + return inst +} + +// GetCcipRmnRemoteCursesAccount gets the "ccipRmnRemoteCurses" account. +func (inst *CcipSend) GetCcipRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[21] +} + +// SetCcipRmnRemoteConfigAccount sets the "ccipRmnRemoteConfig" account. +func (inst *CcipSend) SetCcipRmnRemoteConfigAccount(ccipRmnRemoteConfig ag_solanago.PublicKey) *CcipSend { + inst.AccountMetaSlice[22] = ag_solanago.Meta(ccipRmnRemoteConfig) + return inst +} + +// GetCcipRmnRemoteConfigAccount gets the "ccipRmnRemoteConfig" account. +func (inst *CcipSend) GetCcipRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[22] +} + +func (inst CcipSend) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CcipSend, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CcipSend) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CcipSend) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + if inst.TokenAmounts == nil { + return errors.New("TokenAmounts parameter is not set") + } + if inst.Data == nil { + return errors.New("Data parameter is not set") + } + if inst.FeeToken == nil { + return errors.New("FeeToken parameter is not set") + } + if inst.TokenIndexes == nil { + return errors.New("TokenIndexes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.CcipSender is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.AuthorityFeeTokenAta is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.CcipRouter is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.CcipConfig is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.CcipDestChainState is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.CcipSenderNonce is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.CcipFeeTokenProgram is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.CcipFeeTokenMint is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.CcipFeeTokenUserAta is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.CcipFeeTokenReceiver is not set") + } + if inst.AccountMetaSlice[14] == nil { + return errors.New("accounts.CcipFeeBillingSigner is not set") + } + if inst.AccountMetaSlice[15] == nil { + return errors.New("accounts.CcipFeeQuoter is not set") + } + if inst.AccountMetaSlice[16] == nil { + return errors.New("accounts.CcipFeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[17] == nil { + return errors.New("accounts.CcipFeeQuoterDestChain is not set") + } + if inst.AccountMetaSlice[18] == nil { + return errors.New("accounts.CcipFeeQuoterBillingTokenConfig is not set") + } + if inst.AccountMetaSlice[19] == nil { + return errors.New("accounts.CcipFeeQuoterLinkTokenConfig is not set") + } + if inst.AccountMetaSlice[20] == nil { + return errors.New("accounts.CcipRmnRemote is not set") + } + if inst.AccountMetaSlice[21] == nil { + return errors.New("accounts.CcipRmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[22] == nil { + return errors.New("accounts.CcipRmnRemoteConfig is not set") + } + } + return nil +} + +func (inst *CcipSend) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CcipSend")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + paramsBranch.Child(ag_format.Param(" TokenAmounts", *inst.TokenAmounts)) + paramsBranch.Child(ag_format.Param(" Data", *inst.Data)) + paramsBranch.Child(ag_format.Param(" FeeToken", *inst.FeeToken)) + paramsBranch.Child(ag_format.Param(" TokenIndexes", *inst.TokenIndexes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=23]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" ccipSender", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authorityFeeTokenAta", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" ccipRouter", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" ccipConfig", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" ccipDestChainState", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" ccipSenderNonce", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" ccipFeeTokenProgram", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" ccipFeeTokenMint", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" ccipFeeTokenUserAta", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" ccipFeeTokenReceiver", inst.AccountMetaSlice[13])) + accountsBranch.Child(ag_format.Meta(" ccipFeeBillingSigner", inst.AccountMetaSlice[14])) + accountsBranch.Child(ag_format.Meta(" ccipFeeQuoter", inst.AccountMetaSlice[15])) + accountsBranch.Child(ag_format.Meta(" ccipFeeQuoterConfig", inst.AccountMetaSlice[16])) + accountsBranch.Child(ag_format.Meta(" ccipFeeQuoterDestChain", inst.AccountMetaSlice[17])) + accountsBranch.Child(ag_format.Meta("ccipFeeQuoterBillingTokenConfig", inst.AccountMetaSlice[18])) + accountsBranch.Child(ag_format.Meta(" ccipFeeQuoterLinkTokenConfig", inst.AccountMetaSlice[19])) + accountsBranch.Child(ag_format.Meta(" ccipRmnRemote", inst.AccountMetaSlice[20])) + accountsBranch.Child(ag_format.Meta(" ccipRmnRemoteCurses", inst.AccountMetaSlice[21])) + accountsBranch.Child(ag_format.Meta(" ccipRmnRemoteConfig", inst.AccountMetaSlice[22])) + }) + }) + }) +} + +func (obj CcipSend) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `TokenAmounts` param: + err = encoder.Encode(obj.TokenAmounts) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + // Serialize `FeeToken` param: + err = encoder.Encode(obj.FeeToken) + if err != nil { + return err + } + // Serialize `TokenIndexes` param: + err = encoder.Encode(obj.TokenIndexes) + if err != nil { + return err + } + return nil +} +func (obj *CcipSend) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `TokenAmounts`: + err = decoder.Decode(&obj.TokenAmounts) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + // Deserialize `FeeToken`: + err = decoder.Decode(&obj.FeeToken) + if err != nil { + return err + } + // Deserialize `TokenIndexes`: + err = decoder.Decode(&obj.TokenIndexes) + if err != nil { + return err + } + return nil +} + +// NewCcipSendInstruction declares a new CcipSend instruction with the provided parameters and accounts. +func NewCcipSendInstruction( + // Parameters: + destChainSelector uint64, + tokenAmounts []SVMTokenAmount, + data []byte, + feeToken ag_solanago.PublicKey, + tokenIndexes []byte, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + ccipSender ag_solanago.PublicKey, + authorityFeeTokenAta ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + ccipRouter ag_solanago.PublicKey, + ccipConfig ag_solanago.PublicKey, + ccipDestChainState ag_solanago.PublicKey, + ccipSenderNonce ag_solanago.PublicKey, + ccipFeeTokenProgram ag_solanago.PublicKey, + ccipFeeTokenMint ag_solanago.PublicKey, + ccipFeeTokenUserAta ag_solanago.PublicKey, + ccipFeeTokenReceiver ag_solanago.PublicKey, + ccipFeeBillingSigner ag_solanago.PublicKey, + ccipFeeQuoter ag_solanago.PublicKey, + ccipFeeQuoterConfig ag_solanago.PublicKey, + ccipFeeQuoterDestChain ag_solanago.PublicKey, + ccipFeeQuoterBillingTokenConfig ag_solanago.PublicKey, + ccipFeeQuoterLinkTokenConfig ag_solanago.PublicKey, + ccipRmnRemote ag_solanago.PublicKey, + ccipRmnRemoteCurses ag_solanago.PublicKey, + ccipRmnRemoteConfig ag_solanago.PublicKey) *CcipSend { + return NewCcipSendInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetTokenAmounts(tokenAmounts). + SetData(data). + SetFeeToken(feeToken). + SetTokenIndexes(tokenIndexes). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetCcipSenderAccount(ccipSender). + SetAuthorityFeeTokenAtaAccount(authorityFeeTokenAta). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetCcipRouterAccount(ccipRouter). + SetCcipConfigAccount(ccipConfig). + SetCcipDestChainStateAccount(ccipDestChainState). + SetCcipSenderNonceAccount(ccipSenderNonce). + SetCcipFeeTokenProgramAccount(ccipFeeTokenProgram). + SetCcipFeeTokenMintAccount(ccipFeeTokenMint). + SetCcipFeeTokenUserAtaAccount(ccipFeeTokenUserAta). + SetCcipFeeTokenReceiverAccount(ccipFeeTokenReceiver). + SetCcipFeeBillingSignerAccount(ccipFeeBillingSigner). + SetCcipFeeQuoterAccount(ccipFeeQuoter). + SetCcipFeeQuoterConfigAccount(ccipFeeQuoterConfig). + SetCcipFeeQuoterDestChainAccount(ccipFeeQuoterDestChain). + SetCcipFeeQuoterBillingTokenConfigAccount(ccipFeeQuoterBillingTokenConfig). + SetCcipFeeQuoterLinkTokenConfigAccount(ccipFeeQuoterLinkTokenConfig). + SetCcipRmnRemoteAccount(ccipRmnRemote). + SetCcipRmnRemoteCursesAccount(ccipRmnRemoteCurses). + SetCcipRmnRemoteConfigAccount(ccipRmnRemoteConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend_test.go new file mode 100644 index 0000000000..51f1f8984e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/CcipSend_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CcipSend(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CcipSend"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CcipSend) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CcipSend) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig.go new file mode 100644 index 0000000000..17db5e19e7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitChainConfig is the `initChainConfig` instruction. +type InitChainConfig struct { + ChainSelector *uint64 + Recipient *[]byte + ExtraArgsBytes *[]byte + + // [0] = [WRITE] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitChainConfigInstructionBuilder creates a new `InitChainConfig` instruction builder. +func NewInitChainConfigInstructionBuilder() *InitChainConfig { + nd := &InitChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *InitChainConfig) SetChainSelector(chainSelector uint64) *InitChainConfig { + inst.ChainSelector = &chainSelector + return inst +} + +// SetRecipient sets the "recipient" parameter. +func (inst *InitChainConfig) SetRecipient(recipient []byte) *InitChainConfig { + inst.Recipient = &recipient + return inst +} + +// SetExtraArgsBytes sets the "extraArgsBytes" parameter. +func (inst *InitChainConfig) SetExtraArgsBytes(extraArgsBytes []byte) *InitChainConfig { + inst.ExtraArgsBytes = &extraArgsBytes + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitChainConfig) SetStateAccount(state ag_solanago.PublicKey) *InitChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *InitChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *InitChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *InitChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitChainConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitChainConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitChainConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst InitChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + if inst.Recipient == nil { + return errors.New("Recipient parameter is not set") + } + if inst.ExtraArgsBytes == nil { + return errors.New("ExtraArgsBytes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *InitChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" ChainSelector", *inst.ChainSelector)) + paramsBranch.Child(ag_format.Param(" Recipient", *inst.Recipient)) + paramsBranch.Child(ag_format.Param("ExtraArgsBytes", *inst.ExtraArgsBytes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj InitChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `Recipient` param: + err = encoder.Encode(obj.Recipient) + if err != nil { + return err + } + // Serialize `ExtraArgsBytes` param: + err = encoder.Encode(obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} +func (obj *InitChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `Recipient`: + err = decoder.Decode(&obj.Recipient) + if err != nil { + return err + } + // Deserialize `ExtraArgsBytes`: + err = decoder.Decode(&obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} + +// NewInitChainConfigInstruction declares a new InitChainConfig instruction with the provided parameters and accounts. +func NewInitChainConfigInstruction( + // Parameters: + chainSelector uint64, + recipient []byte, + extraArgsBytes []byte, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *InitChainConfig { + return NewInitChainConfigInstructionBuilder(). + SetChainSelector(chainSelector). + SetRecipient(recipient). + SetExtraArgsBytes(extraArgsBytes). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig_test.go new file mode 100644 index 0000000000..0af8a7eae4 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/InitChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize.go new file mode 100644 index 0000000000..74d990de6f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + Router *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRouter sets the "router" parameter. +func (inst *Initialize) SetRouter(router ag_solanago.PublicKey) *Initialize { + inst.Router = &router + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Router == nil { + return errors.New("Router parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Router", *inst.Router)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Parameters: + router ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetRouter(router). + SetStateAccount(state). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize_test.go new file mode 100644 index 0000000000..3f974c701c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig.go new file mode 100644 index 0000000000..d61629a62e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// RemoveChainConfig is the `removeChainConfig` instruction. +type RemoveChainConfig struct { + ChainSelector *uint64 + + // [0] = [WRITE] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemoveChainConfigInstructionBuilder creates a new `RemoveChainConfig` instruction builder. +func NewRemoveChainConfigInstructionBuilder() *RemoveChainConfig { + nd := &RemoveChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *RemoveChainConfig) SetChainSelector(chainSelector uint64) *RemoveChainConfig { + inst.ChainSelector = &chainSelector + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *RemoveChainConfig) SetStateAccount(state ag_solanago.PublicKey) *RemoveChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *RemoveChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *RemoveChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *RemoveChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *RemoveChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemoveChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemoveChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemoveChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemoveChainConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemoveChainConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemoveChainConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemoveChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemoveChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemoveChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemoveChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemoveChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemoveChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ChainSelector", *inst.ChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemoveChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *RemoveChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + return nil +} + +// NewRemoveChainConfigInstruction declares a new RemoveChainConfig instruction with the provided parameters and accounts. +func NewRemoveChainConfigInstruction( + // Parameters: + chainSelector uint64, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemoveChainConfig { + return NewRemoveChainConfigInstructionBuilder(). + SetChainSelector(chainSelector). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig_test.go new file mode 100644 index 0000000000..336a3c9841 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/RemoveChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemoveChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemoveChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemoveChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemoveChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership.go new file mode 100644 index 0000000000..15554dc681 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership.go @@ -0,0 +1,146 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferOwnership is the `transferOwnership` instruction. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership_test.go new file mode 100644 index 0000000000..550d67679d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig.go new file mode 100644 index 0000000000..f4e82ed03d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateChainConfig is the `updateChainConfig` instruction. +type UpdateChainConfig struct { + ChainSelector *uint64 + Recipient *[]byte + ExtraArgsBytes *[]byte + + // [0] = [WRITE] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateChainConfigInstructionBuilder creates a new `UpdateChainConfig` instruction builder. +func NewUpdateChainConfigInstructionBuilder() *UpdateChainConfig { + nd := &UpdateChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *UpdateChainConfig) SetChainSelector(chainSelector uint64) *UpdateChainConfig { + inst.ChainSelector = &chainSelector + return inst +} + +// SetRecipient sets the "recipient" parameter. +func (inst *UpdateChainConfig) SetRecipient(recipient []byte) *UpdateChainConfig { + inst.Recipient = &recipient + return inst +} + +// SetExtraArgsBytes sets the "extraArgsBytes" parameter. +func (inst *UpdateChainConfig) SetExtraArgsBytes(extraArgsBytes []byte) *UpdateChainConfig { + inst.ExtraArgsBytes = &extraArgsBytes + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *UpdateChainConfig) SetStateAccount(state ag_solanago.PublicKey) *UpdateChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *UpdateChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *UpdateChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *UpdateChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *UpdateChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *UpdateChainConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *UpdateChainConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *UpdateChainConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + if inst.Recipient == nil { + return errors.New("Recipient parameter is not set") + } + if inst.ExtraArgsBytes == nil { + return errors.New("ExtraArgsBytes parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *UpdateChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" ChainSelector", *inst.ChainSelector)) + paramsBranch.Child(ag_format.Param(" Recipient", *inst.Recipient)) + paramsBranch.Child(ag_format.Param("ExtraArgsBytes", *inst.ExtraArgsBytes)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `Recipient` param: + err = encoder.Encode(obj.Recipient) + if err != nil { + return err + } + // Serialize `ExtraArgsBytes` param: + err = encoder.Encode(obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} +func (obj *UpdateChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `Recipient`: + err = decoder.Decode(&obj.Recipient) + if err != nil { + return err + } + // Deserialize `ExtraArgsBytes`: + err = decoder.Decode(&obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} + +// NewUpdateChainConfigInstruction declares a new UpdateChainConfig instruction with the provided parameters and accounts. +func NewUpdateChainConfigInstruction( + // Parameters: + chainSelector uint64, + recipient []byte, + extraArgsBytes []byte, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *UpdateChainConfig { + return NewUpdateChainConfigInstructionBuilder(). + SetChainSelector(chainSelector). + SetRecipient(recipient). + SetExtraArgsBytes(extraArgsBytes). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig_test.go new file mode 100644 index 0000000000..dc75e11550 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter.go new file mode 100644 index 0000000000..037b8fbb15 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter.go @@ -0,0 +1,146 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateRouter is the `updateRouter` instruction. +type UpdateRouter struct { + NewRouter *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateRouterInstructionBuilder creates a new `UpdateRouter` instruction builder. +func NewUpdateRouterInstructionBuilder() *UpdateRouter { + nd := &UpdateRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetNewRouter sets the "newRouter" parameter. +func (inst *UpdateRouter) SetNewRouter(newRouter ag_solanago.PublicKey) *UpdateRouter { + inst.NewRouter = &newRouter + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *UpdateRouter) SetStateAccount(state ag_solanago.PublicKey) *UpdateRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *UpdateRouter) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst UpdateRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewRouter == nil { + return errors.New("NewRouter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewRouter", *inst.NewRouter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj UpdateRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewRouter` param: + err = encoder.Encode(obj.NewRouter) + if err != nil { + return err + } + return nil +} +func (obj *UpdateRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewRouter`: + err = decoder.Decode(&obj.NewRouter) + if err != nil { + return err + } + return nil +} + +// NewUpdateRouterInstruction declares a new UpdateRouter instruction with the provided parameters and accounts. +func NewUpdateRouterInstruction( + // Parameters: + newRouter ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateRouter { + return NewUpdateRouterInstructionBuilder(). + SetNewRouter(newRouter). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter_test.go new file mode 100644 index 0000000000..803cffc475 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/UpdateRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens.go new file mode 100644 index 0000000000..3616786cec --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens.go @@ -0,0 +1,264 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// WithdrawTokens is the `withdrawTokens` instruction. +type WithdrawTokens struct { + Amount *uint64 + Decimals *uint8 + + // [0] = [WRITE] state + // + // [1] = [WRITE] programTokenAccount + // + // [2] = [WRITE] toTokenAccount + // + // [3] = [] mint + // + // [4] = [] tokenProgram + // + // [5] = [] ccipSender + // + // [6] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewWithdrawTokensInstructionBuilder creates a new `WithdrawTokens` instruction builder. +func NewWithdrawTokensInstructionBuilder() *WithdrawTokens { + nd := &WithdrawTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetAmount sets the "amount" parameter. +func (inst *WithdrawTokens) SetAmount(amount uint64) *WithdrawTokens { + inst.Amount = &amount + return inst +} + +// SetDecimals sets the "decimals" parameter. +func (inst *WithdrawTokens) SetDecimals(decimals uint8) *WithdrawTokens { + inst.Decimals = &decimals + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *WithdrawTokens) SetStateAccount(state ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *WithdrawTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetProgramTokenAccountAccount sets the "programTokenAccount" account. +func (inst *WithdrawTokens) SetProgramTokenAccountAccount(programTokenAccount ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(programTokenAccount).WRITE() + return inst +} + +// GetProgramTokenAccountAccount gets the "programTokenAccount" account. +func (inst *WithdrawTokens) GetProgramTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetToTokenAccountAccount sets the "toTokenAccount" account. +func (inst *WithdrawTokens) SetToTokenAccountAccount(toTokenAccount ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(toTokenAccount).WRITE() + return inst +} + +// GetToTokenAccountAccount gets the "toTokenAccount" account. +func (inst *WithdrawTokens) GetToTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMintAccount sets the "mint" account. +func (inst *WithdrawTokens) SetMintAccount(mint ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *WithdrawTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *WithdrawTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *WithdrawTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetCcipSenderAccount sets the "ccipSender" account. +func (inst *WithdrawTokens) SetCcipSenderAccount(ccipSender ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(ccipSender) + return inst +} + +// GetCcipSenderAccount gets the "ccipSender" account. +func (inst *WithdrawTokens) GetCcipSenderAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *WithdrawTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *WithdrawTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *WithdrawTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst WithdrawTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_WithdrawTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst WithdrawTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *WithdrawTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Amount == nil { + return errors.New("Amount parameter is not set") + } + if inst.Decimals == nil { + return errors.New("Decimals parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ProgramTokenAccount is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.ToTokenAccount is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.CcipSender is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *WithdrawTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("WithdrawTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Amount", *inst.Amount)) + paramsBranch.Child(ag_format.Param("Decimals", *inst.Decimals)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("programToken", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" toToken", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("tokenProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" ccipSender", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj WithdrawTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `Decimals` param: + err = encoder.Encode(obj.Decimals) + if err != nil { + return err + } + return nil +} +func (obj *WithdrawTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `Decimals`: + err = decoder.Decode(&obj.Decimals) + if err != nil { + return err + } + return nil +} + +// NewWithdrawTokensInstruction declares a new WithdrawTokens instruction with the provided parameters and accounts. +func NewWithdrawTokensInstruction( + // Parameters: + amount uint64, + decimals uint8, + // Accounts: + state ag_solanago.PublicKey, + programTokenAccount ag_solanago.PublicKey, + toTokenAccount ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + ccipSender ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *WithdrawTokens { + return NewWithdrawTokensInstructionBuilder(). + SetAmount(amount). + SetDecimals(decimals). + SetStateAccount(state). + SetProgramTokenAccountAccount(programTokenAccount). + SetToTokenAccountAccount(toTokenAccount). + SetMintAccount(mint). + SetTokenProgramAccount(tokenProgram). + SetCcipSenderAccount(ccipSender). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens_test.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens_test.go new file mode 100644 index 0000000000..4f5c3d5647 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/WithdrawTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_WithdrawTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("WithdrawTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(WithdrawTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(WithdrawTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/accounts.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/accounts.go new file mode 100644 index 0000000000..56e5e13d50 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/accounts.go @@ -0,0 +1,126 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type BaseState struct { + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + Router ag_solanago.PublicKey +} + +var BaseStateDiscriminator = [8]byte{46, 139, 13, 192, 80, 181, 96, 46} + +func (obj BaseState) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(BaseStateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + return nil +} + +func (obj *BaseState) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(BaseStateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[46 139 13 192 80 181 96 46]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + return nil +} + +type RemoteChainConfig struct { + Recipient []byte + ExtraArgsBytes []byte +} + +var RemoteChainConfigDiscriminator = [8]byte{248, 170, 246, 200, 84, 101, 138, 67} + +func (obj RemoteChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(RemoteChainConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Recipient` param: + err = encoder.Encode(obj.Recipient) + if err != nil { + return err + } + // Serialize `ExtraArgsBytes` param: + err = encoder.Encode(obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} + +func (obj *RemoteChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(RemoteChainConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[248 170 246 200 84 101 138 67]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Recipient`: + err = decoder.Decode(&obj.Recipient) + if err != nil { + return err + } + // Deserialize `ExtraArgsBytes`: + err = decoder.Decode(&obj.ExtraArgsBytes) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/alias.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/alias.go new file mode 100644 index 0000000000..e8a646a7da --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/alias.go @@ -0,0 +1,10 @@ +package example_ccip_sender // revive:disable-line:var-naming + +import ( + feequoter "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/fee_quoter" +) + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type SVMTokenAmount = feequoter.SVMTokenAmount diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/instructions.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/instructions.go new file mode 100644 index 0000000000..ab09e0d333 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/instructions.go @@ -0,0 +1,175 @@ +// This program an example of a CCIP Sender Program. +// Used to test CCIP Router ccip_send. +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "ExampleCcipSender" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + Instruction_CcipSend = ag_binary.TypeID([8]byte{108, 216, 134, 191, 249, 234, 33, 84}) + + Instruction_UpdateRouter = ag_binary.TypeID([8]byte{32, 109, 12, 153, 101, 129, 64, 70}) + + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + Instruction_WithdrawTokens = ag_binary.TypeID([8]byte{2, 4, 225, 61, 19, 182, 106, 170}) + + Instruction_InitChainConfig = ag_binary.TypeID([8]byte{21, 94, 4, 115, 130, 211, 10, 229}) + + Instruction_UpdateChainConfig = ag_binary.TypeID([8]byte{192, 127, 91, 206, 38, 245, 41, 121}) + + Instruction_RemoveChainConfig = ag_binary.TypeID([8]byte{212, 220, 209, 147, 118, 171, 38, 48}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_CcipSend: + return "CcipSend" + case Instruction_UpdateRouter: + return "UpdateRouter" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_WithdrawTokens: + return "WithdrawTokens" + case Instruction_InitChainConfig: + return "InitChainConfig" + case Instruction_UpdateChainConfig: + return "UpdateChainConfig" + case Instruction_RemoveChainConfig: + return "RemoveChainConfig" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "ccip_send", (*CcipSend)(nil), + }, + { + "update_router", (*UpdateRouter)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "withdraw_tokens", (*WithdrawTokens)(nil), + }, + { + "init_chain_config", (*InitChainConfig)(nil), + }, + { + "update_chain_config", (*UpdateChainConfig)(nil), + }, + { + "remove_chain_config", (*RemoveChainConfig)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/testing_utils.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/testing_utils.go new file mode 100644 index 0000000000..be9efb35e1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/example_ccip_sender/types.go b/chains/solana/gobindings/v1_6_1/example_ccip_sender/types.go new file mode 100644 index 0000000000..d3a7a64020 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/example_ccip_sender/types.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package example_ccip_sender + +import ag_binary "github.com/gagliardetto/binary" + +type SenderError ag_binary.BorshEnum + +const ( + TransferTokenDuplicated_SenderError SenderError = iota +) + +func (value SenderError) String() string { + switch value { + case TransferTokenDuplicated_SenderError: + return "TransferTokenDuplicated" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership.go new file mode 100644 index 0000000000..fa0298789a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership.go @@ -0,0 +1,124 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Accepts the ownership of the fee quoter by the proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for accepting ownership. +// The new owner must be a signer of the transaction. +type AcceptOwnership struct { + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *AcceptOwnership) SetConfigAccount(config ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AcceptOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership_test.go new file mode 100644 index 0000000000..04edfa04eb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig.go new file mode 100644 index 0000000000..0ce4131ec7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig.go @@ -0,0 +1,285 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Adds a billing token configuration. +// Only CCIP Admin can add a billing token configuration. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for adding the billing token configuration. +// * `config` - The billing token configuration to be added. +type AddBillingTokenConfig struct { + Config *BillingTokenConfig + + // [0] = [] config + // + // [1] = [WRITE] billingTokenConfig + // + // [2] = [] tokenProgram + // + // [3] = [] feeTokenMint + // + // [4] = [WRITE] feeTokenReceiver + // + // [5] = [WRITE, SIGNER] authority + // + // [6] = [] feeBillingSigner + // + // [7] = [] associatedTokenProgram + // + // [8] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddBillingTokenConfigInstructionBuilder creates a new `AddBillingTokenConfig` instruction builder. +func NewAddBillingTokenConfigInstructionBuilder() *AddBillingTokenConfig { + nd := &AddBillingTokenConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 9), + } + return nd +} + +// SetConfig sets the "config" parameter. +func (inst *AddBillingTokenConfig) SetConfig(config BillingTokenConfig) *AddBillingTokenConfig { + inst.Config = &config + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *AddBillingTokenConfig) SetConfigAccount(config ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddBillingTokenConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetBillingTokenConfigAccount sets the "billingTokenConfig" account. +func (inst *AddBillingTokenConfig) SetBillingTokenConfigAccount(billingTokenConfig ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(billingTokenConfig).WRITE() + return inst +} + +// GetBillingTokenConfigAccount gets the "billingTokenConfig" account. +func (inst *AddBillingTokenConfig) GetBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *AddBillingTokenConfig) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *AddBillingTokenConfig) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *AddBillingTokenConfig) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *AddBillingTokenConfig) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeTokenReceiverAccount sets the "feeTokenReceiver" account. +func (inst *AddBillingTokenConfig) SetFeeTokenReceiverAccount(feeTokenReceiver ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeTokenReceiver).WRITE() + return inst +} + +// GetFeeTokenReceiverAccount gets the "feeTokenReceiver" account. +func (inst *AddBillingTokenConfig) GetFeeTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddBillingTokenConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[5] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddBillingTokenConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetFeeBillingSignerAccount sets the "feeBillingSigner" account. +func (inst *AddBillingTokenConfig) SetFeeBillingSignerAccount(feeBillingSigner ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[6] = ag_solanago.Meta(feeBillingSigner) + return inst +} + +// GetFeeBillingSignerAccount gets the "feeBillingSigner" account. +func (inst *AddBillingTokenConfig) GetFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account. +func (inst *AddBillingTokenConfig) SetAssociatedTokenProgramAccount(associatedTokenProgram ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[7] = ag_solanago.Meta(associatedTokenProgram) + return inst +} + +// GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account. +func (inst *AddBillingTokenConfig) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddBillingTokenConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddBillingTokenConfig { + inst.AccountMetaSlice[8] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddBillingTokenConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +func (inst AddBillingTokenConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddBillingTokenConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddBillingTokenConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddBillingTokenConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Config == nil { + return errors.New("Config parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.BillingTokenConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeTokenReceiver is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.FeeBillingSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.AssociatedTokenProgram is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddBillingTokenConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddBillingTokenConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Config", *inst.Config)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=9]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" billingTokenConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feeTokenReceiver", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" feeBillingSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta("associatedTokenProgram", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[8])) + }) + }) + }) +} + +func (obj AddBillingTokenConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} +func (obj *AddBillingTokenConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +// NewAddBillingTokenConfigInstruction declares a new AddBillingTokenConfig instruction with the provided parameters and accounts. +func NewAddBillingTokenConfigInstruction( + // Parameters: + config BillingTokenConfig, + // Accounts: + configAccount ag_solanago.PublicKey, + billingTokenConfig ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + feeTokenReceiver ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + feeBillingSigner ag_solanago.PublicKey, + associatedTokenProgram ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddBillingTokenConfig { + return NewAddBillingTokenConfigInstructionBuilder(). + SetConfig(config). + SetConfigAccount(configAccount). + SetBillingTokenConfigAccount(billingTokenConfig). + SetTokenProgramAccount(tokenProgram). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenReceiverAccount(feeTokenReceiver). + SetAuthorityAccount(authority). + SetFeeBillingSignerAccount(feeBillingSigner). + SetAssociatedTokenProgramAccount(associatedTokenProgram). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig_test.go new file mode 100644 index 0000000000..c9ad8fdf19 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddBillingTokenConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddBillingTokenConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddBillingTokenConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddBillingTokenConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddBillingTokenConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain.go new file mode 100644 index 0000000000..8b14152584 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain.go @@ -0,0 +1,216 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Adds a new destination chain selector to the fee quoter. +// +// The Admin needs to add any new chain supported. +// When adding a new chain, the Admin needs to specify if it's enabled or not. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for adding the chain selector. +// * `chain_selector` - The new chain selector to be added. +// * `dest_chain_config` - The configuration for the chain as destination. +type AddDestChain struct { + ChainSelector *uint64 + DestChainConfig *DestChainConfig + + // [0] = [] config + // + // [1] = [WRITE] destChain + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddDestChainInstructionBuilder creates a new `AddDestChain` instruction builder. +func NewAddDestChainInstructionBuilder() *AddDestChain { + nd := &AddDestChain{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *AddDestChain) SetChainSelector(chainSelector uint64) *AddDestChain { + inst.ChainSelector = &chainSelector + return inst +} + +// SetDestChainConfig sets the "destChainConfig" parameter. +func (inst *AddDestChain) SetDestChainConfig(destChainConfig DestChainConfig) *AddDestChain { + inst.DestChainConfig = &destChainConfig + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *AddDestChain) SetConfigAccount(config ag_solanago.PublicKey) *AddDestChain { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddDestChain) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainAccount sets the "destChain" account. +func (inst *AddDestChain) SetDestChainAccount(destChain ag_solanago.PublicKey) *AddDestChain { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChain).WRITE() + return inst +} + +// GetDestChainAccount gets the "destChain" account. +func (inst *AddDestChain) GetDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddDestChain) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddDestChain { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddDestChain) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddDestChain) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddDestChain { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddDestChain) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AddDestChain) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddDestChain, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddDestChain) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddDestChain) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + if inst.DestChainConfig == nil { + return errors.New("DestChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChain is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddDestChain) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddDestChain")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" ChainSelector", *inst.ChainSelector)) + paramsBranch.Child(ag_format.Param("DestChainConfig", *inst.DestChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" destChain", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AddDestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `DestChainConfig` param: + err = encoder.Encode(obj.DestChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *AddDestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainConfig`: + err = decoder.Decode(&obj.DestChainConfig) + if err != nil { + return err + } + return nil +} + +// NewAddDestChainInstruction declares a new AddDestChain instruction with the provided parameters and accounts. +func NewAddDestChainInstruction( + // Parameters: + chainSelector uint64, + destChainConfig DestChainConfig, + // Accounts: + config ag_solanago.PublicKey, + destChain ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddDestChain { + return NewAddDestChainInstructionBuilder(). + SetChainSelector(chainSelector). + SetDestChainConfig(destChainConfig). + SetConfigAccount(config). + SetDestChainAccount(destChain). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain_test.go new file mode 100644 index 0000000000..4386f2b6c3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddDestChain_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddDestChain(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddDestChain"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddDestChain) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddDestChain) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater.go new file mode 100644 index 0000000000..6a0c477e5b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater.go @@ -0,0 +1,190 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Add a price updater address to the list of allowed price updaters. +// On price updates, the fee quoter will check the that caller is allowed. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for this operation. +// * `price_updater` - The price updater address. +type AddPriceUpdater struct { + PriceUpdater *ag_solanago.PublicKey + + // [0] = [WRITE] allowedPriceUpdater + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAddPriceUpdaterInstructionBuilder creates a new `AddPriceUpdater` instruction builder. +func NewAddPriceUpdaterInstructionBuilder() *AddPriceUpdater { + nd := &AddPriceUpdater{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetPriceUpdater sets the "priceUpdater" parameter. +func (inst *AddPriceUpdater) SetPriceUpdater(priceUpdater ag_solanago.PublicKey) *AddPriceUpdater { + inst.PriceUpdater = &priceUpdater + return inst +} + +// SetAllowedPriceUpdaterAccount sets the "allowedPriceUpdater" account. +func (inst *AddPriceUpdater) SetAllowedPriceUpdaterAccount(allowedPriceUpdater ag_solanago.PublicKey) *AddPriceUpdater { + inst.AccountMetaSlice[0] = ag_solanago.Meta(allowedPriceUpdater).WRITE() + return inst +} + +// GetAllowedPriceUpdaterAccount gets the "allowedPriceUpdater" account. +func (inst *AddPriceUpdater) GetAllowedPriceUpdaterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *AddPriceUpdater) SetConfigAccount(config ag_solanago.PublicKey) *AddPriceUpdater { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AddPriceUpdater) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AddPriceUpdater) SetAuthorityAccount(authority ag_solanago.PublicKey) *AddPriceUpdater { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AddPriceUpdater) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AddPriceUpdater) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AddPriceUpdater { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AddPriceUpdater) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AddPriceUpdater) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AddPriceUpdater, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AddPriceUpdater) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AddPriceUpdater) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.PriceUpdater == nil { + return errors.New("PriceUpdater parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.AllowedPriceUpdater is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AddPriceUpdater) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AddPriceUpdater")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("PriceUpdater", *inst.PriceUpdater)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("allowedPriceUpdater", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AddPriceUpdater) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PriceUpdater` param: + err = encoder.Encode(obj.PriceUpdater) + if err != nil { + return err + } + return nil +} +func (obj *AddPriceUpdater) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PriceUpdater`: + err = decoder.Decode(&obj.PriceUpdater) + if err != nil { + return err + } + return nil +} + +// NewAddPriceUpdaterInstruction declares a new AddPriceUpdater instruction with the provided parameters and accounts. +func NewAddPriceUpdaterInstruction( + // Parameters: + priceUpdater ag_solanago.PublicKey, + // Accounts: + allowedPriceUpdater ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AddPriceUpdater { + return NewAddPriceUpdaterInstructionBuilder(). + SetPriceUpdater(priceUpdater). + SetAllowedPriceUpdaterAccount(allowedPriceUpdater). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater_test.go new file mode 100644 index 0000000000..ae7d8024e1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/AddPriceUpdater_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AddPriceUpdater(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AddPriceUpdater"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AddPriceUpdater) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AddPriceUpdater) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain.go b/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain.go new file mode 100644 index 0000000000..6a7321df71 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Disables the destination chain selector. +// +// The Admin is the only one able to disable the chain selector as destination. This method is thought of as an emergency kill-switch. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for disabling the chain selector. +// * `chain_selector` - The destination chain selector to be disabled. +type DisableDestChain struct { + ChainSelector *uint64 + + // [0] = [] config + // + // [1] = [WRITE] destChain + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDisableDestChainInstructionBuilder creates a new `DisableDestChain` instruction builder. +func NewDisableDestChainInstructionBuilder() *DisableDestChain { + nd := &DisableDestChain{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *DisableDestChain) SetChainSelector(chainSelector uint64) *DisableDestChain { + inst.ChainSelector = &chainSelector + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *DisableDestChain) SetConfigAccount(config ag_solanago.PublicKey) *DisableDestChain { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *DisableDestChain) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainAccount sets the "destChain" account. +func (inst *DisableDestChain) SetDestChainAccount(destChain ag_solanago.PublicKey) *DisableDestChain { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChain).WRITE() + return inst +} + +// GetDestChainAccount gets the "destChain" account. +func (inst *DisableDestChain) GetDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DisableDestChain) SetAuthorityAccount(authority ag_solanago.PublicKey) *DisableDestChain { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DisableDestChain) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst DisableDestChain) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DisableDestChain, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DisableDestChain) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DisableDestChain) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChain is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *DisableDestChain) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DisableDestChain")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ChainSelector", *inst.ChainSelector)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("destChain", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj DisableDestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + return nil +} +func (obj *DisableDestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + return nil +} + +// NewDisableDestChainInstruction declares a new DisableDestChain instruction with the provided parameters and accounts. +func NewDisableDestChainInstruction( + // Parameters: + chainSelector uint64, + // Accounts: + config ag_solanago.PublicKey, + destChain ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *DisableDestChain { + return NewDisableDestChainInstructionBuilder(). + SetChainSelector(chainSelector). + SetConfigAccount(config). + SetDestChainAccount(destChain). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain_test.go new file mode 100644 index 0000000000..62a183309e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/DisableDestChain_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DisableDestChain(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DisableDestChain"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DisableDestChain) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DisableDestChain) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee.go b/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee.go new file mode 100644 index 0000000000..29aeef730e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee.go @@ -0,0 +1,233 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Calculates the fee for sending a message to the destination chain. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the fee calculation. +// * `dest_chain_selector` - The chain selector for the destination chain. +// * `message` - The message to be sent. +// +// # Additional accounts +// +// In addition to the fixed amount of accounts defined in the `GetFee` context, +// the following accounts must be provided: +// +// * First, the billing token config accounts for each token sent with the message, sequentially. +// For each token with no billing config account (i.e. tokens that cannot be possibly used as fee +// tokens, which also have no BPS fees enabled) the ZERO address must be provided instead. +// * Then, the per chain / per token config of every token sent with the message, sequentially +// in the same order. +// +// # Returns +// +// GetFeeResult struct with: +// - the fee token mint address, +// - the fee amount of said token, +// - the fee value in juels, +// - additional data required when performing the cross-chain transfer of tokens in that message +// - deserialized and processed extra args +type GetFee struct { + DestChainSelector *uint64 + Message *SVM2AnyMessage + + // [0] = [] config + // + // [1] = [] destChain + // + // [2] = [] billingTokenConfig + // + // [3] = [] linkTokenConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewGetFeeInstructionBuilder creates a new `GetFee` instruction builder. +func NewGetFeeInstructionBuilder() *GetFee { + nd := &GetFee{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetDestChainSelector sets the "destChainSelector" parameter. +func (inst *GetFee) SetDestChainSelector(destChainSelector uint64) *GetFee { + inst.DestChainSelector = &destChainSelector + return inst +} + +// SetMessage sets the "message" parameter. +func (inst *GetFee) SetMessage(message SVM2AnyMessage) *GetFee { + inst.Message = &message + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *GetFee) SetConfigAccount(config ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *GetFee) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainAccount sets the "destChain" account. +func (inst *GetFee) SetDestChainAccount(destChain ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChain) + return inst +} + +// GetDestChainAccount gets the "destChain" account. +func (inst *GetFee) GetDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetBillingTokenConfigAccount sets the "billingTokenConfig" account. +func (inst *GetFee) SetBillingTokenConfigAccount(billingTokenConfig ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[2] = ag_solanago.Meta(billingTokenConfig) + return inst +} + +// GetBillingTokenConfigAccount gets the "billingTokenConfig" account. +func (inst *GetFee) GetBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetLinkTokenConfigAccount sets the "linkTokenConfig" account. +func (inst *GetFee) SetLinkTokenConfigAccount(linkTokenConfig ag_solanago.PublicKey) *GetFee { + inst.AccountMetaSlice[3] = ag_solanago.Meta(linkTokenConfig) + return inst +} + +// GetLinkTokenConfigAccount gets the "linkTokenConfig" account. +func (inst *GetFee) GetLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst GetFee) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_GetFee, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst GetFee) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *GetFee) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.DestChainSelector == nil { + return errors.New("DestChainSelector parameter is not set") + } + if inst.Message == nil { + return errors.New("Message parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChain is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.BillingTokenConfig is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.LinkTokenConfig is not set") + } + } + return nil +} + +func (inst *GetFee) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("GetFee")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("DestChainSelector", *inst.DestChainSelector)) + paramsBranch.Child(ag_format.Param(" Message", *inst.Message)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" destChain", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("billingTokenConfig", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" linkTokenConfig", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj GetFee) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + return nil +} +func (obj *GetFee) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + return nil +} + +// NewGetFeeInstruction declares a new GetFee instruction with the provided parameters and accounts. +func NewGetFeeInstruction( + // Parameters: + destChainSelector uint64, + message SVM2AnyMessage, + // Accounts: + config ag_solanago.PublicKey, + destChain ag_solanago.PublicKey, + billingTokenConfig ag_solanago.PublicKey, + linkTokenConfig ag_solanago.PublicKey) *GetFee { + return NewGetFeeInstructionBuilder(). + SetDestChainSelector(destChainSelector). + SetMessage(message). + SetConfigAccount(config). + SetDestChainAccount(destChain). + SetBillingTokenConfigAccount(billingTokenConfig). + SetLinkTokenConfigAccount(linkTokenConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee_test.go new file mode 100644 index 0000000000..1e1c6ba294 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/GetFee_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_GetFee(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("GetFee"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(GetFee) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(GetFee) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize.go b/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize.go new file mode 100644 index 0000000000..64a6a2df6e --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize.go @@ -0,0 +1,255 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initializes the Fee Quoter. +// +// The initialization is responsibility of Admin, nothing more than calling this method should be done first. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for initialization. +// * `max_fee_juels_per_msg` - The maximum fee in juels that can be charged per message. +// * `onramp` - The public key of the onramp. +// +// The function also uses the link_token_mint account from the context. +type Initialize struct { + MaxFeeJuelsPerMsg *ag_binary.Uint128 + Onramp *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [] linkTokenMint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + } + return nd +} + +// SetMaxFeeJuelsPerMsg sets the "maxFeeJuelsPerMsg" parameter. +func (inst *Initialize) SetMaxFeeJuelsPerMsg(maxFeeJuelsPerMsg ag_binary.Uint128) *Initialize { + inst.MaxFeeJuelsPerMsg = &maxFeeJuelsPerMsg + return inst +} + +// SetOnramp sets the "onramp" parameter. +func (inst *Initialize) SetOnramp(onramp ag_solanago.PublicKey) *Initialize { + inst.Onramp = &onramp + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetLinkTokenMintAccount sets the "linkTokenMint" account. +func (inst *Initialize) SetLinkTokenMintAccount(linkTokenMint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(linkTokenMint) + return inst +} + +// GetLinkTokenMintAccount gets the "linkTokenMint" account. +func (inst *Initialize) GetLinkTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.MaxFeeJuelsPerMsg == nil { + return errors.New("MaxFeeJuelsPerMsg parameter is not set") + } + if inst.Onramp == nil { + return errors.New("Onramp parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.LinkTokenMint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("MaxFeeJuelsPerMsg", *inst.MaxFeeJuelsPerMsg)) + paramsBranch.Child(ag_format.Param(" Onramp", *inst.Onramp)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("linkTokenMint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MaxFeeJuelsPerMsg` param: + err = encoder.Encode(obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + // Serialize `Onramp` param: + err = encoder.Encode(obj.Onramp) + if err != nil { + return err + } + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MaxFeeJuelsPerMsg`: + err = decoder.Decode(&obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + // Deserialize `Onramp`: + err = decoder.Decode(&obj.Onramp) + if err != nil { + return err + } + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Parameters: + maxFeeJuelsPerMsg ag_binary.Uint128, + onramp ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + linkTokenMint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetMaxFeeJuelsPerMsg(maxFeeJuelsPerMsg). + SetOnramp(onramp). + SetConfigAccount(config). + SetLinkTokenMintAccount(linkTokenMint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize_test.go new file mode 100644 index 0000000000..f08c4f5092 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater.go b/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater.go new file mode 100644 index 0000000000..7d36520f12 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater.go @@ -0,0 +1,189 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Remove a price updater address from the list of allowed price updaters. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for this operation. +// * `price_updater` - The price updater address. +type RemovePriceUpdater struct { + PriceUpdater *ag_solanago.PublicKey + + // [0] = [WRITE] allowedPriceUpdater + // + // [1] = [] config + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemovePriceUpdaterInstructionBuilder creates a new `RemovePriceUpdater` instruction builder. +func NewRemovePriceUpdaterInstructionBuilder() *RemovePriceUpdater { + nd := &RemovePriceUpdater{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetPriceUpdater sets the "priceUpdater" parameter. +func (inst *RemovePriceUpdater) SetPriceUpdater(priceUpdater ag_solanago.PublicKey) *RemovePriceUpdater { + inst.PriceUpdater = &priceUpdater + return inst +} + +// SetAllowedPriceUpdaterAccount sets the "allowedPriceUpdater" account. +func (inst *RemovePriceUpdater) SetAllowedPriceUpdaterAccount(allowedPriceUpdater ag_solanago.PublicKey) *RemovePriceUpdater { + inst.AccountMetaSlice[0] = ag_solanago.Meta(allowedPriceUpdater).WRITE() + return inst +} + +// GetAllowedPriceUpdaterAccount gets the "allowedPriceUpdater" account. +func (inst *RemovePriceUpdater) GetAllowedPriceUpdaterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +func (inst *RemovePriceUpdater) SetConfigAccount(config ag_solanago.PublicKey) *RemovePriceUpdater { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *RemovePriceUpdater) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemovePriceUpdater) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemovePriceUpdater { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemovePriceUpdater) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemovePriceUpdater) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemovePriceUpdater { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemovePriceUpdater) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemovePriceUpdater) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemovePriceUpdater, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemovePriceUpdater) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemovePriceUpdater) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.PriceUpdater == nil { + return errors.New("PriceUpdater parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.AllowedPriceUpdater is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemovePriceUpdater) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemovePriceUpdater")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("PriceUpdater", *inst.PriceUpdater)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("allowedPriceUpdater", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemovePriceUpdater) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PriceUpdater` param: + err = encoder.Encode(obj.PriceUpdater) + if err != nil { + return err + } + return nil +} +func (obj *RemovePriceUpdater) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PriceUpdater`: + err = decoder.Decode(&obj.PriceUpdater) + if err != nil { + return err + } + return nil +} + +// NewRemovePriceUpdaterInstruction declares a new RemovePriceUpdater instruction with the provided parameters and accounts. +func NewRemovePriceUpdaterInstruction( + // Parameters: + priceUpdater ag_solanago.PublicKey, + // Accounts: + allowedPriceUpdater ag_solanago.PublicKey, + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemovePriceUpdater { + return NewRemovePriceUpdaterInstructionBuilder(). + SetPriceUpdater(priceUpdater). + SetAllowedPriceUpdaterAccount(allowedPriceUpdater). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater_test.go new file mode 100644 index 0000000000..a0ee46aa83 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/RemovePriceUpdater_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemovePriceUpdater(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemovePriceUpdater"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemovePriceUpdater) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemovePriceUpdater) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion.go new file mode 100644 index 0000000000..77c6d8b837 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion.go @@ -0,0 +1,154 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the default code version to be used. This is then used by the slim routing layer to determine +// which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `code_version` - The new code version to be set as default. +type SetDefaultCodeVersion struct { + CodeVersion *CodeVersion + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetDefaultCodeVersionInstructionBuilder creates a new `SetDefaultCodeVersion` instruction builder. +func NewSetDefaultCodeVersionInstructionBuilder() *SetDefaultCodeVersion { + nd := &SetDefaultCodeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetCodeVersion sets the "codeVersion" parameter. +func (inst *SetDefaultCodeVersion) SetCodeVersion(codeVersion CodeVersion) *SetDefaultCodeVersion { + inst.CodeVersion = &codeVersion + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetDefaultCodeVersion) SetConfigAccount(config ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetDefaultCodeVersion) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetDefaultCodeVersion) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetDefaultCodeVersion) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetDefaultCodeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetDefaultCodeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetDefaultCodeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetDefaultCodeVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.CodeVersion == nil { + return errors.New("CodeVersion parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetDefaultCodeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetDefaultCodeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("CodeVersion", *inst.CodeVersion)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetDefaultCodeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `CodeVersion` param: + err = encoder.Encode(obj.CodeVersion) + if err != nil { + return err + } + return nil +} +func (obj *SetDefaultCodeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `CodeVersion`: + err = decoder.Decode(&obj.CodeVersion) + if err != nil { + return err + } + return nil +} + +// NewSetDefaultCodeVersionInstruction declares a new SetDefaultCodeVersion instruction with the provided parameters and accounts. +func NewSetDefaultCodeVersionInstruction( + // Parameters: + codeVersion CodeVersion, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + return NewSetDefaultCodeVersionInstructionBuilder(). + SetCodeVersion(codeVersion). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion_test.go new file mode 100644 index 0000000000..87b5fcd459 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetDefaultCodeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetDefaultCodeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetDefaultCodeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetDefaultCodeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetDefaultCodeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint.go new file mode 100644 index 0000000000..55b99e2239 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint.go @@ -0,0 +1,142 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the link_token_mint and updates the link_token_local_decimals. +// +// Only the admin may set this. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +type SetLinkTokenMint struct { + + // [0] = [WRITE] config + // + // [1] = [] linkTokenMint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetLinkTokenMintInstructionBuilder creates a new `SetLinkTokenMint` instruction builder. +func NewSetLinkTokenMintInstructionBuilder() *SetLinkTokenMint { + nd := &SetLinkTokenMint{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *SetLinkTokenMint) SetConfigAccount(config ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetLinkTokenMint) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetLinkTokenMintAccount sets the "linkTokenMint" account. +func (inst *SetLinkTokenMint) SetLinkTokenMintAccount(linkTokenMint ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[1] = ag_solanago.Meta(linkTokenMint) + return inst +} + +// GetLinkTokenMintAccount gets the "linkTokenMint" account. +func (inst *SetLinkTokenMint) GetLinkTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetLinkTokenMint) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetLinkTokenMint { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetLinkTokenMint) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetLinkTokenMint) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetLinkTokenMint, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetLinkTokenMint) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetLinkTokenMint) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.LinkTokenMint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetLinkTokenMint) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetLinkTokenMint")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("linkTokenMint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetLinkTokenMint) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *SetLinkTokenMint) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewSetLinkTokenMintInstruction declares a new SetLinkTokenMint instruction with the provided parameters and accounts. +func NewSetLinkTokenMintInstruction( + // Accounts: + config ag_solanago.PublicKey, + linkTokenMint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetLinkTokenMint { + return NewSetLinkTokenMintInstructionBuilder(). + SetConfigAccount(config). + SetLinkTokenMintAccount(linkTokenMint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint_test.go new file mode 100644 index 0000000000..6bd2c2d556 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetLinkTokenMint_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetLinkTokenMint(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetLinkTokenMint"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetLinkTokenMint) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetLinkTokenMint) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg.go new file mode 100644 index 0000000000..e33947b3a4 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg.go @@ -0,0 +1,154 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the max_fee_juels_per_msg, which is an upper bound on how much can be billed for any message. +// (1 juels = 1e-18 LINK) +// +// Only the admin may set this. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `max_fee_juels_per_msg` - The new value for the max_feel_juels_per_msg config. +type SetMaxFeeJuelsPerMsg struct { + MaxFeeJuelsPerMsg *ag_binary.Uint128 + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetMaxFeeJuelsPerMsgInstructionBuilder creates a new `SetMaxFeeJuelsPerMsg` instruction builder. +func NewSetMaxFeeJuelsPerMsgInstructionBuilder() *SetMaxFeeJuelsPerMsg { + nd := &SetMaxFeeJuelsPerMsg{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetMaxFeeJuelsPerMsg sets the "maxFeeJuelsPerMsg" parameter. +func (inst *SetMaxFeeJuelsPerMsg) SetMaxFeeJuelsPerMsg(maxFeeJuelsPerMsg ag_binary.Uint128) *SetMaxFeeJuelsPerMsg { + inst.MaxFeeJuelsPerMsg = &maxFeeJuelsPerMsg + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetMaxFeeJuelsPerMsg) SetConfigAccount(config ag_solanago.PublicKey) *SetMaxFeeJuelsPerMsg { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetMaxFeeJuelsPerMsg) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetMaxFeeJuelsPerMsg) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetMaxFeeJuelsPerMsg { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetMaxFeeJuelsPerMsg) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetMaxFeeJuelsPerMsg) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetMaxFeeJuelsPerMsg, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetMaxFeeJuelsPerMsg) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetMaxFeeJuelsPerMsg) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.MaxFeeJuelsPerMsg == nil { + return errors.New("MaxFeeJuelsPerMsg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetMaxFeeJuelsPerMsg) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetMaxFeeJuelsPerMsg")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("MaxFeeJuelsPerMsg", *inst.MaxFeeJuelsPerMsg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetMaxFeeJuelsPerMsg) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MaxFeeJuelsPerMsg` param: + err = encoder.Encode(obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + return nil +} +func (obj *SetMaxFeeJuelsPerMsg) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MaxFeeJuelsPerMsg`: + err = decoder.Decode(&obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + return nil +} + +// NewSetMaxFeeJuelsPerMsgInstruction declares a new SetMaxFeeJuelsPerMsg instruction with the provided parameters and accounts. +func NewSetMaxFeeJuelsPerMsgInstruction( + // Parameters: + maxFeeJuelsPerMsg ag_binary.Uint128, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetMaxFeeJuelsPerMsg { + return NewSetMaxFeeJuelsPerMsgInstructionBuilder(). + SetMaxFeeJuelsPerMsg(maxFeeJuelsPerMsg). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg_test.go new file mode 100644 index 0000000000..aab8826bee --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetMaxFeeJuelsPerMsg_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetMaxFeeJuelsPerMsg(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetMaxFeeJuelsPerMsg"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetMaxFeeJuelsPerMsg) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetMaxFeeJuelsPerMsg) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig.go new file mode 100644 index 0000000000..c9d8b1186b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig.go @@ -0,0 +1,241 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the token transfer fee configuration for a particular token when it's transferred to a particular dest chain. +// It is an upsert, initializing the per-chain-per-token config account if it doesn't exist +// and overwriting it if it does. +// +// Only the Admin can perform this operation. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for setting the token billing configuration. +// * `chain_selector` - The chain selector. +// * `mint` - The public key of the token mint. +// * `cfg` - The token transfer fee configuration. +type SetTokenTransferFeeConfig struct { + ChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *TokenTransferFeeConfig + + // [0] = [] config + // + // [1] = [WRITE] perChainPerTokenConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetTokenTransferFeeConfigInstructionBuilder creates a new `SetTokenTransferFeeConfig` instruction builder. +func NewSetTokenTransferFeeConfigInstructionBuilder() *SetTokenTransferFeeConfig { + nd := &SetTokenTransferFeeConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *SetTokenTransferFeeConfig) SetChainSelector(chainSelector uint64) *SetTokenTransferFeeConfig { + inst.ChainSelector = &chainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *SetTokenTransferFeeConfig) SetMint(mint ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *SetTokenTransferFeeConfig) SetCfg(cfg TokenTransferFeeConfig) *SetTokenTransferFeeConfig { + inst.Cfg = &cfg + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetTokenTransferFeeConfig) SetConfigAccount(config ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetTokenTransferFeeConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetPerChainPerTokenConfigAccount sets the "perChainPerTokenConfig" account. +func (inst *SetTokenTransferFeeConfig) SetPerChainPerTokenConfigAccount(perChainPerTokenConfig ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(perChainPerTokenConfig).WRITE() + return inst +} + +// GetPerChainPerTokenConfigAccount gets the "perChainPerTokenConfig" account. +func (inst *SetTokenTransferFeeConfig) GetPerChainPerTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetTokenTransferFeeConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetTokenTransferFeeConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetTokenTransferFeeConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetTokenTransferFeeConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst SetTokenTransferFeeConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetTokenTransferFeeConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetTokenTransferFeeConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetTokenTransferFeeConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.PerChainPerTokenConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetTokenTransferFeeConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetTokenTransferFeeConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ChainSelector", *inst.ChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("perChainPerTokenConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj SetTokenTransferFeeConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *SetTokenTransferFeeConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewSetTokenTransferFeeConfigInstruction declares a new SetTokenTransferFeeConfig instruction with the provided parameters and accounts. +func NewSetTokenTransferFeeConfigInstruction( + // Parameters: + chainSelector uint64, + mint ag_solanago.PublicKey, + cfg TokenTransferFeeConfig, + // Accounts: + config ag_solanago.PublicKey, + perChainPerTokenConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetTokenTransferFeeConfig { + return NewSetTokenTransferFeeConfigInstructionBuilder(). + SetChainSelector(chainSelector). + SetMint(mint). + SetCfg(cfg). + SetConfigAccount(config). + SetPerChainPerTokenConfigAccount(perChainPerTokenConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig_test.go new file mode 100644 index 0000000000..518986b278 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/SetTokenTransferFeeConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetTokenTransferFeeConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetTokenTransferFeeConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetTokenTransferFeeConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetTokenTransferFeeConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership.go new file mode 100644 index 0000000000..7936cb95a2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership.go @@ -0,0 +1,153 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Transfers the ownership of the fee quoter to a new proposed owner. +// +// Shared func signature with other programs +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer. +// * `proposed_owner` - The public key of the new proposed owner. +type TransferOwnership struct { + NewOwner *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetNewOwner sets the "newOwner" parameter. +func (inst *TransferOwnership) SetNewOwner(newOwner ag_solanago.PublicKey) *TransferOwnership { + inst.NewOwner = &newOwner + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *TransferOwnership) SetConfigAccount(config ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *TransferOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewOwner == nil { + return errors.New("NewOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewOwner", *inst.NewOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewOwner` param: + err = encoder.Encode(obj.NewOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewOwner`: + err = decoder.Decode(&obj.NewOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + newOwner ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetNewOwner(newOwner). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership_test.go new file mode 100644 index 0000000000..279a7702d9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion.go b/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion.go new file mode 100644 index 0000000000..d3b793db3d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion_test.go new file mode 100644 index 0000000000..a69c941b0f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig.go new file mode 100644 index 0000000000..c07207fc77 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the billing token configuration. +// Only CCIP Admin can update a billing token configuration. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the billing token configuration. +// * `config` - The new billing token configuration. +type UpdateBillingTokenConfig struct { + Config *BillingTokenConfig + + // [0] = [] config + // + // [1] = [WRITE] billingTokenConfig + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateBillingTokenConfigInstructionBuilder creates a new `UpdateBillingTokenConfig` instruction builder. +func NewUpdateBillingTokenConfigInstructionBuilder() *UpdateBillingTokenConfig { + nd := &UpdateBillingTokenConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetConfig sets the "config" parameter. +func (inst *UpdateBillingTokenConfig) SetConfig(config BillingTokenConfig) *UpdateBillingTokenConfig { + inst.Config = &config + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateBillingTokenConfig) SetConfigAccount(config ag_solanago.PublicKey) *UpdateBillingTokenConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateBillingTokenConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetBillingTokenConfigAccount sets the "billingTokenConfig" account. +func (inst *UpdateBillingTokenConfig) SetBillingTokenConfigAccount(billingTokenConfig ag_solanago.PublicKey) *UpdateBillingTokenConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(billingTokenConfig).WRITE() + return inst +} + +// GetBillingTokenConfigAccount gets the "billingTokenConfig" account. +func (inst *UpdateBillingTokenConfig) GetBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateBillingTokenConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateBillingTokenConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateBillingTokenConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateBillingTokenConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateBillingTokenConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateBillingTokenConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateBillingTokenConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Config == nil { + return errors.New("Config parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.BillingTokenConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateBillingTokenConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateBillingTokenConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Config", *inst.Config)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("billingTokenConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateBillingTokenConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} +func (obj *UpdateBillingTokenConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +// NewUpdateBillingTokenConfigInstruction declares a new UpdateBillingTokenConfig instruction with the provided parameters and accounts. +func NewUpdateBillingTokenConfigInstruction( + // Parameters: + config BillingTokenConfig, + // Accounts: + configAccount ag_solanago.PublicKey, + billingTokenConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateBillingTokenConfig { + return NewUpdateBillingTokenConfigInstructionBuilder(). + SetConfig(config). + SetConfigAccount(configAccount). + SetBillingTokenConfigAccount(billingTokenConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig_test.go new file mode 100644 index 0000000000..0f1d0c7adf --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateBillingTokenConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateBillingTokenConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateBillingTokenConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateBillingTokenConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateBillingTokenConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig.go new file mode 100644 index 0000000000..633c59665f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig.go @@ -0,0 +1,196 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates the configuration of the destination chain selector. +// +// The Admin is the only one able to update the destination chain config. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the chain selector. +// * `chain_selector` - The destination chain selector to be updated. +// * `dest_chain_config` - The new configuration for the destination chain. +type UpdateDestChainConfig struct { + ChainSelector *uint64 + DestChainConfig *DestChainConfig + + // [0] = [] config + // + // [1] = [WRITE] destChain + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDestChainConfigInstructionBuilder creates a new `UpdateDestChainConfig` instruction builder. +func NewUpdateDestChainConfigInstructionBuilder() *UpdateDestChainConfig { + nd := &UpdateDestChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetChainSelector sets the "chainSelector" parameter. +func (inst *UpdateDestChainConfig) SetChainSelector(chainSelector uint64) *UpdateDestChainConfig { + inst.ChainSelector = &chainSelector + return inst +} + +// SetDestChainConfig sets the "destChainConfig" parameter. +func (inst *UpdateDestChainConfig) SetDestChainConfig(destChainConfig DestChainConfig) *UpdateDestChainConfig { + inst.DestChainConfig = &destChainConfig + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDestChainConfig) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDestChainConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetDestChainAccount sets the "destChain" account. +func (inst *UpdateDestChainConfig) SetDestChainAccount(destChain ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(destChain).WRITE() + return inst +} + +// GetDestChainAccount gets the "destChain" account. +func (inst *UpdateDestChainConfig) GetDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDestChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDestChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDestChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdateDestChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDestChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDestChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDestChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ChainSelector == nil { + return errors.New("ChainSelector parameter is not set") + } + if inst.DestChainConfig == nil { + return errors.New("DestChainConfig parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.DestChain is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *UpdateDestChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDestChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" ChainSelector", *inst.ChainSelector)) + paramsBranch.Child(ag_format.Param("DestChainConfig", *inst.DestChainConfig)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("destChain", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdateDestChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `DestChainConfig` param: + err = encoder.Encode(obj.DestChainConfig) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDestChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `DestChainConfig`: + err = decoder.Decode(&obj.DestChainConfig) + if err != nil { + return err + } + return nil +} + +// NewUpdateDestChainConfigInstruction declares a new UpdateDestChainConfig instruction with the provided parameters and accounts. +func NewUpdateDestChainConfigInstruction( + // Parameters: + chainSelector uint64, + destChainConfig DestChainConfig, + // Accounts: + config ag_solanago.PublicKey, + destChain ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *UpdateDestChainConfig { + return NewUpdateDestChainConfigInstructionBuilder(). + SetChainSelector(chainSelector). + SetDestChainConfig(destChainConfig). + SetConfigAccount(config). + SetDestChainAccount(destChain). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig_test.go new file mode 100644 index 0000000000..ef5da1516f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdateDestChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDestChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDestChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDestChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDestChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices.go new file mode 100644 index 0000000000..1a4aee8997 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices.go @@ -0,0 +1,210 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Updates prices for tokens and gas. This method may only be called by an allowed price updater. +// +// # Arguments +// +// * `ctx` - The context containing the accounts always required for the price updates +// * `token_updates` - Vector of token price updates +// * `gas_updates` - Vector of gas price updates +// +// # Additional accounts +// +// In addition to the fixed amount of accounts defined in the `UpdatePrices` context, +// the following accounts must be provided: +// +// * First, the billing token config accounts for each token whose price is being updated, in the same order +// as the token_updates vector. +// * Then, the dest chain accounts of every chain whose gas price is being updated, in the same order as the +// gas_updates vector. +type UpdatePrices struct { + TokenUpdates *[]TokenPriceUpdate + GasUpdates *[]GasPriceUpdate + + // [0] = [SIGNER] authority + // + // [1] = [] allowedPriceUpdater + // ··········· was added by the owner as an allowed price updater. The constraints enforced guarantee that it is the right PDA + // ··········· and that it was initialized. + // + // [2] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdatePricesInstructionBuilder creates a new `UpdatePrices` instruction builder. +func NewUpdatePricesInstructionBuilder() *UpdatePrices { + nd := &UpdatePrices{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetTokenUpdates sets the "tokenUpdates" parameter. +func (inst *UpdatePrices) SetTokenUpdates(tokenUpdates []TokenPriceUpdate) *UpdatePrices { + inst.TokenUpdates = &tokenUpdates + return inst +} + +// SetGasUpdates sets the "gasUpdates" parameter. +func (inst *UpdatePrices) SetGasUpdates(gasUpdates []GasPriceUpdate) *UpdatePrices { + inst.GasUpdates = &gasUpdates + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdatePrices) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdatePrices { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdatePrices) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAllowedPriceUpdaterAccount sets the "allowedPriceUpdater" account. +// was added by the owner as an allowed price updater. The constraints enforced guarantee that it is the right PDA +// and that it was initialized. +func (inst *UpdatePrices) SetAllowedPriceUpdaterAccount(allowedPriceUpdater ag_solanago.PublicKey) *UpdatePrices { + inst.AccountMetaSlice[1] = ag_solanago.Meta(allowedPriceUpdater) + return inst +} + +// GetAllowedPriceUpdaterAccount gets the "allowedPriceUpdater" account. +// was added by the owner as an allowed price updater. The constraints enforced guarantee that it is the right PDA +// and that it was initialized. +func (inst *UpdatePrices) GetAllowedPriceUpdaterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdatePrices) SetConfigAccount(config ag_solanago.PublicKey) *UpdatePrices { + inst.AccountMetaSlice[2] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdatePrices) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst UpdatePrices) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdatePrices, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdatePrices) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdatePrices) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.TokenUpdates == nil { + return errors.New("TokenUpdates parameter is not set") + } + if inst.GasUpdates == nil { + return errors.New("GasUpdates parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.AllowedPriceUpdater is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *UpdatePrices) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdatePrices")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("TokenUpdates", *inst.TokenUpdates)) + paramsBranch.Child(ag_format.Param(" GasUpdates", *inst.GasUpdates)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("allowedPriceUpdater", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj UpdatePrices) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `TokenUpdates` param: + err = encoder.Encode(obj.TokenUpdates) + if err != nil { + return err + } + // Serialize `GasUpdates` param: + err = encoder.Encode(obj.GasUpdates) + if err != nil { + return err + } + return nil +} +func (obj *UpdatePrices) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `TokenUpdates`: + err = decoder.Decode(&obj.TokenUpdates) + if err != nil { + return err + } + // Deserialize `GasUpdates`: + err = decoder.Decode(&obj.GasUpdates) + if err != nil { + return err + } + return nil +} + +// NewUpdatePricesInstruction declares a new UpdatePrices instruction with the provided parameters and accounts. +func NewUpdatePricesInstruction( + // Parameters: + tokenUpdates []TokenPriceUpdate, + gasUpdates []GasPriceUpdate, + // Accounts: + authority ag_solanago.PublicKey, + allowedPriceUpdater ag_solanago.PublicKey, + config ag_solanago.PublicKey) *UpdatePrices { + return NewUpdatePricesInstructionBuilder(). + SetTokenUpdates(tokenUpdates). + SetGasUpdates(gasUpdates). + SetAuthorityAccount(authority). + SetAllowedPriceUpdaterAccount(allowedPriceUpdater). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices_test.go b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices_test.go new file mode 100644 index 0000000000..7e76aaa5fb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/UpdatePrices_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdatePrices(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdatePrices"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdatePrices) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdatePrices) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/accounts.go b/chains/solana/gobindings/v1_6_1/fee_quoter/accounts.go new file mode 100644 index 0000000000..147b1e8134 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/accounts.go @@ -0,0 +1,361 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type Config struct { + Version uint8 + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + MaxFeeJuelsPerMsg ag_binary.Uint128 + LinkTokenMint ag_solanago.PublicKey + LinkTokenLocalDecimals uint8 + Onramp ag_solanago.PublicKey + DefaultCodeVersion CodeVersion +} + +var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} + +func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `MaxFeeJuelsPerMsg` param: + err = encoder.Encode(obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + // Serialize `LinkTokenMint` param: + err = encoder.Encode(obj.LinkTokenMint) + if err != nil { + return err + } + // Serialize `LinkTokenLocalDecimals` param: + err = encoder.Encode(obj.LinkTokenLocalDecimals) + if err != nil { + return err + } + // Serialize `Onramp` param: + err = encoder.Encode(obj.Onramp) + if err != nil { + return err + } + // Serialize `DefaultCodeVersion` param: + err = encoder.Encode(obj.DefaultCodeVersion) + if err != nil { + return err + } + return nil +} + +func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[155 12 170 224 30 250 204 130]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `MaxFeeJuelsPerMsg`: + err = decoder.Decode(&obj.MaxFeeJuelsPerMsg) + if err != nil { + return err + } + // Deserialize `LinkTokenMint`: + err = decoder.Decode(&obj.LinkTokenMint) + if err != nil { + return err + } + // Deserialize `LinkTokenLocalDecimals`: + err = decoder.Decode(&obj.LinkTokenLocalDecimals) + if err != nil { + return err + } + // Deserialize `Onramp`: + err = decoder.Decode(&obj.Onramp) + if err != nil { + return err + } + // Deserialize `DefaultCodeVersion`: + err = decoder.Decode(&obj.DefaultCodeVersion) + if err != nil { + return err + } + return nil +} + +type DestChain struct { + Version uint8 + ChainSelector uint64 + State DestChainState + Config DestChainConfig +} + +var DestChainDiscriminator = [8]byte{77, 18, 241, 132, 212, 54, 218, 16} + +func (obj DestChain) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(DestChainDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `State` param: + err = encoder.Encode(obj.State) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *DestChain) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(DestChainDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[77 18 241 132 212 54 218 16]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `State`: + err = decoder.Decode(&obj.State) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type BillingTokenConfigWrapper struct { + Version uint8 + Config BillingTokenConfig +} + +var BillingTokenConfigWrapperDiscriminator = [8]byte{63, 178, 72, 57, 171, 66, 44, 151} + +func (obj BillingTokenConfigWrapper) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(BillingTokenConfigWrapperDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *BillingTokenConfigWrapper) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(BillingTokenConfigWrapperDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[63 178 72 57 171 66 44 151]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type PerChainPerTokenConfig struct { + Version uint8 + ChainSelector uint64 + Mint ag_solanago.PublicKey + TokenTransferConfig TokenTransferFeeConfig +} + +var PerChainPerTokenConfigDiscriminator = [8]byte{183, 88, 20, 99, 246, 46, 51, 230} + +func (obj PerChainPerTokenConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(PerChainPerTokenConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `ChainSelector` param: + err = encoder.Encode(obj.ChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `TokenTransferConfig` param: + err = encoder.Encode(obj.TokenTransferConfig) + if err != nil { + return err + } + return nil +} + +func (obj *PerChainPerTokenConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(PerChainPerTokenConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[183 88 20 99 246 46 51 230]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `ChainSelector`: + err = decoder.Decode(&obj.ChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `TokenTransferConfig`: + err = decoder.Decode(&obj.TokenTransferConfig) + if err != nil { + return err + } + return nil +} + +type AllowedPriceUpdater struct{} + +var AllowedPriceUpdaterDiscriminator = [8]byte{51, 136, 222, 161, 38, 7, 184, 190} + +func (obj AllowedPriceUpdater) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(AllowedPriceUpdaterDiscriminator[:], false) + if err != nil { + return err + } + return nil +} + +func (obj *AllowedPriceUpdater) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(AllowedPriceUpdaterDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[51 136 222 161 38 7 184 190]", + fmt.Sprint(discriminator[:])) + } + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/instructions.go b/chains/solana/gobindings/v1_6_1/fee_quoter/instructions.go new file mode 100644 index 0000000000..c6f521f814 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/instructions.go @@ -0,0 +1,396 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "FeeQuoter" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + // Initializes the Fee Quoter. + // + // The initialization is responsibility of Admin, nothing more than calling this method should be done first. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for initialization. + // * `max_fee_juels_per_msg` - The maximum fee in juels that can be charged per message. + // * `onramp` - The public key of the onramp. + // + // The function also uses the link_token_mint account from the context. + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + // Transfers the ownership of the fee quoter to a new proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer. + // * `proposed_owner` - The public key of the new proposed owner. + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + // Accepts the ownership of the fee quoter by the proposed owner. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for accepting ownership. + // The new owner must be a signer of the transaction. + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + // Sets the default code version to be used. This is then used by the slim routing layer to determine + // which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. + // + // Shared func signature with other programs + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `code_version` - The new code version to be set as default. + Instruction_SetDefaultCodeVersion = ag_binary.TypeID([8]byte{47, 151, 233, 254, 121, 82, 206, 152}) + + // Sets the max_fee_juels_per_msg, which is an upper bound on how much can be billed for any message. + // (1 juels = 1e-18 LINK) + // + // Only the admin may set this. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `max_fee_juels_per_msg` - The new value for the max_feel_juels_per_msg config. + Instruction_SetMaxFeeJuelsPerMsg = ag_binary.TypeID([8]byte{50, 235, 110, 147, 169, 199, 69, 46}) + + // Sets the link_token_mint and updates the link_token_local_decimals. + // + // Only the admin may set this. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + Instruction_SetLinkTokenMint = ag_binary.TypeID([8]byte{190, 216, 49, 254, 200, 81, 12, 17}) + + // Adds a billing token configuration. + // Only CCIP Admin can add a billing token configuration. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for adding the billing token configuration. + // * `config` - The billing token configuration to be added. + Instruction_AddBillingTokenConfig = ag_binary.TypeID([8]byte{63, 156, 254, 216, 227, 53, 0, 69}) + + // Updates the billing token configuration. + // Only CCIP Admin can update a billing token configuration. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the billing token configuration. + // * `config` - The new billing token configuration. + Instruction_UpdateBillingTokenConfig = ag_binary.TypeID([8]byte{140, 184, 124, 146, 204, 62, 244, 79}) + + // Adds a new destination chain selector to the fee quoter. + // + // The Admin needs to add any new chain supported. + // When adding a new chain, the Admin needs to specify if it's enabled or not. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for adding the chain selector. + // * `chain_selector` - The new chain selector to be added. + // * `dest_chain_config` - The configuration for the chain as destination. + Instruction_AddDestChain = ag_binary.TypeID([8]byte{122, 202, 174, 155, 55, 100, 102, 36}) + + // Disables the destination chain selector. + // + // The Admin is the only one able to disable the chain selector as destination. This method is thought of as an emergency kill-switch. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for disabling the chain selector. + // * `chain_selector` - The destination chain selector to be disabled. + Instruction_DisableDestChain = ag_binary.TypeID([8]byte{200, 195, 114, 206, 152, 86, 50, 41}) + + // Updates the configuration of the destination chain selector. + // + // The Admin is the only one able to update the destination chain config. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the chain selector. + // * `chain_selector` - The destination chain selector to be updated. + // * `dest_chain_config` - The new configuration for the destination chain. + Instruction_UpdateDestChainConfig = ag_binary.TypeID([8]byte{215, 122, 81, 22, 190, 58, 219, 13}) + + // Sets the token transfer fee configuration for a particular token when it's transferred to a particular dest chain. + // It is an upsert, initializing the per-chain-per-token config account if it doesn't exist + // and overwriting it if it does. + // + // Only the Admin can perform this operation. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for setting the token billing configuration. + // * `chain_selector` - The chain selector. + // * `mint` - The public key of the token mint. + // * `cfg` - The token transfer fee configuration. + Instruction_SetTokenTransferFeeConfig = ag_binary.TypeID([8]byte{76, 243, 16, 214, 126, 11, 254, 77}) + + // Add a price updater address to the list of allowed price updaters. + // On price updates, the fee quoter will check the that caller is allowed. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for this operation. + // * `price_updater` - The price updater address. + Instruction_AddPriceUpdater = ag_binary.TypeID([8]byte{200, 26, 13, 120, 226, 182, 64, 16}) + + // Remove a price updater address from the list of allowed price updaters. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for this operation. + // * `price_updater` - The price updater address. + Instruction_RemovePriceUpdater = ag_binary.TypeID([8]byte{10, 61, 172, 48, 110, 8, 162, 198}) + + // Calculates the fee for sending a message to the destination chain. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the fee calculation. + // * `dest_chain_selector` - The chain selector for the destination chain. + // * `message` - The message to be sent. + // + // # Additional accounts + // + // In addition to the fixed amount of accounts defined in the `GetFee` context, + // the following accounts must be provided: + // + // * First, the billing token config accounts for each token sent with the message, sequentially. + // For each token with no billing config account (i.e. tokens that cannot be possibly used as fee + // tokens, which also have no BPS fees enabled) the ZERO address must be provided instead. + // * Then, the per chain / per token config of every token sent with the message, sequentially + // in the same order. + // + // # Returns + // + // GetFeeResult struct with: + // - the fee token mint address, + // - the fee amount of said token, + // - the fee value in juels, + // - additional data required when performing the cross-chain transfer of tokens in that message + // - deserialized and processed extra args + Instruction_GetFee = ag_binary.TypeID([8]byte{115, 195, 235, 161, 25, 219, 60, 29}) + + // Updates prices for tokens and gas. This method may only be called by an allowed price updater. + // + // # Arguments + // + // * `ctx` - The context containing the accounts always required for the price updates + // * `token_updates` - Vector of token price updates + // * `gas_updates` - Vector of gas price updates + // + // # Additional accounts + // + // In addition to the fixed amount of accounts defined in the `UpdatePrices` context, + // the following accounts must be provided: + // + // * First, the billing token config accounts for each token whose price is being updated, in the same order + // as the token_updates vector. + // * Then, the dest chain accounts of every chain whose gas price is being updated, in the same order as the + // gas_updates vector. + Instruction_UpdatePrices = ag_binary.TypeID([8]byte{62, 161, 234, 136, 106, 26, 18, 160}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetDefaultCodeVersion: + return "SetDefaultCodeVersion" + case Instruction_SetMaxFeeJuelsPerMsg: + return "SetMaxFeeJuelsPerMsg" + case Instruction_SetLinkTokenMint: + return "SetLinkTokenMint" + case Instruction_AddBillingTokenConfig: + return "AddBillingTokenConfig" + case Instruction_UpdateBillingTokenConfig: + return "UpdateBillingTokenConfig" + case Instruction_AddDestChain: + return "AddDestChain" + case Instruction_DisableDestChain: + return "DisableDestChain" + case Instruction_UpdateDestChainConfig: + return "UpdateDestChainConfig" + case Instruction_SetTokenTransferFeeConfig: + return "SetTokenTransferFeeConfig" + case Instruction_AddPriceUpdater: + return "AddPriceUpdater" + case Instruction_RemovePriceUpdater: + return "RemovePriceUpdater" + case Instruction_GetFee: + return "GetFee" + case Instruction_UpdatePrices: + return "UpdatePrices" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_default_code_version", (*SetDefaultCodeVersion)(nil), + }, + { + "set_max_fee_juels_per_msg", (*SetMaxFeeJuelsPerMsg)(nil), + }, + { + "set_link_token_mint", (*SetLinkTokenMint)(nil), + }, + { + "add_billing_token_config", (*AddBillingTokenConfig)(nil), + }, + { + "update_billing_token_config", (*UpdateBillingTokenConfig)(nil), + }, + { + "add_dest_chain", (*AddDestChain)(nil), + }, + { + "disable_dest_chain", (*DisableDestChain)(nil), + }, + { + "update_dest_chain_config", (*UpdateDestChainConfig)(nil), + }, + { + "set_token_transfer_fee_config", (*SetTokenTransferFeeConfig)(nil), + }, + { + "add_price_updater", (*AddPriceUpdater)(nil), + }, + { + "remove_price_updater", (*RemovePriceUpdater)(nil), + }, + { + "get_fee", (*GetFee)(nil), + }, + { + "update_prices", (*UpdatePrices)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/testing_utils.go b/chains/solana/gobindings/v1_6_1/fee_quoter/testing_utils.go new file mode 100644 index 0000000000..44412c1165 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/fee_quoter/types.go b/chains/solana/gobindings/v1_6_1/fee_quoter/types.go new file mode 100644 index 0000000000..aee9003875 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/fee_quoter/types.go @@ -0,0 +1,883 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package fee_quoter + +import ( + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type TokenPriceUpdate struct { + SourceToken ag_solanago.PublicKey + UsdPerToken [28]uint8 +} + +func (obj TokenPriceUpdate) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SourceToken` param: + err = encoder.Encode(obj.SourceToken) + if err != nil { + return err + } + // Serialize `UsdPerToken` param: + err = encoder.Encode(obj.UsdPerToken) + if err != nil { + return err + } + return nil +} + +func (obj *TokenPriceUpdate) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SourceToken`: + err = decoder.Decode(&obj.SourceToken) + if err != nil { + return err + } + // Deserialize `UsdPerToken`: + err = decoder.Decode(&obj.UsdPerToken) + if err != nil { + return err + } + return nil +} + +type GasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas [28]uint8 +} + +func (obj GasPriceUpdate) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestChainSelector` param: + err = encoder.Encode(obj.DestChainSelector) + if err != nil { + return err + } + // Serialize `UsdPerUnitGas` param: + err = encoder.Encode(obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +func (obj *GasPriceUpdate) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestChainSelector`: + err = decoder.Decode(&obj.DestChainSelector) + if err != nil { + return err + } + // Deserialize `UsdPerUnitGas`: + err = decoder.Decode(&obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +type GenericExtraArgsV2 struct { + GasLimit ag_binary.Uint128 + AllowOutOfOrderExecution bool +} + +func (obj GenericExtraArgsV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `GasLimit` param: + err = encoder.Encode(obj.GasLimit) + if err != nil { + return err + } + // Serialize `AllowOutOfOrderExecution` param: + err = encoder.Encode(obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + return nil +} + +func (obj *GenericExtraArgsV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `GasLimit`: + err = decoder.Decode(&obj.GasLimit) + if err != nil { + return err + } + // Deserialize `AllowOutOfOrderExecution`: + err = decoder.Decode(&obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + return nil +} + +type SVMExtraArgsV1 struct { + ComputeUnits uint32 + AccountIsWritableBitmap uint64 + AllowOutOfOrderExecution bool + TokenReceiver [32]uint8 + Accounts [][32]uint8 +} + +func (obj SVMExtraArgsV1) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ComputeUnits` param: + err = encoder.Encode(obj.ComputeUnits) + if err != nil { + return err + } + // Serialize `AccountIsWritableBitmap` param: + err = encoder.Encode(obj.AccountIsWritableBitmap) + if err != nil { + return err + } + // Serialize `AllowOutOfOrderExecution` param: + err = encoder.Encode(obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + // Serialize `TokenReceiver` param: + err = encoder.Encode(obj.TokenReceiver) + if err != nil { + return err + } + // Serialize `Accounts` param: + err = encoder.Encode(obj.Accounts) + if err != nil { + return err + } + return nil +} + +func (obj *SVMExtraArgsV1) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ComputeUnits`: + err = decoder.Decode(&obj.ComputeUnits) + if err != nil { + return err + } + // Deserialize `AccountIsWritableBitmap`: + err = decoder.Decode(&obj.AccountIsWritableBitmap) + if err != nil { + return err + } + // Deserialize `AllowOutOfOrderExecution`: + err = decoder.Decode(&obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + // Deserialize `TokenReceiver`: + err = decoder.Decode(&obj.TokenReceiver) + if err != nil { + return err + } + // Deserialize `Accounts`: + err = decoder.Decode(&obj.Accounts) + if err != nil { + return err + } + return nil +} + +type SVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []SVMTokenAmount + FeeToken ag_solanago.PublicKey + ExtraArgs []byte +} + +func (obj SVM2AnyMessage) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Receiver` param: + err = encoder.Encode(obj.Receiver) + if err != nil { + return err + } + // Serialize `Data` param: + err = encoder.Encode(obj.Data) + if err != nil { + return err + } + // Serialize `TokenAmounts` param: + err = encoder.Encode(obj.TokenAmounts) + if err != nil { + return err + } + // Serialize `FeeToken` param: + err = encoder.Encode(obj.FeeToken) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +func (obj *SVM2AnyMessage) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Receiver`: + err = decoder.Decode(&obj.Receiver) + if err != nil { + return err + } + // Deserialize `Data`: + err = decoder.Decode(&obj.Data) + if err != nil { + return err + } + // Deserialize `TokenAmounts`: + err = decoder.Decode(&obj.TokenAmounts) + if err != nil { + return err + } + // Deserialize `FeeToken`: + err = decoder.Decode(&obj.FeeToken) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +type SVMTokenAmount struct { + Token ag_solanago.PublicKey + Amount uint64 +} + +func (obj SVMTokenAmount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} + +func (obj *SVMTokenAmount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +type TokenTransferAdditionalData struct { + DestBytesOverhead uint32 + DestGasOverhead uint32 +} + +func (obj TokenTransferAdditionalData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `DestBytesOverhead` param: + err = encoder.Encode(obj.DestBytesOverhead) + if err != nil { + return err + } + // Serialize `DestGasOverhead` param: + err = encoder.Encode(obj.DestGasOverhead) + if err != nil { + return err + } + return nil +} + +func (obj *TokenTransferAdditionalData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `DestBytesOverhead`: + err = decoder.Decode(&obj.DestBytesOverhead) + if err != nil { + return err + } + // Deserialize `DestGasOverhead`: + err = decoder.Decode(&obj.DestGasOverhead) + if err != nil { + return err + } + return nil +} + +type GetFeeResult struct { + Token ag_solanago.PublicKey + Amount uint64 + Juels ag_binary.Uint128 + TokenTransferAdditionalData []TokenTransferAdditionalData + ProcessedExtraArgs ProcessedExtraArgs +} + +func (obj GetFeeResult) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Token` param: + err = encoder.Encode(obj.Token) + if err != nil { + return err + } + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + // Serialize `Juels` param: + err = encoder.Encode(obj.Juels) + if err != nil { + return err + } + // Serialize `TokenTransferAdditionalData` param: + err = encoder.Encode(obj.TokenTransferAdditionalData) + if err != nil { + return err + } + // Serialize `ProcessedExtraArgs` param: + err = encoder.Encode(obj.ProcessedExtraArgs) + if err != nil { + return err + } + return nil +} + +func (obj *GetFeeResult) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Token`: + err = decoder.Decode(&obj.Token) + if err != nil { + return err + } + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + // Deserialize `Juels`: + err = decoder.Decode(&obj.Juels) + if err != nil { + return err + } + // Deserialize `TokenTransferAdditionalData`: + err = decoder.Decode(&obj.TokenTransferAdditionalData) + if err != nil { + return err + } + // Deserialize `ProcessedExtraArgs`: + err = decoder.Decode(&obj.ProcessedExtraArgs) + if err != nil { + return err + } + return nil +} + +type ProcessedExtraArgs struct { + Bytes []byte + GasLimit ag_binary.Uint128 + AllowOutOfOrderExecution bool + TokenReceiver *[]byte `bin:"optional"` +} + +func (obj ProcessedExtraArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Bytes` param: + err = encoder.Encode(obj.Bytes) + if err != nil { + return err + } + // Serialize `GasLimit` param: + err = encoder.Encode(obj.GasLimit) + if err != nil { + return err + } + // Serialize `AllowOutOfOrderExecution` param: + err = encoder.Encode(obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + // Serialize `TokenReceiver` param (optional): + { + if obj.TokenReceiver == nil { + err = encoder.WriteBool(false) + if err != nil { + return err + } + } else { + err = encoder.WriteBool(true) + if err != nil { + return err + } + err = encoder.Encode(obj.TokenReceiver) + if err != nil { + return err + } + } + } + return nil +} + +func (obj *ProcessedExtraArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Bytes`: + err = decoder.Decode(&obj.Bytes) + if err != nil { + return err + } + // Deserialize `GasLimit`: + err = decoder.Decode(&obj.GasLimit) + if err != nil { + return err + } + // Deserialize `AllowOutOfOrderExecution`: + err = decoder.Decode(&obj.AllowOutOfOrderExecution) + if err != nil { + return err + } + // Deserialize `TokenReceiver` (optional): + { + ok, err := decoder.ReadBool() + if err != nil { + return err + } + if ok { + err = decoder.Decode(&obj.TokenReceiver) + if err != nil { + return err + } + } + } + return nil +} + +type DestChainConfig struct { + IsEnabled bool + LaneCodeVersion CodeVersion + MaxNumberOfTokensPerMsg uint16 + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 + DestGasOverhead uint32 + DestGasPerPayloadByteBase uint32 + DestGasPerPayloadByteHigh uint32 + DestGasPerPayloadByteThreshold uint32 + DestDataAvailabilityOverheadGas uint32 + DestGasPerDataAvailabilityByte uint16 + DestDataAvailabilityMultiplierBps uint16 + DefaultTokenFeeUsdcents uint16 + DefaultTokenDestGasOverhead uint32 + DefaultTxGasLimit uint32 + GasMultiplierWeiPerEth uint64 + NetworkFeeUsdcents uint32 + GasPriceStalenessThreshold uint32 + EnforceOutOfOrder bool + ChainFamilySelector [4]uint8 +} + +func (obj DestChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `IsEnabled` param: + err = encoder.Encode(obj.IsEnabled) + if err != nil { + return err + } + // Serialize `LaneCodeVersion` param: + err = encoder.Encode(obj.LaneCodeVersion) + if err != nil { + return err + } + // Serialize `MaxNumberOfTokensPerMsg` param: + err = encoder.Encode(obj.MaxNumberOfTokensPerMsg) + if err != nil { + return err + } + // Serialize `MaxDataBytes` param: + err = encoder.Encode(obj.MaxDataBytes) + if err != nil { + return err + } + // Serialize `MaxPerMsgGasLimit` param: + err = encoder.Encode(obj.MaxPerMsgGasLimit) + if err != nil { + return err + } + // Serialize `DestGasOverhead` param: + err = encoder.Encode(obj.DestGasOverhead) + if err != nil { + return err + } + // Serialize `DestGasPerPayloadByteBase` param: + err = encoder.Encode(obj.DestGasPerPayloadByteBase) + if err != nil { + return err + } + // Serialize `DestGasPerPayloadByteHigh` param: + err = encoder.Encode(obj.DestGasPerPayloadByteHigh) + if err != nil { + return err + } + // Serialize `DestGasPerPayloadByteThreshold` param: + err = encoder.Encode(obj.DestGasPerPayloadByteThreshold) + if err != nil { + return err + } + // Serialize `DestDataAvailabilityOverheadGas` param: + err = encoder.Encode(obj.DestDataAvailabilityOverheadGas) + if err != nil { + return err + } + // Serialize `DestGasPerDataAvailabilityByte` param: + err = encoder.Encode(obj.DestGasPerDataAvailabilityByte) + if err != nil { + return err + } + // Serialize `DestDataAvailabilityMultiplierBps` param: + err = encoder.Encode(obj.DestDataAvailabilityMultiplierBps) + if err != nil { + return err + } + // Serialize `DefaultTokenFeeUsdcents` param: + err = encoder.Encode(obj.DefaultTokenFeeUsdcents) + if err != nil { + return err + } + // Serialize `DefaultTokenDestGasOverhead` param: + err = encoder.Encode(obj.DefaultTokenDestGasOverhead) + if err != nil { + return err + } + // Serialize `DefaultTxGasLimit` param: + err = encoder.Encode(obj.DefaultTxGasLimit) + if err != nil { + return err + } + // Serialize `GasMultiplierWeiPerEth` param: + err = encoder.Encode(obj.GasMultiplierWeiPerEth) + if err != nil { + return err + } + // Serialize `NetworkFeeUsdcents` param: + err = encoder.Encode(obj.NetworkFeeUsdcents) + if err != nil { + return err + } + // Serialize `GasPriceStalenessThreshold` param: + err = encoder.Encode(obj.GasPriceStalenessThreshold) + if err != nil { + return err + } + // Serialize `EnforceOutOfOrder` param: + err = encoder.Encode(obj.EnforceOutOfOrder) + if err != nil { + return err + } + // Serialize `ChainFamilySelector` param: + err = encoder.Encode(obj.ChainFamilySelector) + if err != nil { + return err + } + return nil +} + +func (obj *DestChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `IsEnabled`: + err = decoder.Decode(&obj.IsEnabled) + if err != nil { + return err + } + // Deserialize `LaneCodeVersion`: + err = decoder.Decode(&obj.LaneCodeVersion) + if err != nil { + return err + } + // Deserialize `MaxNumberOfTokensPerMsg`: + err = decoder.Decode(&obj.MaxNumberOfTokensPerMsg) + if err != nil { + return err + } + // Deserialize `MaxDataBytes`: + err = decoder.Decode(&obj.MaxDataBytes) + if err != nil { + return err + } + // Deserialize `MaxPerMsgGasLimit`: + err = decoder.Decode(&obj.MaxPerMsgGasLimit) + if err != nil { + return err + } + // Deserialize `DestGasOverhead`: + err = decoder.Decode(&obj.DestGasOverhead) + if err != nil { + return err + } + // Deserialize `DestGasPerPayloadByteBase`: + err = decoder.Decode(&obj.DestGasPerPayloadByteBase) + if err != nil { + return err + } + // Deserialize `DestGasPerPayloadByteHigh`: + err = decoder.Decode(&obj.DestGasPerPayloadByteHigh) + if err != nil { + return err + } + // Deserialize `DestGasPerPayloadByteThreshold`: + err = decoder.Decode(&obj.DestGasPerPayloadByteThreshold) + if err != nil { + return err + } + // Deserialize `DestDataAvailabilityOverheadGas`: + err = decoder.Decode(&obj.DestDataAvailabilityOverheadGas) + if err != nil { + return err + } + // Deserialize `DestGasPerDataAvailabilityByte`: + err = decoder.Decode(&obj.DestGasPerDataAvailabilityByte) + if err != nil { + return err + } + // Deserialize `DestDataAvailabilityMultiplierBps`: + err = decoder.Decode(&obj.DestDataAvailabilityMultiplierBps) + if err != nil { + return err + } + // Deserialize `DefaultTokenFeeUsdcents`: + err = decoder.Decode(&obj.DefaultTokenFeeUsdcents) + if err != nil { + return err + } + // Deserialize `DefaultTokenDestGasOverhead`: + err = decoder.Decode(&obj.DefaultTokenDestGasOverhead) + if err != nil { + return err + } + // Deserialize `DefaultTxGasLimit`: + err = decoder.Decode(&obj.DefaultTxGasLimit) + if err != nil { + return err + } + // Deserialize `GasMultiplierWeiPerEth`: + err = decoder.Decode(&obj.GasMultiplierWeiPerEth) + if err != nil { + return err + } + // Deserialize `NetworkFeeUsdcents`: + err = decoder.Decode(&obj.NetworkFeeUsdcents) + if err != nil { + return err + } + // Deserialize `GasPriceStalenessThreshold`: + err = decoder.Decode(&obj.GasPriceStalenessThreshold) + if err != nil { + return err + } + // Deserialize `EnforceOutOfOrder`: + err = decoder.Decode(&obj.EnforceOutOfOrder) + if err != nil { + return err + } + // Deserialize `ChainFamilySelector`: + err = decoder.Decode(&obj.ChainFamilySelector) + if err != nil { + return err + } + return nil +} + +type DestChainState struct { + UsdPerUnitGas TimestampedPackedU224 +} + +func (obj DestChainState) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `UsdPerUnitGas` param: + err = encoder.Encode(obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +func (obj *DestChainState) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `UsdPerUnitGas`: + err = decoder.Decode(&obj.UsdPerUnitGas) + if err != nil { + return err + } + return nil +} + +type TimestampedPackedU224 struct { + Value [28]uint8 + Timestamp int64 +} + +func (obj TimestampedPackedU224) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Value` param: + err = encoder.Encode(obj.Value) + if err != nil { + return err + } + // Serialize `Timestamp` param: + err = encoder.Encode(obj.Timestamp) + if err != nil { + return err + } + return nil +} + +func (obj *TimestampedPackedU224) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Value`: + err = decoder.Decode(&obj.Value) + if err != nil { + return err + } + // Deserialize `Timestamp`: + err = decoder.Decode(&obj.Timestamp) + if err != nil { + return err + } + return nil +} + +type BillingTokenConfig struct { + Enabled bool + Mint ag_solanago.PublicKey + UsdPerToken TimestampedPackedU224 + PremiumMultiplierWeiPerEth uint64 +} + +func (obj BillingTokenConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Enabled` param: + err = encoder.Encode(obj.Enabled) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `UsdPerToken` param: + err = encoder.Encode(obj.UsdPerToken) + if err != nil { + return err + } + // Serialize `PremiumMultiplierWeiPerEth` param: + err = encoder.Encode(obj.PremiumMultiplierWeiPerEth) + if err != nil { + return err + } + return nil +} + +func (obj *BillingTokenConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Enabled`: + err = decoder.Decode(&obj.Enabled) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `UsdPerToken`: + err = decoder.Decode(&obj.UsdPerToken) + if err != nil { + return err + } + // Deserialize `PremiumMultiplierWeiPerEth`: + err = decoder.Decode(&obj.PremiumMultiplierWeiPerEth) + if err != nil { + return err + } + return nil +} + +type TokenTransferFeeConfig struct { + MinFeeUsdcents uint32 + MaxFeeUsdcents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 + IsEnabled bool +} + +func (obj TokenTransferFeeConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `MinFeeUsdcents` param: + err = encoder.Encode(obj.MinFeeUsdcents) + if err != nil { + return err + } + // Serialize `MaxFeeUsdcents` param: + err = encoder.Encode(obj.MaxFeeUsdcents) + if err != nil { + return err + } + // Serialize `DeciBps` param: + err = encoder.Encode(obj.DeciBps) + if err != nil { + return err + } + // Serialize `DestGasOverhead` param: + err = encoder.Encode(obj.DestGasOverhead) + if err != nil { + return err + } + // Serialize `DestBytesOverhead` param: + err = encoder.Encode(obj.DestBytesOverhead) + if err != nil { + return err + } + // Serialize `IsEnabled` param: + err = encoder.Encode(obj.IsEnabled) + if err != nil { + return err + } + return nil +} + +func (obj *TokenTransferFeeConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `MinFeeUsdcents`: + err = decoder.Decode(&obj.MinFeeUsdcents) + if err != nil { + return err + } + // Deserialize `MaxFeeUsdcents`: + err = decoder.Decode(&obj.MaxFeeUsdcents) + if err != nil { + return err + } + // Deserialize `DeciBps`: + err = decoder.Decode(&obj.DeciBps) + if err != nil { + return err + } + // Deserialize `DestGasOverhead`: + err = decoder.Decode(&obj.DestGasOverhead) + if err != nil { + return err + } + // Deserialize `DestBytesOverhead`: + err = decoder.Decode(&obj.DestBytesOverhead) + if err != nil { + return err + } + // Deserialize `IsEnabled`: + err = decoder.Decode(&obj.IsEnabled) + if err != nil { + return err + } + return nil +} + +type CodeVersion ag_binary.BorshEnum + +const ( + Default_CodeVersion CodeVersion = iota + V1_CodeVersion +) + +func (value CodeVersion) String() string { + switch value { + case Default_CodeVersion: + return "Default" + case V1_CodeVersion: + return "V1" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership.go new file mode 100644 index 0000000000..8b673f2a31 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership.go @@ -0,0 +1,136 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AcceptOwnership is the `acceptOwnership` instruction. +type AcceptOwnership struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *AcceptOwnership) SetMintAccount(mint ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *AcceptOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership_test.go new file mode 100644 index 0000000000..09ff49a54b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses.go new file mode 100644 index 0000000000..e5fc4d08f0 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AppendRemotePoolAddresses is the `appendRemotePoolAddresses` instruction. +type AppendRemotePoolAddresses struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Addresses *[]RemoteAddress + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAppendRemotePoolAddressesInstructionBuilder creates a new `AppendRemotePoolAddresses` instruction builder. +func NewAppendRemotePoolAddressesInstructionBuilder() *AppendRemotePoolAddresses { + nd := &AppendRemotePoolAddresses{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *AppendRemotePoolAddresses) SetRemoteChainSelector(remoteChainSelector uint64) *AppendRemotePoolAddresses { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *AppendRemotePoolAddresses) SetMint(mint ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.Mint = &mint + return inst +} + +// SetAddresses sets the "addresses" parameter. +func (inst *AppendRemotePoolAddresses) SetAddresses(addresses []RemoteAddress) *AppendRemotePoolAddresses { + inst.Addresses = &addresses + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *AppendRemotePoolAddresses) SetStateAccount(state ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AppendRemotePoolAddresses) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AppendRemotePoolAddresses) SetAuthorityAccount(authority ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AppendRemotePoolAddresses) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AppendRemotePoolAddresses) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AppendRemotePoolAddresses, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AppendRemotePoolAddresses) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AppendRemotePoolAddresses) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Addresses == nil { + return errors.New("Addresses parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AppendRemotePoolAddresses) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AppendRemotePoolAddresses")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Addresses", *inst.Addresses)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AppendRemotePoolAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Addresses` param: + err = encoder.Encode(obj.Addresses) + if err != nil { + return err + } + return nil +} +func (obj *AppendRemotePoolAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Addresses`: + err = decoder.Decode(&obj.Addresses) + if err != nil { + return err + } + return nil +} + +// NewAppendRemotePoolAddressesInstruction declares a new AppendRemotePoolAddresses instruction with the provided parameters and accounts. +func NewAppendRemotePoolAddressesInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + addresses []RemoteAddress, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + return NewAppendRemotePoolAddressesInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetAddresses(addresses). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses_test.go new file mode 100644 index 0000000000..3ecc42d1d6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/AppendRemotePoolAddresses_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AppendRemotePoolAddresses(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AppendRemotePoolAddresses"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AppendRemotePoolAddresses) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AppendRemotePoolAddresses) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList.go new file mode 100644 index 0000000000..544b85181a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList.go @@ -0,0 +1,207 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ConfigureAllowList is the `configureAllowList` instruction. +type ConfigureAllowList struct { + Add *[]ag_solanago.PublicKey + Enabled *bool + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewConfigureAllowListInstructionBuilder creates a new `ConfigureAllowList` instruction builder. +func NewConfigureAllowListInstructionBuilder() *ConfigureAllowList { + nd := &ConfigureAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetAdd sets the "add" parameter. +func (inst *ConfigureAllowList) SetAdd(add []ag_solanago.PublicKey) *ConfigureAllowList { + inst.Add = &add + return inst +} + +// SetEnabled sets the "enabled" parameter. +func (inst *ConfigureAllowList) SetEnabled(enabled bool) *ConfigureAllowList { + inst.Enabled = &enabled + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ConfigureAllowList) SetStateAccount(state ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ConfigureAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *ConfigureAllowList) SetMintAccount(mint ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ConfigureAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ConfigureAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ConfigureAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *ConfigureAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *ConfigureAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst ConfigureAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ConfigureAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ConfigureAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ConfigureAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Add == nil { + return errors.New("Add parameter is not set") + } + if inst.Enabled == nil { + return errors.New("Enabled parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *ConfigureAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ConfigureAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Add", *inst.Add)) + paramsBranch.Child(ag_format.Param("Enabled", *inst.Enabled)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj ConfigureAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Add` param: + err = encoder.Encode(obj.Add) + if err != nil { + return err + } + // Serialize `Enabled` param: + err = encoder.Encode(obj.Enabled) + if err != nil { + return err + } + return nil +} +func (obj *ConfigureAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Add`: + err = decoder.Decode(&obj.Add) + if err != nil { + return err + } + // Deserialize `Enabled`: + err = decoder.Decode(&obj.Enabled) + if err != nil { + return err + } + return nil +} + +// NewConfigureAllowListInstruction declares a new ConfigureAllowList instruction with the provided parameters and accounts. +func NewConfigureAllowListInstruction( + // Parameters: + add []ag_solanago.PublicKey, + enabled bool, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *ConfigureAllowList { + return NewConfigureAllowListInstructionBuilder(). + SetAdd(add). + SetEnabled(enabled). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList_test.go new file mode 100644 index 0000000000..df26eeebb5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ConfigureAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ConfigureAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ConfigureAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ConfigureAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ConfigureAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig.go new file mode 100644 index 0000000000..ed0cfb6bb5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig.go @@ -0,0 +1,188 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeleteChainConfig is the `deleteChainConfig` instruction. +type DeleteChainConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeleteChainConfigInstructionBuilder creates a new `DeleteChainConfig` instruction builder. +func NewDeleteChainConfigInstructionBuilder() *DeleteChainConfig { + nd := &DeleteChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *DeleteChainConfig) SetRemoteChainSelector(remoteChainSelector uint64) *DeleteChainConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *DeleteChainConfig) SetMint(mint ag_solanago.PublicKey) *DeleteChainConfig { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *DeleteChainConfig) SetStateAccount(state ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *DeleteChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *DeleteChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *DeleteChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DeleteChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DeleteChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst DeleteChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeleteChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeleteChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeleteChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *DeleteChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeleteChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj DeleteChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *DeleteChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewDeleteChainConfigInstruction declares a new DeleteChainConfig instruction with the provided parameters and accounts. +func NewDeleteChainConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *DeleteChainConfig { + return NewDeleteChainConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig_test.go new file mode 100644 index 0000000000..bdc2573a26 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/DeleteChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeleteChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeleteChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeleteChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeleteChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig.go new file mode 100644 index 0000000000..72c1e983d3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// EditChainRemoteConfig is the `editChainRemoteConfig` instruction. +type EditChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewEditChainRemoteConfigInstructionBuilder creates a new `EditChainRemoteConfig` instruction builder. +func NewEditChainRemoteConfigInstructionBuilder() *EditChainRemoteConfig { + nd := &EditChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *EditChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *EditChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *EditChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *EditChainRemoteConfig) SetCfg(cfg RemoteConfig) *EditChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *EditChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *EditChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *EditChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *EditChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *EditChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *EditChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *EditChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *EditChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst EditChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_EditChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst EditChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *EditChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *EditChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("EditChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj EditChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *EditChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewEditChainRemoteConfigInstruction declares a new EditChainRemoteConfig instruction with the provided parameters and accounts. +func NewEditChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + return NewEditChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig_test.go new file mode 100644 index 0000000000..8eda9e879a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/EditChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_EditChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("EditChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(EditChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(EditChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig.go new file mode 100644 index 0000000000..6cfccead26 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitChainRemoteConfig is the `initChainRemoteConfig` instruction. +type InitChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitChainRemoteConfigInstructionBuilder creates a new `InitChainRemoteConfig` instruction builder. +func NewInitChainRemoteConfigInstructionBuilder() *InitChainRemoteConfig { + nd := &InitChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *InitChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *InitChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *InitChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *InitChainRemoteConfig) SetCfg(cfg RemoteConfig) *InitChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *InitChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *InitChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst InitChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *InitChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj InitChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *InitChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewInitChainRemoteConfigInstruction declares a new InitChainRemoteConfig instruction with the provided parameters and accounts. +func NewInitChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + return NewInitChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig_test.go new file mode 100644 index 0000000000..ea47b3e447 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig.go new file mode 100644 index 0000000000..e911f656ce --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig.go @@ -0,0 +1,226 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitGlobalConfig is the `initGlobalConfig` instruction. +type InitGlobalConfig struct { + RouterAddress *ag_solanago.PublicKey + RmnAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitGlobalConfigInstructionBuilder creates a new `InitGlobalConfig` instruction builder. +func NewInitGlobalConfigInstructionBuilder() *InitGlobalConfig { + nd := &InitGlobalConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetRouterAddress sets the "routerAddress" parameter. +func (inst *InitGlobalConfig) SetRouterAddress(routerAddress ag_solanago.PublicKey) *InitGlobalConfig { + inst.RouterAddress = &routerAddress + return inst +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *InitGlobalConfig) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *InitGlobalConfig { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *InitGlobalConfig) SetConfigAccount(config ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *InitGlobalConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitGlobalConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitGlobalConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitGlobalConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitGlobalConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *InitGlobalConfig) SetProgramAccount(program ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *InitGlobalConfig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *InitGlobalConfig) SetProgramDataAccount(programData ag_solanago.PublicKey) *InitGlobalConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *InitGlobalConfig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst InitGlobalConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitGlobalConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitGlobalConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitGlobalConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RouterAddress == nil { + return errors.New("RouterAddress parameter is not set") + } + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *InitGlobalConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitGlobalConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RouterAddress", *inst.RouterAddress)) + paramsBranch.Child(ag_format.Param(" RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj InitGlobalConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RouterAddress` param: + err = encoder.Encode(obj.RouterAddress) + if err != nil { + return err + } + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *InitGlobalConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RouterAddress`: + err = decoder.Decode(&obj.RouterAddress) + if err != nil { + return err + } + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewInitGlobalConfigInstruction declares a new InitGlobalConfig instruction with the provided parameters and accounts. +func NewInitGlobalConfigInstruction( + // Parameters: + routerAddress ag_solanago.PublicKey, + rmnAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *InitGlobalConfig { + return NewInitGlobalConfigInstructionBuilder(). + SetRouterAddress(routerAddress). + SetRmnAddress(rmnAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig_test.go new file mode 100644 index 0000000000..71bafa2d99 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitGlobalConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitGlobalConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitGlobalConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitGlobalConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitGlobalConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize.go new file mode 100644 index 0000000000..b4de612ef5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize.go @@ -0,0 +1,212 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + // + // [6] = [] config + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *Initialize) SetMintAccount(mint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *Initialize) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[6] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey, + config ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion.go new file mode 100644 index 0000000000..2554b9dc2d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion.go @@ -0,0 +1,127 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitializeStateVersion is the `initializeStateVersion` instruction. +type InitializeStateVersion struct { + Mint *ag_solanago.PublicKey + + // [0] = [WRITE] state + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeStateVersionInstructionBuilder creates a new `InitializeStateVersion` instruction builder. +func NewInitializeStateVersionInstructionBuilder() *InitializeStateVersion { + nd := &InitializeStateVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *InitializeStateVersion) SetMint(mint ag_solanago.PublicKey) *InitializeStateVersion { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitializeStateVersion) SetStateAccount(state ag_solanago.PublicKey) *InitializeStateVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitializeStateVersion) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst InitializeStateVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitializeStateVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitializeStateVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitializeStateVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + } + return nil +} + +func (inst *InitializeStateVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitializeStateVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj InitializeStateVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *InitializeStateVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewInitializeStateVersionInstruction declares a new InitializeStateVersion instruction with the provided parameters and accounts. +func NewInitializeStateVersionInstruction( + // Parameters: + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey) *InitializeStateVersion { + return NewInitializeStateVersionInstructionBuilder(). + SetMint(mint). + SetStateAccount(state) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion_test.go new file mode 100644 index 0000000000..cd25f2f5ee --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/InitializeStateVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitializeStateVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitializeStateVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitializeStateVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitializeStateVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize_test.go new file mode 100644 index 0000000000..818f8bbc40 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens.go new file mode 100644 index 0000000000..d4a940369b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens.go @@ -0,0 +1,298 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// LockOrBurnTokens is the `lockOrBurnTokens` instruction. +type LockOrBurnTokens struct { + LockOrBurn *LockOrBurnInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] state + // + // [2] = [] tokenProgram + // + // [3] = [WRITE] mint + // + // [4] = [] poolSigner + // + // [5] = [WRITE] poolTokenAccount + // + // [6] = [] rmnRemote + // + // [7] = [] rmnRemoteCurses + // + // [8] = [] rmnRemoteConfig + // + // [9] = [WRITE] chainConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewLockOrBurnTokensInstructionBuilder creates a new `LockOrBurnTokens` instruction builder. +func NewLockOrBurnTokensInstructionBuilder() *LockOrBurnTokens { + nd := &LockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 10), + } + return nd +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *LockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *LockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *LockOrBurnTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *LockOrBurnTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetStateAccount sets the "state" account. +func (inst *LockOrBurnTokens) SetStateAccount(state ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *LockOrBurnTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *LockOrBurnTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *LockOrBurnTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMintAccount sets the "mint" account. +func (inst *LockOrBurnTokens) SetMintAccount(mint ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *LockOrBurnTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *LockOrBurnTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *LockOrBurnTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *LockOrBurnTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *LockOrBurnTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *LockOrBurnTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *LockOrBurnTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +func (inst LockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_LockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst LockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *LockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.ChainConfig is not set") + } + } + return nil +} + +func (inst *LockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("LockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=10]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[9])) + }) + }) + }) +} + +func (obj LockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *LockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewLockOrBurnTokensInstruction declares a new LockOrBurnTokens instruction with the provided parameters and accounts. +func NewLockOrBurnTokensInstruction( + // Parameters: + lockOrBurn LockOrBurnInV1, + // Accounts: + authority ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + return NewLockOrBurnTokensInstructionBuilder(). + SetLockOrBurn(lockOrBurn). + SetAuthorityAccount(authority). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetChainConfigAccount(chainConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens_test.go new file mode 100644 index 0000000000..6b3eb3595d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/LockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_LockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("LockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(LockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(LockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity.go new file mode 100644 index 0000000000..0b4587179b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity.go @@ -0,0 +1,241 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ProvideLiquidity is the `provideLiquidity` instruction. +type ProvideLiquidity struct { + Amount *uint64 + + // [0] = [] state + // + // [1] = [] tokenProgram + // + // [2] = [WRITE] mint + // + // [3] = [] poolSigner + // + // [4] = [WRITE] poolTokenAccount + // + // [5] = [WRITE] remoteTokenAccount + // + // [6] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewProvideLiquidityInstructionBuilder creates a new `ProvideLiquidity` instruction builder. +func NewProvideLiquidityInstructionBuilder() *ProvideLiquidity { + nd := &ProvideLiquidity{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetAmount sets the "amount" parameter. +func (inst *ProvideLiquidity) SetAmount(amount uint64) *ProvideLiquidity { + inst.Amount = &amount + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *ProvideLiquidity) SetStateAccount(state ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ProvideLiquidity) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *ProvideLiquidity) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *ProvideLiquidity) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *ProvideLiquidity) SetMintAccount(mint ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ProvideLiquidity) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ProvideLiquidity) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[3] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ProvideLiquidity) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *ProvideLiquidity) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *ProvideLiquidity) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetRemoteTokenAccountAccount sets the "remoteTokenAccount" account. +func (inst *ProvideLiquidity) SetRemoteTokenAccountAccount(remoteTokenAccount ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[5] = ag_solanago.Meta(remoteTokenAccount).WRITE() + return inst +} + +// GetRemoteTokenAccountAccount gets the "remoteTokenAccount" account. +func (inst *ProvideLiquidity) GetRemoteTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ProvideLiquidity) SetAuthorityAccount(authority ag_solanago.PublicKey) *ProvideLiquidity { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ProvideLiquidity) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst ProvideLiquidity) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ProvideLiquidity, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ProvideLiquidity) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ProvideLiquidity) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Amount == nil { + return errors.New("Amount parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.RemoteTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *ProvideLiquidity) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ProvideLiquidity")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Amount", *inst.Amount)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" remoteToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj ProvideLiquidity) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} +func (obj *ProvideLiquidity) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +// NewProvideLiquidityInstruction declares a new ProvideLiquidity instruction with the provided parameters and accounts. +func NewProvideLiquidityInstruction( + // Parameters: + amount uint64, + // Accounts: + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + remoteTokenAccount ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *ProvideLiquidity { + return NewProvideLiquidityInstructionBuilder(). + SetAmount(amount). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRemoteTokenAccountAccount(remoteTokenAccount). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity_test.go new file mode 100644 index 0000000000..5b7f7ef0c0 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ProvideLiquidity_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ProvideLiquidity(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ProvideLiquidity"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ProvideLiquidity) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ProvideLiquidity) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens.go new file mode 100644 index 0000000000..13c3679ee5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens.go @@ -0,0 +1,367 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ReleaseOrMintTokens is the `releaseOrMintTokens` instruction. +type ReleaseOrMintTokens struct { + ReleaseOrMint *ReleaseOrMintInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] offrampProgram + // ··········· CHECK offramp program: exists only to derive the allowed offramp PDA + // ··········· and the authority PDA. + // + // [2] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp + // + // [3] = [] state + // + // [4] = [] tokenProgram + // + // [5] = [WRITE] mint + // + // [6] = [] poolSigner + // + // [7] = [WRITE] poolTokenAccount + // + // [8] = [WRITE] chainConfig + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + // + // [12] = [WRITE] receiverTokenAccount + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReleaseOrMintTokensInstructionBuilder creates a new `ReleaseOrMintTokens` instruction builder. +func NewReleaseOrMintTokensInstructionBuilder() *ReleaseOrMintTokens { + nd := &ReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 13), + } + return nd +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *ReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *ReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReleaseOrMintTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReleaseOrMintTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetOfframpProgramAccount sets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) SetOfframpProgramAccount(offrampProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(offrampProgram) + return inst +} + +// GetOfframpProgramAccount gets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) GetOfframpProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetStateAccount sets the "state" account. +func (inst *ReleaseOrMintTokens) SetStateAccount(state ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReleaseOrMintTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetMintAccount sets the "mint" account. +func (inst *ReleaseOrMintTokens) SetMintAccount(mint ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ReleaseOrMintTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetReceiverTokenAccountAccount sets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetReceiverTokenAccountAccount(receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[12] = ag_solanago.Meta(receiverTokenAccount).WRITE() + return inst +} + +// GetReceiverTokenAccountAccount gets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetReceiverTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +func (inst ReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.OfframpProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.ReceiverTokenAccount is not set") + } + } + return nil +} + +func (inst *ReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" offrampProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" receiverToken", inst.AccountMetaSlice[12])) + }) + }) + }) +} + +func (obj ReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *ReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewReleaseOrMintTokensInstruction declares a new ReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewReleaseOrMintTokensInstruction( + // Parameters: + releaseOrMint ReleaseOrMintInV1, + // Accounts: + authority ag_solanago.PublicKey, + offrampProgram ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + return NewReleaseOrMintTokensInstructionBuilder(). + SetReleaseOrMint(releaseOrMint). + SetAuthorityAccount(authority). + SetOfframpProgramAccount(offrampProgram). + SetAllowedOfframpAccount(allowedOfframp). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetChainConfigAccount(chainConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetReceiverTokenAccountAccount(receiverTokenAccount) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..c948b7fb38 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/ReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList.go new file mode 100644 index 0000000000..7ce5963ec3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// RemoveFromAllowList is the `removeFromAllowList` instruction. +type RemoveFromAllowList struct { + Remove *[]ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewRemoveFromAllowListInstructionBuilder creates a new `RemoveFromAllowList` instruction builder. +func NewRemoveFromAllowListInstructionBuilder() *RemoveFromAllowList { + nd := &RemoveFromAllowList{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemove sets the "remove" parameter. +func (inst *RemoveFromAllowList) SetRemove(remove []ag_solanago.PublicKey) *RemoveFromAllowList { + inst.Remove = &remove + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *RemoveFromAllowList) SetStateAccount(state ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *RemoveFromAllowList) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *RemoveFromAllowList) SetMintAccount(mint ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *RemoveFromAllowList) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *RemoveFromAllowList) SetAuthorityAccount(authority ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *RemoveFromAllowList) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *RemoveFromAllowList) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *RemoveFromAllowList) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst RemoveFromAllowList) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_RemoveFromAllowList, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst RemoveFromAllowList) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *RemoveFromAllowList) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Remove == nil { + return errors.New("Remove parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *RemoveFromAllowList) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("RemoveFromAllowList")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Remove", *inst.Remove)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj RemoveFromAllowList) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Remove` param: + err = encoder.Encode(obj.Remove) + if err != nil { + return err + } + return nil +} +func (obj *RemoveFromAllowList) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Remove`: + err = decoder.Decode(&obj.Remove) + if err != nil { + return err + } + return nil +} + +// NewRemoveFromAllowListInstruction declares a new RemoveFromAllowList instruction with the provided parameters and accounts. +func NewRemoveFromAllowListInstruction( + // Parameters: + remove []ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *RemoveFromAllowList { + return NewRemoveFromAllowListInstructionBuilder(). + SetRemove(remove). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList_test.go new file mode 100644 index 0000000000..f019f76e07 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/RemoveFromAllowList_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_RemoveFromAllowList(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("RemoveFromAllowList"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(RemoveFromAllowList) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(RemoveFromAllowList) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity.go new file mode 100644 index 0000000000..584b4b84ae --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetCanAcceptLiquidity is the `setCanAcceptLiquidity` instruction. +type SetCanAcceptLiquidity struct { + Allow *bool + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetCanAcceptLiquidityInstructionBuilder creates a new `SetCanAcceptLiquidity` instruction builder. +func NewSetCanAcceptLiquidityInstructionBuilder() *SetCanAcceptLiquidity { + nd := &SetCanAcceptLiquidity{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetAllow sets the "allow" parameter. +func (inst *SetCanAcceptLiquidity) SetAllow(allow bool) *SetCanAcceptLiquidity { + inst.Allow = &allow + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetCanAcceptLiquidity) SetStateAccount(state ag_solanago.PublicKey) *SetCanAcceptLiquidity { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetCanAcceptLiquidity) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetCanAcceptLiquidity) SetMintAccount(mint ag_solanago.PublicKey) *SetCanAcceptLiquidity { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetCanAcceptLiquidity) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetCanAcceptLiquidity) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetCanAcceptLiquidity { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetCanAcceptLiquidity) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetCanAcceptLiquidity) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetCanAcceptLiquidity, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetCanAcceptLiquidity) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetCanAcceptLiquidity) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Allow == nil { + return errors.New("Allow parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetCanAcceptLiquidity) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetCanAcceptLiquidity")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Allow", *inst.Allow)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetCanAcceptLiquidity) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Allow` param: + err = encoder.Encode(obj.Allow) + if err != nil { + return err + } + return nil +} +func (obj *SetCanAcceptLiquidity) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Allow`: + err = decoder.Decode(&obj.Allow) + if err != nil { + return err + } + return nil +} + +// NewSetCanAcceptLiquidityInstruction declares a new SetCanAcceptLiquidity instruction with the provided parameters and accounts. +func NewSetCanAcceptLiquidityInstruction( + // Parameters: + allow bool, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetCanAcceptLiquidity { + return NewSetCanAcceptLiquidityInstructionBuilder(). + SetAllow(allow). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity_test.go new file mode 100644 index 0000000000..0a2569cf96 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetCanAcceptLiquidity_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetCanAcceptLiquidity(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetCanAcceptLiquidity"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetCanAcceptLiquidity) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetCanAcceptLiquidity) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit.go new file mode 100644 index 0000000000..988d2b7b3b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit.go @@ -0,0 +1,234 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetChainRateLimit is the `setChainRateLimit` instruction. +type SetChainRateLimit struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Inbound *RateLimitConfig + Outbound *RateLimitConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetChainRateLimitInstructionBuilder creates a new `SetChainRateLimit` instruction builder. +func NewSetChainRateLimitInstructionBuilder() *SetChainRateLimit { + nd := &SetChainRateLimit{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *SetChainRateLimit) SetRemoteChainSelector(remoteChainSelector uint64) *SetChainRateLimit { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *SetChainRateLimit) SetMint(mint ag_solanago.PublicKey) *SetChainRateLimit { + inst.Mint = &mint + return inst +} + +// SetInbound sets the "inbound" parameter. +func (inst *SetChainRateLimit) SetInbound(inbound RateLimitConfig) *SetChainRateLimit { + inst.Inbound = &inbound + return inst +} + +// SetOutbound sets the "outbound" parameter. +func (inst *SetChainRateLimit) SetOutbound(outbound RateLimitConfig) *SetChainRateLimit { + inst.Outbound = &outbound + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetChainRateLimit) SetStateAccount(state ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetChainRateLimit) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *SetChainRateLimit) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *SetChainRateLimit) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetChainRateLimit) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetChainRateLimit) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetChainRateLimit) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetChainRateLimit, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetChainRateLimit) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetChainRateLimit) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Inbound == nil { + return errors.New("Inbound parameter is not set") + } + if inst.Outbound == nil { + return errors.New("Outbound parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetChainRateLimit) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetChainRateLimit")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Inbound", *inst.Inbound)) + paramsBranch.Child(ag_format.Param(" Outbound", *inst.Outbound)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetChainRateLimit) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Inbound` param: + err = encoder.Encode(obj.Inbound) + if err != nil { + return err + } + // Serialize `Outbound` param: + err = encoder.Encode(obj.Outbound) + if err != nil { + return err + } + return nil +} +func (obj *SetChainRateLimit) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Inbound`: + err = decoder.Decode(&obj.Inbound) + if err != nil { + return err + } + // Deserialize `Outbound`: + err = decoder.Decode(&obj.Outbound) + if err != nil { + return err + } + return nil +} + +// NewSetChainRateLimitInstruction declares a new SetChainRateLimit instruction with the provided parameters and accounts. +func NewSetChainRateLimitInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + inbound RateLimitConfig, + outbound RateLimitConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetChainRateLimit { + return NewSetChainRateLimitInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetInbound(inbound). + SetOutbound(outbound). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit_test.go new file mode 100644 index 0000000000..2cf8a2d747 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetChainRateLimit_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetChainRateLimit(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetChainRateLimit"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetChainRateLimit) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetChainRateLimit) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin.go new file mode 100644 index 0000000000..9c035820b2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin.go @@ -0,0 +1,169 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRateLimitAdmin is the `setRateLimitAdmin` instruction. +type SetRateLimitAdmin struct { + Mint *ag_solanago.PublicKey + NewRateLimitAdmin *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRateLimitAdminInstructionBuilder creates a new `SetRateLimitAdmin` instruction builder. +func NewSetRateLimitAdminInstructionBuilder() *SetRateLimitAdmin { + nd := &SetRateLimitAdmin{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *SetRateLimitAdmin) SetMint(mint ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.Mint = &mint + return inst +} + +// SetNewRateLimitAdmin sets the "newRateLimitAdmin" parameter. +func (inst *SetRateLimitAdmin) SetNewRateLimitAdmin(newRateLimitAdmin ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.NewRateLimitAdmin = &newRateLimitAdmin + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRateLimitAdmin) SetStateAccount(state ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRateLimitAdmin) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRateLimitAdmin) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRateLimitAdmin) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetRateLimitAdmin) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRateLimitAdmin, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRateLimitAdmin) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRateLimitAdmin) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.NewRateLimitAdmin == nil { + return errors.New("NewRateLimitAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRateLimitAdmin) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRateLimitAdmin")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param("NewRateLimitAdmin", *inst.NewRateLimitAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetRateLimitAdmin) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `NewRateLimitAdmin` param: + err = encoder.Encode(obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} +func (obj *SetRateLimitAdmin) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `NewRateLimitAdmin`: + err = decoder.Decode(&obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} + +// NewSetRateLimitAdminInstruction declares a new SetRateLimitAdmin instruction with the provided parameters and accounts. +func NewSetRateLimitAdminInstruction( + // Parameters: + mint ag_solanago.PublicKey, + newRateLimitAdmin ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRateLimitAdmin { + return NewSetRateLimitAdminInstructionBuilder(). + SetMint(mint). + SetNewRateLimitAdmin(newRateLimitAdmin). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin_test.go new file mode 100644 index 0000000000..535dd5be93 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRateLimitAdmin_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRateLimitAdmin(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRateLimitAdmin"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRateLimitAdmin) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRateLimitAdmin) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer.go new file mode 100644 index 0000000000..8730706cc5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRebalancer is the `setRebalancer` instruction. +type SetRebalancer struct { + Rebalancer *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRebalancerInstructionBuilder creates a new `SetRebalancer` instruction builder. +func NewSetRebalancerInstructionBuilder() *SetRebalancer { + nd := &SetRebalancer{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetRebalancer sets the "rebalancer" parameter. +func (inst *SetRebalancer) SetRebalancer(rebalancer ag_solanago.PublicKey) *SetRebalancer { + inst.Rebalancer = &rebalancer + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRebalancer) SetStateAccount(state ag_solanago.PublicKey) *SetRebalancer { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRebalancer) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRebalancer) SetMintAccount(mint ag_solanago.PublicKey) *SetRebalancer { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRebalancer) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRebalancer) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRebalancer { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRebalancer) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetRebalancer) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRebalancer, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRebalancer) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRebalancer) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Rebalancer == nil { + return errors.New("Rebalancer parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRebalancer) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRebalancer")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Rebalancer", *inst.Rebalancer)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetRebalancer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Rebalancer` param: + err = encoder.Encode(obj.Rebalancer) + if err != nil { + return err + } + return nil +} +func (obj *SetRebalancer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Rebalancer`: + err = decoder.Decode(&obj.Rebalancer) + if err != nil { + return err + } + return nil +} + +// NewSetRebalancerInstruction declares a new SetRebalancer instruction with the provided parameters and accounts. +func NewSetRebalancerInstruction( + // Parameters: + rebalancer ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRebalancer { + return NewSetRebalancerInstructionBuilder(). + SetRebalancer(rebalancer). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer_test.go new file mode 100644 index 0000000000..558056eebe --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRebalancer_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRebalancer(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRebalancer"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRebalancer) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRebalancer) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn.go new file mode 100644 index 0000000000..6a0666de1b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRmn is the `setRmn` instruction. +type SetRmn struct { + RmnAddress *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRmnInstructionBuilder creates a new `SetRmn` instruction builder. +func NewSetRmnInstructionBuilder() *SetRmn { + nd := &SetRmn{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *SetRmn) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *SetRmn { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRmn) SetStateAccount(state ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRmn) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRmn) SetMintAccount(mint ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRmn) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRmn) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRmn) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRmn) SetProgramAccount(program ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRmn) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRmn) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRmn { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRmn) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRmn) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRmn, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRmn) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRmn) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRmn) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRmn")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRmn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *SetRmn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewSetRmnInstruction declares a new SetRmn instruction with the provided parameters and accounts. +func NewSetRmnInstruction( + // Parameters: + rmnAddress ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRmn { + return NewSetRmnInstructionBuilder(). + SetRmnAddress(rmnAddress). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn_test.go new file mode 100644 index 0000000000..b7f7ca25f1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRmn_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRmn(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRmn"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRmn) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRmn) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter.go new file mode 100644 index 0000000000..faff63ffdb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter.go @@ -0,0 +1,203 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRouter is the `setRouter` instruction. +type SetRouter struct { + NewRouter *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] program + // + // [4] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRouterInstructionBuilder creates a new `SetRouter` instruction builder. +func NewSetRouterInstructionBuilder() *SetRouter { + nd := &SetRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 5), + } + return nd +} + +// SetNewRouter sets the "newRouter" parameter. +func (inst *SetRouter) SetNewRouter(newRouter ag_solanago.PublicKey) *SetRouter { + inst.NewRouter = &newRouter + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRouter) SetStateAccount(state ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRouter) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRouter) SetMintAccount(mint ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRouter) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramAccount sets the "program" account. +func (inst *SetRouter) SetProgramAccount(program ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[3] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *SetRouter) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *SetRouter) SetProgramDataAccount(programData ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[4] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *SetRouter) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +func (inst SetRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewRouter == nil { + return errors.New("NewRouter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *SetRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewRouter", *inst.NewRouter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[4])) + }) + }) + }) +} + +func (obj SetRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewRouter` param: + err = encoder.Encode(obj.NewRouter) + if err != nil { + return err + } + return nil +} +func (obj *SetRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewRouter`: + err = decoder.Decode(&obj.NewRouter) + if err != nil { + return err + } + return nil +} + +// NewSetRouterInstruction declares a new SetRouter instruction with the provided parameters and accounts. +func NewSetRouterInstruction( + // Parameters: + newRouter ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *SetRouter { + return NewSetRouterInstructionBuilder(). + SetNewRouter(newRouter). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter_test.go new file mode 100644 index 0000000000..3a7ce7ea14 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/SetRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership.go new file mode 100644 index 0000000000..e0dbb0c453 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferOwnership is the `transferOwnership` instruction. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferOwnership) SetMintAccount(mint ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership_test.go new file mode 100644 index 0000000000..9877a6fbb6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion.go new file mode 100644 index 0000000000..5a6ccf47bf --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion_test.go new file mode 100644 index 0000000000..ee7a913259 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn.go new file mode 100644 index 0000000000..a1c5588e45 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateDefaultRmn is the `updateDefaultRmn` instruction. +type UpdateDefaultRmn struct { + RmnAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDefaultRmnInstructionBuilder creates a new `UpdateDefaultRmn` instruction builder. +func NewUpdateDefaultRmnInstructionBuilder() *UpdateDefaultRmn { + nd := &UpdateDefaultRmn{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRmnAddress sets the "rmnAddress" parameter. +func (inst *UpdateDefaultRmn) SetRmnAddress(rmnAddress ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.RmnAddress = &rmnAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDefaultRmn) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDefaultRmn) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDefaultRmn) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDefaultRmn) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateDefaultRmn) SetProgramAccount(program ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateDefaultRmn) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateDefaultRmn) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateDefaultRmn { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateDefaultRmn) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateDefaultRmn) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDefaultRmn, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDefaultRmn) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDefaultRmn) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RmnAddress == nil { + return errors.New("RmnAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateDefaultRmn) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDefaultRmn")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RmnAddress", *inst.RmnAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateDefaultRmn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RmnAddress` param: + err = encoder.Encode(obj.RmnAddress) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDefaultRmn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RmnAddress`: + err = decoder.Decode(&obj.RmnAddress) + if err != nil { + return err + } + return nil +} + +// NewUpdateDefaultRmnInstruction declares a new UpdateDefaultRmn instruction with the provided parameters and accounts. +func NewUpdateDefaultRmnInstruction( + // Parameters: + rmnAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateDefaultRmn { + return NewUpdateDefaultRmnInstructionBuilder(). + SetRmnAddress(rmnAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn_test.go new file mode 100644 index 0000000000..1ecd244400 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRmn_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDefaultRmn(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDefaultRmn"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDefaultRmn) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDefaultRmn) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter.go new file mode 100644 index 0000000000..3b3616c9a7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateDefaultRouter is the `updateDefaultRouter` instruction. +type UpdateDefaultRouter struct { + RouterAddress *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateDefaultRouterInstructionBuilder creates a new `UpdateDefaultRouter` instruction builder. +func NewUpdateDefaultRouterInstructionBuilder() *UpdateDefaultRouter { + nd := &UpdateDefaultRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRouterAddress sets the "routerAddress" parameter. +func (inst *UpdateDefaultRouter) SetRouterAddress(routerAddress ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.RouterAddress = &routerAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateDefaultRouter) SetConfigAccount(config ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateDefaultRouter) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateDefaultRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateDefaultRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateDefaultRouter) SetProgramAccount(program ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateDefaultRouter) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateDefaultRouter) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateDefaultRouter { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateDefaultRouter) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateDefaultRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateDefaultRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateDefaultRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateDefaultRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RouterAddress == nil { + return errors.New("RouterAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateDefaultRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateDefaultRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RouterAddress", *inst.RouterAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateDefaultRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RouterAddress` param: + err = encoder.Encode(obj.RouterAddress) + if err != nil { + return err + } + return nil +} +func (obj *UpdateDefaultRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RouterAddress`: + err = decoder.Decode(&obj.RouterAddress) + if err != nil { + return err + } + return nil +} + +// NewUpdateDefaultRouterInstruction declares a new UpdateDefaultRouter instruction with the provided parameters and accounts. +func NewUpdateDefaultRouterInstruction( + // Parameters: + routerAddress ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateDefaultRouter { + return NewUpdateDefaultRouterInstructionBuilder(). + SetRouterAddress(routerAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter_test.go new file mode 100644 index 0000000000..63ed90b71b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateDefaultRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateDefaultRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateDefaultRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateDefaultRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateDefaultRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed.go new file mode 100644 index 0000000000..fdb12a0fd6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed.go @@ -0,0 +1,184 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// UpdateSelfServedAllowed is the `updateSelfServedAllowed` instruction. +type UpdateSelfServedAllowed struct { + SelfServedAllowed *bool + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + // + // [2] = [] program + // + // [3] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUpdateSelfServedAllowedInstructionBuilder creates a new `UpdateSelfServedAllowed` instruction builder. +func NewUpdateSelfServedAllowedInstructionBuilder() *UpdateSelfServedAllowed { + nd := &UpdateSelfServedAllowed{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSelfServedAllowed sets the "selfServedAllowed" parameter. +func (inst *UpdateSelfServedAllowed) SetSelfServedAllowed(selfServedAllowed bool) *UpdateSelfServedAllowed { + inst.SelfServedAllowed = &selfServedAllowed + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *UpdateSelfServedAllowed) SetConfigAccount(config ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *UpdateSelfServedAllowed) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *UpdateSelfServedAllowed) SetAuthorityAccount(authority ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *UpdateSelfServedAllowed) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetProgramAccount sets the "program" account. +func (inst *UpdateSelfServedAllowed) SetProgramAccount(program ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[2] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *UpdateSelfServedAllowed) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *UpdateSelfServedAllowed) SetProgramDataAccount(programData ag_solanago.PublicKey) *UpdateSelfServedAllowed { + inst.AccountMetaSlice[3] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *UpdateSelfServedAllowed) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst UpdateSelfServedAllowed) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_UpdateSelfServedAllowed, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst UpdateSelfServedAllowed) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *UpdateSelfServedAllowed) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.SelfServedAllowed == nil { + return errors.New("SelfServedAllowed parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *UpdateSelfServedAllowed) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("UpdateSelfServedAllowed")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("SelfServedAllowed", *inst.SelfServedAllowed)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("programData", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj UpdateSelfServedAllowed) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `SelfServedAllowed` param: + err = encoder.Encode(obj.SelfServedAllowed) + if err != nil { + return err + } + return nil +} +func (obj *UpdateSelfServedAllowed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `SelfServedAllowed`: + err = decoder.Decode(&obj.SelfServedAllowed) + if err != nil { + return err + } + return nil +} + +// NewUpdateSelfServedAllowedInstruction declares a new UpdateSelfServedAllowed instruction with the provided parameters and accounts. +func NewUpdateSelfServedAllowedInstruction( + // Parameters: + selfServedAllowed bool, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *UpdateSelfServedAllowed { + return NewUpdateSelfServedAllowedInstructionBuilder(). + SetSelfServedAllowed(selfServedAllowed). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed_test.go new file mode 100644 index 0000000000..225841056d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/UpdateSelfServedAllowed_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_UpdateSelfServedAllowed(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("UpdateSelfServedAllowed"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(UpdateSelfServedAllowed) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(UpdateSelfServedAllowed) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity.go new file mode 100644 index 0000000000..62b9168ceb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity.go @@ -0,0 +1,241 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// WithdrawLiquidity is the `withdrawLiquidity` instruction. +type WithdrawLiquidity struct { + Amount *uint64 + + // [0] = [] state + // + // [1] = [] tokenProgram + // + // [2] = [WRITE] mint + // + // [3] = [] poolSigner + // + // [4] = [WRITE] poolTokenAccount + // + // [5] = [WRITE] remoteTokenAccount + // + // [6] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewWithdrawLiquidityInstructionBuilder creates a new `WithdrawLiquidity` instruction builder. +func NewWithdrawLiquidityInstructionBuilder() *WithdrawLiquidity { + nd := &WithdrawLiquidity{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + } + return nd +} + +// SetAmount sets the "amount" parameter. +func (inst *WithdrawLiquidity) SetAmount(amount uint64) *WithdrawLiquidity { + inst.Amount = &amount + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *WithdrawLiquidity) SetStateAccount(state ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *WithdrawLiquidity) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *WithdrawLiquidity) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[1] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *WithdrawLiquidity) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetMintAccount sets the "mint" account. +func (inst *WithdrawLiquidity) SetMintAccount(mint ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[2] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *WithdrawLiquidity) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *WithdrawLiquidity) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[3] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *WithdrawLiquidity) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *WithdrawLiquidity) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *WithdrawLiquidity) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetRemoteTokenAccountAccount sets the "remoteTokenAccount" account. +func (inst *WithdrawLiquidity) SetRemoteTokenAccountAccount(remoteTokenAccount ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[5] = ag_solanago.Meta(remoteTokenAccount).WRITE() + return inst +} + +// GetRemoteTokenAccountAccount gets the "remoteTokenAccount" account. +func (inst *WithdrawLiquidity) GetRemoteTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *WithdrawLiquidity) SetAuthorityAccount(authority ag_solanago.PublicKey) *WithdrawLiquidity { + inst.AccountMetaSlice[6] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *WithdrawLiquidity) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +func (inst WithdrawLiquidity) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_WithdrawLiquidity, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst WithdrawLiquidity) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *WithdrawLiquidity) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Amount == nil { + return errors.New("Amount parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.RemoteTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *WithdrawLiquidity) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("WithdrawLiquidity")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Amount", *inst.Amount)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("tokenProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" remoteToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[6])) + }) + }) + }) +} + +func (obj WithdrawLiquidity) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Amount` param: + err = encoder.Encode(obj.Amount) + if err != nil { + return err + } + return nil +} +func (obj *WithdrawLiquidity) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Amount`: + err = decoder.Decode(&obj.Amount) + if err != nil { + return err + } + return nil +} + +// NewWithdrawLiquidityInstruction declares a new WithdrawLiquidity instruction with the provided parameters and accounts. +func NewWithdrawLiquidityInstruction( + // Parameters: + amount uint64, + // Accounts: + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + remoteTokenAccount ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *WithdrawLiquidity { + return NewWithdrawLiquidityInstructionBuilder(). + SetAmount(amount). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRemoteTokenAccountAccount(remoteTokenAccount). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity_test.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity_test.go new file mode 100644 index 0000000000..0e30118e4d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/WithdrawLiquidity_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_WithdrawLiquidity(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("WithdrawLiquidity"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(WithdrawLiquidity) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(WithdrawLiquidity) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/accounts.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/accounts.go new file mode 100644 index 0000000000..0a85d7ce8f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/accounts.go @@ -0,0 +1,179 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type PoolConfig struct { + Version uint8 + SelfServedAllowed bool + Router ag_solanago.PublicKey + RmnRemote ag_solanago.PublicKey +} + +var PoolConfigDiscriminator = [8]byte{26, 108, 14, 123, 116, 230, 129, 43} + +func (obj PoolConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(PoolConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `SelfServedAllowed` param: + err = encoder.Encode(obj.SelfServedAllowed) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +func (obj *PoolConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(PoolConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[26 108 14 123 116 230 129 43]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `SelfServedAllowed`: + err = decoder.Decode(&obj.SelfServedAllowed) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +type State struct { + Version uint8 + Config BaseConfig +} + +var StateDiscriminator = [8]byte{216, 146, 107, 94, 104, 75, 182, 177} + +func (obj State) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(StateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *State) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(StateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[216 146 107 94 104 75 182 177]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type ChainConfig struct { + Base BaseChain +} + +var ChainConfigDiscriminator = [8]byte{13, 177, 233, 141, 212, 29, 148, 56} + +func (obj ChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ChainConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Base` param: + err = encoder.Encode(obj.Base) + if err != nil { + return err + } + return nil +} + +func (obj *ChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ChainConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[13 177 233 141 212 29 148 56]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Base`: + err = decoder.Decode(&obj.Base) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/alias.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/alias.go new file mode 100644 index 0000000000..c997b96241 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/alias.go @@ -0,0 +1,16 @@ +package lockrelease_token_pool // revive:disable-line:var-naming + +import ( + base "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/base_token_pool" +) + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type RemoteAddress = base.RemoteAddress +type RemoteConfig = base.RemoteConfig +type LockOrBurnInV1 = base.LockOrBurnInV1 +type ReleaseOrMintInV1 = base.ReleaseOrMintInV1 +type RateLimitConfig = base.RateLimitConfig +type BaseConfig = base.BaseConfig +type BaseChain = base.BaseChain diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/instructions.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/instructions.go new file mode 100644 index 0000000000..ad85923826 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/instructions.go @@ -0,0 +1,290 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "LockreleaseTokenPool" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_InitGlobalConfig = ag_binary.TypeID([8]byte{140, 136, 214, 48, 87, 0, 120, 255}) + + Instruction_UpdateSelfServedAllowed = ag_binary.TypeID([8]byte{210, 165, 57, 132, 64, 203, 100, 73}) + + Instruction_UpdateDefaultRouter = ag_binary.TypeID([8]byte{29, 86, 6, 222, 73, 220, 6, 186}) + + Instruction_UpdateDefaultRmn = ag_binary.TypeID([8]byte{204, 186, 36, 125, 180, 133, 227, 162}) + + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + Instruction_SetRouter = ag_binary.TypeID([8]byte{236, 248, 107, 200, 151, 160, 44, 250}) + + Instruction_SetRmn = ag_binary.TypeID([8]byte{252, 89, 60, 179, 198, 54, 169, 120}) + + Instruction_InitializeStateVersion = ag_binary.TypeID([8]byte{54, 186, 181, 26, 2, 198, 200, 158}) + + Instruction_InitChainRemoteConfig = ag_binary.TypeID([8]byte{21, 150, 133, 36, 2, 116, 199, 129}) + + Instruction_EditChainRemoteConfig = ag_binary.TypeID([8]byte{149, 112, 186, 72, 116, 217, 159, 175}) + + Instruction_AppendRemotePoolAddresses = ag_binary.TypeID([8]byte{172, 57, 83, 55, 70, 112, 26, 197}) + + Instruction_SetChainRateLimit = ag_binary.TypeID([8]byte{188, 188, 161, 37, 100, 249, 123, 170}) + + Instruction_SetRateLimitAdmin = ag_binary.TypeID([8]byte{21, 182, 126, 128, 31, 241, 37, 34}) + + Instruction_DeleteChainConfig = ag_binary.TypeID([8]byte{241, 159, 142, 210, 64, 173, 77, 179}) + + Instruction_ConfigureAllowList = ag_binary.TypeID([8]byte{18, 180, 102, 187, 209, 0, 130, 191}) + + Instruction_RemoveFromAllowList = ag_binary.TypeID([8]byte{44, 46, 123, 213, 40, 11, 107, 18}) + + Instruction_ReleaseOrMintTokens = ag_binary.TypeID([8]byte{92, 100, 150, 198, 252, 63, 164, 228}) + + Instruction_LockOrBurnTokens = ag_binary.TypeID([8]byte{114, 161, 94, 29, 147, 25, 232, 191}) + + Instruction_SetRebalancer = ag_binary.TypeID([8]byte{28, 161, 168, 250, 215, 4, 144, 154}) + + Instruction_SetCanAcceptLiquidity = ag_binary.TypeID([8]byte{118, 130, 209, 172, 190, 90, 146, 130}) + + Instruction_ProvideLiquidity = ag_binary.TypeID([8]byte{40, 110, 107, 116, 174, 127, 97, 204}) + + Instruction_WithdrawLiquidity = ag_binary.TypeID([8]byte{149, 158, 33, 185, 47, 243, 253, 31}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_InitGlobalConfig: + return "InitGlobalConfig" + case Instruction_UpdateSelfServedAllowed: + return "UpdateSelfServedAllowed" + case Instruction_UpdateDefaultRouter: + return "UpdateDefaultRouter" + case Instruction_UpdateDefaultRmn: + return "UpdateDefaultRmn" + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetRouter: + return "SetRouter" + case Instruction_SetRmn: + return "SetRmn" + case Instruction_InitializeStateVersion: + return "InitializeStateVersion" + case Instruction_InitChainRemoteConfig: + return "InitChainRemoteConfig" + case Instruction_EditChainRemoteConfig: + return "EditChainRemoteConfig" + case Instruction_AppendRemotePoolAddresses: + return "AppendRemotePoolAddresses" + case Instruction_SetChainRateLimit: + return "SetChainRateLimit" + case Instruction_SetRateLimitAdmin: + return "SetRateLimitAdmin" + case Instruction_DeleteChainConfig: + return "DeleteChainConfig" + case Instruction_ConfigureAllowList: + return "ConfigureAllowList" + case Instruction_RemoveFromAllowList: + return "RemoveFromAllowList" + case Instruction_ReleaseOrMintTokens: + return "ReleaseOrMintTokens" + case Instruction_LockOrBurnTokens: + return "LockOrBurnTokens" + case Instruction_SetRebalancer: + return "SetRebalancer" + case Instruction_SetCanAcceptLiquidity: + return "SetCanAcceptLiquidity" + case Instruction_ProvideLiquidity: + return "ProvideLiquidity" + case Instruction_WithdrawLiquidity: + return "WithdrawLiquidity" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "init_global_config", (*InitGlobalConfig)(nil), + }, + { + "update_self_served_allowed", (*UpdateSelfServedAllowed)(nil), + }, + { + "update_default_router", (*UpdateDefaultRouter)(nil), + }, + { + "update_default_rmn", (*UpdateDefaultRmn)(nil), + }, + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_router", (*SetRouter)(nil), + }, + { + "set_rmn", (*SetRmn)(nil), + }, + { + "initialize_state_version", (*InitializeStateVersion)(nil), + }, + { + "init_chain_remote_config", (*InitChainRemoteConfig)(nil), + }, + { + "edit_chain_remote_config", (*EditChainRemoteConfig)(nil), + }, + { + "append_remote_pool_addresses", (*AppendRemotePoolAddresses)(nil), + }, + { + "set_chain_rate_limit", (*SetChainRateLimit)(nil), + }, + { + "set_rate_limit_admin", (*SetRateLimitAdmin)(nil), + }, + { + "delete_chain_config", (*DeleteChainConfig)(nil), + }, + { + "configure_allow_list", (*ConfigureAllowList)(nil), + }, + { + "remove_from_allow_list", (*RemoveFromAllowList)(nil), + }, + { + "release_or_mint_tokens", (*ReleaseOrMintTokens)(nil), + }, + { + "lock_or_burn_tokens", (*LockOrBurnTokens)(nil), + }, + { + "set_rebalancer", (*SetRebalancer)(nil), + }, + { + "set_can_accept_liquidity", (*SetCanAcceptLiquidity)(nil), + }, + { + "provide_liquidity", (*ProvideLiquidity)(nil), + }, + { + "withdraw_liquidity", (*WithdrawLiquidity)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/testing_utils.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/testing_utils.go new file mode 100644 index 0000000000..b3d31e748c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/types.go b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/types.go new file mode 100644 index 0000000000..663ea5d17c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/lockrelease_token_pool/types.go @@ -0,0 +1,3 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package lockrelease_token_pool diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive.go new file mode 100644 index 0000000000..de8cc1eff7 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive.go @@ -0,0 +1,602 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// CcipReceive is the `ccipReceive` instruction. +type CcipReceive struct { + Message *Any2SVMMessage + + // [0] = [SIGNER] authority + // + // [1] = [] offrampProgram + // ··········· CHECK offramp program: exists only to derive the allowed offramp PDA + // ··········· and the authority PDA. Must be second. + // + // [2] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp + // + // [3] = [] config + // + // [4] = [WRITE] ccipSendSigner + // ··········· CHECK + // + // [5] = [] feeTokenProgram + // + // [6] = [] feeTokenMint + // + // [7] = [WRITE] feeTokenAta + // + // [8] = [] ccipRouterProgram + // ··········· CHECK + // + // [9] = [] ccipRouterConfig + // ··········· CHECK + // + // [10] = [WRITE] ccipRouterDestChainState + // ··········· CHECK + // + // [11] = [WRITE] ccipRouterNonce + // ··········· CHECK + // + // [12] = [WRITE] ccipRouterFeeReceiver + // ··········· CHECK + // + // [13] = [] ccipRouterFeeBillingSigner + // ··········· CHECK + // + // [14] = [] feeQuoter + // ··········· CHECK + // + // [15] = [] feeQuoterConfig + // ··········· CHECK + // + // [16] = [] feeQuoterDestChain + // ··········· CHECK + // + // [17] = [] feeQuoterBillingTokenConfig + // ··········· CHECK + // + // [18] = [] feeQuoterLinkTokenConfig + // ··········· CHECK + // + // [19] = [] rmnRemote + // ··········· CHECK + // + // [20] = [] rmnRemoteCurses + // ··········· CHECK + // + // [21] = [] rmnRemoteConfig + // ··········· CHECK + // + // [22] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCcipReceiveInstructionBuilder creates a new `CcipReceive` instruction builder. +func NewCcipReceiveInstructionBuilder() *CcipReceive { + nd := &CcipReceive{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 23), + } + return nd +} + +// SetMessage sets the "message" parameter. +func (inst *CcipReceive) SetMessage(message Any2SVMMessage) *CcipReceive { + inst.Message = &message + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CcipReceive) SetAuthorityAccount(authority ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CcipReceive) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetOfframpProgramAccount sets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. Must be second. +func (inst *CcipReceive) SetOfframpProgramAccount(offrampProgram ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[1] = ag_solanago.Meta(offrampProgram) + return inst +} + +// GetOfframpProgramAccount gets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. Must be second. +func (inst *CcipReceive) GetOfframpProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *CcipReceive) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[2] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *CcipReceive) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetConfigAccount sets the "config" account. +func (inst *CcipReceive) SetConfigAccount(config ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[3] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CcipReceive) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetCcipSendSignerAccount sets the "ccipSendSigner" account. +// CHECK +func (inst *CcipReceive) SetCcipSendSignerAccount(ccipSendSigner ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[4] = ag_solanago.Meta(ccipSendSigner).WRITE() + return inst +} + +// GetCcipSendSignerAccount gets the "ccipSendSigner" account. +// CHECK +func (inst *CcipReceive) GetCcipSendSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeTokenProgramAccount sets the "feeTokenProgram" account. +func (inst *CcipReceive) SetFeeTokenProgramAccount(feeTokenProgram ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeTokenProgram) + return inst +} + +// GetFeeTokenProgramAccount gets the "feeTokenProgram" account. +func (inst *CcipReceive) GetFeeTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *CcipReceive) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[6] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *CcipReceive) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetFeeTokenAtaAccount sets the "feeTokenAta" account. +func (inst *CcipReceive) SetFeeTokenAtaAccount(feeTokenAta ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[7] = ag_solanago.Meta(feeTokenAta).WRITE() + return inst +} + +// GetFeeTokenAtaAccount gets the "feeTokenAta" account. +func (inst *CcipReceive) GetFeeTokenAtaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetCcipRouterProgramAccount sets the "ccipRouterProgram" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterProgramAccount(ccipRouterProgram ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[8] = ag_solanago.Meta(ccipRouterProgram) + return inst +} + +// GetCcipRouterProgramAccount gets the "ccipRouterProgram" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetCcipRouterConfigAccount sets the "ccipRouterConfig" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterConfigAccount(ccipRouterConfig ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[9] = ag_solanago.Meta(ccipRouterConfig) + return inst +} + +// GetCcipRouterConfigAccount gets the "ccipRouterConfig" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetCcipRouterDestChainStateAccount sets the "ccipRouterDestChainState" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterDestChainStateAccount(ccipRouterDestChainState ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[10] = ag_solanago.Meta(ccipRouterDestChainState).WRITE() + return inst +} + +// GetCcipRouterDestChainStateAccount gets the "ccipRouterDestChainState" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetCcipRouterNonceAccount sets the "ccipRouterNonce" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterNonceAccount(ccipRouterNonce ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[11] = ag_solanago.Meta(ccipRouterNonce).WRITE() + return inst +} + +// GetCcipRouterNonceAccount gets the "ccipRouterNonce" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterNonceAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetCcipRouterFeeReceiverAccount sets the "ccipRouterFeeReceiver" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterFeeReceiverAccount(ccipRouterFeeReceiver ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[12] = ag_solanago.Meta(ccipRouterFeeReceiver).WRITE() + return inst +} + +// GetCcipRouterFeeReceiverAccount gets the "ccipRouterFeeReceiver" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterFeeReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetCcipRouterFeeBillingSignerAccount sets the "ccipRouterFeeBillingSigner" account. +// CHECK +func (inst *CcipReceive) SetCcipRouterFeeBillingSignerAccount(ccipRouterFeeBillingSigner ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[13] = ag_solanago.Meta(ccipRouterFeeBillingSigner) + return inst +} + +// GetCcipRouterFeeBillingSignerAccount gets the "ccipRouterFeeBillingSigner" account. +// CHECK +func (inst *CcipReceive) GetCcipRouterFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +// CHECK +func (inst *CcipReceive) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[14] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +// CHECK +func (inst *CcipReceive) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[14] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +// CHECK +func (inst *CcipReceive) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[15] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +// CHECK +func (inst *CcipReceive) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[15] +} + +// SetFeeQuoterDestChainAccount sets the "feeQuoterDestChain" account. +// CHECK +func (inst *CcipReceive) SetFeeQuoterDestChainAccount(feeQuoterDestChain ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[16] = ag_solanago.Meta(feeQuoterDestChain) + return inst +} + +// GetFeeQuoterDestChainAccount gets the "feeQuoterDestChain" account. +// CHECK +func (inst *CcipReceive) GetFeeQuoterDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[16] +} + +// SetFeeQuoterBillingTokenConfigAccount sets the "feeQuoterBillingTokenConfig" account. +// CHECK +func (inst *CcipReceive) SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[17] = ag_solanago.Meta(feeQuoterBillingTokenConfig) + return inst +} + +// GetFeeQuoterBillingTokenConfigAccount gets the "feeQuoterBillingTokenConfig" account. +// CHECK +func (inst *CcipReceive) GetFeeQuoterBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[17] +} + +// SetFeeQuoterLinkTokenConfigAccount sets the "feeQuoterLinkTokenConfig" account. +// CHECK +func (inst *CcipReceive) SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[18] = ag_solanago.Meta(feeQuoterLinkTokenConfig) + return inst +} + +// GetFeeQuoterLinkTokenConfigAccount gets the "feeQuoterLinkTokenConfig" account. +// CHECK +func (inst *CcipReceive) GetFeeQuoterLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[18] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +// CHECK +func (inst *CcipReceive) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[19] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +// CHECK +func (inst *CcipReceive) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[19] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +// CHECK +func (inst *CcipReceive) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[20] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +// CHECK +func (inst *CcipReceive) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[20] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +// CHECK +func (inst *CcipReceive) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[21] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +// CHECK +func (inst *CcipReceive) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[21] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *CcipReceive) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *CcipReceive { + inst.AccountMetaSlice[22] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *CcipReceive) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[22] +} + +func (inst CcipReceive) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CcipReceive, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CcipReceive) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CcipReceive) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Message == nil { + return errors.New("Message parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.OfframpProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.CcipSendSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeTokenProgram is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.FeeTokenAta is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.CcipRouterProgram is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.CcipRouterConfig is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.CcipRouterDestChainState is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.CcipRouterNonce is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.CcipRouterFeeReceiver is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.CcipRouterFeeBillingSigner is not set") + } + if inst.AccountMetaSlice[14] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[15] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[16] == nil { + return errors.New("accounts.FeeQuoterDestChain is not set") + } + if inst.AccountMetaSlice[17] == nil { + return errors.New("accounts.FeeQuoterBillingTokenConfig is not set") + } + if inst.AccountMetaSlice[18] == nil { + return errors.New("accounts.FeeQuoterLinkTokenConfig is not set") + } + if inst.AccountMetaSlice[19] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[20] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[21] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[22] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *CcipReceive) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CcipReceive")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Message", *inst.Message)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=23]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" offrampProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" ccipSendSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeTokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" feeTokenAta", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" ccipRouterProgram", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" ccipRouterConfig", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" ccipRouterDestChainState", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" ccipRouterNonce", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" ccipRouterFeeReceiver", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" ccipRouterFeeBillingSigner", inst.AccountMetaSlice[13])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[14])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[15])) + accountsBranch.Child(ag_format.Meta(" feeQuoterDestChain", inst.AccountMetaSlice[16])) + accountsBranch.Child(ag_format.Meta("feeQuoterBillingTokenConfig", inst.AccountMetaSlice[17])) + accountsBranch.Child(ag_format.Meta(" feeQuoterLinkTokenConfig", inst.AccountMetaSlice[18])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[19])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[20])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[21])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[22])) + }) + }) + }) +} + +func (obj CcipReceive) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Message` param: + err = encoder.Encode(obj.Message) + if err != nil { + return err + } + return nil +} +func (obj *CcipReceive) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + return nil +} + +// NewCcipReceiveInstruction declares a new CcipReceive instruction with the provided parameters and accounts. +func NewCcipReceiveInstruction( + // Parameters: + message Any2SVMMessage, + // Accounts: + authority ag_solanago.PublicKey, + offrampProgram ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + config ag_solanago.PublicKey, + ccipSendSigner ag_solanago.PublicKey, + feeTokenProgram ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + feeTokenAta ag_solanago.PublicKey, + ccipRouterProgram ag_solanago.PublicKey, + ccipRouterConfig ag_solanago.PublicKey, + ccipRouterDestChainState ag_solanago.PublicKey, + ccipRouterNonce ag_solanago.PublicKey, + ccipRouterFeeReceiver ag_solanago.PublicKey, + ccipRouterFeeBillingSigner ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + feeQuoterDestChain ag_solanago.PublicKey, + feeQuoterBillingTokenConfig ag_solanago.PublicKey, + feeQuoterLinkTokenConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *CcipReceive { + return NewCcipReceiveInstructionBuilder(). + SetMessage(message). + SetAuthorityAccount(authority). + SetOfframpProgramAccount(offrampProgram). + SetAllowedOfframpAccount(allowedOfframp). + SetConfigAccount(config). + SetCcipSendSignerAccount(ccipSendSigner). + SetFeeTokenProgramAccount(feeTokenProgram). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenAtaAccount(feeTokenAta). + SetCcipRouterProgramAccount(ccipRouterProgram). + SetCcipRouterConfigAccount(ccipRouterConfig). + SetCcipRouterDestChainStateAccount(ccipRouterDestChainState). + SetCcipRouterNonceAccount(ccipRouterNonce). + SetCcipRouterFeeReceiverAccount(ccipRouterFeeReceiver). + SetCcipRouterFeeBillingSignerAccount(ccipRouterFeeBillingSigner). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetFeeQuoterDestChainAccount(feeQuoterDestChain). + SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig). + SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive_test.go new file mode 100644 index 0000000000..ce4a3307bd --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/CcipReceive_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CcipReceive(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CcipReceive"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CcipReceive) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CcipReceive) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize.go new file mode 100644 index 0000000000..e68caa0fd8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize.go @@ -0,0 +1,275 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + + // [0] = [] config + // + // [1] = [WRITE] nameVersion + // + // [2] = [] routerFeeBillingSigner + // ··········· CHECK + // + // [3] = [] feeTokenProgram + // + // [4] = [] feeTokenMint + // + // [5] = [WRITE] feeTokenAta + // + // [6] = [] ccipSendSigner + // ··········· CHECK + // + // [7] = [WRITE, SIGNER] authority + // + // [8] = [] associatedTokenProgram + // + // [9] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 10), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetNameVersionAccount sets the "nameVersion" account. +func (inst *Initialize) SetNameVersionAccount(nameVersion ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(nameVersion).WRITE() + return inst +} + +// GetNameVersionAccount gets the "nameVersion" account. +func (inst *Initialize) GetNameVersionAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetRouterFeeBillingSignerAccount sets the "routerFeeBillingSigner" account. +// CHECK +func (inst *Initialize) SetRouterFeeBillingSignerAccount(routerFeeBillingSigner ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(routerFeeBillingSigner) + return inst +} + +// GetRouterFeeBillingSignerAccount gets the "routerFeeBillingSigner" account. +// CHECK +func (inst *Initialize) GetRouterFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetFeeTokenProgramAccount sets the "feeTokenProgram" account. +func (inst *Initialize) SetFeeTokenProgramAccount(feeTokenProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(feeTokenProgram) + return inst +} + +// GetFeeTokenProgramAccount gets the "feeTokenProgram" account. +func (inst *Initialize) GetFeeTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *Initialize) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *Initialize) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeTokenAtaAccount sets the "feeTokenAta" account. +func (inst *Initialize) SetFeeTokenAtaAccount(feeTokenAta ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeTokenAta).WRITE() + return inst +} + +// GetFeeTokenAtaAccount gets the "feeTokenAta" account. +func (inst *Initialize) GetFeeTokenAtaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetCcipSendSignerAccount sets the "ccipSendSigner" account. +// CHECK +func (inst *Initialize) SetCcipSendSignerAccount(ccipSendSigner ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[6] = ag_solanago.Meta(ccipSendSigner) + return inst +} + +// GetCcipSendSignerAccount gets the "ccipSendSigner" account. +// CHECK +func (inst *Initialize) GetCcipSendSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[7] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account. +func (inst *Initialize) SetAssociatedTokenProgramAccount(associatedTokenProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[8] = ag_solanago.Meta(associatedTokenProgram) + return inst +} + +// GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account. +func (inst *Initialize) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[9] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.NameVersion is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.RouterFeeBillingSigner is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.FeeTokenProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeTokenAta is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.CcipSendSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.AssociatedTokenProgram is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=10]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" nameVersion", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("routerFeeBillingSigner", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feeTokenProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeTokenAta", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" ccipSendSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("associatedTokenProgram", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[9])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Accounts: + config ag_solanago.PublicKey, + nameVersion ag_solanago.PublicKey, + routerFeeBillingSigner ag_solanago.PublicKey, + feeTokenProgram ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + feeTokenAta ag_solanago.PublicKey, + ccipSendSigner ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + associatedTokenProgram ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetConfigAccount(config). + SetNameVersionAccount(nameVersion). + SetRouterFeeBillingSignerAccount(routerFeeBillingSigner). + SetFeeTokenProgramAccount(feeTokenProgram). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenAtaAccount(feeTokenAta). + SetCcipSendSignerAccount(ccipSendSigner). + SetAuthorityAccount(authority). + SetAssociatedTokenProgramAccount(associatedTokenProgram). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig.go new file mode 100644 index 0000000000..a29c2e20b5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig.go @@ -0,0 +1,314 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitializeConfig is the `initializeConfig` instruction. +type InitializeConfig struct { + Router *ag_solanago.PublicKey + CounterpartChainSelector *uint64 + CounterpartAddress *[]byte + IsPaused *bool + ExtraArgs *[]byte + + // [0] = [WRITE] config + // + // [1] = [] feeTokenMint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeConfigInstructionBuilder creates a new `InitializeConfig` instruction builder. +func NewInitializeConfigInstructionBuilder() *InitializeConfig { + nd := &InitializeConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + } + return nd +} + +// SetRouter sets the "router" parameter. +func (inst *InitializeConfig) SetRouter(router ag_solanago.PublicKey) *InitializeConfig { + inst.Router = &router + return inst +} + +// SetCounterpartChainSelector sets the "counterpartChainSelector" parameter. +func (inst *InitializeConfig) SetCounterpartChainSelector(counterpartChainSelector uint64) *InitializeConfig { + inst.CounterpartChainSelector = &counterpartChainSelector + return inst +} + +// SetCounterpartAddress sets the "counterpartAddress" parameter. +func (inst *InitializeConfig) SetCounterpartAddress(counterpartAddress []byte) *InitializeConfig { + inst.CounterpartAddress = &counterpartAddress + return inst +} + +// SetIsPaused sets the "isPaused" parameter. +func (inst *InitializeConfig) SetIsPaused(isPaused bool) *InitializeConfig { + inst.IsPaused = &isPaused + return inst +} + +// SetExtraArgs sets the "extraArgs" parameter. +func (inst *InitializeConfig) SetExtraArgs(extraArgs []byte) *InitializeConfig { + inst.ExtraArgs = &extraArgs + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *InitializeConfig) SetConfigAccount(config ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *InitializeConfig) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *InitializeConfig) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *InitializeConfig) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitializeConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitializeConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitializeConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitializeConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *InitializeConfig) SetProgramAccount(program ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *InitializeConfig) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *InitializeConfig) SetProgramDataAccount(programData ag_solanago.PublicKey) *InitializeConfig { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *InitializeConfig) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +func (inst InitializeConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitializeConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitializeConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitializeConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Router == nil { + return errors.New("Router parameter is not set") + } + if inst.CounterpartChainSelector == nil { + return errors.New("CounterpartChainSelector parameter is not set") + } + if inst.CounterpartAddress == nil { + return errors.New("CounterpartAddress parameter is not set") + } + if inst.IsPaused == nil { + return errors.New("IsPaused parameter is not set") + } + if inst.ExtraArgs == nil { + return errors.New("ExtraArgs parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *InitializeConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitializeConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=5]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Router", *inst.Router)) + paramsBranch.Child(ag_format.Param("CounterpartChainSelector", *inst.CounterpartChainSelector)) + paramsBranch.Child(ag_format.Param(" CounterpartAddress", *inst.CounterpartAddress)) + paramsBranch.Child(ag_format.Param(" IsPaused", *inst.IsPaused)) + paramsBranch.Child(ag_format.Param(" ExtraArgs", *inst.ExtraArgs)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + }) + }) + }) +} + +func (obj InitializeConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `CounterpartChainSelector` param: + err = encoder.Encode(obj.CounterpartChainSelector) + if err != nil { + return err + } + // Serialize `CounterpartAddress` param: + err = encoder.Encode(obj.CounterpartAddress) + if err != nil { + return err + } + // Serialize `IsPaused` param: + err = encoder.Encode(obj.IsPaused) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} +func (obj *InitializeConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `CounterpartChainSelector`: + err = decoder.Decode(&obj.CounterpartChainSelector) + if err != nil { + return err + } + // Deserialize `CounterpartAddress`: + err = decoder.Decode(&obj.CounterpartAddress) + if err != nil { + return err + } + // Deserialize `IsPaused`: + err = decoder.Decode(&obj.IsPaused) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +// NewInitializeConfigInstruction declares a new InitializeConfig instruction with the provided parameters and accounts. +func NewInitializeConfigInstruction( + // Parameters: + router ag_solanago.PublicKey, + counterpartChainSelector uint64, + counterpartAddress []byte, + isPaused bool, + extraArgs []byte, + // Accounts: + config ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *InitializeConfig { + return NewInitializeConfigInstructionBuilder(). + SetRouter(router). + SetCounterpartChainSelector(counterpartChainSelector). + SetCounterpartAddress(counterpartAddress). + SetIsPaused(isPaused). + SetExtraArgs(extraArgs). + SetConfigAccount(config). + SetFeeTokenMintAccount(feeTokenMint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig_test.go new file mode 100644 index 0000000000..1a125e63ad --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/InitializeConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitializeConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitializeConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitializeConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitializeConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize_test.go new file mode 100644 index 0000000000..22529281c6 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart.go new file mode 100644 index 0000000000..6a4a57234b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart.go @@ -0,0 +1,169 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetCounterpart is the `setCounterpart` instruction. +type SetCounterpart struct { + CounterpartChainSelector *uint64 + CounterpartAddress *[]byte + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetCounterpartInstructionBuilder creates a new `SetCounterpart` instruction builder. +func NewSetCounterpartInstructionBuilder() *SetCounterpart { + nd := &SetCounterpart{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetCounterpartChainSelector sets the "counterpartChainSelector" parameter. +func (inst *SetCounterpart) SetCounterpartChainSelector(counterpartChainSelector uint64) *SetCounterpart { + inst.CounterpartChainSelector = &counterpartChainSelector + return inst +} + +// SetCounterpartAddress sets the "counterpartAddress" parameter. +func (inst *SetCounterpart) SetCounterpartAddress(counterpartAddress []byte) *SetCounterpart { + inst.CounterpartAddress = &counterpartAddress + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetCounterpart) SetConfigAccount(config ag_solanago.PublicKey) *SetCounterpart { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetCounterpart) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetCounterpart) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetCounterpart { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetCounterpart) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetCounterpart) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetCounterpart, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetCounterpart) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetCounterpart) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.CounterpartChainSelector == nil { + return errors.New("CounterpartChainSelector parameter is not set") + } + if inst.CounterpartAddress == nil { + return errors.New("CounterpartAddress parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetCounterpart) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetCounterpart")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("CounterpartChainSelector", *inst.CounterpartChainSelector)) + paramsBranch.Child(ag_format.Param(" CounterpartAddress", *inst.CounterpartAddress)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetCounterpart) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `CounterpartChainSelector` param: + err = encoder.Encode(obj.CounterpartChainSelector) + if err != nil { + return err + } + // Serialize `CounterpartAddress` param: + err = encoder.Encode(obj.CounterpartAddress) + if err != nil { + return err + } + return nil +} +func (obj *SetCounterpart) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `CounterpartChainSelector`: + err = decoder.Decode(&obj.CounterpartChainSelector) + if err != nil { + return err + } + // Deserialize `CounterpartAddress`: + err = decoder.Decode(&obj.CounterpartAddress) + if err != nil { + return err + } + return nil +} + +// NewSetCounterpartInstruction declares a new SetCounterpart instruction with the provided parameters and accounts. +func NewSetCounterpartInstruction( + // Parameters: + counterpartChainSelector uint64, + counterpartAddress []byte, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetCounterpart { + return NewSetCounterpartInstructionBuilder(). + SetCounterpartChainSelector(counterpartChainSelector). + SetCounterpartAddress(counterpartAddress). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart_test.go new file mode 100644 index 0000000000..23c6be4475 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetCounterpart_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetCounterpart(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetCounterpart"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetCounterpart) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetCounterpart) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs.go new file mode 100644 index 0000000000..204bff3326 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetExtraArgs is the `setExtraArgs` instruction. +type SetExtraArgs struct { + ExtraArgs *[]byte + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetExtraArgsInstructionBuilder creates a new `SetExtraArgs` instruction builder. +func NewSetExtraArgsInstructionBuilder() *SetExtraArgs { + nd := &SetExtraArgs{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetExtraArgs sets the "extraArgs" parameter. +func (inst *SetExtraArgs) SetExtraArgs(extraArgs []byte) *SetExtraArgs { + inst.ExtraArgs = &extraArgs + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetExtraArgs) SetConfigAccount(config ag_solanago.PublicKey) *SetExtraArgs { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetExtraArgs) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetExtraArgs) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetExtraArgs { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetExtraArgs) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetExtraArgs) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetExtraArgs { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetExtraArgs) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetExtraArgs) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetExtraArgs, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetExtraArgs) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetExtraArgs) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ExtraArgs == nil { + return errors.New("ExtraArgs parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetExtraArgs) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetExtraArgs")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ExtraArgs", *inst.ExtraArgs)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetExtraArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} +func (obj *SetExtraArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +// NewSetExtraArgsInstruction declares a new SetExtraArgs instruction with the provided parameters and accounts. +func NewSetExtraArgsInstruction( + // Parameters: + extraArgs []byte, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetExtraArgs { + return NewSetExtraArgsInstructionBuilder(). + SetExtraArgs(extraArgs). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs_test.go new file mode 100644 index 0000000000..dade1b00a3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetExtraArgs_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetExtraArgs(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetExtraArgs"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetExtraArgs) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetExtraArgs) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused.go new file mode 100644 index 0000000000..8903cc6438 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused.go @@ -0,0 +1,146 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetPaused is the `setPaused` instruction. +type SetPaused struct { + Pause *bool + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetPausedInstructionBuilder creates a new `SetPaused` instruction builder. +func NewSetPausedInstructionBuilder() *SetPaused { + nd := &SetPaused{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetPause sets the "pause" parameter. +func (inst *SetPaused) SetPause(pause bool) *SetPaused { + inst.Pause = &pause + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetPaused) SetConfigAccount(config ag_solanago.PublicKey) *SetPaused { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetPaused) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetPaused) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetPaused { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetPaused) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetPaused) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetPaused, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetPaused) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetPaused) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Pause == nil { + return errors.New("Pause parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetPaused) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetPaused")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Pause", *inst.Pause)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetPaused) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Pause` param: + err = encoder.Encode(obj.Pause) + if err != nil { + return err + } + return nil +} +func (obj *SetPaused) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Pause`: + err = decoder.Decode(&obj.Pause) + if err != nil { + return err + } + return nil +} + +// NewSetPausedInstruction declares a new SetPaused instruction with the provided parameters and accounts. +func NewSetPausedInstruction( + // Parameters: + pause bool, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetPaused { + return NewSetPausedInstructionBuilder(). + SetPause(pause). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused_test.go new file mode 100644 index 0000000000..42d7d179a5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/SetPaused_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetPaused(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetPaused"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetPaused) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetPaused) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong.go new file mode 100644 index 0000000000..10f0525b92 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong.go @@ -0,0 +1,523 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// StartPingPong is the `startPingPong` instruction. +type StartPingPong struct { + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [WRITE] ccipSendSigner + // ··········· CHECK + // + // [3] = [] feeTokenProgram + // + // [4] = [] feeTokenMint + // + // [5] = [WRITE] feeTokenAta + // + // [6] = [] ccipRouterProgram + // ··········· CHECK + // + // [7] = [] ccipRouterConfig + // ··········· CHECK + // + // [8] = [WRITE] ccipRouterDestChainState + // ··········· CHECK + // + // [9] = [WRITE] ccipRouterNonce + // ··········· CHECK + // + // [10] = [WRITE] ccipRouterFeeReceiver + // ··········· CHECK + // + // [11] = [] ccipRouterFeeBillingSigner + // ··········· CHECK + // + // [12] = [] feeQuoter + // ··········· CHECK + // + // [13] = [] feeQuoterConfig + // ··········· CHECK + // + // [14] = [] feeQuoterDestChain + // ··········· CHECK + // + // [15] = [] feeQuoterBillingTokenConfig + // ··········· CHECK + // + // [16] = [] feeQuoterLinkTokenConfig + // ··········· CHECK + // + // [17] = [] rmnRemote + // ··········· CHECK + // + // [18] = [] rmnRemoteCurses + // ··········· CHECK + // + // [19] = [] rmnRemoteConfig + // ··········· CHECK + // + // [20] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewStartPingPongInstructionBuilder creates a new `StartPingPong` instruction builder. +func NewStartPingPongInstructionBuilder() *StartPingPong { + nd := &StartPingPong{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 21), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *StartPingPong) SetConfigAccount(config ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *StartPingPong) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *StartPingPong) SetAuthorityAccount(authority ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *StartPingPong) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetCcipSendSignerAccount sets the "ccipSendSigner" account. +// CHECK +func (inst *StartPingPong) SetCcipSendSignerAccount(ccipSendSigner ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[2] = ag_solanago.Meta(ccipSendSigner).WRITE() + return inst +} + +// GetCcipSendSignerAccount gets the "ccipSendSigner" account. +// CHECK +func (inst *StartPingPong) GetCcipSendSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetFeeTokenProgramAccount sets the "feeTokenProgram" account. +func (inst *StartPingPong) SetFeeTokenProgramAccount(feeTokenProgram ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[3] = ag_solanago.Meta(feeTokenProgram) + return inst +} + +// GetFeeTokenProgramAccount gets the "feeTokenProgram" account. +func (inst *StartPingPong) GetFeeTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetFeeTokenMintAccount sets the "feeTokenMint" account. +func (inst *StartPingPong) SetFeeTokenMintAccount(feeTokenMint ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[4] = ag_solanago.Meta(feeTokenMint) + return inst +} + +// GetFeeTokenMintAccount gets the "feeTokenMint" account. +func (inst *StartPingPong) GetFeeTokenMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetFeeTokenAtaAccount sets the "feeTokenAta" account. +func (inst *StartPingPong) SetFeeTokenAtaAccount(feeTokenAta ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[5] = ag_solanago.Meta(feeTokenAta).WRITE() + return inst +} + +// GetFeeTokenAtaAccount gets the "feeTokenAta" account. +func (inst *StartPingPong) GetFeeTokenAtaAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetCcipRouterProgramAccount sets the "ccipRouterProgram" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterProgramAccount(ccipRouterProgram ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[6] = ag_solanago.Meta(ccipRouterProgram) + return inst +} + +// GetCcipRouterProgramAccount gets the "ccipRouterProgram" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetCcipRouterConfigAccount sets the "ccipRouterConfig" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterConfigAccount(ccipRouterConfig ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[7] = ag_solanago.Meta(ccipRouterConfig) + return inst +} + +// GetCcipRouterConfigAccount gets the "ccipRouterConfig" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetCcipRouterDestChainStateAccount sets the "ccipRouterDestChainState" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterDestChainStateAccount(ccipRouterDestChainState ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[8] = ag_solanago.Meta(ccipRouterDestChainState).WRITE() + return inst +} + +// GetCcipRouterDestChainStateAccount gets the "ccipRouterDestChainState" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterDestChainStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetCcipRouterNonceAccount sets the "ccipRouterNonce" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterNonceAccount(ccipRouterNonce ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[9] = ag_solanago.Meta(ccipRouterNonce).WRITE() + return inst +} + +// GetCcipRouterNonceAccount gets the "ccipRouterNonce" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterNonceAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetCcipRouterFeeReceiverAccount sets the "ccipRouterFeeReceiver" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterFeeReceiverAccount(ccipRouterFeeReceiver ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[10] = ag_solanago.Meta(ccipRouterFeeReceiver).WRITE() + return inst +} + +// GetCcipRouterFeeReceiverAccount gets the "ccipRouterFeeReceiver" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterFeeReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetCcipRouterFeeBillingSignerAccount sets the "ccipRouterFeeBillingSigner" account. +// CHECK +func (inst *StartPingPong) SetCcipRouterFeeBillingSignerAccount(ccipRouterFeeBillingSigner ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[11] = ag_solanago.Meta(ccipRouterFeeBillingSigner) + return inst +} + +// GetCcipRouterFeeBillingSignerAccount gets the "ccipRouterFeeBillingSigner" account. +// CHECK +func (inst *StartPingPong) GetCcipRouterFeeBillingSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetFeeQuoterAccount sets the "feeQuoter" account. +// CHECK +func (inst *StartPingPong) SetFeeQuoterAccount(feeQuoter ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[12] = ag_solanago.Meta(feeQuoter) + return inst +} + +// GetFeeQuoterAccount gets the "feeQuoter" account. +// CHECK +func (inst *StartPingPong) GetFeeQuoterAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +// SetFeeQuoterConfigAccount sets the "feeQuoterConfig" account. +// CHECK +func (inst *StartPingPong) SetFeeQuoterConfigAccount(feeQuoterConfig ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[13] = ag_solanago.Meta(feeQuoterConfig) + return inst +} + +// GetFeeQuoterConfigAccount gets the "feeQuoterConfig" account. +// CHECK +func (inst *StartPingPong) GetFeeQuoterConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[13] +} + +// SetFeeQuoterDestChainAccount sets the "feeQuoterDestChain" account. +// CHECK +func (inst *StartPingPong) SetFeeQuoterDestChainAccount(feeQuoterDestChain ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[14] = ag_solanago.Meta(feeQuoterDestChain) + return inst +} + +// GetFeeQuoterDestChainAccount gets the "feeQuoterDestChain" account. +// CHECK +func (inst *StartPingPong) GetFeeQuoterDestChainAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[14] +} + +// SetFeeQuoterBillingTokenConfigAccount sets the "feeQuoterBillingTokenConfig" account. +// CHECK +func (inst *StartPingPong) SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[15] = ag_solanago.Meta(feeQuoterBillingTokenConfig) + return inst +} + +// GetFeeQuoterBillingTokenConfigAccount gets the "feeQuoterBillingTokenConfig" account. +// CHECK +func (inst *StartPingPong) GetFeeQuoterBillingTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[15] +} + +// SetFeeQuoterLinkTokenConfigAccount sets the "feeQuoterLinkTokenConfig" account. +// CHECK +func (inst *StartPingPong) SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[16] = ag_solanago.Meta(feeQuoterLinkTokenConfig) + return inst +} + +// GetFeeQuoterLinkTokenConfigAccount gets the "feeQuoterLinkTokenConfig" account. +// CHECK +func (inst *StartPingPong) GetFeeQuoterLinkTokenConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[16] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +// CHECK +func (inst *StartPingPong) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[17] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +// CHECK +func (inst *StartPingPong) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[17] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +// CHECK +func (inst *StartPingPong) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[18] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +// CHECK +func (inst *StartPingPong) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[18] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +// CHECK +func (inst *StartPingPong) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[19] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +// CHECK +func (inst *StartPingPong) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[19] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *StartPingPong) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *StartPingPong { + inst.AccountMetaSlice[20] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *StartPingPong) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[20] +} + +func (inst StartPingPong) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_StartPingPong, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst StartPingPong) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *StartPingPong) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.CcipSendSigner is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.FeeTokenProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.FeeTokenMint is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.FeeTokenAta is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.CcipRouterProgram is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.CcipRouterConfig is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.CcipRouterDestChainState is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.CcipRouterNonce is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.CcipRouterFeeReceiver is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.CcipRouterFeeBillingSigner is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.FeeQuoter is not set") + } + if inst.AccountMetaSlice[13] == nil { + return errors.New("accounts.FeeQuoterConfig is not set") + } + if inst.AccountMetaSlice[14] == nil { + return errors.New("accounts.FeeQuoterDestChain is not set") + } + if inst.AccountMetaSlice[15] == nil { + return errors.New("accounts.FeeQuoterBillingTokenConfig is not set") + } + if inst.AccountMetaSlice[16] == nil { + return errors.New("accounts.FeeQuoterLinkTokenConfig is not set") + } + if inst.AccountMetaSlice[17] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[18] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[19] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[20] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *StartPingPong) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("StartPingPong")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=21]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" ccipSendSigner", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feeTokenProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feeTokenMint", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" feeTokenAta", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" ccipRouterProgram", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" ccipRouterConfig", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" ccipRouterDestChainState", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" ccipRouterNonce", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta(" ccipRouterFeeReceiver", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta(" ccipRouterFeeBillingSigner", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" feeQuoter", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" feeQuoterConfig", inst.AccountMetaSlice[13])) + accountsBranch.Child(ag_format.Meta(" feeQuoterDestChain", inst.AccountMetaSlice[14])) + accountsBranch.Child(ag_format.Meta("feeQuoterBillingTokenConfig", inst.AccountMetaSlice[15])) + accountsBranch.Child(ag_format.Meta(" feeQuoterLinkTokenConfig", inst.AccountMetaSlice[16])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[17])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteCurses", inst.AccountMetaSlice[18])) + accountsBranch.Child(ag_format.Meta(" rmnRemoteConfig", inst.AccountMetaSlice[19])) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[20])) + }) + }) + }) +} + +func (obj StartPingPong) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *StartPingPong) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewStartPingPongInstruction declares a new StartPingPong instruction with the provided parameters and accounts. +func NewStartPingPongInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + ccipSendSigner ag_solanago.PublicKey, + feeTokenProgram ag_solanago.PublicKey, + feeTokenMint ag_solanago.PublicKey, + feeTokenAta ag_solanago.PublicKey, + ccipRouterProgram ag_solanago.PublicKey, + ccipRouterConfig ag_solanago.PublicKey, + ccipRouterDestChainState ag_solanago.PublicKey, + ccipRouterNonce ag_solanago.PublicKey, + ccipRouterFeeReceiver ag_solanago.PublicKey, + ccipRouterFeeBillingSigner ag_solanago.PublicKey, + feeQuoter ag_solanago.PublicKey, + feeQuoterConfig ag_solanago.PublicKey, + feeQuoterDestChain ag_solanago.PublicKey, + feeQuoterBillingTokenConfig ag_solanago.PublicKey, + feeQuoterLinkTokenConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *StartPingPong { + return NewStartPingPongInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetCcipSendSignerAccount(ccipSendSigner). + SetFeeTokenProgramAccount(feeTokenProgram). + SetFeeTokenMintAccount(feeTokenMint). + SetFeeTokenAtaAccount(feeTokenAta). + SetCcipRouterProgramAccount(ccipRouterProgram). + SetCcipRouterConfigAccount(ccipRouterConfig). + SetCcipRouterDestChainStateAccount(ccipRouterDestChainState). + SetCcipRouterNonceAccount(ccipRouterNonce). + SetCcipRouterFeeReceiverAccount(ccipRouterFeeReceiver). + SetCcipRouterFeeBillingSignerAccount(ccipRouterFeeBillingSigner). + SetFeeQuoterAccount(feeQuoter). + SetFeeQuoterConfigAccount(feeQuoterConfig). + SetFeeQuoterDestChainAccount(feeQuoterDestChain). + SetFeeQuoterBillingTokenConfigAccount(feeQuoterBillingTokenConfig). + SetFeeQuoterLinkTokenConfigAccount(feeQuoterLinkTokenConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong_test.go new file mode 100644 index 0000000000..2680aa1dd9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/StartPingPong_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_StartPingPong(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("StartPingPong"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(StartPingPong) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(StartPingPong) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion.go new file mode 100644 index 0000000000..4660e41919 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion_test.go new file mode 100644 index 0000000000..fe84981996 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/accounts.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/accounts.go new file mode 100644 index 0000000000..b54025f433 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/accounts.go @@ -0,0 +1,170 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type Config struct { + Owner ag_solanago.PublicKey + Router ag_solanago.PublicKey + CounterpartChainSelector uint64 + CounterpartAddress CounterpartAddress + IsPaused bool + FeeTokenMint ag_solanago.PublicKey + ExtraArgs []byte +} + +var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} + +func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `CounterpartChainSelector` param: + err = encoder.Encode(obj.CounterpartChainSelector) + if err != nil { + return err + } + // Serialize `CounterpartAddress` param: + err = encoder.Encode(obj.CounterpartAddress) + if err != nil { + return err + } + // Serialize `IsPaused` param: + err = encoder.Encode(obj.IsPaused) + if err != nil { + return err + } + // Serialize `FeeTokenMint` param: + err = encoder.Encode(obj.FeeTokenMint) + if err != nil { + return err + } + // Serialize `ExtraArgs` param: + err = encoder.Encode(obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[155 12 170 224 30 250 204 130]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `CounterpartChainSelector`: + err = decoder.Decode(&obj.CounterpartChainSelector) + if err != nil { + return err + } + // Deserialize `CounterpartAddress`: + err = decoder.Decode(&obj.CounterpartAddress) + if err != nil { + return err + } + // Deserialize `IsPaused`: + err = decoder.Decode(&obj.IsPaused) + if err != nil { + return err + } + // Deserialize `FeeTokenMint`: + err = decoder.Decode(&obj.FeeTokenMint) + if err != nil { + return err + } + // Deserialize `ExtraArgs`: + err = decoder.Decode(&obj.ExtraArgs) + if err != nil { + return err + } + return nil +} + +type NameVersion struct { + Name string + Version string +} + +var NameVersionDiscriminator = [8]byte{4, 169, 171, 229, 87, 69, 68, 244} + +func (obj NameVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(NameVersionDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Name` param: + err = encoder.Encode(obj.Name) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + return nil +} + +func (obj *NameVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(NameVersionDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[4 169 171 229 87 69 68 244]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Name`: + err = decoder.Decode(&obj.Name) + if err != nil { + return err + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/alias.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/alias.go new file mode 100644 index 0000000000..e8bb716c3b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/alias.go @@ -0,0 +1,10 @@ +package ping_pong_demo // revive:disable-line:var-naming + +import ( + "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/example_ccip_receiver" +) + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type Any2SVMMessage = example_ccip_receiver.Any2SVMMessage diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/instructions.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/instructions.go new file mode 100644 index 0000000000..f3638ffd2d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/instructions.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "PingPongDemo" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_InitializeConfig = ag_binary.TypeID([8]byte{208, 127, 21, 1, 194, 190, 196, 70}) + + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + Instruction_SetCounterpart = ag_binary.TypeID([8]byte{118, 28, 243, 127, 218, 176, 228, 228}) + + Instruction_SetPaused = ag_binary.TypeID([8]byte{91, 60, 125, 192, 176, 225, 166, 218}) + + Instruction_SetExtraArgs = ag_binary.TypeID([8]byte{103, 87, 237, 252, 141, 176, 81, 193}) + + Instruction_StartPingPong = ag_binary.TypeID([8]byte{53, 36, 169, 135, 221, 239, 52, 103}) + + Instruction_CcipReceive = ag_binary.TypeID([8]byte{11, 244, 9, 249, 44, 83, 47, 245}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_InitializeConfig: + return "InitializeConfig" + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_SetCounterpart: + return "SetCounterpart" + case Instruction_SetPaused: + return "SetPaused" + case Instruction_SetExtraArgs: + return "SetExtraArgs" + case Instruction_StartPingPong: + return "StartPingPong" + case Instruction_CcipReceive: + return "CcipReceive" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize_config", (*InitializeConfig)(nil), + }, + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "set_counterpart", (*SetCounterpart)(nil), + }, + { + "set_paused", (*SetPaused)(nil), + }, + { + "set_extra_args", (*SetExtraArgs)(nil), + }, + { + "start_ping_pong", (*StartPingPong)(nil), + }, + { + "ccip_receive", (*CcipReceive)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/testing_utils.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/testing_utils.go new file mode 100644 index 0000000000..9f0a46fd44 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/ping_pong_demo/types.go b/chains/solana/gobindings/v1_6_1/ping_pong_demo/types.go new file mode 100644 index 0000000000..3839f36be2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/ping_pong_demo/types.go @@ -0,0 +1,38 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package ping_pong_demo + +import ag_binary "github.com/gagliardetto/binary" + +type CounterpartAddress struct { + Bytes [64]uint8 + Len uint8 +} + +func (obj CounterpartAddress) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Bytes` param: + err = encoder.Encode(obj.Bytes) + if err != nil { + return err + } + // Serialize `Len` param: + err = encoder.Encode(obj.Len) + if err != nil { + return err + } + return nil +} + +func (obj *CounterpartAddress) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Bytes`: + err = decoder.Decode(&obj.Bytes) + if err != nil { + return err + } + // Deserialize `Len`: + err = decoder.Decode(&obj.Len) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership.go new file mode 100644 index 0000000000..0b53b546d8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership.go @@ -0,0 +1,124 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Accepts the ownership of the fee quoter by the proposed owner. +// +// Shared func signature with other programs. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for accepting ownership. +// The new owner must be a signer of the transaction. +type AcceptOwnership struct { + + // [0] = [WRITE] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *AcceptOwnership) SetConfigAccount(config ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *AcceptOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership_test.go new file mode 100644 index 0000000000..75716ab983 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent.go b/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent.go new file mode 100644 index 0000000000..31cc31d9ef --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent.go @@ -0,0 +1,156 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Backwards-compatible way of implementing CPI events without other contracts needing to +// add more accounts to make a self-CPI. Calls made to this instruction include the event data +// in the instruction data, so offchain code can inspect it. +// +// Only event authorities can invoke this instruction. While there is basic onchain +// authorization, the offchain is still expected to check the caller program to attribute the +// event to it, as this method may be invoked by more than one program so that it can be reused. +// +// # Arguments +// * `_ctx` - The context containing the accounts required for the CPI event. +// * `_event_data` - The raw event data to be emitted. +type CpiEvent struct { + EventData *[]byte + + // [0] = [] config + // + // [1] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCpiEventInstructionBuilder creates a new `CpiEvent` instruction builder. +func NewCpiEventInstructionBuilder() *CpiEvent { + nd := &CpiEvent{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetEventData sets the "eventData" parameter. +func (inst *CpiEvent) SetEventData(eventData []byte) *CpiEvent { + inst.EventData = &eventData + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *CpiEvent) SetConfigAccount(config ag_solanago.PublicKey) *CpiEvent { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *CpiEvent) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *CpiEvent) SetAuthorityAccount(authority ag_solanago.PublicKey) *CpiEvent { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *CpiEvent) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst CpiEvent) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_CpiEvent, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst CpiEvent) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *CpiEvent) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.EventData == nil { + return errors.New("EventData parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *CpiEvent) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("CpiEvent")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("EventData", *inst.EventData)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj CpiEvent) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `EventData` param: + err = encoder.Encode(obj.EventData) + if err != nil { + return err + } + return nil +} +func (obj *CpiEvent) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `EventData`: + err = decoder.Decode(&obj.EventData) + if err != nil { + return err + } + return nil +} + +// NewCpiEventInstruction declares a new CpiEvent instruction with the provided parameters and accounts. +func NewCpiEventInstruction( + // Parameters: + eventData []byte, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *CpiEvent { + return NewCpiEventInstructionBuilder(). + SetEventData(eventData). + SetConfigAccount(config). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent_test.go new file mode 100644 index 0000000000..22c1d3f180 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/CpiEvent_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_CpiEvent(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("CpiEvent"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(CpiEvent) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(CpiEvent) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Curse.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Curse.go new file mode 100644 index 0000000000..de32888a1b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Curse.go @@ -0,0 +1,192 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Curses an abstract subject. If the subject is CurseSubject::GLOBAL, +// the entire chain will be cursed. +// +// Only the CCIP Admin may perform this operation +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for adding a new curse. +// * `subject` - The subject to curse. +type Curse struct { + Subject *CurseSubject + + // [0] = [] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [WRITE] curses + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewCurseInstructionBuilder creates a new `Curse` instruction builder. +func NewCurseInstructionBuilder() *Curse { + nd := &Curse{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSubject sets the "subject" parameter. +func (inst *Curse) SetSubject(subject CurseSubject) *Curse { + inst.Subject = &subject + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Curse) SetConfigAccount(config ag_solanago.PublicKey) *Curse { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Curse) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Curse) SetAuthorityAccount(authority ag_solanago.PublicKey) *Curse { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Curse) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetCursesAccount sets the "curses" account. +func (inst *Curse) SetCursesAccount(curses ag_solanago.PublicKey) *Curse { + inst.AccountMetaSlice[2] = ag_solanago.Meta(curses).WRITE() + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *Curse) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Curse) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Curse { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Curse) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst Curse) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Curse, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Curse) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Curse) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Subject == nil { + return errors.New("Subject parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *Curse) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Curse")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Subject", *inst.Subject)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" curses", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj Curse) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Subject` param: + err = encoder.Encode(obj.Subject) + if err != nil { + return err + } + return nil +} +func (obj *Curse) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Subject`: + err = decoder.Decode(&obj.Subject) + if err != nil { + return err + } + return nil +} + +// NewCurseInstruction declares a new Curse instruction with the provided parameters and accounts. +func NewCurseInstruction( + // Parameters: + subject CurseSubject, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + curses ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *Curse { + return NewCurseInstructionBuilder(). + SetSubject(subject). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetCursesAccount(curses). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Curse_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Curse_test.go new file mode 100644 index 0000000000..3d5b3895c3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Curse_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Curse(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Curse"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Curse) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Curse) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize.go new file mode 100644 index 0000000000..5d63f5282c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize.go @@ -0,0 +1,199 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initializes the Rmn Remote contract. +// +// The initialization is responsibility of Admin, nothing more than calling this method should be done first. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for initialization. +type Initialize struct { + + // [0] = [WRITE] config + // + // [1] = [WRITE] curses + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + } + return nd +} + +// SetConfigAccount sets the "config" account. +func (inst *Initialize) SetConfigAccount(config ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Initialize) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetCursesAccount sets the "curses" account. +func (inst *Initialize) SetCursesAccount(curses ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(curses).WRITE() + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *Initialize) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" curses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Accounts: + config ag_solanago.PublicKey, + curses ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetConfigAccount(config). + SetCursesAccount(curses). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize_test.go new file mode 100644 index 0000000000..c6954cd3e9 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2.go b/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2.go new file mode 100644 index 0000000000..f1e2a4b71d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2.go @@ -0,0 +1,144 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state +// from v1 to v2. This is a permissionless operation, as the default values set for the new +// v2 fields are backwards-compatible and safe. +// # Arguments +// +// * `ctx` - The context containing the accounts required for the migration. +type MigrateConfigV1ToV2 struct { + + // [0] = [WRITE] config + // ··········· has the new property in it, so it can't be deserialized as Config before the migration has happened. + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewMigrateConfigV1ToV2InstructionBuilder creates a new `MigrateConfigV1ToV2` instruction builder. +func NewMigrateConfigV1ToV2InstructionBuilder() *MigrateConfigV1ToV2 { + nd := &MigrateConfigV1ToV2{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetConfigAccount sets the "config" account. +// has the new property in it, so it can't be deserialized as Config before the migration has happened. +func (inst *MigrateConfigV1ToV2) SetConfigAccount(config ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +// has the new property in it, so it can't be deserialized as Config before the migration has happened. +func (inst *MigrateConfigV1ToV2) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *MigrateConfigV1ToV2) SetAuthorityAccount(authority ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *MigrateConfigV1ToV2) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *MigrateConfigV1ToV2) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *MigrateConfigV1ToV2) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst MigrateConfigV1ToV2) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_MigrateConfigV1ToV2, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst MigrateConfigV1ToV2) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *MigrateConfigV1ToV2) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *MigrateConfigV1ToV2) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("MigrateConfigV1ToV2")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj MigrateConfigV1ToV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *MigrateConfigV1ToV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewMigrateConfigV1ToV2Instruction declares a new MigrateConfigV1ToV2 instruction with the provided parameters and accounts. +func NewMigrateConfigV1ToV2Instruction( + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *MigrateConfigV1ToV2 { + return NewMigrateConfigV1ToV2InstructionBuilder(). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2_test.go new file mode 100644 index 0000000000..5a76190f85 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/MigrateConfigV1ToV2_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_MigrateConfigV1ToV2(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("MigrateConfigV1ToV2"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(MigrateConfigV1ToV2) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(MigrateConfigV1ToV2) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion.go b/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion.go new file mode 100644 index 0000000000..b7d99ddf0d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion.go @@ -0,0 +1,173 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Sets the default code version to be used. This is then used by the slim routing layer to determine +// which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. +// +// Shared func signature with other programs. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for updating the configuration. +// * `code_version` - The new code version to be set as default. +type SetDefaultCodeVersion struct { + CodeVersion *CodeVersion + + // [0] = [WRITE] config + // + // [1] = [] curses + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetDefaultCodeVersionInstructionBuilder creates a new `SetDefaultCodeVersion` instruction builder. +func NewSetDefaultCodeVersionInstructionBuilder() *SetDefaultCodeVersion { + nd := &SetDefaultCodeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetCodeVersion sets the "codeVersion" parameter. +func (inst *SetDefaultCodeVersion) SetCodeVersion(codeVersion CodeVersion) *SetDefaultCodeVersion { + inst.CodeVersion = &codeVersion + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetDefaultCodeVersion) SetConfigAccount(config ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetDefaultCodeVersion) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetCursesAccount sets the "curses" account. +func (inst *SetDefaultCodeVersion) SetCursesAccount(curses ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[1] = ag_solanago.Meta(curses) + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *SetDefaultCodeVersion) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetDefaultCodeVersion) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetDefaultCodeVersion) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetDefaultCodeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetDefaultCodeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetDefaultCodeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetDefaultCodeVersion) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.CodeVersion == nil { + return errors.New("CodeVersion parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetDefaultCodeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetDefaultCodeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("CodeVersion", *inst.CodeVersion)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" curses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetDefaultCodeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `CodeVersion` param: + err = encoder.Encode(obj.CodeVersion) + if err != nil { + return err + } + return nil +} +func (obj *SetDefaultCodeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `CodeVersion`: + err = decoder.Decode(&obj.CodeVersion) + if err != nil { + return err + } + return nil +} + +// NewSetDefaultCodeVersionInstruction declares a new SetDefaultCodeVersion instruction with the provided parameters and accounts. +func NewSetDefaultCodeVersionInstruction( + // Parameters: + codeVersion CodeVersion, + // Accounts: + config ag_solanago.PublicKey, + curses ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetDefaultCodeVersion { + return NewSetDefaultCodeVersionInstructionBuilder(). + SetCodeVersion(codeVersion). + SetConfigAccount(config). + SetCursesAccount(curses). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion_test.go new file mode 100644 index 0000000000..457bcd4120 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/SetDefaultCodeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetDefaultCodeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetDefaultCodeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetDefaultCodeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetDefaultCodeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities.go b/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities.go new file mode 100644 index 0000000000..0ae5873b3f --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities.go @@ -0,0 +1,171 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Overwrites the list of addresses authorized to invoke the `cpi_event` instruction. +// +// Only the CCIP Admin may perform this operation. +// +// # Arguments +// * `ctx` - The context containing the accounts required for updating event authorities. +// * `new_event_authorities` - The new list of event authority public keys. +type SetEventAuthorities struct { + NewEventAuthorities *[]ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetEventAuthoritiesInstructionBuilder creates a new `SetEventAuthorities` instruction builder. +func NewSetEventAuthoritiesInstructionBuilder() *SetEventAuthorities { + nd := &SetEventAuthorities{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetNewEventAuthorities sets the "newEventAuthorities" parameter. +func (inst *SetEventAuthorities) SetNewEventAuthorities(newEventAuthorities []ag_solanago.PublicKey) *SetEventAuthorities { + inst.NewEventAuthorities = &newEventAuthorities + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *SetEventAuthorities) SetConfigAccount(config ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *SetEventAuthorities) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetEventAuthorities) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetEventAuthorities) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetEventAuthorities) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetEventAuthorities { + inst.AccountMetaSlice[2] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetEventAuthorities) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetEventAuthorities) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetEventAuthorities, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetEventAuthorities) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetEventAuthorities) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewEventAuthorities == nil { + return errors.New("NewEventAuthorities parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetEventAuthorities) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetEventAuthorities")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewEventAuthorities", *inst.NewEventAuthorities)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetEventAuthorities) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewEventAuthorities` param: + err = encoder.Encode(obj.NewEventAuthorities) + if err != nil { + return err + } + return nil +} +func (obj *SetEventAuthorities) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewEventAuthorities`: + err = decoder.Decode(&obj.NewEventAuthorities) + if err != nil { + return err + } + return nil +} + +// NewSetEventAuthoritiesInstruction declares a new SetEventAuthorities instruction with the provided parameters and accounts. +func NewSetEventAuthoritiesInstruction( + // Parameters: + newEventAuthorities []ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetEventAuthorities { + return NewSetEventAuthoritiesInstructionBuilder(). + SetNewEventAuthorities(newEventAuthorities). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities_test.go new file mode 100644 index 0000000000..01d6763310 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/SetEventAuthorities_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetEventAuthorities(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetEventAuthorities"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetEventAuthorities) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetEventAuthorities) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership.go new file mode 100644 index 0000000000..9e1e4e9756 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership.go @@ -0,0 +1,172 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Transfers the ownership of the fee quoter to a new proposed owner. +// +// Shared func signature with other programs. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for the transfer. +// * `proposed_owner` - The public key of the new proposed owner. +type TransferOwnership struct { + NewOwner *ag_solanago.PublicKey + + // [0] = [WRITE] config + // + // [1] = [] curses + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetNewOwner sets the "newOwner" parameter. +func (inst *TransferOwnership) SetNewOwner(newOwner ag_solanago.PublicKey) *TransferOwnership { + inst.NewOwner = &newOwner + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *TransferOwnership) SetConfigAccount(config ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config).WRITE() + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *TransferOwnership) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetCursesAccount sets the "curses" account. +func (inst *TransferOwnership) SetCursesAccount(curses ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(curses) + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *TransferOwnership) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewOwner == nil { + return errors.New("NewOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewOwner", *inst.NewOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" curses", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewOwner` param: + err = encoder.Encode(obj.NewOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewOwner`: + err = decoder.Decode(&obj.NewOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + newOwner ag_solanago.PublicKey, + // Accounts: + config ag_solanago.PublicKey, + curses ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetNewOwner(newOwner). + SetConfigAccount(config). + SetCursesAccount(curses). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership_test.go new file mode 100644 index 0000000000..232b5d979b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion.go b/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion.go new file mode 100644 index 0000000000..e0ae71f7f2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion.go @@ -0,0 +1,102 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Returns the program type (name) and version. +// Used by offchain code to easily determine which program & version is being interacted with. +// +// # Arguments +// * `ctx` - The context +type TypeVersion struct { + + // [0] = [] clock + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTypeVersionInstructionBuilder creates a new `TypeVersion` instruction builder. +func NewTypeVersionInstructionBuilder() *TypeVersion { + nd := &TypeVersion{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 1), + } + return nd +} + +// SetClockAccount sets the "clock" account. +func (inst *TypeVersion) SetClockAccount(clock ag_solanago.PublicKey) *TypeVersion { + inst.AccountMetaSlice[0] = ag_solanago.Meta(clock) + return inst +} + +// GetClockAccount gets the "clock" account. +func (inst *TypeVersion) GetClockAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +func (inst TypeVersion) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TypeVersion, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TypeVersion) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TypeVersion) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Clock is not set") + } + } + return nil +} + +func (inst *TypeVersion) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TypeVersion")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("clock", inst.AccountMetaSlice[0])) + }) + }) + }) +} + +func (obj TypeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *TypeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewTypeVersionInstruction declares a new TypeVersion instruction with the provided parameters and accounts. +func NewTypeVersionInstruction( + // Accounts: + clock ag_solanago.PublicKey) *TypeVersion { + return NewTypeVersionInstructionBuilder(). + SetClockAccount(clock) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion_test.go new file mode 100644 index 0000000000..737a60d7aa --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/TypeVersion_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TypeVersion(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TypeVersion"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TypeVersion) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TypeVersion) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse.go new file mode 100644 index 0000000000..f0e28303cb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse.go @@ -0,0 +1,193 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Uncurses an abstract subject. If the subject is CurseSubject::GLOBAL, +// the entire chain curse will be lifted. (note that any other specific +// subject curses will remain active.) +// +// Only the CCIP Admin may perform this operation +// +// # Arguments +// +// * `ctx` - The context containing the accounts required for removing a curse. +// * `subject` - The subject to uncurse. +type Uncurse struct { + Subject *CurseSubject + + // [0] = [] config + // + // [1] = [WRITE, SIGNER] authority + // + // [2] = [WRITE] curses + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewUncurseInstructionBuilder creates a new `Uncurse` instruction builder. +func NewUncurseInstructionBuilder() *Uncurse { + nd := &Uncurse{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetSubject sets the "subject" parameter. +func (inst *Uncurse) SetSubject(subject CurseSubject) *Uncurse { + inst.Subject = &subject + return inst +} + +// SetConfigAccount sets the "config" account. +func (inst *Uncurse) SetConfigAccount(config ag_solanago.PublicKey) *Uncurse { + inst.AccountMetaSlice[0] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +func (inst *Uncurse) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Uncurse) SetAuthorityAccount(authority ag_solanago.PublicKey) *Uncurse { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Uncurse) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetCursesAccount sets the "curses" account. +func (inst *Uncurse) SetCursesAccount(curses ag_solanago.PublicKey) *Uncurse { + inst.AccountMetaSlice[2] = ag_solanago.Meta(curses).WRITE() + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *Uncurse) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Uncurse) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Uncurse { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Uncurse) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst Uncurse) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Uncurse, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Uncurse) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Uncurse) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Subject == nil { + return errors.New("Subject parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Config is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *Uncurse) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Uncurse")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Subject", *inst.Subject)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" config", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" curses", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj Uncurse) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Subject` param: + err = encoder.Encode(obj.Subject) + if err != nil { + return err + } + return nil +} +func (obj *Uncurse) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Subject`: + err = decoder.Decode(&obj.Subject) + if err != nil { + return err + } + return nil +} + +// NewUncurseInstruction declares a new Uncurse instruction with the provided parameters and accounts. +func NewUncurseInstruction( + // Parameters: + subject CurseSubject, + // Accounts: + config ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + curses ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *Uncurse { + return NewUncurseInstructionBuilder(). + SetSubject(subject). + SetConfigAccount(config). + SetAuthorityAccount(authority). + SetCursesAccount(curses). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse_test.go new file mode 100644 index 0000000000..e56ef449ae --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/Uncurse_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Uncurse(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Uncurse"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Uncurse) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Uncurse) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed.go b/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed.go new file mode 100644 index 0000000000..2da9bf7471 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed.go @@ -0,0 +1,156 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Verifies that the subject is not cursed AND that this chain is not globally cursed. +// In case either of those assumptions fail, the instruction reverts. +// +// # Arguments +// +// * `ctx` - The context containing the accounts required to inspect curses. +// * `subject` - The subject to verify. Note that this instruction will revert if the chain +// is globally cursed too, even if the provided subject is not explicitly cursed. +type VerifyNotCursed struct { + Subject *CurseSubject + + // [0] = [] curses + // + // [1] = [] config + // ··········· After the upgrade is made, this can be changed to Account<'info, Config>. + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewVerifyNotCursedInstructionBuilder creates a new `VerifyNotCursed` instruction builder. +func NewVerifyNotCursedInstructionBuilder() *VerifyNotCursed { + nd := &VerifyNotCursed{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetSubject sets the "subject" parameter. +func (inst *VerifyNotCursed) SetSubject(subject CurseSubject) *VerifyNotCursed { + inst.Subject = &subject + return inst +} + +// SetCursesAccount sets the "curses" account. +func (inst *VerifyNotCursed) SetCursesAccount(curses ag_solanago.PublicKey) *VerifyNotCursed { + inst.AccountMetaSlice[0] = ag_solanago.Meta(curses) + return inst +} + +// GetCursesAccount gets the "curses" account. +func (inst *VerifyNotCursed) GetCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetConfigAccount sets the "config" account. +// After the upgrade is made, this can be changed to Account<'info, Config>. +func (inst *VerifyNotCursed) SetConfigAccount(config ag_solanago.PublicKey) *VerifyNotCursed { + inst.AccountMetaSlice[1] = ag_solanago.Meta(config) + return inst +} + +// GetConfigAccount gets the "config" account. +// After the upgrade is made, this can be changed to Account<'info, Config>. +func (inst *VerifyNotCursed) GetConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst VerifyNotCursed) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_VerifyNotCursed, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst VerifyNotCursed) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *VerifyNotCursed) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Subject == nil { + return errors.New("Subject parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Curses is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Config is not set") + } + } + return nil +} + +func (inst *VerifyNotCursed) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("VerifyNotCursed")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("Subject", *inst.Subject)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta("curses", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("config", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj VerifyNotCursed) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Subject` param: + err = encoder.Encode(obj.Subject) + if err != nil { + return err + } + return nil +} +func (obj *VerifyNotCursed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Subject`: + err = decoder.Decode(&obj.Subject) + if err != nil { + return err + } + return nil +} + +// NewVerifyNotCursedInstruction declares a new VerifyNotCursed instruction with the provided parameters and accounts. +func NewVerifyNotCursedInstruction( + // Parameters: + subject CurseSubject, + // Accounts: + curses ag_solanago.PublicKey, + config ag_solanago.PublicKey) *VerifyNotCursed { + return NewVerifyNotCursedInstructionBuilder(). + SetSubject(subject). + SetCursesAccount(curses). + SetConfigAccount(config) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed_test.go b/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed_test.go new file mode 100644 index 0000000000..12154d78a1 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/VerifyNotCursed_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_VerifyNotCursed(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("VerifyNotCursed"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(VerifyNotCursed) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(VerifyNotCursed) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/accounts.go b/chains/solana/gobindings/v1_6_1/rmn_remote/accounts.go new file mode 100644 index 0000000000..4ecb9e1661 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/accounts.go @@ -0,0 +1,148 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" +) + +type Config struct { + Version uint8 + Owner ag_solanago.PublicKey + ProposedOwner ag_solanago.PublicKey + DefaultCodeVersion CodeVersion + EventAuthorities []ag_solanago.PublicKey +} + +var ConfigDiscriminator = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} + +func (obj Config) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `Owner` param: + err = encoder.Encode(obj.Owner) + if err != nil { + return err + } + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + // Serialize `DefaultCodeVersion` param: + err = encoder.Encode(obj.DefaultCodeVersion) + if err != nil { + return err + } + // Serialize `EventAuthorities` param: + err = encoder.Encode(obj.EventAuthorities) + if err != nil { + return err + } + return nil +} + +func (obj *Config) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[155 12 170 224 30 250 204 130]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `Owner`: + err = decoder.Decode(&obj.Owner) + if err != nil { + return err + } + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + // Deserialize `DefaultCodeVersion`: + err = decoder.Decode(&obj.DefaultCodeVersion) + if err != nil { + return err + } + // Deserialize `EventAuthorities`: + err = decoder.Decode(&obj.EventAuthorities) + if err != nil { + return err + } + return nil +} + +type Curses struct { + Version uint8 + CursedSubjects []CurseSubject +} + +var CursesDiscriminator = [8]byte{129, 28, 49, 58, 74, 237, 146, 202} + +func (obj Curses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(CursesDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Version` param: + err = encoder.Encode(obj.Version) + if err != nil { + return err + } + // Serialize `CursedSubjects` param: + err = encoder.Encode(obj.CursedSubjects) + if err != nil { + return err + } + return nil +} + +func (obj *Curses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(CursesDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[129 28 49 58 74 237 146 202]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Version`: + err = decoder.Decode(&obj.Version) + if err != nil { + return err + } + // Deserialize `CursedSubjects`: + err = decoder.Decode(&obj.CursedSubjects) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/instructions.go b/chains/solana/gobindings/v1_6_1/rmn_remote/instructions.go new file mode 100644 index 0000000000..f33b0dbf82 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/instructions.go @@ -0,0 +1,275 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "RmnRemote" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + // Initializes the Rmn Remote contract. + // + // The initialization is responsibility of Admin, nothing more than calling this method should be done first. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for initialization. + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + // Returns the program type (name) and version. + // Used by offchain code to easily determine which program & version is being interacted with. + // + // # Arguments + // * `ctx` - The context + Instruction_TypeVersion = ag_binary.TypeID([8]byte{129, 251, 8, 243, 122, 229, 252, 164}) + + // Transfers the ownership of the fee quoter to a new proposed owner. + // + // Shared func signature with other programs. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for the transfer. + // * `proposed_owner` - The public key of the new proposed owner. + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + // Accepts the ownership of the fee quoter by the proposed owner. + // + // Shared func signature with other programs. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for accepting ownership. + // The new owner must be a signer of the transaction. + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + // Sets the default code version to be used. This is then used by the slim routing layer to determine + // which version of the versioned business logic module (`instructions`) to use. Only the admin may set this. + // + // Shared func signature with other programs. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for updating the configuration. + // * `code_version` - The new code version to be set as default. + Instruction_SetDefaultCodeVersion = ag_binary.TypeID([8]byte{47, 151, 233, 254, 121, 82, 206, 152}) + + // Curses an abstract subject. If the subject is CurseSubject::GLOBAL, + // the entire chain will be cursed. + // + // Only the CCIP Admin may perform this operation + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for adding a new curse. + // * `subject` - The subject to curse. + Instruction_Curse = ag_binary.TypeID([8]byte{10, 127, 226, 227, 138, 3, 192, 73}) + + // Uncurses an abstract subject. If the subject is CurseSubject::GLOBAL, + // the entire chain curse will be lifted. (note that any other specific + // subject curses will remain active.) + // + // Only the CCIP Admin may perform this operation + // + // # Arguments + // + // * `ctx` - The context containing the accounts required for removing a curse. + // * `subject` - The subject to uncurse. + Instruction_Uncurse = ag_binary.TypeID([8]byte{235, 227, 61, 167, 15, 109, 129, 79}) + + // Overwrites the list of addresses authorized to invoke the `cpi_event` instruction. + // + // Only the CCIP Admin may perform this operation. + // + // # Arguments + // * `ctx` - The context containing the accounts required for updating event authorities. + // * `new_event_authorities` - The new list of event authority public keys. + Instruction_SetEventAuthorities = ag_binary.TypeID([8]byte{76, 83, 229, 160, 40, 1, 149, 103}) + + // Verifies that the subject is not cursed AND that this chain is not globally cursed. + // In case either of those assumptions fail, the instruction reverts. + // + // # Arguments + // + // * `ctx` - The context containing the accounts required to inspect curses. + // * `subject` - The subject to verify. Note that this instruction will revert if the chain + // is globally cursed too, even if the provided subject is not explicitly cursed. + Instruction_VerifyNotCursed = ag_binary.TypeID([8]byte{86, 200, 58, 143, 7, 109, 155, 125}) + + // Backwards-compatible way of implementing CPI events without other contracts needing to + // add more accounts to make a self-CPI. Calls made to this instruction include the event data + // in the instruction data, so offchain code can inspect it. + // + // Only event authorities can invoke this instruction. While there is basic onchain + // authorization, the offchain is still expected to check the caller program to attribute the + // event to it, as this method may be invoked by more than one program so that it can be reused. + // + // # Arguments + // * `_ctx` - The context containing the accounts required for the CPI event. + // * `_event_data` - The raw event data to be emitted. + Instruction_CpiEvent = ag_binary.TypeID([8]byte{188, 216, 166, 108, 26, 166, 142, 182}) + + // Extends the Config PDA to allocate space for v2 fields, and migrates the onchain state + // from v1 to v2. This is a permissionless operation, as the default values set for the new + // v2 fields are backwards-compatible and safe. + // # Arguments + // + // * `ctx` - The context containing the accounts required for the migration. + Instruction_MigrateConfigV1ToV2 = ag_binary.TypeID([8]byte{201, 212, 171, 0, 73, 91, 124, 99}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_TypeVersion: + return "TypeVersion" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetDefaultCodeVersion: + return "SetDefaultCodeVersion" + case Instruction_Curse: + return "Curse" + case Instruction_Uncurse: + return "Uncurse" + case Instruction_SetEventAuthorities: + return "SetEventAuthorities" + case Instruction_VerifyNotCursed: + return "VerifyNotCursed" + case Instruction_CpiEvent: + return "CpiEvent" + case Instruction_MigrateConfigV1ToV2: + return "MigrateConfigV1ToV2" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "type_version", (*TypeVersion)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_default_code_version", (*SetDefaultCodeVersion)(nil), + }, + { + "curse", (*Curse)(nil), + }, + { + "uncurse", (*Uncurse)(nil), + }, + { + "set_event_authorities", (*SetEventAuthorities)(nil), + }, + { + "verify_not_cursed", (*VerifyNotCursed)(nil), + }, + { + "cpi_event", (*CpiEvent)(nil), + }, + { + "migrate_config_v1_to_v2", (*MigrateConfigV1ToV2)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/testing_utils.go b/chains/solana/gobindings/v1_6_1/rmn_remote/testing_utils.go new file mode 100644 index 0000000000..270cc88fe8 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/rmn_remote/types.go b/chains/solana/gobindings/v1_6_1/rmn_remote/types.go new file mode 100644 index 0000000000..69327435b0 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/rmn_remote/types.go @@ -0,0 +1,45 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package rmn_remote + +import ag_binary "github.com/gagliardetto/binary" + +type CurseSubject struct { + Value [16]uint8 +} + +func (obj CurseSubject) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Value` param: + err = encoder.Encode(obj.Value) + if err != nil { + return err + } + return nil +} + +func (obj *CurseSubject) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Value`: + err = decoder.Decode(&obj.Value) + if err != nil { + return err + } + return nil +} + +type CodeVersion ag_binary.BorshEnum + +const ( + Default_CodeVersion CodeVersion = iota + V1_CodeVersion +) + +func (value CodeVersion) String() string { + switch value { + case Default_CodeVersion: + return "Default" + case V1_CodeVersion: + return "V1" + default: + return "" + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership.go b/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership.go new file mode 100644 index 0000000000..b83564d3eb --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership.go @@ -0,0 +1,136 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AcceptOwnership is the `acceptOwnership` instruction. +type AcceptOwnership struct { + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. +func NewAcceptOwnershipInstructionBuilder() *AcceptOwnership { + nd := &AcceptOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetStateAccount sets the "state" account. +func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *AcceptOwnership) SetMintAccount(mint ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *AcceptOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst AcceptOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AcceptOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AcceptOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AcceptOwnership) Validate() error { + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AcceptOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj AcceptOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + return nil +} +func (obj *AcceptOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + return nil +} + +// NewAcceptOwnershipInstruction declares a new AcceptOwnership instruction with the provided parameters and accounts. +func NewAcceptOwnershipInstruction( + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *AcceptOwnership { + return NewAcceptOwnershipInstructionBuilder(). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership_test.go new file mode 100644 index 0000000000..59bf8ddd3d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/AcceptOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AcceptOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AcceptOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AcceptOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AcceptOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses.go b/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses.go new file mode 100644 index 0000000000..d9b8b716a2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// AppendRemotePoolAddresses is the `appendRemotePoolAddresses` instruction. +type AppendRemotePoolAddresses struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Addresses *[]RemoteAddress + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewAppendRemotePoolAddressesInstructionBuilder creates a new `AppendRemotePoolAddresses` instruction builder. +func NewAppendRemotePoolAddressesInstructionBuilder() *AppendRemotePoolAddresses { + nd := &AppendRemotePoolAddresses{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *AppendRemotePoolAddresses) SetRemoteChainSelector(remoteChainSelector uint64) *AppendRemotePoolAddresses { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *AppendRemotePoolAddresses) SetMint(mint ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.Mint = &mint + return inst +} + +// SetAddresses sets the "addresses" parameter. +func (inst *AppendRemotePoolAddresses) SetAddresses(addresses []RemoteAddress) *AppendRemotePoolAddresses { + inst.Addresses = &addresses + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *AppendRemotePoolAddresses) SetStateAccount(state ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *AppendRemotePoolAddresses) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *AppendRemotePoolAddresses) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *AppendRemotePoolAddresses) SetAuthorityAccount(authority ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *AppendRemotePoolAddresses) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *AppendRemotePoolAddresses) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst AppendRemotePoolAddresses) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_AppendRemotePoolAddresses, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst AppendRemotePoolAddresses) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *AppendRemotePoolAddresses) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Addresses == nil { + return errors.New("Addresses parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *AppendRemotePoolAddresses) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("AppendRemotePoolAddresses")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Addresses", *inst.Addresses)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj AppendRemotePoolAddresses) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Addresses` param: + err = encoder.Encode(obj.Addresses) + if err != nil { + return err + } + return nil +} +func (obj *AppendRemotePoolAddresses) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Addresses`: + err = decoder.Decode(&obj.Addresses) + if err != nil { + return err + } + return nil +} + +// NewAppendRemotePoolAddressesInstruction declares a new AppendRemotePoolAddresses instruction with the provided parameters and accounts. +func NewAppendRemotePoolAddressesInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + addresses []RemoteAddress, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *AppendRemotePoolAddresses { + return NewAppendRemotePoolAddressesInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetAddresses(addresses). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses_test.go new file mode 100644 index 0000000000..46da255016 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/AppendRemotePoolAddresses_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_AppendRemotePoolAddresses(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("AppendRemotePoolAddresses"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(AppendRemotePoolAddresses) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(AppendRemotePoolAddresses) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig.go new file mode 100644 index 0000000000..605482cece --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig.go @@ -0,0 +1,207 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeleteChainConfig is the `deleteChainConfig` instruction. +type DeleteChainConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeleteChainConfigInstructionBuilder creates a new `DeleteChainConfig` instruction builder. +func NewDeleteChainConfigInstructionBuilder() *DeleteChainConfig { + nd := &DeleteChainConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *DeleteChainConfig) SetRemoteChainSelector(remoteChainSelector uint64) *DeleteChainConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *DeleteChainConfig) SetMint(mint ag_solanago.PublicKey) *DeleteChainConfig { + inst.Mint = &mint + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *DeleteChainConfig) SetStateAccount(state ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *DeleteChainConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *DeleteChainConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *DeleteChainConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *DeleteChainConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *DeleteChainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *DeleteChainConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *DeleteChainConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *DeleteChainConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst DeleteChainConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeleteChainConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeleteChainConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeleteChainConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *DeleteChainConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeleteChainConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj DeleteChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + return nil +} +func (obj *DeleteChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + return nil +} + +// NewDeleteChainConfigInstruction declares a new DeleteChainConfig instruction with the provided parameters and accounts. +func NewDeleteChainConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *DeleteChainConfig { + return NewDeleteChainConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig_test.go new file mode 100644 index 0000000000..1cc5dcaec3 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeleteChainConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeleteChainConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeleteChainConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeleteChainConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeleteChainConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens.go new file mode 100644 index 0000000000..08e6766e25 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens.go @@ -0,0 +1,130 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeriveAccountsLockOrBurnTokens is the `deriveAccountsLockOrBurnTokens` instruction. +type DeriveAccountsLockOrBurnTokens struct { + Stage *string + LockOrBurn *LockOrBurnInV1 + + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsLockOrBurnTokensInstructionBuilder creates a new `DeriveAccountsLockOrBurnTokens` instruction builder. +func NewDeriveAccountsLockOrBurnTokensInstructionBuilder() *DeriveAccountsLockOrBurnTokens { + nd := &DeriveAccountsLockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 0), + } + return nd +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsLockOrBurnTokens) SetStage(stage string) *DeriveAccountsLockOrBurnTokens { + inst.Stage = &stage + return inst +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *DeriveAccountsLockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *DeriveAccountsLockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +func (inst DeriveAccountsLockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsLockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsLockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsLockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + } + return nil +} + +func (inst *DeriveAccountsLockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsLockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=0]").ParentFunc(func(accountsBranch ag_treeout.Branches) {}) + }) + }) +} + +func (obj DeriveAccountsLockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsLockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsLockOrBurnTokensInstruction declares a new DeriveAccountsLockOrBurnTokens instruction with the provided parameters and accounts. +func NewDeriveAccountsLockOrBurnTokensInstruction( + // Parameters: + stage string, + lockOrBurn LockOrBurnInV1) *DeriveAccountsLockOrBurnTokens { + return NewDeriveAccountsLockOrBurnTokensInstructionBuilder(). + SetStage(stage). + SetLockOrBurn(lockOrBurn) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens_test.go new file mode 100644 index 0000000000..82dc6a7423 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsLockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsLockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsLockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsLockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsLockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens.go new file mode 100644 index 0000000000..0ed9b17cbf --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens.go @@ -0,0 +1,130 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// DeriveAccountsReleaseOrMintTokens is the `deriveAccountsReleaseOrMintTokens` instruction. +type DeriveAccountsReleaseOrMintTokens struct { + Stage *string + ReleaseOrMint *ReleaseOrMintInV1 + + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewDeriveAccountsReleaseOrMintTokensInstructionBuilder creates a new `DeriveAccountsReleaseOrMintTokens` instruction builder. +func NewDeriveAccountsReleaseOrMintTokensInstructionBuilder() *DeriveAccountsReleaseOrMintTokens { + nd := &DeriveAccountsReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 0), + } + return nd +} + +// SetStage sets the "stage" parameter. +func (inst *DeriveAccountsReleaseOrMintTokens) SetStage(stage string) *DeriveAccountsReleaseOrMintTokens { + inst.Stage = &stage + return inst +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *DeriveAccountsReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *DeriveAccountsReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +func (inst DeriveAccountsReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_DeriveAccountsReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst DeriveAccountsReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *DeriveAccountsReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Stage == nil { + return errors.New("Stage parameter is not set") + } + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + } + return nil +} + +func (inst *DeriveAccountsReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("DeriveAccountsReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Stage", *inst.Stage)) + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=0]").ParentFunc(func(accountsBranch ag_treeout.Branches) {}) + }) + }) +} + +func (obj DeriveAccountsReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Stage` param: + err = encoder.Encode(obj.Stage) + if err != nil { + return err + } + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *DeriveAccountsReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Stage`: + err = decoder.Decode(&obj.Stage) + if err != nil { + return err + } + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewDeriveAccountsReleaseOrMintTokensInstruction declares a new DeriveAccountsReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewDeriveAccountsReleaseOrMintTokensInstruction( + // Parameters: + stage string, + releaseOrMint ReleaseOrMintInV1) *DeriveAccountsReleaseOrMintTokens { + return NewDeriveAccountsReleaseOrMintTokensInstructionBuilder(). + SetStage(stage). + SetReleaseOrMint(releaseOrMint) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..856242ece5 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/DeriveAccountsReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_DeriveAccountsReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("DeriveAccountsReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(DeriveAccountsReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(DeriveAccountsReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig.go new file mode 100644 index 0000000000..b4fa747a0c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// EditChainRemoteConfig is the `editChainRemoteConfig` instruction. +type EditChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewEditChainRemoteConfigInstructionBuilder creates a new `EditChainRemoteConfig` instruction builder. +func NewEditChainRemoteConfigInstructionBuilder() *EditChainRemoteConfig { + nd := &EditChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *EditChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *EditChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *EditChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *EditChainRemoteConfig) SetCfg(cfg RemoteConfig) *EditChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *EditChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *EditChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *EditChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *EditChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *EditChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *EditChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *EditChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *EditChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst EditChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_EditChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst EditChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *EditChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *EditChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("EditChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj EditChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *EditChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewEditChainRemoteConfigInstruction declares a new EditChainRemoteConfig instruction with the provided parameters and accounts. +func NewEditChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *EditChainRemoteConfig { + return NewEditChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig_test.go new file mode 100644 index 0000000000..e5c8579c2d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/EditChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_EditChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("EditChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(EditChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(EditChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig.go b/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig.go new file mode 100644 index 0000000000..4fe9f1639d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig.go @@ -0,0 +1,230 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// InitChainRemoteConfig is the `initChainRemoteConfig` instruction. +type InitChainRemoteConfig struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Cfg *RemoteConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitChainRemoteConfigInstructionBuilder creates a new `InitChainRemoteConfig` instruction builder. +func NewInitChainRemoteConfigInstructionBuilder() *InitChainRemoteConfig { + nd := &InitChainRemoteConfig{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *InitChainRemoteConfig) SetRemoteChainSelector(remoteChainSelector uint64) *InitChainRemoteConfig { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *InitChainRemoteConfig) SetMint(mint ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.Mint = &mint + return inst +} + +// SetCfg sets the "cfg" parameter. +func (inst *InitChainRemoteConfig) SetCfg(cfg RemoteConfig) *InitChainRemoteConfig { + inst.Cfg = &cfg + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *InitChainRemoteConfig) SetStateAccount(state ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *InitChainRemoteConfig) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *InitChainRemoteConfig) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *InitChainRemoteConfig) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *InitChainRemoteConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *InitChainRemoteConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *InitChainRemoteConfig) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *InitChainRemoteConfig) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst InitChainRemoteConfig) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_InitChainRemoteConfig, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst InitChainRemoteConfig) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *InitChainRemoteConfig) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Cfg == nil { + return errors.New("Cfg parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *InitChainRemoteConfig) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("InitChainRemoteConfig")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Cfg", *inst.Cfg)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj InitChainRemoteConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Cfg` param: + err = encoder.Encode(obj.Cfg) + if err != nil { + return err + } + return nil +} +func (obj *InitChainRemoteConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Cfg`: + err = decoder.Decode(&obj.Cfg) + if err != nil { + return err + } + return nil +} + +// NewInitChainRemoteConfigInstruction declares a new InitChainRemoteConfig instruction with the provided parameters and accounts. +func NewInitChainRemoteConfigInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + cfg RemoteConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *InitChainRemoteConfig { + return NewInitChainRemoteConfigInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetCfg(cfg). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig_test.go new file mode 100644 index 0000000000..541d945378 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/InitChainRemoteConfig_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_InitChainRemoteConfig(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("InitChainRemoteConfig"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(InitChainRemoteConfig) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(InitChainRemoteConfig) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize.go b/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize.go new file mode 100644 index 0000000000..314815e713 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize.go @@ -0,0 +1,268 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// Initialize is the `initialize` instruction. +type Initialize struct { + PoolType *PoolType + Router *ag_solanago.PublicKey + RmnRemote *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + // + // [4] = [] program + // + // [5] = [] programData + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. +func NewInitializeInstructionBuilder() *Initialize { + nd := &Initialize{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + } + return nd +} + +// SetPoolType sets the "poolType" parameter. +func (inst *Initialize) SetPoolType(poolType PoolType) *Initialize { + inst.PoolType = &poolType + return inst +} + +// SetRouter sets the "router" parameter. +func (inst *Initialize) SetRouter(router ag_solanago.PublicKey) *Initialize { + inst.Router = &router + return inst +} + +// SetRmnRemote sets the "rmnRemote" parameter. +func (inst *Initialize) SetRmnRemote(rmnRemote ag_solanago.PublicKey) *Initialize { + inst.RmnRemote = &rmnRemote + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *Initialize) SetMintAccount(mint ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *Initialize) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *Initialize) SetAuthorityAccount(authority ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *Initialize) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetProgramAccount sets the "program" account. +func (inst *Initialize) SetProgramAccount(program ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[4] = ag_solanago.Meta(program) + return inst +} + +// GetProgramAccount gets the "program" account. +func (inst *Initialize) GetProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetProgramDataAccount sets the "programData" account. +func (inst *Initialize) SetProgramDataAccount(programData ag_solanago.PublicKey) *Initialize { + inst.AccountMetaSlice[5] = ag_solanago.Meta(programData) + return inst +} + +// GetProgramDataAccount gets the "programData" account. +func (inst *Initialize) GetProgramDataAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +func (inst Initialize) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_Initialize, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst Initialize) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *Initialize) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.PoolType == nil { + return errors.New("PoolType parameter is not set") + } + if inst.Router == nil { + return errors.New("Router parameter is not set") + } + if inst.RmnRemote == nil { + return errors.New("RmnRemote parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.Program is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.ProgramData is not set") + } + } + return nil +} + +func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("Initialize")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=3]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" PoolType", *inst.PoolType)) + paramsBranch.Child(ag_format.Param(" Router", *inst.Router)) + paramsBranch.Child(ag_format.Param("RmnRemote", *inst.RmnRemote)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" program", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" programData", inst.AccountMetaSlice[5])) + }) + }) + }) +} + +func (obj Initialize) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `PoolType` param: + err = encoder.Encode(obj.PoolType) + if err != nil { + return err + } + // Serialize `Router` param: + err = encoder.Encode(obj.Router) + if err != nil { + return err + } + // Serialize `RmnRemote` param: + err = encoder.Encode(obj.RmnRemote) + if err != nil { + return err + } + return nil +} +func (obj *Initialize) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `PoolType`: + err = decoder.Decode(&obj.PoolType) + if err != nil { + return err + } + // Deserialize `Router`: + err = decoder.Decode(&obj.Router) + if err != nil { + return err + } + // Deserialize `RmnRemote`: + err = decoder.Decode(&obj.RmnRemote) + if err != nil { + return err + } + return nil +} + +// NewInitializeInstruction declares a new Initialize instruction with the provided parameters and accounts. +func NewInitializeInstruction( + // Parameters: + poolType PoolType, + router ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey, + program ag_solanago.PublicKey, + programData ag_solanago.PublicKey) *Initialize { + return NewInitializeInstructionBuilder(). + SetPoolType(poolType). + SetRouter(router). + SetRmnRemote(rmnRemote). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram). + SetProgramAccount(program). + SetProgramDataAccount(programData) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize_test.go new file mode 100644 index 0000000000..5c9bebab52 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/Initialize_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_Initialize(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("Initialize"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(Initialize) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(Initialize) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens.go b/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens.go new file mode 100644 index 0000000000..c78b0bc72b --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens.go @@ -0,0 +1,298 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// LockOrBurnTokens is the `lockOrBurnTokens` instruction. +type LockOrBurnTokens struct { + LockOrBurn *LockOrBurnInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] state + // + // [2] = [] tokenProgram + // + // [3] = [WRITE] mint + // + // [4] = [] poolSigner + // + // [5] = [WRITE] poolTokenAccount + // + // [6] = [] rmnRemote + // + // [7] = [] rmnRemoteCurses + // + // [8] = [] rmnRemoteConfig + // + // [9] = [WRITE] chainConfig + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewLockOrBurnTokensInstructionBuilder creates a new `LockOrBurnTokens` instruction builder. +func NewLockOrBurnTokensInstructionBuilder() *LockOrBurnTokens { + nd := &LockOrBurnTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 10), + } + return nd +} + +// SetLockOrBurn sets the "lockOrBurn" parameter. +func (inst *LockOrBurnTokens) SetLockOrBurn(lockOrBurn LockOrBurnInV1) *LockOrBurnTokens { + inst.LockOrBurn = &lockOrBurn + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *LockOrBurnTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *LockOrBurnTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetStateAccount sets the "state" account. +func (inst *LockOrBurnTokens) SetStateAccount(state ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *LockOrBurnTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *LockOrBurnTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *LockOrBurnTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetMintAccount sets the "mint" account. +func (inst *LockOrBurnTokens) SetMintAccount(mint ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *LockOrBurnTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *LockOrBurnTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *LockOrBurnTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *LockOrBurnTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *LockOrBurnTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *LockOrBurnTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *LockOrBurnTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *LockOrBurnTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *LockOrBurnTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *LockOrBurnTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +func (inst LockOrBurnTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_LockOrBurnTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst LockOrBurnTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *LockOrBurnTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.LockOrBurn == nil { + return errors.New("LockOrBurn parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.ChainConfig is not set") + } + } + return nil +} + +func (inst *LockOrBurnTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("LockOrBurnTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("LockOrBurn", *inst.LockOrBurn)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=10]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[9])) + }) + }) + }) +} + +func (obj LockOrBurnTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `LockOrBurn` param: + err = encoder.Encode(obj.LockOrBurn) + if err != nil { + return err + } + return nil +} +func (obj *LockOrBurnTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `LockOrBurn`: + err = decoder.Decode(&obj.LockOrBurn) + if err != nil { + return err + } + return nil +} + +// NewLockOrBurnTokensInstruction declares a new LockOrBurnTokens instruction with the provided parameters and accounts. +func NewLockOrBurnTokensInstruction( + // Parameters: + lockOrBurn LockOrBurnInV1, + // Accounts: + authority ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey) *LockOrBurnTokens { + return NewLockOrBurnTokensInstructionBuilder(). + SetLockOrBurn(lockOrBurn). + SetAuthorityAccount(authority). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetChainConfigAccount(chainConfig) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens_test.go new file mode 100644 index 0000000000..dc436aebf2 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/LockOrBurnTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_LockOrBurnTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("LockOrBurnTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(LockOrBurnTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(LockOrBurnTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens.go b/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens.go new file mode 100644 index 0000000000..9a2d4b8c1c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens.go @@ -0,0 +1,367 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// ReleaseOrMintTokens is the `releaseOrMintTokens` instruction. +type ReleaseOrMintTokens struct { + ReleaseOrMint *ReleaseOrMintInV1 + + // [0] = [SIGNER] authority + // + // [1] = [] offrampProgram + // ··········· CHECK offramp program: exists only to derive the allowed offramp PDA + // ··········· and the authority PDA. + // + // [2] = [] allowedOfframp + // ··········· CHECK PDA of the router program verifying the signer is an allowed offramp. + // ··········· If PDA does not exist, the router doesn't allow this offramp + // + // [3] = [] state + // + // [4] = [] tokenProgram + // + // [5] = [WRITE] mint + // + // [6] = [] poolSigner + // + // [7] = [WRITE] poolTokenAccount + // + // [8] = [WRITE] chainConfig + // + // [9] = [] rmnRemote + // + // [10] = [] rmnRemoteCurses + // + // [11] = [] rmnRemoteConfig + // + // [12] = [WRITE] receiverTokenAccount + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewReleaseOrMintTokensInstructionBuilder creates a new `ReleaseOrMintTokens` instruction builder. +func NewReleaseOrMintTokensInstructionBuilder() *ReleaseOrMintTokens { + nd := &ReleaseOrMintTokens{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 13), + } + return nd +} + +// SetReleaseOrMint sets the "releaseOrMint" parameter. +func (inst *ReleaseOrMintTokens) SetReleaseOrMint(releaseOrMint ReleaseOrMintInV1) *ReleaseOrMintTokens { + inst.ReleaseOrMint = &releaseOrMint + return inst +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *ReleaseOrMintTokens) SetAuthorityAccount(authority ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[0] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *ReleaseOrMintTokens) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetOfframpProgramAccount sets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) SetOfframpProgramAccount(offrampProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[1] = ag_solanago.Meta(offrampProgram) + return inst +} + +// GetOfframpProgramAccount gets the "offrampProgram" account. +// CHECK offramp program: exists only to derive the allowed offramp PDA +// and the authority PDA. +func (inst *ReleaseOrMintTokens) GetOfframpProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAllowedOfframpAccount sets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) SetAllowedOfframpAccount(allowedOfframp ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[2] = ag_solanago.Meta(allowedOfframp) + return inst +} + +// GetAllowedOfframpAccount gets the "allowedOfframp" account. +// CHECK PDA of the router program verifying the signer is an allowed offramp. +// If PDA does not exist, the router doesn't allow this offramp +func (inst *ReleaseOrMintTokens) GetAllowedOfframpAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetStateAccount sets the "state" account. +func (inst *ReleaseOrMintTokens) SetStateAccount(state ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[3] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *ReleaseOrMintTokens) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +// SetTokenProgramAccount sets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenProgram) + return inst +} + +// GetTokenProgramAccount gets the "tokenProgram" account. +func (inst *ReleaseOrMintTokens) GetTokenProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[4] +} + +// SetMintAccount sets the "mint" account. +func (inst *ReleaseOrMintTokens) SetMintAccount(mint ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[5] = ag_solanago.Meta(mint).WRITE() + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *ReleaseOrMintTokens) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[5] +} + +// SetPoolSignerAccount sets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) SetPoolSignerAccount(poolSigner ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[6] = ag_solanago.Meta(poolSigner) + return inst +} + +// GetPoolSignerAccount gets the "poolSigner" account. +func (inst *ReleaseOrMintTokens) GetPoolSignerAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[6] +} + +// SetPoolTokenAccountAccount sets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetPoolTokenAccountAccount(poolTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[7] = ag_solanago.Meta(poolTokenAccount).WRITE() + return inst +} + +// GetPoolTokenAccountAccount gets the "poolTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetPoolTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[7] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[8] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *ReleaseOrMintTokens) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[8] +} + +// SetRmnRemoteAccount sets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteAccount(rmnRemote ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[9] = ag_solanago.Meta(rmnRemote) + return inst +} + +// GetRmnRemoteAccount gets the "rmnRemote" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[9] +} + +// SetRmnRemoteCursesAccount sets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteCursesAccount(rmnRemoteCurses ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[10] = ag_solanago.Meta(rmnRemoteCurses) + return inst +} + +// GetRmnRemoteCursesAccount gets the "rmnRemoteCurses" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteCursesAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[10] +} + +// SetRmnRemoteConfigAccount sets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) SetRmnRemoteConfigAccount(rmnRemoteConfig ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[11] = ag_solanago.Meta(rmnRemoteConfig) + return inst +} + +// GetRmnRemoteConfigAccount gets the "rmnRemoteConfig" account. +func (inst *ReleaseOrMintTokens) GetRmnRemoteConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[11] +} + +// SetReceiverTokenAccountAccount sets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) SetReceiverTokenAccountAccount(receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + inst.AccountMetaSlice[12] = ag_solanago.Meta(receiverTokenAccount).WRITE() + return inst +} + +// GetReceiverTokenAccountAccount gets the "receiverTokenAccount" account. +func (inst *ReleaseOrMintTokens) GetReceiverTokenAccountAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[12] +} + +func (inst ReleaseOrMintTokens) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_ReleaseOrMintTokens, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst ReleaseOrMintTokens) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *ReleaseOrMintTokens) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ReleaseOrMint == nil { + return errors.New("ReleaseOrMint parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.OfframpProgram is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.AllowedOfframp is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[4] == nil { + return errors.New("accounts.TokenProgram is not set") + } + if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.PoolSigner is not set") + } + if inst.AccountMetaSlice[7] == nil { + return errors.New("accounts.PoolTokenAccount is not set") + } + if inst.AccountMetaSlice[8] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[9] == nil { + return errors.New("accounts.RmnRemote is not set") + } + if inst.AccountMetaSlice[10] == nil { + return errors.New("accounts.RmnRemoteCurses is not set") + } + if inst.AccountMetaSlice[11] == nil { + return errors.New("accounts.RmnRemoteConfig is not set") + } + if inst.AccountMetaSlice[12] == nil { + return errors.New("accounts.ReceiverTokenAccount is not set") + } + } + return nil +} + +func (inst *ReleaseOrMintTokens) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("ReleaseOrMintTokens")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ReleaseOrMint", *inst.ReleaseOrMint)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" offrampProgram", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" allowedOfframp", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" poolSigner", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" poolToken", inst.AccountMetaSlice[7])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[8])) + accountsBranch.Child(ag_format.Meta(" rmnRemote", inst.AccountMetaSlice[9])) + accountsBranch.Child(ag_format.Meta("rmnRemoteCurses", inst.AccountMetaSlice[10])) + accountsBranch.Child(ag_format.Meta("rmnRemoteConfig", inst.AccountMetaSlice[11])) + accountsBranch.Child(ag_format.Meta(" receiverToken", inst.AccountMetaSlice[12])) + }) + }) + }) +} + +func (obj ReleaseOrMintTokens) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ReleaseOrMint` param: + err = encoder.Encode(obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} +func (obj *ReleaseOrMintTokens) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ReleaseOrMint`: + err = decoder.Decode(&obj.ReleaseOrMint) + if err != nil { + return err + } + return nil +} + +// NewReleaseOrMintTokensInstruction declares a new ReleaseOrMintTokens instruction with the provided parameters and accounts. +func NewReleaseOrMintTokensInstruction( + // Parameters: + releaseOrMint ReleaseOrMintInV1, + // Accounts: + authority ag_solanago.PublicKey, + offrampProgram ag_solanago.PublicKey, + allowedOfframp ag_solanago.PublicKey, + state ag_solanago.PublicKey, + tokenProgram ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + poolSigner ag_solanago.PublicKey, + poolTokenAccount ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + rmnRemote ag_solanago.PublicKey, + rmnRemoteCurses ag_solanago.PublicKey, + rmnRemoteConfig ag_solanago.PublicKey, + receiverTokenAccount ag_solanago.PublicKey) *ReleaseOrMintTokens { + return NewReleaseOrMintTokensInstructionBuilder(). + SetReleaseOrMint(releaseOrMint). + SetAuthorityAccount(authority). + SetOfframpProgramAccount(offrampProgram). + SetAllowedOfframpAccount(allowedOfframp). + SetStateAccount(state). + SetTokenProgramAccount(tokenProgram). + SetMintAccount(mint). + SetPoolSignerAccount(poolSigner). + SetPoolTokenAccountAccount(poolTokenAccount). + SetChainConfigAccount(chainConfig). + SetRmnRemoteAccount(rmnRemote). + SetRmnRemoteCursesAccount(rmnRemoteCurses). + SetRmnRemoteConfigAccount(rmnRemoteConfig). + SetReceiverTokenAccountAccount(receiverTokenAccount) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens_test.go new file mode 100644 index 0000000000..24e8c73e68 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/ReleaseOrMintTokens_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_ReleaseOrMintTokens(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("ReleaseOrMintTokens"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(ReleaseOrMintTokens) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(ReleaseOrMintTokens) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit.go new file mode 100644 index 0000000000..e1472d2d58 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit.go @@ -0,0 +1,253 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetChainRateLimit is the `setChainRateLimit` instruction. +type SetChainRateLimit struct { + RemoteChainSelector *uint64 + Mint *ag_solanago.PublicKey + Inbound *RateLimitConfig + Outbound *RateLimitConfig + + // [0] = [] state + // + // [1] = [WRITE] chainConfig + // + // [2] = [WRITE, SIGNER] authority + // + // [3] = [] systemProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetChainRateLimitInstructionBuilder creates a new `SetChainRateLimit` instruction builder. +func NewSetChainRateLimitInstructionBuilder() *SetChainRateLimit { + nd := &SetChainRateLimit{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 4), + } + return nd +} + +// SetRemoteChainSelector sets the "remoteChainSelector" parameter. +func (inst *SetChainRateLimit) SetRemoteChainSelector(remoteChainSelector uint64) *SetChainRateLimit { + inst.RemoteChainSelector = &remoteChainSelector + return inst +} + +// SetMint sets the "mint" parameter. +func (inst *SetChainRateLimit) SetMint(mint ag_solanago.PublicKey) *SetChainRateLimit { + inst.Mint = &mint + return inst +} + +// SetInbound sets the "inbound" parameter. +func (inst *SetChainRateLimit) SetInbound(inbound RateLimitConfig) *SetChainRateLimit { + inst.Inbound = &inbound + return inst +} + +// SetOutbound sets the "outbound" parameter. +func (inst *SetChainRateLimit) SetOutbound(outbound RateLimitConfig) *SetChainRateLimit { + inst.Outbound = &outbound + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetChainRateLimit) SetStateAccount(state ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state) + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetChainRateLimit) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetChainConfigAccount sets the "chainConfig" account. +func (inst *SetChainRateLimit) SetChainConfigAccount(chainConfig ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[1] = ag_solanago.Meta(chainConfig).WRITE() + return inst +} + +// GetChainConfigAccount gets the "chainConfig" account. +func (inst *SetChainRateLimit) GetChainConfigAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetChainRateLimit) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetChainRateLimit) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +// SetSystemProgramAccount sets the "systemProgram" account. +func (inst *SetChainRateLimit) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *SetChainRateLimit { + inst.AccountMetaSlice[3] = ag_solanago.Meta(systemProgram) + return inst +} + +// GetSystemProgramAccount gets the "systemProgram" account. +func (inst *SetChainRateLimit) GetSystemProgramAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] +} + +func (inst SetChainRateLimit) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetChainRateLimit, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetChainRateLimit) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetChainRateLimit) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.RemoteChainSelector == nil { + return errors.New("RemoteChainSelector parameter is not set") + } + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.Inbound == nil { + return errors.New("Inbound parameter is not set") + } + if inst.Outbound == nil { + return errors.New("Outbound parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.ChainConfig is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + if inst.AccountMetaSlice[3] == nil { + return errors.New("accounts.SystemProgram is not set") + } + } + return nil +} + +func (inst *SetChainRateLimit) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetChainRateLimit")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=4]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("RemoteChainSelector", *inst.RemoteChainSelector)) + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param(" Inbound", *inst.Inbound)) + paramsBranch.Child(ag_format.Param(" Outbound", *inst.Outbound)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" chainConfig", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("systemProgram", inst.AccountMetaSlice[3])) + }) + }) + }) +} + +func (obj SetChainRateLimit) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `RemoteChainSelector` param: + err = encoder.Encode(obj.RemoteChainSelector) + if err != nil { + return err + } + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `Inbound` param: + err = encoder.Encode(obj.Inbound) + if err != nil { + return err + } + // Serialize `Outbound` param: + err = encoder.Encode(obj.Outbound) + if err != nil { + return err + } + return nil +} +func (obj *SetChainRateLimit) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `RemoteChainSelector`: + err = decoder.Decode(&obj.RemoteChainSelector) + if err != nil { + return err + } + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `Inbound`: + err = decoder.Decode(&obj.Inbound) + if err != nil { + return err + } + // Deserialize `Outbound`: + err = decoder.Decode(&obj.Outbound) + if err != nil { + return err + } + return nil +} + +// NewSetChainRateLimitInstruction declares a new SetChainRateLimit instruction with the provided parameters and accounts. +func NewSetChainRateLimitInstruction( + // Parameters: + remoteChainSelector uint64, + mint ag_solanago.PublicKey, + inbound RateLimitConfig, + outbound RateLimitConfig, + // Accounts: + state ag_solanago.PublicKey, + chainConfig ag_solanago.PublicKey, + authority ag_solanago.PublicKey, + systemProgram ag_solanago.PublicKey) *SetChainRateLimit { + return NewSetChainRateLimitInstructionBuilder(). + SetRemoteChainSelector(remoteChainSelector). + SetMint(mint). + SetInbound(inbound). + SetOutbound(outbound). + SetStateAccount(state). + SetChainConfigAccount(chainConfig). + SetAuthorityAccount(authority). + SetSystemProgramAccount(systemProgram) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit_test.go new file mode 100644 index 0000000000..ef65a9658a --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetChainRateLimit_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetChainRateLimit(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetChainRateLimit"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetChainRateLimit) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetChainRateLimit) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin.go new file mode 100644 index 0000000000..ac6595646d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin.go @@ -0,0 +1,169 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRateLimitAdmin is the `setRateLimitAdmin` instruction. +type SetRateLimitAdmin struct { + Mint *ag_solanago.PublicKey + NewRateLimitAdmin *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [WRITE, SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRateLimitAdminInstructionBuilder creates a new `SetRateLimitAdmin` instruction builder. +func NewSetRateLimitAdminInstructionBuilder() *SetRateLimitAdmin { + nd := &SetRateLimitAdmin{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 2), + } + return nd +} + +// SetMint sets the "mint" parameter. +func (inst *SetRateLimitAdmin) SetMint(mint ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.Mint = &mint + return inst +} + +// SetNewRateLimitAdmin sets the "newRateLimitAdmin" parameter. +func (inst *SetRateLimitAdmin) SetNewRateLimitAdmin(newRateLimitAdmin ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.NewRateLimitAdmin = &newRateLimitAdmin + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRateLimitAdmin) SetStateAccount(state ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRateLimitAdmin) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRateLimitAdmin) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRateLimitAdmin { + inst.AccountMetaSlice[1] = ag_solanago.Meta(authority).WRITE().SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRateLimitAdmin) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +func (inst SetRateLimitAdmin) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRateLimitAdmin, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRateLimitAdmin) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRateLimitAdmin) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.Mint == nil { + return errors.New("Mint parameter is not set") + } + if inst.NewRateLimitAdmin == nil { + return errors.New("NewRateLimitAdmin parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRateLimitAdmin) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRateLimitAdmin")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param(" Mint", *inst.Mint)) + paramsBranch.Child(ag_format.Param("NewRateLimitAdmin", *inst.NewRateLimitAdmin)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + }) + }) + }) +} + +func (obj SetRateLimitAdmin) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `Mint` param: + err = encoder.Encode(obj.Mint) + if err != nil { + return err + } + // Serialize `NewRateLimitAdmin` param: + err = encoder.Encode(obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} +func (obj *SetRateLimitAdmin) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `Mint`: + err = decoder.Decode(&obj.Mint) + if err != nil { + return err + } + // Deserialize `NewRateLimitAdmin`: + err = decoder.Decode(&obj.NewRateLimitAdmin) + if err != nil { + return err + } + return nil +} + +// NewSetRateLimitAdminInstruction declares a new SetRateLimitAdmin instruction with the provided parameters and accounts. +func NewSetRateLimitAdminInstruction( + // Parameters: + mint ag_solanago.PublicKey, + newRateLimitAdmin ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRateLimitAdmin { + return NewSetRateLimitAdminInstructionBuilder(). + SetMint(mint). + SetNewRateLimitAdmin(newRateLimitAdmin). + SetStateAccount(state). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin_test.go new file mode 100644 index 0000000000..cb26686f5d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRateLimitAdmin_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRateLimitAdmin(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRateLimitAdmin"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRateLimitAdmin) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRateLimitAdmin) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter.go new file mode 100644 index 0000000000..b1eb9edb0c --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// SetRouter is the `setRouter` instruction. +type SetRouter struct { + NewRouter *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewSetRouterInstructionBuilder creates a new `SetRouter` instruction builder. +func NewSetRouterInstructionBuilder() *SetRouter { + nd := &SetRouter{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetNewRouter sets the "newRouter" parameter. +func (inst *SetRouter) SetNewRouter(newRouter ag_solanago.PublicKey) *SetRouter { + inst.NewRouter = &newRouter + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *SetRouter) SetStateAccount(state ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *SetRouter) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *SetRouter) SetMintAccount(mint ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *SetRouter) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *SetRouter) SetAuthorityAccount(authority ag_solanago.PublicKey) *SetRouter { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *SetRouter) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst SetRouter) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_SetRouter, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst SetRouter) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *SetRouter) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.NewRouter == nil { + return errors.New("NewRouter parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *SetRouter) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("SetRouter")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("NewRouter", *inst.NewRouter)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj SetRouter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `NewRouter` param: + err = encoder.Encode(obj.NewRouter) + if err != nil { + return err + } + return nil +} +func (obj *SetRouter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `NewRouter`: + err = decoder.Decode(&obj.NewRouter) + if err != nil { + return err + } + return nil +} + +// NewSetRouterInstruction declares a new SetRouter instruction with the provided parameters and accounts. +func NewSetRouterInstruction( + // Parameters: + newRouter ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *SetRouter { + return NewSetRouterInstructionBuilder(). + SetNewRouter(newRouter). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter_test.go new file mode 100644 index 0000000000..1fbb83f2ab --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/SetRouter_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_SetRouter(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("SetRouter"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(SetRouter) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(SetRouter) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership.go b/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership.go new file mode 100644 index 0000000000..6adfe19a2d --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership.go @@ -0,0 +1,165 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "errors" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_format "github.com/gagliardetto/solana-go/text/format" + ag_treeout "github.com/gagliardetto/treeout" +) + +// TransferOwnership is the `transferOwnership` instruction. +type TransferOwnership struct { + ProposedOwner *ag_solanago.PublicKey + + // [0] = [WRITE] state + // + // [1] = [] mint + // + // [2] = [SIGNER] authority + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` +} + +// NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. +func NewTransferOwnershipInstructionBuilder() *TransferOwnership { + nd := &TransferOwnership{ + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 3), + } + return nd +} + +// SetProposedOwner sets the "proposedOwner" parameter. +func (inst *TransferOwnership) SetProposedOwner(proposedOwner ag_solanago.PublicKey) *TransferOwnership { + inst.ProposedOwner = &proposedOwner + return inst +} + +// SetStateAccount sets the "state" account. +func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[0] = ag_solanago.Meta(state).WRITE() + return inst +} + +// GetStateAccount gets the "state" account. +func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[0] +} + +// SetMintAccount sets the "mint" account. +func (inst *TransferOwnership) SetMintAccount(mint ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[1] = ag_solanago.Meta(mint) + return inst +} + +// GetMintAccount gets the "mint" account. +func (inst *TransferOwnership) GetMintAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[1] +} + +// SetAuthorityAccount sets the "authority" account. +func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey) *TransferOwnership { + inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + return inst +} + +// GetAuthorityAccount gets the "authority" account. +func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] +} + +func (inst TransferOwnership) Build() *Instruction { + return &Instruction{BaseVariant: ag_binary.BaseVariant{ + Impl: inst, + TypeID: Instruction_TransferOwnership, + }} +} + +// ValidateAndBuild validates the instruction parameters and accounts; +// if there is a validation error, it returns the error. +// Otherwise, it builds and returns the instruction. +func (inst TransferOwnership) ValidateAndBuild() (*Instruction, error) { + if err := inst.Validate(); err != nil { + return nil, err + } + return inst.Build(), nil +} + +func (inst *TransferOwnership) Validate() error { + // Check whether all (required) parameters are set: + { + if inst.ProposedOwner == nil { + return errors.New("ProposedOwner parameter is not set") + } + } + + // Check whether all (required) accounts are set: + { + if inst.AccountMetaSlice[0] == nil { + return errors.New("accounts.State is not set") + } + if inst.AccountMetaSlice[1] == nil { + return errors.New("accounts.Mint is not set") + } + if inst.AccountMetaSlice[2] == nil { + return errors.New("accounts.Authority is not set") + } + } + return nil +} + +func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { + parent.Child(ag_format.Program(ProgramName, ProgramID)). + // + ParentFunc(func(programBranch ag_treeout.Branches) { + programBranch.Child(ag_format.Instruction("TransferOwnership")). + // + ParentFunc(func(instructionBranch ag_treeout.Branches) { + + // Parameters of the instruction: + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + paramsBranch.Child(ag_format.Param("ProposedOwner", *inst.ProposedOwner)) + }) + + // Accounts of the instruction: + instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" mint", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + }) + }) + }) +} + +func (obj TransferOwnership) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Serialize `ProposedOwner` param: + err = encoder.Encode(obj.ProposedOwner) + if err != nil { + return err + } + return nil +} +func (obj *TransferOwnership) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Deserialize `ProposedOwner`: + err = decoder.Decode(&obj.ProposedOwner) + if err != nil { + return err + } + return nil +} + +// NewTransferOwnershipInstruction declares a new TransferOwnership instruction with the provided parameters and accounts. +func NewTransferOwnershipInstruction( + // Parameters: + proposedOwner ag_solanago.PublicKey, + // Accounts: + state ag_solanago.PublicKey, + mint ag_solanago.PublicKey, + authority ag_solanago.PublicKey) *TransferOwnership { + return NewTransferOwnershipInstructionBuilder(). + SetProposedOwner(proposedOwner). + SetStateAccount(state). + SetMintAccount(mint). + SetAuthorityAccount(authority) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership_test.go b/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership_test.go new file mode 100644 index 0000000000..0bb1d23460 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/TransferOwnership_test.go @@ -0,0 +1,32 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + ag_gofuzz "github.com/gagliardetto/gofuzz" + ag_require "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +func TestEncodeDecode_TransferOwnership(t *testing.T) { + fu := ag_gofuzz.New().NilChance(0) + for i := 0; i < 1; i++ { + t.Run("TransferOwnership"+strconv.Itoa(i), func(t *testing.T) { + { + params := new(TransferOwnership) + fu.Fuzz(params) + params.AccountMetaSlice = nil + buf := new(bytes.Buffer) + err := encodeT(*params, buf) + ag_require.NoError(t, err) + got := new(TransferOwnership) + err = decodeT(got, buf.Bytes()) + got.AccountMetaSlice = nil + ag_require.NoError(t, err) + ag_require.Equal(t, params, got) + } + }) + } +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/accounts.go b/chains/solana/gobindings/v1_6_1/test_token_pool/accounts.go new file mode 100644 index 0000000000..1e7b934ffe --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/accounts.go @@ -0,0 +1,103 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +type State struct { + PoolType PoolType + Config BaseConfig +} + +var StateDiscriminator = [8]byte{216, 146, 107, 94, 104, 75, 182, 177} + +func (obj State) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(StateDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `PoolType` param: + err = encoder.Encode(obj.PoolType) + if err != nil { + return err + } + // Serialize `Config` param: + err = encoder.Encode(obj.Config) + if err != nil { + return err + } + return nil +} + +func (obj *State) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(StateDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[216 146 107 94 104 75 182 177]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `PoolType`: + err = decoder.Decode(&obj.PoolType) + if err != nil { + return err + } + // Deserialize `Config`: + err = decoder.Decode(&obj.Config) + if err != nil { + return err + } + return nil +} + +type ChainConfig struct { + Base BaseChain +} + +var ChainConfigDiscriminator = [8]byte{13, 177, 233, 141, 212, 29, 148, 56} + +func (obj ChainConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { + // Write account discriminator: + err = encoder.WriteBytes(ChainConfigDiscriminator[:], false) + if err != nil { + return err + } + // Serialize `Base` param: + err = encoder.Encode(obj.Base) + if err != nil { + return err + } + return nil +} + +func (obj *ChainConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, err := decoder.ReadTypeID() + if err != nil { + return err + } + if !discriminator.Equal(ChainConfigDiscriminator[:]) { + return fmt.Errorf( + "wrong discriminator: wanted %s, got %s", + "[13 177 233 141 212 29 148 56]", + fmt.Sprint(discriminator[:])) + } + } + // Deserialize `Base`: + err = decoder.Decode(&obj.Base) + if err != nil { + return err + } + return nil +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/alias.go b/chains/solana/gobindings/v1_6_1/test_token_pool/alias.go new file mode 100644 index 0000000000..f715d3af28 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/alias.go @@ -0,0 +1,14 @@ +package test_token_pool // revive:disable-line:var-naming + +import "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/base_token_pool" + +// DO NOT DELETE - imported custom types are are not-automatically resolved by `anchor-go` but are declared in the anchor idl +// this files aliases types from other modules to ensure the go modules compile + +type BaseChain = base_token_pool.BaseChain +type BaseConfig = base_token_pool.BaseConfig +type LockOrBurnInV1 = base_token_pool.LockOrBurnInV1 +type RateLimitConfig = base_token_pool.RateLimitConfig +type ReleaseOrMintInV1 = base_token_pool.ReleaseOrMintInV1 +type RemoteAddress = base_token_pool.RemoteAddress +type RemoteConfig = base_token_pool.RemoteConfig diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/instructions.go b/chains/solana/gobindings/v1_6_1/test_token_pool/instructions.go new file mode 100644 index 0000000000..05fc4890ae --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/instructions.go @@ -0,0 +1,208 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + "fmt" + ag_spew "github.com/davecgh/go-spew/spew" + ag_binary "github.com/gagliardetto/binary" + ag_solanago "github.com/gagliardetto/solana-go" + ag_text "github.com/gagliardetto/solana-go/text" + ag_treeout "github.com/gagliardetto/treeout" +) + +var ProgramID ag_solanago.PublicKey + +func SetProgramID(pubkey ag_solanago.PublicKey) { + ProgramID = pubkey + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) +} + +const ProgramName = "TestTokenPool" + +func init() { + if !ProgramID.IsZero() { + ag_solanago.RegisterInstructionDecoder(ProgramID, registryDecodeInstruction) + } +} + +var ( + Instruction_Initialize = ag_binary.TypeID([8]byte{175, 175, 109, 31, 13, 152, 155, 237}) + + Instruction_TransferOwnership = ag_binary.TypeID([8]byte{65, 177, 215, 73, 53, 45, 99, 47}) + + Instruction_AcceptOwnership = ag_binary.TypeID([8]byte{172, 23, 43, 13, 238, 213, 85, 150}) + + Instruction_SetRouter = ag_binary.TypeID([8]byte{236, 248, 107, 200, 151, 160, 44, 250}) + + Instruction_InitChainRemoteConfig = ag_binary.TypeID([8]byte{21, 150, 133, 36, 2, 116, 199, 129}) + + Instruction_EditChainRemoteConfig = ag_binary.TypeID([8]byte{149, 112, 186, 72, 116, 217, 159, 175}) + + Instruction_AppendRemotePoolAddresses = ag_binary.TypeID([8]byte{172, 57, 83, 55, 70, 112, 26, 197}) + + Instruction_SetChainRateLimit = ag_binary.TypeID([8]byte{188, 188, 161, 37, 100, 249, 123, 170}) + + Instruction_SetRateLimitAdmin = ag_binary.TypeID([8]byte{21, 182, 126, 128, 31, 241, 37, 34}) + + Instruction_DeleteChainConfig = ag_binary.TypeID([8]byte{241, 159, 142, 210, 64, 173, 77, 179}) + + Instruction_ReleaseOrMintTokens = ag_binary.TypeID([8]byte{92, 100, 150, 198, 252, 63, 164, 228}) + + Instruction_LockOrBurnTokens = ag_binary.TypeID([8]byte{114, 161, 94, 29, 147, 25, 232, 191}) + + Instruction_DeriveAccountsReleaseOrMintTokens = ag_binary.TypeID([8]byte{40, 91, 244, 228, 0, 2, 51, 238}) + + Instruction_DeriveAccountsLockOrBurnTokens = ag_binary.TypeID([8]byte{20, 237, 184, 4, 166, 153, 108, 174}) +) + +// InstructionIDToName returns the name of the instruction given its ID. +func InstructionIDToName(id ag_binary.TypeID) string { + switch id { + case Instruction_Initialize: + return "Initialize" + case Instruction_TransferOwnership: + return "TransferOwnership" + case Instruction_AcceptOwnership: + return "AcceptOwnership" + case Instruction_SetRouter: + return "SetRouter" + case Instruction_InitChainRemoteConfig: + return "InitChainRemoteConfig" + case Instruction_EditChainRemoteConfig: + return "EditChainRemoteConfig" + case Instruction_AppendRemotePoolAddresses: + return "AppendRemotePoolAddresses" + case Instruction_SetChainRateLimit: + return "SetChainRateLimit" + case Instruction_SetRateLimitAdmin: + return "SetRateLimitAdmin" + case Instruction_DeleteChainConfig: + return "DeleteChainConfig" + case Instruction_ReleaseOrMintTokens: + return "ReleaseOrMintTokens" + case Instruction_LockOrBurnTokens: + return "LockOrBurnTokens" + case Instruction_DeriveAccountsReleaseOrMintTokens: + return "DeriveAccountsReleaseOrMintTokens" + case Instruction_DeriveAccountsLockOrBurnTokens: + return "DeriveAccountsLockOrBurnTokens" + default: + return "" + } +} + +type Instruction struct { + ag_binary.BaseVariant +} + +func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches) { + if enToTree, ok := inst.Impl.(ag_text.EncodableToTree); ok { + enToTree.EncodeToTree(parent) + } else { + parent.Child(ag_spew.Sdump(inst)) + } +} + +var InstructionImplDef = ag_binary.NewVariantDefinition( + ag_binary.AnchorTypeIDEncoding, + []ag_binary.VariantType{ + { + "initialize", (*Initialize)(nil), + }, + { + "transfer_ownership", (*TransferOwnership)(nil), + }, + { + "accept_ownership", (*AcceptOwnership)(nil), + }, + { + "set_router", (*SetRouter)(nil), + }, + { + "init_chain_remote_config", (*InitChainRemoteConfig)(nil), + }, + { + "edit_chain_remote_config", (*EditChainRemoteConfig)(nil), + }, + { + "append_remote_pool_addresses", (*AppendRemotePoolAddresses)(nil), + }, + { + "set_chain_rate_limit", (*SetChainRateLimit)(nil), + }, + { + "set_rate_limit_admin", (*SetRateLimitAdmin)(nil), + }, + { + "delete_chain_config", (*DeleteChainConfig)(nil), + }, + { + "release_or_mint_tokens", (*ReleaseOrMintTokens)(nil), + }, + { + "lock_or_burn_tokens", (*LockOrBurnTokens)(nil), + }, + { + "derive_accounts_release_or_mint_tokens", (*DeriveAccountsReleaseOrMintTokens)(nil), + }, + { + "derive_accounts_lock_or_burn_tokens", (*DeriveAccountsLockOrBurnTokens)(nil), + }, + }, +) + +func (inst *Instruction) ProgramID() ag_solanago.PublicKey { + return ProgramID +} + +func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta) { + return inst.Impl.(ag_solanago.AccountsGettable).GetAccounts() +} + +func (inst *Instruction) Data() ([]byte, error) { + buf := new(bytes.Buffer) + if err := ag_binary.NewBorshEncoder(buf).Encode(inst); err != nil { + return nil, fmt.Errorf("unable to encode instruction: %w", err) + } + return buf.Bytes(), nil +} + +func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error { + return encoder.Encode(inst.Impl, option) +} + +func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error { + return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef) +} + +func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error { + err := encoder.WriteBytes(inst.TypeID.Bytes(), false) + if err != nil { + return fmt.Errorf("unable to write variant type: %w", err) + } + return encoder.Encode(inst.Impl) +} + +func registryDecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (interface{}, error) { + inst, err := DecodeInstruction(accounts, data) + if err != nil { + return nil, err + } + return inst, nil +} + +func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error) { + inst := new(Instruction) + if err := ag_binary.NewBorshDecoder(data).Decode(inst); err != nil { + return nil, fmt.Errorf("unable to decode instruction: %w", err) + } + if v, ok := inst.Impl.(ag_solanago.AccountsSettable); ok { + err := v.SetAccounts(accounts) + if err != nil { + return nil, fmt.Errorf("unable to set accounts for instruction: %w", err) + } + } + return inst, nil +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/testing_utils.go b/chains/solana/gobindings/v1_6_1/test_token_pool/testing_utils.go new file mode 100644 index 0000000000..56429c0762 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/testing_utils.go @@ -0,0 +1,20 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ( + "bytes" + "fmt" + ag_binary "github.com/gagliardetto/binary" +) + +func encodeT(data interface{}, buf *bytes.Buffer) error { + if err := ag_binary.NewBorshEncoder(buf).Encode(data); err != nil { + return fmt.Errorf("unable to encode instruction: %w", err) + } + return nil +} + +func decodeT(dst interface{}, data []byte) error { + return ag_binary.NewBorshDecoder(data).Decode(dst) +} diff --git a/chains/solana/gobindings/v1_6_1/test_token_pool/types.go b/chains/solana/gobindings/v1_6_1/test_token_pool/types.go new file mode 100644 index 0000000000..5fa7741826 --- /dev/null +++ b/chains/solana/gobindings/v1_6_1/test_token_pool/types.go @@ -0,0 +1,26 @@ +// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. + +package test_token_pool + +import ag_binary "github.com/gagliardetto/binary" + +type PoolType ag_binary.BorshEnum + +const ( + LockAndRelease_PoolType PoolType = iota + BurnAndMint_PoolType + Wrapped_PoolType +) + +func (value PoolType) String() string { + switch value { + case LockAndRelease_PoolType: + return "LockAndRelease" + case BurnAndMint_PoolType: + return "BurnAndMint" + case Wrapped_PoolType: + return "Wrapped" + default: + return "" + } +} diff --git a/chains/solana/utils/ccip/ccip_events.go b/chains/solana/utils/ccip/ccip_events.go index db2e2c0da2..23d32a0e85 100644 --- a/chains/solana/utils/ccip/ccip_events.go +++ b/chains/solana/utils/ccip/ccip_events.go @@ -1,6 +1,8 @@ package ccip import ( + "fmt" + bin "github.com/gagliardetto/binary" "github.com/gagliardetto/solana-go" @@ -19,6 +21,38 @@ type EventCCIPMessageSent struct { Message ccip_router.SVM2AnyRampMessage } +var eventCCIPMessageSentDiscriminator = [8]byte{23, 77, 73, 183, 123, 185, 115, 57} + +func (obj *EventCCIPMessageSent) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) { + // Read and check account discriminator: + { + discriminator, decoderErr := decoder.ReadTypeID() + if decoderErr != nil { + return decoderErr + } + if !discriminator.Equal(eventCCIPMessageSentDiscriminator[:]) { + return fmt.Errorf("wrong discriminator: wanted %v, got %v", + eventCCIPMessageSentDiscriminator, discriminator) + } + } + // Deserialize `DestinationChainSelector`: + err = decoder.Decode(&obj.DestinationChainSelector) + if err != nil { + return err + } + // Deserialize `SequenceNumber`: + err = decoder.Decode(&obj.SequenceNumber) + if err != nil { + return err + } + // Deserialize `Message`: + err = decoder.Decode(&obj.Message) + if err != nil { + return err + } + return nil +} + type EventCommitReportAccepted struct { Discriminator [8]byte Report *ccip_offramp.MerkleRoot `bin:"optional"` diff --git a/chains/solana/utils/common/transactions.go b/chains/solana/utils/common/transactions.go index 321102ef4e..73f364df74 100644 --- a/chains/solana/utils/common/transactions.go +++ b/chains/solana/utils/common/transactions.go @@ -392,6 +392,15 @@ type anchorType[T any] interface { UnmarshalWithDecoder(decoder *bin.Decoder) (err error) } +func UnmarshalAnchorType[T any, PT anchorType[T]](bytes []byte) (*T, error) { + var result T + err := PT(&result).UnmarshalWithDecoder(bin.NewBorshDecoder(bytes)) + if err != nil { + return nil, err + } + return &result, nil +} + func ExtractAnchorTypedReturnValue[T any, PT anchorType[T]](ctx context.Context, logs []string, programID string) (*T, error) { var result T bytes, err := ExtractReturnValue(ctx, logs, programID) diff --git a/devenv/chainimpl/ccip-solana/impl.go b/devenv/chainimpl/ccip-solana/impl.go index 91735cabcc..bcb8723f3d 100644 --- a/devenv/chainimpl/ccip-solana/impl.go +++ b/devenv/chainimpl/ccip-solana/impl.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "os" "time" "github.com/Masterminds/semver/v3" @@ -34,6 +35,7 @@ import ( rmnremoteops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/rmn_remote" routerops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/router" solanaseqs "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/rmn_remote" solCommonUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" "github.com/smartcontractkit/chainlink-ccip/deployment/testadapters" common_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -162,7 +164,7 @@ func (m *CCIP16Solana) DeployLocalNetwork(ctx context.Context, bc *blockchain.In if err != nil { return nil, fmt.Errorf("failed to get chain details: %w", err) } - err = PreloadSolanaEnvironment(bc.ContractsDir, d.ChainSelector) + err = PreloadSolanaEnvironment(ctx, bc.ContractsDir, d.ChainSelector) if err != nil { return nil, fmt.Errorf("failed to preload Solana environment: %w", err) } @@ -203,12 +205,18 @@ var solanaContracts = map[string]datastore.ContractType{ "test_ccip_receiver": datastore.ContractType("TestReceiver"), } -func PreloadSolanaEnvironment(programsPath string, chainSelector uint64) error { - err := utils.DownloadSolanaCCIPProgramArtifacts(context.Background(), programsPath, utils.VersionToShortCommitSHA[utils.VersionSolanaV1_6_0]) - if err != nil { - return err +func PreloadSolanaEnvironment(ctx context.Context, programsPath string, chainSelector uint64) error { + l := zerolog.Ctx(ctx) + + files, _ := os.ReadDir(programsPath) + if len(files) > 0 { + l.Info().Msg("Using pre-existing Solana contracts, without downloading fresh ones") + return nil } - return nil + + l.Info().Msgf("Downloading Solana contracts into %s", programsPath) + shortSha := utils.VersionToShortCommitSHA[utils.VersionSolanaV1_6_1] + return utils.DownloadSolanaCCIPProgramArtifacts(ctx, programsPath, shortSha) } // Populates datastore with the predeployed program addresses @@ -331,6 +339,36 @@ func (m *CCIP16Solana) PostDeployContractsForSelector(ctx context.Context, env * if err != nil { return fmt.Errorf("failed to add price updater: %w", err) } + + cpiSigner, _, err := state.FindFeeBillingSignerPDA(routerID) + if err != nil { + return fmt.Errorf("failed to find billing signer PDA: %w", err) + } + + rmnRemoteAddrRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: selector, + Type: datastore.ContractType("RMNRemote"), + }, selector, datastore_utils.FullRef) + if err != nil { + return fmt.Errorf("failed to get RMNRemote address: %w", err) + } + rmnRemoteAddr := solana.MustPublicKeyFromBase58(rmnRemoteAddrRef.Address) + if rmn_remote.ProgramID.IsZero() { + rmn_remote.ProgramID = rmnRemoteAddr + } + rmnConfig, _, err := state.FindConfigPDA(rmnRemoteAddr) + if err != nil { + return fmt.Errorf("failed to find RMNRemote config PDA: %w", err) + } + rmnIx, err := rmn_remote.NewSetEventAuthoritiesInstruction([]solana.PublicKey{cpiSigner}, rmnConfig, chain.DeployerKey.PublicKey(), solana.SystemProgramID).ValidateAndBuild() + if err != nil { + return fmt.Errorf("failed to build set event authorities instruction: %w", err) + } + err = chain.Confirm([]solana.Instruction{rmnIx}) + if err != nil { + return fmt.Errorf("failed to set event authorities: %w", err) + } + for _, tokenPubKey := range []solana.PublicKey{ solana.WrappedSol, solana.MustPublicKeyFromBase58(linkAddr.Address), diff --git a/devenv/go.mod b/devenv/go.mod index 47c4fc8589..0cd653d28c 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -7,6 +7,7 @@ replace ( github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment => ../chains/evm/deployment github.com/smartcontractkit/chainlink-ccip/chains/solana => ../chains/solana github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment => ../chains/solana/deployment + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings => ../chains/solana/gobindings github.com/smartcontractkit/chainlink-ccip/deployment => ../deployment // local development diff --git a/devenv/go.sum b/devenv/go.sum index 6b8b9020ab..e95705fc60 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -1179,8 +1179,6 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d h1:ytcMsJM0zlw5PnaZ1D8JmyGT1m6Fxtb8ycqWYMGheYs= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d/go.mod h1:ZtZ+wtqU9JsJEmbiCsavVVEbhywpgMF7q/IpD9Eaq48= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 h1:cMzoreLtepEiB5pfYrvreXNoZideVRzQQKNr5Io5J7M= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= From 6a5681413afc247a7600bd807a37550aba6a06ce Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:44:41 -0800 Subject: [PATCH 03/41] token expansion e2e fixes (#1732) * e2e fixes * casting * casting * cll * pass token pool version * skip ownership transfer * fix devenv * fix: use proper bindings based on token pool version * feat: infer TokenTransferConfig chain selector for TokenExpansion * fix transfer in devenv * fix: remove unnecessary SetPool call after RegisterToken * bubble up * skip rate limit admin with authority * action update * fix flake * fix flake * fix flake --------- Co-authored-by: chris-de-leon-cll <147140544+chris-de-leon-cll@users.noreply.github.com> --- .github/workflows/test-deployments.yml | 18 +- .../configure_token_pool_for_remote_chains.go | 6 +- .../v1_6_0/sequences/token_and_pools.go | 332 ++++++++++++------ .../v1_6_0/testadapter/test_adapter.go | 4 +- .../configure_token_pool_for_remote_chains.go | 269 ++++++++++++++ .../v1_6_0/operations/token_pools/burnmint.go | 52 +++ .../operations/token_pools/lockrelease.go | 52 +++ .../deployment/v1_6_0/sequences/tokens.go | 50 ++- .../v1_6_0/testadapter/test_adapter.go | 2 - .../tokens/configure_tokens_for_transfers.go | 33 +- .../configure_tokens_for_transfers_test.go | 36 +- deployment/tokens/product.go | 4 +- deployment/tokens/product_test.go | 6 +- deployment/tokens/token_expansion.go | 57 ++- .../deployment/tokens_and_token_pools_test.go | 6 +- 15 files changed, 708 insertions(+), 219 deletions(-) create mode 100644 chains/evm/deployment/v1_6_1/sequences/token_pool/configure_token_pool_for_remote_chains.go diff --git a/.github/workflows/test-deployments.yml b/.github/workflows/test-deployments.yml index 9f284c8913..21906d7bc1 100644 --- a/.github/workflows/test-deployments.yml +++ b/.github/workflows/test-deployments.yml @@ -14,10 +14,10 @@ jobs: detect_deployments_changes: runs-on: ubuntu-latest outputs: - run_solana_deployment: ${{ steps.filter.outputs.deployment_workflow == 'true' || steps.filter.outputs.run_solana_deployment == 'true' }} - run_evm_deployment: ${{ steps.filter.outputs.deployment_workflow == 'true' || steps.filter.outputs.run_evm_deployment == 'true' }} - run_deployment: ${{ steps.filter.outputs.deployment_workflow == 'true' || steps.filter.outputs.run_deployment == 'true' }} - run_crosschain_deployment: ${{ steps.filter.outputs.deployment_workflow == 'true' || steps.filter.outputs.run_crosschain_deployment == 'true' }} + run_solana_deployment: ${{ steps.filter.outputs.run_deployment == 'true' || steps.filter.outputs.run_solana_deployment == 'true' }} + run_evm_deployment: ${{ steps.filter.outputs.run_deployment == 'true' || steps.filter.outputs.run_evm_deployment == 'true' }} + run_deployment: ${{ steps.filter.outputs.run_deployment == 'true' }} + run_crosschain_deployment: ${{ steps.filter.outputs.run_deployment == 'true' || steps.filter.outputs.run_solana_deployment == 'true' || steps.filter.outputs.run_evm_deployment == 'true' || steps.filter.outputs.run_crosschain_deployment == 'true' }} steps: - uses: actions/checkout@v4 - name: Detect changes @@ -28,6 +28,7 @@ jobs: filters: | run_deployment: - 'deployment/**' + - '.github/workflows/test-deployments.yml' run_evm_deployment: - 'chains/evm/gobindings/generated/**' - 'chains/evm/deployment/**' @@ -36,8 +37,6 @@ jobs: - 'chains/solana/deployment/**' run_crosschain_deployment: - 'integration-tests/deployment/**' - deployment_workflow: - - '.github/workflows/test-deployments.yml' test-evm-deployments: needs: [detect_deployments_changes] @@ -125,12 +124,7 @@ jobs: test-deployments-crosschain: needs: [detect_deployments_changes] - if: |- - ${{ - needs.detect_deployments_changes.outputs.run_crosschain_deployment == 'true' || - needs.detect_deployments_changes.outputs.run_evm_deployment == 'true' || - needs.detect_deployments_changes.outputs.run_solana_deployment == 'true' - }} + if: ${{ needs.detect_deployments_changes.outputs.run_crosschain_deployment == 'true' }} runs-on: ubuntu-latest defaults: run: diff --git a/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go b/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go index 25f3b6855d..54140df3af 100644 --- a/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go +++ b/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go @@ -5,6 +5,7 @@ import ( "fmt" "slices" + "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -20,11 +21,13 @@ import ( type ConfigureTokenPoolForRemoteChainsInput struct { TokenPoolAddress common.Address + TokenPoolVersion *semver.Version RemoteChains map[uint64]tokensapi.RemoteChainConfig[[]byte, string] } type ConfigureTokenPoolForRemoteChainInput struct { TokenPoolAddress common.Address + TokenPoolVersion *semver.Version RemoteChainSelector uint64 RemoteChainConfig tokensapi.RemoteChainConfig[[]byte, string] } @@ -66,6 +69,7 @@ var ConfigureTokenPoolForRemoteChains = cldf_ops.NewSequence( chain, ConfigureTokenPoolForRemoteChainInput{ TokenPoolAddress: tokenPool.Address(), + TokenPoolVersion: input.TokenPoolVersion, RemoteChainSelector: remoteChainSelector, RemoteChainConfig: remoteChainConfig, }, @@ -112,7 +116,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( localDecimals, input.RemoteChainConfig.RemoteDecimals, chain.Family(), - tpops.Version, + input.TokenPoolVersion, ) // Token pool remote chain configuration can vary depending on whether the remote diff --git a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go index c15b1a9f72..20afe1ba66 100644 --- a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go +++ b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go @@ -14,14 +14,24 @@ import ( bnmERC20ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/burn_mint_erc20" tarops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/token_admin_registry" tarseq "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" - tpops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_1/operations/token_pool" - tpseq "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_1/sequences/token_pool" + tpOpsV1_5_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_1/operations/token_pool" + tpSeqV1_5_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_1/sequences/token_pool" + tpOpsV1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/operations/token_pool" + tpSeqV1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/sequences/token_pool" + + // NOTE: both v1.5.1 and v1.6.1 token pool contracts inherit from the same abstract v1.5.1 + // TokenPool.sol contract so we can still use the 1.5.1 bindings to read all onchain state + // between these two versions. "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" tokensapi "github.com/smartcontractkit/chainlink-ccip/deployment/tokens" cciputils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" @@ -30,7 +40,7 @@ import ( func (a *EVMAdapter) ConfigureTokenForTransfersSequence() *cldf_ops.Sequence[tokensapi.ConfigureTokenForTransfersInput, sequences.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "evm-adapter:configure-token-for-transfers", - tpops.Version, + cciputils.Version_1_6_0, "Configure a token for cross-chain transfers for an EVM chain", func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokensapi.ConfigureTokenForTransfersInput) (sequences.OnChainOutput, error) { var result sequences.OnChainOutput @@ -64,69 +74,54 @@ func (a *EVMAdapter) ConfigureTokenForTransfersSequence() *cldf_ops.Sequence[tok return sequences.OnChainOutput{}, fmt.Errorf("failed to get token admin registry address for chain %d: %w", input.ChainSelector, err) } - token, err := cldf_ops.ExecuteOperation(b, - tpops.GetToken, - chain, - evm_contract.FunctionInput[struct{}]{ - ChainSelector: input.ChainSelector, - Address: tpAddr, - Args: struct{}{}, - }, - ) + filters := datastore.AddressRef{ + ChainSelector: input.ChainSelector, + Address: tpAddr.String(), + } + fullTpRef, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, filters, input.ChainSelector, datastore_utils.FullRef) if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to get token address via GetToken operation: %w", err) + return sequences.OnChainOutput{}, fmt.Errorf("failed to find token pool in datastore using ref (%+v): %w", filters, err) } - report, err := cldf_ops.ExecuteSequence(b, - tarseq.RegisterToken, - chain, - tarseq.RegisterTokenInput{ - ChainSelector: input.ChainSelector, - TokenAdminRegistryAddress: tarAddress, - TokenPoolAddress: tpAddr, - ExternalAdmin: externalAdmin, - TokenAddress: token.Output, - }, - ) + tokenAddress, err := a.GetTokenAddressFromFullTokenPoolRef(b, chain, fullTpRef) if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to register token on chain %d: %w", input.ChainSelector, err) + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token address from token pool ref (%+v): %w", fullTpRef, err) } - result.Addresses = append(result.Addresses, report.Output.Addresses...) - result.BatchOps = append(result.BatchOps, report.Output.BatchOps...) - - setPoolReport, err := cldf_ops.ExecuteOperation(b, - tarops.SetPool, - chain, - evm_contract.FunctionInput[tarops.SetPoolArgs]{ - Address: tarAddress, - ChainSelector: input.ChainSelector, - Args: tarops.SetPoolArgs{ + switch fullTpRef.Version.String() { + case tpOpsV1_5_1.Version.String(): + if configureReport, err := cldf_ops.ExecuteSequence(b, + tpSeqV1_5_1.ConfigureTokenPoolForRemoteChains, chain, + tpSeqV1_5_1.ConfigureTokenPoolForRemoteChainsInput{ TokenPoolAddress: tpAddr, - TokenAddress: token.Output, + TokenPoolVersion: fullTpRef.Version, + RemoteChains: input.RemoteChains, }, - }, - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to set pool for token %q on chain selector %d: %w", input.TokenRef.Qualifier, input.ChainSelector, err) - } - - batchOp, err := evm_contract.NewBatchOperationFromWrites([]evm_contract.WriteOutput{setPoolReport.Output}) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation from writes: %w", err) - } - result.BatchOps = append(result.BatchOps, batchOp) - - configureReport, err := cldf_ops.ExecuteSequence(b, - tpseq.ConfigureTokenPoolForRemoteChains, - chain, - tpseq.ConfigureTokenPoolForRemoteChainsInput{ - TokenPoolAddress: tpAddr, - RemoteChains: input.RemoteChains, - }, - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to configure token pool for transfers on chain %d: %w", input.ChainSelector, err) + ); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to configure token pool for transfers on chain %d: %w", input.ChainSelector, err) + } else { + result.Addresses = append(result.Addresses, configureReport.Output.Addresses...) + result.BatchOps = append(result.BatchOps, configureReport.Output.BatchOps...) + } + case tpOpsV1_6_1.Version.String(): + if configureReport, err := cldf_ops.ExecuteSequence(b, + tpSeqV1_6_1.ConfigureTokenPoolForRemoteChains, chain, + tpSeqV1_6_1.ConfigureTokenPoolForRemoteChainsInput{ + TokenPoolAddress: tpAddr, + TokenPoolVersion: fullTpRef.Version, + RemoteChains: input.RemoteChains, + }, + ); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to configure token pool for transfers on chain %d: %w", input.ChainSelector, err) + } else { + result.Addresses = append(result.Addresses, configureReport.Output.Addresses...) + result.BatchOps = append(result.BatchOps, configureReport.Output.BatchOps...) + } + default: + return sequences.OnChainOutput{}, fmt.Errorf( + "unsupported token pool version %s for token pool at address %q on chain selector %d", + fullTpRef.Version.String(), tpAddr.String(), input.ChainSelector, + ) } registerReport, err := cldf_ops.ExecuteSequence(b, @@ -137,16 +132,13 @@ func (a *EVMAdapter) ConfigureTokenForTransfersSequence() *cldf_ops.Sequence[tok TokenAdminRegistryAddress: tarAddress, TokenPoolAddress: tpAddr, ExternalAdmin: externalAdmin, - TokenAddress: token.Output, + TokenAddress: tokenAddress, }, ) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to register token on chain %d: %w", input.ChainSelector, err) } - - result.Addresses = append(result.Addresses, configureReport.Output.Addresses...) result.Addresses = append(result.Addresses, registerReport.Output.Addresses...) - result.BatchOps = append(result.BatchOps, configureReport.Output.BatchOps...) result.BatchOps = append(result.BatchOps, registerReport.Output.BatchOps...) return result, nil @@ -182,20 +174,12 @@ func (a *EVMAdapter) DeriveTokenAddress(e deployment.Environment, chainSelector return nil, errors.New("token pool address is zero address") } - token, err := cldf_ops.ExecuteOperation(e.OperationsBundle, - tpops.GetToken, - chain, - evm_contract.FunctionInput[struct{}]{ - ChainSelector: chainSelector, - Address: tpAddr, - Args: struct{}{}, - }, - ) + tokenAddr, err := a.GetTokenAddressFromFullTokenPoolRef(e.OperationsBundle, chain, addrRef) if err != nil { - return nil, fmt.Errorf("failed to get token address via GetToken operation: %w", err) + return nil, fmt.Errorf("failed to get token address from token pool ref (%+v): %w", addrRef, err) } - return token.Output.Bytes(), nil + return tokenAddr.Bytes(), nil } func (a *EVMAdapter) DeriveTokenDecimals(e deployment.Environment, chainSelector uint64, poolRef datastore.AddressRef, token []byte) (uint8, error) { @@ -234,7 +218,7 @@ func (a *EVMAdapter) DeriveTokenPoolCounterpart(e deployment.Environment, chainS func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLRemotes, sequences.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "evm-adapter:set-token-pool-rate-limits", - tpops.Version, + cciputils.Version_1_6_0, "Set rate limits for a token pool across multiple EVM chains", func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokensapi.TPRLRemotes) (sequences.OnChainOutput, error) { var result sequences.OnChainOutput @@ -243,27 +227,64 @@ func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLR return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) } - report, err := cldf_ops.ExecuteOperation(b, tpops.SetChainRateLimiterConfig, chain, evm_contract.FunctionInput[tpops.SetChainRateLimiterConfigArgs]{ - ChainSelector: chain.Selector, - Address: common.HexToAddress(input.TokenPoolRef.Address), - Args: tpops.SetChainRateLimiterConfigArgs{ - OutboundRateLimitConfig: token_pool.RateLimiterConfig{ - IsEnabled: input.OutboundRateLimiterConfig.IsEnabled, - Capacity: input.OutboundRateLimiterConfig.Capacity, - Rate: input.OutboundRateLimiterConfig.Rate, - }, - InboundRateLimitConfig: token_pool.RateLimiterConfig{ - IsEnabled: input.InboundRateLimiterConfig.IsEnabled, - Capacity: input.InboundRateLimiterConfig.Capacity, - Rate: input.InboundRateLimiterConfig.Rate, - }, - RemoteChainSelector: input.RemoteChainSelector, - }, - }) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to set rate limiter config: %w", err) + var output evm_contract.WriteOutput + switch input.TokenPoolRef.Version.String() { + case tpOpsV1_5_1.Version.String(): + if report, err := cldf_ops.ExecuteOperation(b, + tpOpsV1_5_1.SetChainRateLimiterConfig, chain, + evm_contract.FunctionInput[tpOpsV1_5_1.SetChainRateLimiterConfigArgs]{ + ChainSelector: chain.Selector, + Address: common.HexToAddress(input.TokenPoolRef.Address), + Args: tpOpsV1_5_1.SetChainRateLimiterConfigArgs{ + OutboundRateLimitConfig: token_pool.RateLimiterConfig{ + IsEnabled: input.OutboundRateLimiterConfig.IsEnabled, + Capacity: input.OutboundRateLimiterConfig.Capacity, + Rate: input.OutboundRateLimiterConfig.Rate, + }, + InboundRateLimitConfig: token_pool.RateLimiterConfig{ + IsEnabled: input.InboundRateLimiterConfig.IsEnabled, + Capacity: input.InboundRateLimiterConfig.Capacity, + Rate: input.InboundRateLimiterConfig.Rate, + }, + RemoteChainSelector: input.RemoteChainSelector, + }, + }); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to set rate limiter config: %w", err) + } else { + output = report.Output + } + case tpOpsV1_6_1.Version.String(): + if report, err := cldf_ops.ExecuteOperation(b, + tpOpsV1_6_1.SetChainRateLimiterConfig, chain, + evm_contract.FunctionInput[tpOpsV1_6_1.SetChainRateLimiterConfigArgs]{ + ChainSelector: chain.Selector, + Address: common.HexToAddress(input.TokenPoolRef.Address), + Args: tpOpsV1_6_1.SetChainRateLimiterConfigArgs{ + OutboundConfig: tpOpsV1_6_1.Config{ + IsEnabled: input.OutboundRateLimiterConfig.IsEnabled, + Capacity: input.OutboundRateLimiterConfig.Capacity, + Rate: input.OutboundRateLimiterConfig.Rate, + }, + InboundConfig: tpOpsV1_6_1.Config{ + IsEnabled: input.InboundRateLimiterConfig.IsEnabled, + Capacity: input.InboundRateLimiterConfig.Capacity, + Rate: input.InboundRateLimiterConfig.Rate, + }, + RemoteChainSelector: input.RemoteChainSelector, + }, + }); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to set rate limiter config: %w", err) + } else { + output = report.Output + } + default: + return sequences.OnChainOutput{}, fmt.Errorf( + "unsupported token pool version %s for token pool with ref (%+v) on chain selector %d", + input.TokenPoolRef.Version.String(), input.TokenPoolRef, input.ChainSelector, + ) } - batchOp, err := evm_contract.NewBatchOperationFromWrites([]evm_contract.WriteOutput{report.Output}) + + batchOp, err := evm_contract.NewBatchOperationFromWrites([]evm_contract.WriteOutput{output}) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation: %w", err) } @@ -275,7 +296,7 @@ func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLR func (a *EVMAdapter) ManualRegistration() *cldf_ops.Sequence[tokensapi.ManualRegistrationSequenceInput, sequences.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "evm-adapter:manual-registration", - tarops.Version, + cciputils.Version_1_6_0, "Manually register a token and token pool on multiple EVM chains", func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokensapi.ManualRegistrationSequenceInput) (sequences.OnChainOutput, error) { chain, ok := chains.EVMChains()[input.ChainSelector] @@ -311,23 +332,14 @@ func (a *EVMAdapter) ManualRegistration() *cldf_ops.Sequence[tokensapi.ManualReg if tokenPoolAddr == (common.Address{}) { return sequences.OnChainOutput{}, fmt.Errorf("token pool address for ref (%+v) is zero address", tokenPoolRef) } - - token, err := cldf_ops.ExecuteOperation(b, - tpops.GetToken, - chain, - evm_contract.FunctionInput[struct{}]{ - ChainSelector: chain.Selector, - Address: tokenPoolAddr, - Args: struct{}{}, - }, - ) + tokenAddr, err := a.GetTokenAddressFromFullTokenPoolRef(b, chain, tokenPoolRef) if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to get token address via GetToken operation: %w", err) + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token address from token pool ref (%+v): %w", tokenPoolRef, err) } tokenRef = datastore.AddressRef{ ChainSelector: chain.Selector, - Address: token.Output.Hex(), + Address: tokenAddr.Hex(), } } else { tokenRef = tokRef @@ -375,9 +387,7 @@ func (a *EVMAdapter) DeployToken() *cldf_ops.Sequence[tokensapi.DeployTokenInput return DeployToken } -func (a *EVMAdapter) DeployTokenVerify(e deployment.Environment, in any) error { - input := in.(tokensapi.DeployTokenInput) - +func (a *EVMAdapter) DeployTokenVerify(e deployment.Environment, input tokensapi.DeployTokenInput) error { tokenAddr, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, datastore.AddressRef{ ChainSelector: input.ChainSelector, Type: datastore.ContractType(input.Type), @@ -413,7 +423,7 @@ func (a *EVMAdapter) DeployTokenVerify(e deployment.Environment, in any) error { func (a *EVMAdapter) DeployTokenPoolForToken() *cldf_ops.Sequence[tokensapi.DeployTokenPoolInput, sequences.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "evm-adapter:deploy-token-pool-for-token", - tpops.Version, + cciputils.Version_1_6_0, "Deploy a token pool for a token on an EVM chains", func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokensapi.DeployTokenPoolInput) (output sequences.OnChainOutput, err error) { out, err := cldf_ops.ExecuteSequence(b, DeployTokenPool, chains, input) @@ -562,6 +572,51 @@ func (a *EVMAdapter) FindOneTokenAddress(ds datastore.DataStore, chainSelector u return common.BytesToAddress(addr), nil } +func (a *EVMAdapter) GetTokenAddressFromFullTokenPoolRef(b cldf_ops.Bundle, chain evm.Chain, populatedTokenPoolRef datastore.AddressRef) (common.Address, error) { + tokenPoolAddressBytes, err := a.AddressRefToBytes(populatedTokenPoolRef) + if err != nil { + return common.Address{}, fmt.Errorf("failed to convert token pool address ref to bytes: %w", err) + } + + tokenPoolAddress := common.BytesToAddress(tokenPoolAddressBytes) + if tokenPoolAddress == (common.Address{}) { + return common.Address{}, fmt.Errorf("token pool address for ref (%+v) is zero address", populatedTokenPoolRef) + } + + switch populatedTokenPoolRef.Version.String() { + case tpOpsV1_5_1.Version.String(): + if res, err := cldf_ops.ExecuteOperation(b, + tpOpsV1_5_1.GetToken, chain, + evm_contract.FunctionInput[struct{}]{ + ChainSelector: populatedTokenPoolRef.ChainSelector, + Address: tokenPoolAddress, + Args: struct{}{}, + }, + ); err != nil { + return common.Address{}, fmt.Errorf("failed to get token address via GetToken operation (version=%s): %w", tpOpsV1_5_1.Version.String(), err) + } else { + return res.Output, nil + } + case tpOpsV1_6_1.Version.String(): + if res, err := cldf_ops.ExecuteOperation(b, + tpOpsV1_6_1.GetToken, chain, + evm_contract.FunctionInput[struct{}]{ + ChainSelector: populatedTokenPoolRef.ChainSelector, + Address: tokenPoolAddress, + Args: struct{}{}, + }); err != nil { + return common.Address{}, fmt.Errorf("failed to get token address via GetToken operation (version=%s): %w", tpOpsV1_6_1.Version.String(), err) + } else { + return res.Output, nil + } + default: + return common.Address{}, fmt.Errorf( + "unsupported token pool version %s for token pool at address %q on chain selector %d", + populatedTokenPoolRef.Version.String(), tokenPoolAddress.Hex(), populatedTokenPoolRef.ChainSelector, + ) + } +} + func (a *EVMAdapter) FindLatestAddressRef(ds datastore.DataStore, ref datastore.AddressRef) (common.Address, error) { // Define the version range minVersion := semver.MustParse("1.5.0") // inclusive @@ -624,18 +679,61 @@ func (a *EVMAdapter) FindLatestAddressRef(ds datastore.DataStore, ref datastore. return common.BytesToAddress(addrBytes), nil } -func (a *EVMAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokensapi.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains] { +func (a *EVMAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokensapi.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment] { return cldf_ops.NewSequence( "evm-adapter:update-authorities", tarops.Version, "Update authorities for a token and token pool on EVM Chain", - func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokensapi.UpdateAuthoritiesInput) (sequences.OnChainOutput, error) { + func(b cldf_ops.Bundle, e *deployment.Environment, input tokensapi.UpdateAuthoritiesInput) (sequences.OnChainOutput, error) { var result sequences.OnChainOutput - // chain, ok := chains.EVMChains()[input.ChainSelector] - // if !ok { - // return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) - // } + chain, ok := e.BlockChains.EVMChains()[input.ChainSelector] + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) + } + filter := datastore.AddressRef{ + Type: datastore.ContractType(cciputils.RBACTimelock), + ChainSelector: chain.Selector, + Qualifier: cciputils.CLLQualifier, + } + + timelockAddr, err := datastore_utils.FindAndFormatRef( + e.DataStore, + filter, + chain.Selector, + datastore_utils.FullRef, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to find timelock address for chain %d: %w", input.ChainSelector, err) + } + + err = a.InitializeTimelockAddress(*e, mcms.Input{Qualifier: cciputils.CLLQualifier}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to initialize timelock address for chain %d: %w", input.ChainSelector, err) + } + + result, err = sequences.RunAndMergeSequence(b, e.BlockChains, + a.SequenceTransferOwnershipViaMCMS(), + deployops.TransferOwnershipPerChainInput{ + ChainSelector: chain.Selector, + CurrentOwner: chain.DeployerKey.From.Hex(), + ProposedOwner: timelockAddr.Address, + ContractRef: []datastore.AddressRef{input.TokenPoolRef}, + }, result) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to transfer ownership to proposed owner on chain %d: %w", input.ChainSelector, err) + } + result, err = sequences.RunAndMergeSequence(b, e.BlockChains, + a.SequenceAcceptOwnership(), + deployops.TransferOwnershipPerChainInput{ + ChainSelector: chain.Selector, + CurrentOwner: chain.DeployerKey.From.Hex(), + ProposedOwner: timelockAddr.Address, + ContractRef: []datastore.AddressRef{input.TokenPoolRef}, + }, result) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to accept ownership on chain %d: %w", input.ChainSelector, err) + } return result, nil }) } diff --git a/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go b/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go index 3a5d3baad6..8698c6f815 100644 --- a/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go +++ b/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go @@ -379,7 +379,7 @@ func (a *EVMAdapter) GetTokenExpansionConfig() tokensapi.TokenExpansionInputPerC mintAmnt := new(big.Int).Mul(oneToken, big.NewInt(1_000_000)) // pre-mint 1 million tokens return tokensapi.TokenExpansionInputPerChain{ - TokenPoolVersion: cciputils.Version_1_5_1, + TokenPoolVersion: cciputils.Version_1_5_1, DeployTokenInput: &tokensapi.DeployTokenInput{ Decimals: deci, Symbol: "TEST_TOKEN_" + suffix, @@ -391,7 +391,6 @@ func (a *EVMAdapter) GetTokenExpansionConfig() tokensapi.TokenExpansionInputPerC ExternalAdmin: "", // not needed for tests DisableFreezeAuthority: false, // not applicable for EVM TokenPrivKey: "", // not applicable for EVM - CCIPAdmin: admin, // deployer is the admin (if empty defaults to timelock) }, DeployTokenPoolInput: &tokensapi.DeployTokenPoolInput{ PoolType: cciputils.BurnMintTokenPool.String(), @@ -399,7 +398,6 @@ func (a *EVMAdapter) GetTokenExpansionConfig() tokensapi.TokenExpansionInputPerC }, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: a.Selector, - ExternalAdmin: admin, RegistryRef: datastore.AddressRef{ ChainSelector: a.Selector, Address: registryAddr, diff --git a/chains/evm/deployment/v1_6_1/sequences/token_pool/configure_token_pool_for_remote_chains.go b/chains/evm/deployment/v1_6_1/sequences/token_pool/configure_token_pool_for_remote_chains.go new file mode 100644 index 0000000000..aec6c6ae72 --- /dev/null +++ b/chains/evm/deployment/v1_6_1/sequences/token_pool/configure_token_pool_for_remote_chains.go @@ -0,0 +1,269 @@ +package token_pool + +import ( + "bytes" + "fmt" + "slices" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + tpops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/operations/token_pool" + + // NOTE: the token pool contracts for v1.6.1 are still children of the abstract v1.5.1 + // TokenPool.sol contract so we can still use the 1.5.1 bindings to read onchain state + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + + tokensapi "github.com/smartcontractkit/chainlink-ccip/deployment/tokens" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" +) + +type ConfigureTokenPoolForRemoteChainsInput struct { + TokenPoolAddress common.Address + TokenPoolVersion *semver.Version + RemoteChains map[uint64]tokensapi.RemoteChainConfig[[]byte, string] +} + +type ConfigureTokenPoolForRemoteChainInput struct { + TokenPoolAddress common.Address + TokenPoolVersion *semver.Version + RemoteChainSelector uint64 + RemoteChainConfig tokensapi.RemoteChainConfig[[]byte, string] +} + +// ConfigureTokenPoolForRemoteChains configures a token pool on an EVM chain for cross- +// chain token transfers with other remote chains. It's capable of configuring multiple +// remote chains with a single invocation. +var ConfigureTokenPoolForRemoteChains = cldf_ops.NewSequence( + "token-pool:configure-token-pool-for-remote-chains", + tpops.Version, + "Configure a token on an EVM chain for cross-chain transfers", + func(b cldf_ops.Bundle, chain evm.Chain, input ConfigureTokenPoolForRemoteChainsInput) (sequences.OnChainOutput, error) { + // NOTE: this sequence will be called repeatedly as part of a larger changeset (e.g. + // ConfigureTokensForTransfers) so we intentionally use the direct contract bindings + // over ExecuteOperation to avoid the possibility of reading stale onchain data from + // the operation reports cache. + tokenPool, err := token_pool.NewTokenPool(input.TokenPoolAddress, chain.Client) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to instantiate token pool contract: %w", err) + } + + tokenAddress, err := tokenPool.GetToken(&bind.CallOpts{Context: b.GetContext()}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token from token pool: %w", err) + } + + isSupported, err := tokenPool.IsSupportedToken(&bind.CallOpts{Context: b.GetContext()}, tokenAddress) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to check if token is supported: %w", err) + } + if !isSupported { + return sequences.OnChainOutput{}, fmt.Errorf("token %s is not supported by token pool %s", tokenAddress.Hex(), input.TokenPoolAddress) + } + + batchOps := make([]mcms_types.BatchOperation, 0) + for remoteChainSelector, remoteChainConfig := range input.RemoteChains { + report, err := cldf_ops.ExecuteSequence(b, + ConfigureTokenPoolForRemoteChain, + chain, + ConfigureTokenPoolForRemoteChainInput{ + TokenPoolAddress: tokenPool.Address(), + TokenPoolVersion: input.TokenPoolVersion, + RemoteChainSelector: remoteChainSelector, + RemoteChainConfig: remoteChainConfig, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to configure token pool for remote chain %d: %w", remoteChainSelector, err) + } + + batchOps = append(batchOps, report.Output.BatchOps...) + } + + return sequences.OnChainOutput{BatchOps: batchOps}, nil + }) + +// ConfigureTokenPoolForRemoteChain is a helper sequence that performs the logic for +// configuring a token pool for a SINGLE remote chain. The sequence allows the upper +// level ConfigureTokenPoolForRemoteChains sequence to handle multiple remote chains +var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( + "token-pool:configure-token-pool-for-remote-chain", + tpops.Version, + "Configures a token pool on an EVM chain for transfers with other chains", + func(b cldf_ops.Bundle, chain evm.Chain, input ConfigureTokenPoolForRemoteChainInput) (sequences.OnChainOutput, error) { + // Below, we read onchain state directly from the contract binding. We intentionally + // avoid the use of ExecuteOperation because it could return stale onchain data from + // the operations reports cache if this sequence is called as part of a broader, and + // more complex changeset that repeatedly reads and writes to the same config during + // execution (e.g. ConfigureTokensForTransfers) + tp, err := token_pool.NewTokenPool(input.TokenPoolAddress, chain.Client) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to instantiate token pool contract: %w", err) + } + sc, err := tp.GetSupportedChains(&bind.CallOpts{Context: b.GetContext()}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get supported chains: %w", err) + } + localDecimals, err := tp.GetTokenDecimals(&bind.CallOpts{Context: b.GetContext()}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token decimals: %w", err) + } + + inputORL, inputIRL := tokensapi.GenerateTPRLConfigs( + input.RemoteChainConfig.OutboundRateLimiterConfig, + input.RemoteChainConfig.InboundRateLimiterConfig, + localDecimals, + input.RemoteChainConfig.RemoteDecimals, + chain.Family(), + input.TokenPoolVersion, + ) + + // Token pool remote chain configuration can vary depending on whether the remote + // pool is or isn't supported. The different cases to consider are recorded below + // in the code. + reportWrites := []contract.WriteOutput{} + remotesToDel := []uint64{} + if slices.Contains(sc, input.RemoteChainSelector) { + remoteToken, err := tp.GetRemoteToken(&bind.CallOpts{Context: b.GetContext()}, input.RemoteChainSelector) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get remote token: %w", err) + } + + // Token pool remote chain configuration can also vary depending on whether the + // remote token matches or not - see comment further below for more details. + if !bytes.Equal(remoteToken, input.RemoteChainConfig.RemoteToken) { + // If the remote token onchain is different from the one provided as input, then we + // need to ensure that ApplyChainUpdates removes any existing config for the remote + // chain before a new one is used. + remotesToDel = []uint64{input.RemoteChainSelector} + } else { + // If the remote token onchain matches the one provided as input, then we won't call + // ApplyChainUpdates and instead handle the onchain updates via SetRateLimiterConfig + // and AddRemotePool. + remoteTP := input.RemoteChainConfig.RemotePool + remoteCS := input.RemoteChainSelector + + // Query rate limits and remote pools + onchainORL, err := tp.GetCurrentOutboundRateLimiterState(&bind.CallOpts{Context: b.GetContext()}, remoteCS) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get outbound rate limiter state: %w", err) + } + onchainIRL, err := tp.GetCurrentInboundRateLimiterState(&bind.CallOpts{Context: b.GetContext()}, remoteCS) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get inbound rate limiter state: %w", err) + } + remoteTPs, err := tp.GetRemotePools(&bind.CallOpts{Context: b.GetContext()}, remoteCS) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get remote token pools: %w", err) + } + + // Check if the provided outbound RL matches the onchain outbound RL + isOutboundEqual := inputORL.IsEnabled == onchainORL.IsEnabled && + inputORL.Capacity.Cmp(onchainORL.Capacity) == 0 && + inputORL.Rate.Cmp(onchainORL.Rate) == 0 + + // Check if the provided inbound RL matches the onchain inbound RL + isInboundEqual := inputIRL.IsEnabled == onchainIRL.IsEnabled && + inputIRL.Capacity.Cmp(onchainIRL.Capacity) == 0 && + inputIRL.Rate.Cmp(onchainIRL.Rate) == 0 + + // Check if the provided remote token pool is already registered onchain + hasRemoteTP := slices.ContainsFunc(remoteTPs, func(rtp []byte) bool { + return bytes.Equal(rtp, remoteTP) + }) + + // If either rate limiter config is different, then update it + if !isOutboundEqual || !isInboundEqual { + report, err := cldf_ops.ExecuteOperation(b, tpops.SetChainRateLimiterConfig, chain, contract.FunctionInput[tpops.SetChainRateLimiterConfigArgs]{ + ChainSelector: chain.Selector, + Address: input.TokenPoolAddress, + Args: tpops.SetChainRateLimiterConfigArgs{ + OutboundConfig: tpops.Config{IsEnabled: inputORL.IsEnabled, Capacity: inputORL.Capacity, Rate: inputORL.Rate}, + InboundConfig: tpops.Config{IsEnabled: inputIRL.IsEnabled, Capacity: inputIRL.Capacity, Rate: inputIRL.Rate}, + RemoteChainSelector: remoteCS, + }, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to set rate limiter config: %w", err) + } + reportWrites = append(reportWrites, report.Output) + } + + // If the remote token pool is not registered, then add it + if !hasRemoteTP { + report, err := cldf_ops.ExecuteOperation(b, tpops.AddRemotePool, chain, contract.FunctionInput[tpops.AddRemotePoolArgs]{ + ChainSelector: chain.Selector, + Address: input.TokenPoolAddress, + Args: tpops.AddRemotePoolArgs{ + RemoteChainSelector: remoteCS, + RemotePoolAddress: remoteTP, + }, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to add remote token pool: %w", err) + } + reportWrites = append(reportWrites, report.Output) + } + } + } + + // Three cases to consider here: + // -- + // 1. The chain is not supported yet in which case the only thing that's needed is to add + // it via ApplyChainUpdates. No removals are necessary, and rate limiters will be set. + // -- + // 2. The chain is already supported AND the input remote token EQUALS the onchain remote + // token. In this case, we need to ensure that any existing remote configs are removed + // before adding a new one via ApplyChainUpdates. + // -- + // 3. The chain is already supported AND the input remote token DIFFERS from the onchain + // remote token. In this case, we will never call ApplyChainUpdates. Instead, we will + // update on chain state purely using SetRateLimiterConfig and AddRemotePool above. + // + if len(reportWrites) == 0 { + paddedRemoteTokenPoolAddress := common.LeftPadBytes(input.RemoteChainConfig.RemotePool, 32) + applyChainUpdatesInput := contract.FunctionInput[tpops.ApplyChainUpdatesArgs]{ + ChainSelector: chain.Selector, + Address: input.TokenPoolAddress, + Args: tpops.ApplyChainUpdatesArgs{ + RemoteChainSelectorsToRemove: remotesToDel, + ChainsToAdd: []tpops.ChainUpdate{ + { + RemotePoolAddresses: [][]byte{paddedRemoteTokenPoolAddress}, + RemoteChainSelector: input.RemoteChainSelector, + RemoteTokenAddress: input.RemoteChainConfig.RemoteToken, + OutboundRateLimiterConfig: tpops.Config{ + IsEnabled: inputORL.IsEnabled, + Capacity: inputORL.Capacity, + Rate: inputORL.Rate, + }, + InboundRateLimiterConfig: tpops.Config{ + IsEnabled: inputIRL.IsEnabled, + Capacity: inputIRL.Capacity, + Rate: inputIRL.Rate, + }, + }, + }, + }, + } + + report, err := cldf_ops.ExecuteOperation(b, tpops.ApplyChainUpdates, chain, applyChainUpdatesInput) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to apply chain updates: %w", err) + } + + reportWrites = append(reportWrites, report.Output) + } + + batchOp, err := contract.NewBatchOperationFromWrites(reportWrites) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation: %w", err) + } + + return sequences.OnChainOutput{BatchOps: []mcms_types.BatchOperation{batchOp}}, nil + }) diff --git a/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go b/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go index f222d3d345..3bc3e0446d 100644 --- a/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go +++ b/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go @@ -500,6 +500,58 @@ var AcceptOwnershipBurnMint = operations.NewOperation( }, ) +var UpdateRateLimitAdminBurnMint = operations.NewOperation( + "burnmint:update-rate-limit-admin", + common_utils.Version_1_6_0, + "Updates the rate limit admin for a BurnMintTokenPool remote chain config", + func(b operations.Bundle, chain cldf_solana.Chain, input TokenPoolTransferOwnershipInput) (sequences.OnChainOutput, error) { + burnmint_token_pool.SetProgramID(input.Program) + authority, err := GetAuthorityBurnMint(chain, input.Program, input.TokenMint) + if err != nil { + // assume the authority is the upgrade authority if we fail to fetch the current authority, since the pool might not be initialized yet and there won't be an authority set on-chain yet (since the config account won't exist until initialization) + authority, err = utils.GetUpgradeAuthority(chain.Client, input.Program) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get upgrade authority for burn mint token pool: %w", err) + } + // if we had to assume the authority, then the pool isn't initialized yet and therefore + // there won't be an authority set on-chain yet, so we can skip the update since the initializer + // will be able to set the correct authority during initialization + if authority == input.NewOwner { + b.Logger.Info("New owner is the same as the current owner for burn mint token pool with token mint:", input.TokenMint.String()) + return sequences.OnChainOutput{}, nil + } + } + poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) + ixn, err := burnmint_token_pool.NewSetRateLimitAdminInstruction( + input.TokenMint, + input.NewOwner, + poolConfigPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build update rate limit admin instruction: %w", err) + } + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{ixn}, + input.Program.String(), + common_utils.BurnMintTokenPool.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to execute or create batch: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{ixn}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm update rate limit admin: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + func GetAuthorityBurnMint(chain cldf_solana.Chain, program solana.PublicKey, tokenMint solana.PublicKey) (solana.PublicKey, error) { programData := burnmint_token_pool.State{} poolConfigPDA, _ := tokens.TokenPoolConfigAddress(tokenMint, program) diff --git a/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go b/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go index 3a44e4a8a9..4b6c490612 100644 --- a/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go +++ b/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go @@ -443,6 +443,58 @@ var AcceptOwnershipLockRelease = operations.NewOperation( }, ) +var UpdateRateLimitAdminLockRelease = operations.NewOperation( + "lockrelease:update-rate-limit-admin", + common_utils.Version_1_6_0, + "Updates the rate limit admin for a LockReleaseTokenPool remote chain config", + func(b operations.Bundle, chain cldf_solana.Chain, input TokenPoolTransferOwnershipInput) (sequences.OnChainOutput, error) { + lockrelease_token_pool.SetProgramID(input.Program) + authority, err := GetAuthorityLockRelease(chain, input.Program, input.TokenMint) + if err != nil { + // assume the authority is the upgrade authority if we fail to fetch the current authority, since the pool might not be initialized yet and there won't be an authority set on-chain yet (since the config account won't exist until initialization) + authority, err = utils.GetUpgradeAuthority(chain.Client, input.Program) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get upgrade authority for lock release token pool: %w", err) + } + // if we had to assume the authority, then the pool isn't initialized yet and therefore + // there won't be an authority set on-chain yet, so we can skip the update since the initializer + // will be able to set the correct authority during initialization + if authority == input.NewOwner { + b.Logger.Info("New owner is the same as the current owner for lock release token pool with token mint:", input.TokenMint.String()) + return sequences.OnChainOutput{}, nil + } + } + poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) + ixn, err := lockrelease_token_pool.NewSetRateLimitAdminInstruction( + input.TokenMint, + input.NewOwner, + poolConfigPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build update rate limit admin instruction: %w", err) + } + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{ixn}, + input.Program.String(), + common_utils.LockReleaseTokenPool.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to execute or create batch: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{ixn}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm update rate limit admin: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + func GetAuthorityLockRelease(chain cldf_solana.Chain, program solana.PublicKey, tokenMint solana.PublicKey) (solana.PublicKey, error) { programData := lockrelease_token_pool.State{} poolConfigPDA, _ := tokens.TokenPoolConfigAddress(tokenMint, program) diff --git a/chains/solana/deployment/v1_6_0/sequences/tokens.go b/chains/solana/deployment/v1_6_0/sequences/tokens.go index 483c27c848..1f82af18cc 100644 --- a/chains/solana/deployment/v1_6_0/sequences/tokens.go +++ b/chains/solana/deployment/v1_6_0/sequences/tokens.go @@ -274,9 +274,9 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR result.BatchOps = append(result.BatchOps, initTPOut.Output.BatchOps...) transferOwnershipOut, err := operations.ExecuteOperation(b, transferOwnershipTPOp, chains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ - Program: tokenPool, - NewOwner: solana.MustPublicKeyFromBase58(input.ProposedOwner), - TokenMint: tokenMint, + Program: tokenPool, + NewOwner: solana.MustPublicKeyFromBase58(input.ProposedOwner), + TokenMint: tokenMint, }) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to transfer ownership: %w", err) @@ -430,7 +430,7 @@ func (a *SolanaAdapter) DeployToken() *cldf_ops.Sequence[tokenapi.DeployTokenInp ) } -func (a *SolanaAdapter) DeployTokenVerify(e deployment.Environment, in any) error { +func (a *SolanaAdapter) DeployTokenVerify(e deployment.Environment, in tokenapi.DeployTokenInput) error { return nil } @@ -570,29 +570,30 @@ func getTokenMintAndTokenProgram(store datastore.DataStore, tokenRef datastore.A return tokenAddr, tokenProgramId, nil } -func (a *SolanaAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokenapi.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains] { +func (a *SolanaAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokenapi.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment] { return cldf_ops.NewSequence( "svm-adapter:update-authorities", common_utils.Version_1_6_0, "Update authorities for a token and token pool on Solana Chain", - func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input tokenapi.UpdateAuthoritiesInput) (sequences.OnChainOutput, error) { + func(b cldf_ops.Bundle, e *deployment.Environment, input tokenapi.UpdateAuthoritiesInput) (sequences.OnChainOutput, error) { var result sequences.OnChainOutput - chain, ok := chains.SolanaChains()[input.ChainSelector] + chain, ok := e.BlockChains.SolanaChains()[input.ChainSelector] if !ok { return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) } - tokenRef, _, err := getTokenMintAndTokenProgram(input.ExistingDataStore, input.TokenRef, chain) + ds := e.DataStore + tokenRef, _, err := getTokenMintAndTokenProgram(ds, input.TokenRef, chain) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to get token and token program address using the specified reference (%+v): %w", input.TokenRef, err) } timelockSigner := utils.GetTimelockSignerPDA( - input.ExistingDataStore.Addresses().Filter(), + ds.Addresses().Filter(), chain.Selector, common_utils.CLLQualifier, ) - tokenPoolRef, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, input.TokenPoolRef, chain.Selector, datastore_utils.FullRef) + tokenPoolRef, err := datastore_utils.FindAndFormatRef(ds, input.TokenPoolRef, chain.Selector, datastore_utils.FullRef) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to find token pool address using the specified reference (%+v): %w", input.TokenPoolRef, err) } @@ -601,21 +602,34 @@ func (a *SolanaAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokenapi.UpdateAu transferOwnershipTPOp := tokenpoolops.TransferOwnershipBurnMint acceptOwnershipTPOp := tokenpoolops.AcceptOwnershipBurnMint + tprlAdminTPOp := tokenpoolops.UpdateRateLimitAdminBurnMint switch tokenPoolRef.Type.String() { case common_utils.BurnMintTokenPool.String(): // Already set to burn mint case common_utils.LockReleaseTokenPool.String(): transferOwnershipTPOp = tokenpoolops.TransferOwnershipLockRelease acceptOwnershipTPOp = tokenpoolops.AcceptOwnershipLockRelease + tprlAdminTPOp = tokenpoolops.UpdateRateLimitAdminLockRelease default: return sequences.OnChainOutput{}, fmt.Errorf("unsupported token pool type '%s' for Solana", tokenPoolRef.Type) } + tprlAdminOut, err := operations.ExecuteOperation(b, tprlAdminTPOp, e.BlockChains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ + Program: tokenPool, + TokenMint: tokenMint, + NewOwner: timelockSigner, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to update TPRL admin: %w", err) + } + result.Addresses = append(result.Addresses, tprlAdminOut.Output.Addresses...) + result.BatchOps = append(result.BatchOps, tprlAdminOut.Output.BatchOps...) + b.Logger.Infof("Transferring ownership of token pool %s to timelock signer %s", tokenPool.String(), timelockSigner.String()) - transferOwnershipOut, err := operations.ExecuteOperation(b, transferOwnershipTPOp, chains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ - Program: tokenPool, - NewOwner: timelockSigner, - TokenMint: tokenMint, + transferOwnershipOut, err := operations.ExecuteOperation(b, transferOwnershipTPOp, e.BlockChains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ + Program: tokenPool, + NewOwner: timelockSigner, + TokenMint: tokenMint, }) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to transfer ownership: %w", err) @@ -624,10 +638,10 @@ func (a *SolanaAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokenapi.UpdateAu result.BatchOps = append(result.BatchOps, transferOwnershipOut.Output.BatchOps...) b.Logger.Infof("Accepting ownership of token pool %s by timelock signer %s", tokenPool.String(), timelockSigner.String()) - acceptOwnershipOut, err := operations.ExecuteOperation(b, acceptOwnershipTPOp, chains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ - Program: tokenPool, - NewOwner: timelockSigner, - TokenMint: tokenMint, + acceptOwnershipOut, err := operations.ExecuteOperation(b, acceptOwnershipTPOp, e.BlockChains.SolanaChains()[chain.Selector], tokenpoolops.TokenPoolTransferOwnershipInput{ + Program: tokenPool, + NewOwner: timelockSigner, + TokenMint: tokenMint, }) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to accept ownership: %w", err) diff --git a/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go b/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go index d351b2a329..9cdd6752f6 100644 --- a/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go +++ b/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go @@ -530,7 +530,6 @@ func (a *SVMAdapter) GetTokenExpansionConfig() tokensapi.TokenExpansionInputPerC ExternalAdmin: "", // not needed for tests DisableFreezeAuthority: false, // don't revoke freeze authority after token creation TokenPrivKey: "", // if empty, a new keypair will be generated - CCIPAdmin: admin, // deployer is the admin (if empty defaults to timelock) }, DeployTokenPoolInput: &tokensapi.DeployTokenPoolInput{ PoolType: cciputils.BurnMintTokenPool.String(), @@ -538,7 +537,6 @@ func (a *SVMAdapter) GetTokenExpansionConfig() tokensapi.TokenExpansionInputPerC }, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: a.Selector, - ExternalAdmin: admin, RegistryRef: datastore.AddressRef{ ChainSelector: a.Selector, Address: registryAddr, diff --git a/deployment/tokens/configure_tokens_for_transfers.go b/deployment/tokens/configure_tokens_for_transfers.go index 2c03838cdb..d594fec3f9 100644 --- a/deployment/tokens/configure_tokens_for_transfers.go +++ b/deployment/tokens/configure_tokens_for_transfers.go @@ -63,62 +63,64 @@ func makeApply(tokenRegistry *TokenAdapterRegistry, mcmsRegistry *changesets.MCM for _, config := range cfg.Tokens { configs[config.ChainSelector] = config } - batchOps, reports, err := processTokenConfigForChain(e, configs, cfg.ChainAdapterVersion) + batchOps, reports, ds, err := processTokenConfigForChain(e, configs, cfg.ChainAdapterVersion) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to process token configs for chains: %w", err) } return changesets.NewOutputBuilder(e, mcmsRegistry). WithReports(reports). WithBatchOps(batchOps). + WithDataStore(ds). Build(cfg.MCMS) } } -func processTokenConfigForChain(e deployment.Environment, cfg map[uint64]TokenTransferConfig, chainAdapterVersion *semver.Version) ([]mcms_types.BatchOperation, []cldf_ops.Report[any, any], error) { +func processTokenConfigForChain(e deployment.Environment, cfg map[uint64]TokenTransferConfig, chainAdapterVersion *semver.Version) ([]mcms_types.BatchOperation, []cldf_ops.Report[any, any], *datastore.MemoryDataStore, error) { tokenRegistry := GetTokenAdapterRegistry() batchOps := make([]mcms_types.BatchOperation, 0) reports := make([]cldf_ops.Report[any, any], 0) + ds := datastore.NewMemoryDataStore() for selector, token := range cfg { tokenPool, err := datastore_utils.FindAndFormatRef(e.DataStore, token.TokenPoolRef, selector, datastore_utils.FullRef) if err != nil { - return nil, nil, fmt.Errorf("failed to resolve token pool ref on chain with selector %d: %w", selector, err) + return nil, nil, nil, fmt.Errorf("failed to resolve token pool ref on chain with selector %d: %w", selector, err) } registry, err := datastore_utils.FindAndFormatRef(e.DataStore, token.RegistryRef, selector, datastore_utils.FullRef) if err != nil { - return nil, nil, fmt.Errorf("failed to resolve registry ref on chain with selector %d: %w", selector, err) + return nil, nil, nil, fmt.Errorf("failed to resolve registry ref on chain with selector %d: %w", selector, err) } family, err := chain_selectors.GetSelectorFamily(selector) if err != nil { - return nil, nil, fmt.Errorf("failed to get chain family for chain selector %d: %w", selector, err) + return nil, nil, nil, fmt.Errorf("failed to get chain family for chain selector %d: %w", selector, err) } adapter, ok := tokenRegistry.GetTokenAdapter(family, chainAdapterVersion) if !ok { - return nil, nil, fmt.Errorf("no token adapter registered for chain family '%s' and chain adapter version '%s'", family, chainAdapterVersion) + return nil, nil, nil, fmt.Errorf("no token adapter registered for chain family '%s' and chain adapter version '%s'", family, chainAdapterVersion) } remoteChains := make(map[uint64]RemoteChainConfig[[]byte, string], len(token.RemoteChains)) for remoteChainSelector, inCfg := range token.RemoteChains { remoteFamily, err := chain_selectors.GetSelectorFamily(remoteChainSelector) if err != nil { - return nil, nil, fmt.Errorf("failed to get chain family for remote chain selector %d: %w", remoteChainSelector, err) + return nil, nil, nil, fmt.Errorf("failed to get chain family for remote chain selector %d: %w", remoteChainSelector, err) } remoteAdapter, ok := tokenRegistry.GetTokenAdapter(remoteFamily, chainAdapterVersion) if !ok { - return nil, nil, fmt.Errorf("no token adapter registered for chain family '%s' and chain adapter version '%s'", remoteFamily, chainAdapterVersion) + return nil, nil, nil, fmt.Errorf("no token adapter registered for chain family '%s' and chain adapter version '%s'", remoteFamily, chainAdapterVersion) } counterpart, ok := cfg[remoteChainSelector] if !ok { - return nil, nil, fmt.Errorf("missing token transfer config for remote chain selector %d", remoteChainSelector) + return nil, nil, nil, fmt.Errorf("missing token transfer config for remote chain selector %d", remoteChainSelector) } counterpartRemoteChainCfg, ok := counterpart.RemoteChains[selector] if !ok { - return nil, nil, fmt.Errorf("missing remote chain config for chain selector %d in token transfer config for remote chain selector %d", selector, remoteChainSelector) + return nil, nil, nil, fmt.Errorf("missing remote chain config for chain selector %d in token transfer config for remote chain selector %d", selector, remoteChainSelector) } remoteChains[remoteChainSelector], err = convertRemoteChainConfig(e, remoteAdapter, selector, remoteChainSelector, inCfg, counterpartRemoteChainCfg.OutboundRateLimiterConfig) if err != nil { - return nil, nil, fmt.Errorf("failed to process remote chain config for remote chain selector %d: %w", remoteChainSelector, err) + return nil, nil, nil, fmt.Errorf("failed to process remote chain config for remote chain selector %d: %w", remoteChainSelector, err) } } @@ -133,13 +135,18 @@ func processTokenConfigForChain(e deployment.Environment, cfg map[uint64]TokenTr ExistingDataStore: e.DataStore, }) if err != nil { - return batchOps, reports, fmt.Errorf("failed to configure token pool on chain with selector %d: %w", selector, err) + return batchOps, reports, nil, fmt.Errorf("failed to configure token pool on chain with selector %d: %w", selector, err) } batchOps = append(batchOps, configureTokenReport.Output.BatchOps...) reports = append(reports, configureTokenReport.ExecutionReports...) + for _, r := range configureTokenReport.Output.Addresses { + if err := ds.Addresses().Add(r); err != nil { + return nil, nil, nil, fmt.Errorf("failed to add address %s to datastore: %w", r.Address, err) + } + } } - return batchOps, reports, nil + return batchOps, reports, ds, nil } func convertRemoteChainConfig( diff --git a/deployment/tokens/configure_tokens_for_transfers_test.go b/deployment/tokens/configure_tokens_for_transfers_test.go index 113ecdbe7e..83ec139f2a 100644 --- a/deployment/tokens/configure_tokens_for_transfers_test.go +++ b/deployment/tokens/configure_tokens_for_transfers_test.go @@ -144,7 +144,7 @@ func (ma *transfersTest_MockTokenAdapter) DeployToken() *cldf_ops.Sequence[token return &cldf_ops.Sequence[tokens.DeployTokenInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} } -func (ma *transfersTest_MockTokenAdapter) DeployTokenVerify(e deployment.Environment, in any) error { +func (ma *transfersTest_MockTokenAdapter) DeployTokenVerify(e deployment.Environment, in tokens.DeployTokenInput) error { return nil } @@ -152,8 +152,8 @@ func (ma *transfersTest_MockTokenAdapter) DeployTokenPoolForToken() *cldf_ops.Se return &cldf_ops.Sequence[tokens.DeployTokenPoolInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} } -func (ma *transfersTest_MockTokenAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains] { - return &cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} +func (ma *transfersTest_MockTokenAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment] { + return &cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment]{} } var basicMCMSInput = mcms.Input{ @@ -494,38 +494,10 @@ func TestConfigureTokensForTransfers_Apply(t *testing.T) { }, }, }, - { - ChainSelector: 15971525489660198786, - TokenPoolRef: datastore.AddressRef{ - Type: "TokenPool", - Version: semver.MustParse("1.0.0"), - ChainSelector: 15971525489660198786, - }, - RegistryRef: datastore.AddressRef{ - Type: "Registry", - Version: semver.MustParse("1.0.0"), - ChainSelector: 15971525489660198786, - }, - RemoteChains: map[uint64]tokens.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ - 5009297550715157269: { - RemoteToken: &datastore.AddressRef{ - Type: "Token", - Version: semver.MustParse("1.0.0"), - ChainSelector: 5009297550715157269, - }, - RemotePool: &datastore.AddressRef{ - Type: "TokenPool", - Version: semver.MustParse("1.0.0"), - ChainSelector: 5009297550715157269, - }, - OutboundRateLimiterConfig: tokens.RateLimiterConfigFloatInput{IsEnabled: false}, - }, - }, - }, }, MCMS: basicMCMSInput, }, - expectedSequenceErrorMsg: "failed to resolve remote pool ref", + expectedSequenceErrorMsg: "missing token transfer config for remote chain", }, { desc: "failure to resolve remote token ref", diff --git a/deployment/tokens/product.go b/deployment/tokens/product.go index 0134963484..ee4311520f 100644 --- a/deployment/tokens/product.go +++ b/deployment/tokens/product.go @@ -39,9 +39,9 @@ type TokenAdapter interface { // SetTokenPoolRateLimits returns a sequence that sets rate limits on a token pool. SetTokenPoolRateLimits() *cldf_ops.Sequence[TPRLRemotes, sequences.OnChainOutput, cldf_chain.BlockChains] DeployToken() *cldf_ops.Sequence[DeployTokenInput, sequences.OnChainOutput, cldf_chain.BlockChains] - DeployTokenVerify(e deployment.Environment, in any) error + DeployTokenVerify(e deployment.Environment, in DeployTokenInput) error DeployTokenPoolForToken() *cldf_ops.Sequence[DeployTokenPoolInput, sequences.OnChainOutput, cldf_chain.BlockChains] - UpdateAuthorities() *cldf_ops.Sequence[UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains] + UpdateAuthorities() *cldf_ops.Sequence[UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment] } // RateLimiterConfig specifies configuration for a rate limiter on a token pool. diff --git a/deployment/tokens/product_test.go b/deployment/tokens/product_test.go index 5d5aab5332..9649205fc9 100644 --- a/deployment/tokens/product_test.go +++ b/deployment/tokens/product_test.go @@ -48,7 +48,7 @@ func (ma *productTest_MockTokenAdapter) DeployToken() *cldf_ops.Sequence[tokens. return &cldf_ops.Sequence[tokens.DeployTokenInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} } -func (ma *productTest_MockTokenAdapter) DeployTokenVerify(e deployment.Environment, in any) error { +func (ma *productTest_MockTokenAdapter) DeployTokenVerify(e deployment.Environment, in tokens.DeployTokenInput) error { return nil } @@ -56,8 +56,8 @@ func (ma *productTest_MockTokenAdapter) DeployTokenPoolForToken() *cldf_ops.Sequ return &cldf_ops.Sequence[tokens.DeployTokenPoolInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} } -func (ma *productTest_MockTokenAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains] { - return &cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, cldf_chain.BlockChains]{} +func (ma *productTest_MockTokenAdapter) UpdateAuthorities() *cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment] { + return &cldf_ops.Sequence[tokens.UpdateAuthoritiesInput, sequences.OnChainOutput, *deployment.Environment]{} } func TestRegisterTokenAdapter(t *testing.T) { diff --git a/deployment/tokens/token_expansion.go b/deployment/tokens/token_expansion.go index 472c84abc8..b49a9acee7 100644 --- a/deployment/tokens/token_expansion.go +++ b/deployment/tokens/token_expansion.go @@ -5,11 +5,12 @@ import ( "math/big" "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" mcms_types "github.com/smartcontractkit/mcms/types" - common_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" @@ -34,6 +35,9 @@ type TokenExpansionInputPerChain struct { DeployTokenPoolInput *DeployTokenPoolInput `yaml:"deployTokenPoolInput" json:"deployTokenPoolInput"` // if not nil, will try to fully configure the token for transfers, including registering the token and token pool on-chain and setting the pool on the token TokenTransferConfig *TokenTransferConfig `yaml:"tokenTransferConfig" json:"tokenTransferConfig"` + // if true, the ownership transfer to the timelock and acceptance of ownership by the timelock + // will be skipped for token pools at the end of the changeset. + SkipOwnershipTransfer bool `yaml:"skipOwnershipTransfer" json:"skipOwnershipTransfer"` } type DeployTokenInput struct { @@ -108,10 +112,9 @@ type DeployTokenPoolInput struct { type UpdateAuthoritiesInput struct { // below are not specified by the user, filled in by the deployment system to pass to chain operations - ChainSelector uint64 - ExistingDataStore datastore.DataStore - TokenRef datastore.AddressRef - TokenPoolRef datastore.AddressRef + ChainSelector uint64 + TokenRef datastore.AddressRef + TokenPoolRef datastore.AddressRef } func TokenExpansion() cldf.ChangeSetV2[TokenExpansionInput] { @@ -134,7 +137,7 @@ func tokenExpansionVerify() func(cldf.Environment, TokenExpansionInput) error { deployTokenInput := input.DeployTokenInput deployTokenInput.ExistingDataStore = e.DataStore deployTokenInput.ChainSelector = selector - err = tokenPoolAdapter.DeployTokenVerify(e, input) + err = tokenPoolAdapter.DeployTokenVerify(e, *deployTokenInput) if err != nil { return fmt.Errorf("failed to verify deploy token input for chain selector %d: %w", selector, err) } @@ -178,9 +181,9 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha // and we may not be able to register the token by CLL in that case. if deployTokenInput.CCIPAdmin == "" { filter := datastore.AddressRef{ - Type: datastore.ContractType(common_utils.RBACTimelock), + Type: datastore.ContractType(utils.RBACTimelock), ChainSelector: deployTokenInput.ChainSelector, - Qualifier: cfg.MCMS.Qualifier, + Qualifier: utils.CLLQualifier, } timelockAddr, err := datastore_utils.FindAndFormatRef( @@ -192,7 +195,7 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf( "couldn't find the RBACTimelock address in datastore for selector %d and qualifier %s: %w", - deployTokenInput.ChainSelector, cfg.MCMS.Qualifier, err, + deployTokenInput.ChainSelector, utils.CLLQualifier, err, ) } @@ -280,6 +283,7 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha // if token transfer config is provided, we will update the remote chain config with the token and token pool addresses and // save the token transfer config for processing after all tokens and token pools have been deployed if input.TokenTransferConfig != nil { + input.TokenTransferConfig.ChainSelector = selector actualPool := tokenPool if actualPool == nil { // if token pool is not deployed by this changeset, we expect the user to provide the token pool address in the TokenTransferConfig @@ -337,12 +341,13 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha } // we process the token configs for transfers, which will register the tokens and token pools on-chain and set the pool on the token if necessary - transferOps, transferReports, err := processTokenConfigForChain(e, allTokenConfigs, cfg.ChainAdapterVersion) + transferOps, transferReports, tokends, err := processTokenConfigForChain(e, allTokenConfigs, cfg.ChainAdapterVersion) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to process token configs for transfers: %w", err) } batchOps = append(batchOps, transferOps...) reports = append(reports, transferReports...) + ds.Merge(tokends.Seal()) // finally, we update the authorities on the tokens if necessary for selector, tokenConfig := range allTokenConfigs { @@ -354,13 +359,35 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha if !exists { return cldf.ChangesetOutput{}, fmt.Errorf("no TokenPoolAdapter registered for chain family '%s'", family) } + fullPoolRef, err := datastore_utils.FindAndFormatRef(e.DataStore, tokenConfig.TokenPoolRef, selector, datastore_utils.FullRef) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to find full token pool ref for chain selector %d: %w", selector, err) + } + fullTokenRef, err := datastore_utils.FindAndFormatRef(e.DataStore, tokenConfig.TokenRef, selector, datastore_utils.FullRef) + if err != nil { + e.Logger.Warnf("failed to find full token ref for chain selector %d, will try to derive it: %v", selector, err) + tokenBytes, err := tokenPoolAdapter.DeriveTokenAddress(e, selector, tokenConfig.TokenPoolRef) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to derive token address for chain selector %d: %w", selector, err) + } + fullTokenRef = datastore.AddressRef{ + ChainSelector: selector, + Type: tokenConfig.TokenRef.Type, + Version: tokenConfig.TokenRef.Version, + Qualifier: tokenConfig.TokenRef.Qualifier, + Address: common.Bytes2Hex(tokenBytes), + } + } + if cfg.TokenExpansionInputPerChain[selector].SkipOwnershipTransfer { + e.Logger.Infof("skipping ownership transfer for token pool %s on chain with selector %d", fullPoolRef, selector) + continue + } updateAuthoritiesInput := UpdateAuthoritiesInput{ - TokenRef: tokenConfig.TokenRef, - TokenPoolRef: tokenConfig.TokenPoolRef, - ChainSelector: selector, - ExistingDataStore: e.DataStore, + TokenRef: fullTokenRef, + TokenPoolRef: fullPoolRef, + ChainSelector: selector, } - updateAuthoritiesReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, tokenPoolAdapter.UpdateAuthorities(), e.BlockChains, updateAuthoritiesInput) + updateAuthoritiesReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, tokenPoolAdapter.UpdateAuthorities(), &e, updateAuthoritiesInput) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to update authorities for token on chain %d: %w", selector, err) } diff --git a/integration-tests/deployment/tokens_and_token_pools_test.go b/integration-tests/deployment/tokens_and_token_pools_test.go index a4f8ee5733..d486e1c3e0 100644 --- a/integration-tests/deployment/tokens_and_token_pools_test.go +++ b/integration-tests/deployment/tokens_and_token_pools_test.go @@ -479,6 +479,7 @@ func TestTokensAndTokenPools(t *testing.T) { output, err = tokensapi.TokenExpansion().Apply(*env, tokensapi.TokenExpansionInput{ TokenExpansionInputPerChain: map[uint64]tokensapi.TokenExpansionInputPerChain{ evmA.Chain.Selector: { + SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmA.Chain.Selector, @@ -512,6 +513,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, }, evmB.Chain.Selector: { + SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmB.Chain.Selector, @@ -866,6 +868,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, }, evmA.Chain.Selector: { + SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmA.Chain.Selector, @@ -899,6 +902,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, }, evmB.Chain.Selector: { + SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmB.Chain.Selector, @@ -957,7 +961,7 @@ func TestTokensAndTokenPools(t *testing.T) { require.NoError(t, stateErr) require.Equal(t, timelockSigner, tokenPoolStateAccountAfter.Config.Owner) require.Equal(t, tokenMint, tokenPoolStateAccountAfter.Config.Mint) - require.Equal(t, chain.DeployerKey.PublicKey(), tokenPoolStateAccountAfter.Config.RateLimitAdmin) + require.Equal(t, timelockSigner, tokenPoolStateAccountAfter.Config.RateLimitAdmin) }) }) } From b5cd1dc065966e660b45f18ef72adc9865513c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tob=C3=ADas=20Lichtig?= Date: Wed, 25 Feb 2026 16:45:31 -0300 Subject: [PATCH 04/41] Fix 1.6.1 commit (#1738) --- chains/solana/deployment/utils/artifact_versions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chains/solana/deployment/utils/artifact_versions.go b/chains/solana/deployment/utils/artifact_versions.go index 42e5a095e6..f92dc4a192 100644 --- a/chains/solana/deployment/utils/artifact_versions.go +++ b/chains/solana/deployment/utils/artifact_versions.go @@ -25,7 +25,7 @@ var VersionToShortCommitSHA = map[string]string{ VersionSolanaV0_1_1TokenPools: "ee587a6c0562", VersionSolanaV0_1_0: "be8d09930aaa", VersionSolanaV1_6_0: "d0d81df31957", - VersionSolanaV1_6_1: "10b851bd2104", + VersionSolanaV1_6_1: "cb23ec38649f", } var VersionToFullCommitSHA = map[string]string{ @@ -34,5 +34,5 @@ var VersionToFullCommitSHA = map[string]string{ VersionSolanaV0_1_1TokenPools: "ee587a6c056204009310019b790ed6d474825316", VersionSolanaV0_1_0: "be8d09930aaaae31b574ef316ca73021fe272b08", VersionSolanaV1_6_0: "d0d81df3195728091cad1b0569a2980201a92e97", - VersionSolanaV1_6_1: "10b851bd210430f58f2cbb507fe76be9a366571c", + VersionSolanaV1_6_1: "cb23ec38649f9d23aabd0350e30d3d649ebc2174", } From a4824ec152fa7235a1ff770bc617ba5477f25090 Mon Sep 17 00:00:00 2001 From: Chunkai Yang Date: Thu, 26 Feb 2026 05:21:33 -0800 Subject: [PATCH 05/41] Implement disable lane (#1741) * Implement disable lane * extend existing adaptor as opposed to creating new one * cleaner file names --- .gitignore | 1 + .../v1_6_0/sequences/disable_remote_chain.go | 51 ++++++ .../operations/fee_quoter/fee_quoter.go | 46 +++++ .../v1_6_0/operations/offramp/offramp.go | 46 +++++ .../v1_6_0/sequences/disable_remote_chain.go | 63 +++++++ deployment/lanes/disable_lane.go | 130 ++++++++++++++ deployment/lanes/product.go | 1 + .../deployment/connect_chains_test.go | 160 ++++++++++++++++++ 8 files changed, 498 insertions(+) create mode 100644 chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go create mode 100644 chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go create mode 100644 deployment/lanes/disable_lane.go diff --git a/.gitignore b/.gitignore index 728c19367d..07bd29f106 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ gcr_creds.env devenv/tests/e2e/blockscout devenv/env-out.toml .cursorrules +.claude diff --git a/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go new file mode 100644 index 0000000000..77e99804de --- /dev/null +++ b/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go @@ -0,0 +1,51 @@ +package sequences + +import ( + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + + "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" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +var DisableRemoteChainSequence = operations.NewSequence( + "DisableRemoteChain", + semver.MustParse("1.6.0"), + "Disables both sending to and receiving from a remote chain on an EVM chain via router updates", + func(b operations.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { + var result sequences.OnChainOutput + b.Logger.Infof("EVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + result, err := sequences.RunAndMergeSequence(b, chains, RouterApplyRampUpdatesSequence, RouterApplyRampUpdatesSequenceInput{ + Address: common.BytesToAddress(input.Router), + ChainSelector: input.LocalChainSelector, + UpdatesByChain: router.ApplyRampsUpdatesArgs{ + OnRampUpdates: []router.OnRamp{ + { + DestChainSelector: input.RemoteChainSelector, + OnRamp: common.HexToAddress("0x0"), + }, + }, + OffRampRemoves: []router.OffRamp{ + { + SourceChainSelector: input.RemoteChainSelector, + OffRamp: common.BytesToAddress(input.OffRamp), + }, + }, + }, + }, result) + if err != nil { + return result, err + } + b.Logger.Infof("Remote chain %d disabled on EVM chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + return result, nil + }, +) + +func (a *EVMAdapter) DisableRemoteChain() *operations.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { + return DisableRemoteChainSequence +} diff --git a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go index 801c235a16..5c309f865c 100644 --- a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go +++ b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go @@ -185,6 +185,52 @@ var ConnectChains = operations.NewOperation( }, ) +type DisableDestChainParams struct { + FeeQuoter solana.PublicKey + RemoteChainSelector uint64 +} + +var DisableDestChain = operations.NewOperation( + "fee-quoter:disable-dest-chain", + Version, + "Disables a destination chain on the FeeQuoter, preventing sending to that chain", + func(b operations.Bundle, chain cldf_solana.Chain, input DisableDestChainParams) (sequences.OnChainOutput, error) { + fee_quoter.SetProgramID(input.FeeQuoter) + authority := GetAuthority(chain, input.FeeQuoter) + feeQuoterConfigPDA, _, _ := state.FindFqConfigPDA(input.FeeQuoter) + fqDestChainPDA, _, _ := state.FindFqDestChainPDA(input.RemoteChainSelector, input.FeeQuoter) + + instruction, err := fee_quoter.NewDisableDestChainInstruction( + input.RemoteChainSelector, + feeQuoterConfigPDA, + fqDestChainPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable dest chain instruction: %w", err) + } + + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{instruction}, + input.FeeQuoter.String(), + ContractType.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable dest chain: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{instruction}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable dest chain: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + var TransferOwnership = operations.NewOperation( "fee-quoter:transfer-ownership", Version, diff --git a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go index 26bf4138c5..42942422f0 100644 --- a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go +++ b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go @@ -242,6 +242,52 @@ var ConnectChains = operations.NewOperation( }, ) +type DisableSourceChainParams struct { + OffRamp solana.PublicKey + RemoteChainSelector uint64 +} + +var DisableSourceChain = operations.NewOperation( + "off-ramp:disable-source-chain", + Version, + "Disables a source chain on the OffRamp, preventing receiving from that chain", + func(b operations.Bundle, chain cldf_solana.Chain, input DisableSourceChainParams) (sequences.OnChainOutput, error) { + ccip_offramp.SetProgramID(input.OffRamp) + authority := GetAuthority(chain, input.OffRamp) + offRampConfigPDA, _, _ := state.FindOfframpConfigPDA(input.OffRamp) + offRampSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(input.RemoteChainSelector, input.OffRamp) + + instruction, err := ccip_offramp.NewDisableSourceChainSelectorInstruction( + input.RemoteChainSelector, + offRampSourceChainPDA, + offRampConfigPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable source chain instruction: %w", err) + } + + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{instruction}, + input.OffRamp.String(), + ContractType.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable source chain: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{instruction}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable source chain: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + var SetOcr3 = operations.NewOperation( "off-ramp:set-ocr3", Version, diff --git a/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go new file mode 100644 index 0000000000..87ab822010 --- /dev/null +++ b/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go @@ -0,0 +1,63 @@ +package sequences + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/gagliardetto/solana-go" + + fqops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/fee_quoter" + offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" + "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +var DisableRemoteChainSequence = cldf_ops.NewSequence( + "DisableRemoteChain", + semver.MustParse("1.6.0"), + "Disables both sending to and receiving from a remote chain on a Solana chain", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { + var result sequences.OnChainOutput + b.Logger.Infof("SVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + feeQuoterAddress := solana.PublicKeyFromBytes(input.FeeQuoter) + offRampAddress := solana.PublicKeyFromBytes(input.OffRamp) + + fqOut, err := cldf_ops.ExecuteOperation( + b, + fqops.DisableDestChain, + chains.SolanaChains()[input.LocalChainSelector], + fqops.DisableDestChainParams{ + FeeQuoter: feeQuoterAddress, + RemoteChainSelector: input.RemoteChainSelector, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to disable dest chain on FeeQuoter: %w", err) + } + result.BatchOps = append(result.BatchOps, fqOut.Output.BatchOps...) + + offrampOut, err := cldf_ops.ExecuteOperation( + b, + offrampops.DisableSourceChain, + chains.SolanaChains()[input.LocalChainSelector], + offrampops.DisableSourceChainParams{ + OffRamp: offRampAddress, + RemoteChainSelector: input.RemoteChainSelector, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to disable source chain on OffRamp: %w", err) + } + result.BatchOps = append(result.BatchOps, offrampOut.Output.BatchOps...) + + b.Logger.Infof("Remote chain %d disabled on Solana chain %d", input.RemoteChainSelector, input.LocalChainSelector) + return result, nil + }, +) + +func (a *SolanaAdapter) DisableRemoteChain() *cldf_ops.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { + return DisableRemoteChainSequence +} diff --git a/deployment/lanes/disable_lane.go b/deployment/lanes/disable_lane.go new file mode 100644 index 0000000000..1e6ebb3029 --- /dev/null +++ b/deployment/lanes/disable_lane.go @@ -0,0 +1,130 @@ +package lanes + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" +) + +// DisableRemoteChainInput provides the local and remote chain info +// needed to disable a lane on the local chain. +type DisableRemoteChainInput struct { + LocalChainSelector uint64 + RemoteChainSelector uint64 + OnRamp []byte + OffRamp []byte + Router []byte + FeeQuoter []byte +} + +// DisableLanePair identifies two chains whose bidirectional lane should be disabled. +type DisableLanePair struct { + ChainA uint64 + ChainB uint64 + Version *semver.Version +} + +// DisableLaneConfig is the input for the DisableLane changeset. +type DisableLaneConfig struct { + Lanes []DisableLanePair + MCMS mcms.Input +} + +// DisableLane returns a changeset that disables bidirectional CCIP lanes. +func DisableLane( + laneRegistry *LaneAdapterRegistry, + mcmsRegistry *changesets.MCMSReaderRegistry, +) cldf.ChangeSetV2[DisableLaneConfig] { + return cldf.CreateChangeSet( + makeDisableApply(laneRegistry, mcmsRegistry), + makeDisableVerify(), + ) +} + +func makeDisableVerify() func(cldf.Environment, DisableLaneConfig) error { + return func(_ cldf.Environment, _ DisableLaneConfig) error { + return nil + } +} + +func makeDisableApply( + laneRegistry *LaneAdapterRegistry, + mcmsRegistry *changesets.MCMSReaderRegistry, +) func(cldf.Environment, DisableLaneConfig) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, cfg DisableLaneConfig) (cldf.ChangesetOutput, error) { + batchOps := make([]mcms_types.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + + for _, lane := range cfg.Lanes { + chainAFamily, err := chain_selectors.GetSelectorFamily(lane.ChainA) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainA, err) + } + chainBFamily, err := chain_selectors.GetSelectorFamily(lane.ChainB) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainB, err) + } + + chainAAdapter, exists := laneRegistry.GetLaneAdapter(chainAFamily, lane.Version) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainAFamily, lane.Version) + } + chainBAdapter, exists := laneRegistry.GetLaneAdapter(chainBFamily, lane.Version) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainBFamily, lane.Version) + } + + chainADef := &ChainDefinition{Selector: lane.ChainA} + chainBDef := &ChainDefinition{Selector: lane.ChainB} + + err = populateAddresses(e.DataStore, chainADef, chainAAdapter) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainA, err) + } + err = populateAddresses(e.DataStore, chainBDef, chainBAdapter) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainB, err) + } + + type disablePair struct { + local *ChainDefinition + remote *ChainDefinition + adapter LaneAdapter + } + for _, pair := range []disablePair{ + {local: chainADef, remote: chainBDef, adapter: chainAAdapter}, + {local: chainBDef, remote: chainADef, adapter: chainBAdapter}, + } { + report, err := cldf_ops.ExecuteSequence( + e.OperationsBundle, + pair.adapter.DisableRemoteChain(), + e.BlockChains, + DisableRemoteChainInput{ + LocalChainSelector: pair.local.Selector, + RemoteChainSelector: pair.remote.Selector, + OnRamp: pair.local.OnRamp, + OffRamp: pair.local.OffRamp, + Router: pair.local.Router, + FeeQuoter: pair.local.FeeQuoter, + }, + ) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to disable remote chain %d on chain %d: %w", pair.remote.Selector, pair.local.Selector, err) + } + batchOps = append(batchOps, report.Output.BatchOps...) + reports = append(reports, report.ExecutionReports...) + } + } + + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + Build(cfg.MCMS) + } +} diff --git a/deployment/lanes/product.go b/deployment/lanes/product.go index f2a51bcde2..5508a51d0f 100644 --- a/deployment/lanes/product.go +++ b/deployment/lanes/product.go @@ -16,6 +16,7 @@ type LaneAdapter interface { // high level API ConfigureLaneLegAsSource() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] ConfigureLaneLegAsDest() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] + DisableRemoteChain() *cldf_ops.Sequence[DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] // helpers to expose lower level functionality if needed // needed for populating values in chain specific configs diff --git a/integration-tests/deployment/connect_chains_test.go b/integration-tests/deployment/connect_chains_test.go index ccaffcc230..1829f315e0 100644 --- a/integration-tests/deployment/connect_chains_test.go +++ b/integration-tests/deployment/connect_chains_test.go @@ -163,6 +163,52 @@ func checkBidirectionalLaneConnectivity( require.Equal(t, solanaChain.GasPrice, price.Value, "price must equal expected") } +func checkLaneDisabled( + t *testing.T, + e *fdeployment.Environment, + solanaChain lanesapi.ChainDefinition, + evmChain lanesapi.ChainDefinition, + solanaAdapter lanesapi.LaneAdapter, + evmAdapter lanesapi.LaneAdapter, +) { + t.Helper() + + // EVM Router: OnRamp must be zeroed for the remote chain + routerOnDestAddr, err := evmAdapter.GetRouterAddress(e.DataStore, evmChain.Selector) + require.NoError(t, err, "must get router from evmAdapter") + routerOnDest, err := router.NewRouter(common.BytesToAddress(routerOnDestAddr), e.BlockChains.EVMChains()[evmChain.Selector].Client) + require.NoError(t, err, "must instantiate router") + + onRampOnRouter, err := routerOnDest.GetOnRamp(nil, solanaChain.Selector) + require.NoError(t, err, "must get onRamp from router") + require.Equal(t, common.Address{}, onRampOnRouter, "onRamp must be zeroed after disable") + + // EVM Router: OffRamp must be removed for the remote chain + offRampDestAddr, err := evmAdapter.GetOffRampAddress(e.DataStore, evmChain.Selector) + require.NoError(t, err, "must get offRamp from evmAdapter") + isOffRamp, err := routerOnDest.IsOffRamp(nil, solanaChain.Selector, common.Address(offRampDestAddr)) + require.NoError(t, err, "must check if router has offRamp") + require.False(t, isOffRamp, "offRamp must be removed from router after disable") + + // Solana FeeQuoter: DestChain must be disabled for the remote chain + feeQuoterOnSrcAddr, err := solanaAdapter.GetFQAddress(e.DataStore, solanaChain.Selector) + require.NoError(t, err, "must get feeQuoter from solanaAdapter") + var destChainFqAccount fee_quoter.DestChain + fqEvmDestChainPDA, _, _ := state.FindFqDestChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(feeQuoterOnSrcAddr)) + err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), fqEvmDestChainPDA, &destChainFqAccount) + require.NoError(t, err, "must get FeeQuoter dest chain account") + require.False(t, destChainFqAccount.Config.IsEnabled, "Solana FeeQuoter dest chain must be disabled") + + // Solana OffRamp: SourceChain must be disabled for the remote chain + offRampOnSrcAddr, err := solanaAdapter.GetOffRampAddress(e.DataStore, solanaChain.Selector) + require.NoError(t, err, "must get offRamp from solanaAdapter") + var offRampSourceChain ccip_offramp.SourceChain + offRampEvmSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(offRampOnSrcAddr)) + err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), offRampEvmSourceChainPDA, &offRampSourceChain) + require.NoError(t, err, "must get OffRamp source chain account") + require.False(t, offRampSourceChain.Config.IsEnabled, "Solana OffRamp source chain must be disabled") +} + func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { t.Parallel() programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) @@ -262,3 +308,117 @@ func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { // should add a new entry for remote source and remote dest in solana require.Equal(t, 2, len(connectOut.DataStore.Addresses().Filter())) } + +func TestDisableLane_EVM2SVM(t *testing.T) { + t.Parallel() + programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) + require.NoError(t, err, "Failed to set up Solana environment") + require.NotNil(t, ds, "Datastore should be created") + + evmChains := []uint64{ + chain_selectors.ETHEREUM_MAINNET.Selector, + } + solanaChains := []uint64{ + chain_selectors.SOLANA_MAINNET.Selector, + } + allChains := append(evmChains, solanaChains...) + e, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, evmChains), + environment.WithSolanaContainer(t, solanaChains, programsPath, solanaProgramIDs), + ) + require.NoError(t, err, "Failed to create test environment") + require.NotNil(t, e, "Environment should be created") + e.DataStore = ds.Seal() + + mcmsRegistry := cs_core.GetRegistry() + dReg := deployops.GetRegistry() + version := semver.MustParse("1.6.0") + for _, chainSel := range allChains { + mint, _ := solana.NewRandomPrivateKey() + out, err := deployops.DeployContracts(dReg).Apply(*e, deployops.ContractDeploymentConfig{ + MCMS: mcms.Input{}, + Chains: map[uint64]deployops.ContractDeploymentConfigPerChain{ + chainSel: { + Version: version, + TokenPrivKey: mint.String(), + TokenDecimals: 9, + MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1e18)), + TokenPriceStalenessThreshold: uint32(24 * 60 * 60), + LinkPremiumMultiplier: 9e17, + NativeTokenPremiumMultiplier: 1e18, + PermissionLessExecutionThresholdSeconds: uint32((20 * time.Minute).Seconds()), + GasForCallExactCheck: uint16(5000), + }, + }, + }) + require.NoError(t, err, "Failed to apply DeployChainContracts changeset") + out.DataStore.Merge(e.DataStore) + e.DataStore = out.DataStore.Seal() + } + DeployMCMS(t, e, chain_selectors.SOLANA_MAINNET.Selector, []string{cciputils.CLLQualifier}) + SolanaTransferOwnership(t, e, chain_selectors.SOLANA_MAINNET.Selector) + + chain1 := lanesapi.ChainDefinition{ + Selector: chain_selectors.SOLANA_MAINNET.Selector, + GasPrice: big.NewInt(1e17), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.SOLANA_MAINNET.Selector), + } + chain2 := lanesapi.ChainDefinition{ + Selector: chain_selectors.ETHEREUM_MAINNET.Selector, + GasPrice: big.NewInt(1e9), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.ETHEREUM_MAINNET.Selector), + } + + connectOut, err := lanesapi.ConnectChains(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.ConnectChainsConfig{ + Lanes: []lanesapi.LaneConfig{ + { + Version: version, + ChainA: chain1, + ChainB: chain2, + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: false, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("1s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: cciputils.CLLQualifier, + Description: "Connect Chains", + }, + }) + require.NoError(t, err, "Failed to apply ConnectChains changeset") + testhelpers.ProcessTimelockProposals(t, *e, connectOut.MCMSTimelockProposals, false) + + laneRegistry := lanesapi.GetLaneAdapterRegistry() + srcFamily, err := chain_selectors.GetSelectorFamily(chain1.Selector) + require.NoError(t, err, "must get selector family for src") + srcAdapter, exists := laneRegistry.GetLaneAdapter(srcFamily, version) + require.True(t, exists, "must have ChainAdapter registered for src chain family") + destFamily, err := chain_selectors.GetSelectorFamily(chain2.Selector) + require.NoError(t, err, "must get selector family for dest") + destAdapter, exists := laneRegistry.GetLaneAdapter(destFamily, version) + require.True(t, exists, "must have ChainAdapter registered for dest chain family") + checkBidirectionalLaneConnectivity(t, e, chain1, chain2, srcAdapter, destAdapter, false, false) + + disableOut, err := lanesapi.DisableLane(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.DisableLaneConfig{ + Lanes: []lanesapi.DisableLanePair{ + { + ChainA: chain_selectors.SOLANA_MAINNET.Selector, + ChainB: chain_selectors.ETHEREUM_MAINNET.Selector, + Version: version, + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: true, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("1s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: cciputils.CLLQualifier, + Description: "Disable Lane", + }, + }) + require.NoError(t, err, "Failed to apply DisableLane changeset") + testhelpers.ProcessTimelockProposals(t, *e, disableOut.MCMSTimelockProposals, false) + + checkLaneDisabled(t, e, chain1, chain2, srcAdapter, destAdapter) +} From bd9b4e67c7b25dbfc1033ea98bbe769ceee7399e Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Thu, 26 Feb 2026 13:07:12 -0800 Subject: [PATCH 06/41] disable ton in devenv (#1751) * disable ton * generate --- devenv/cldf.go | 97 +++++++++++++++++++------------------ devenv/common/home_chain.go | 47 +++++++++--------- devenv/go.mod | 7 +-- devenv/go.sum | 14 +----- go.md | 16 +----- 5 files changed, 80 insertions(+), 101 deletions(-) diff --git a/devenv/cldf.go b/devenv/cldf.go index 3b8e340cb5..2a1f8d0098 100644 --- a/devenv/cldf.go +++ b/devenv/cldf.go @@ -2,7 +2,7 @@ package ccip import ( "context" - "encoding/hex" + // "encoding/hex" "errors" "fmt" "os" @@ -19,17 +19,17 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain" - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/tlb" - "github.com/xssnick/tonutils-go/ton/wallet" + // "github.com/xssnick/tonutils-go/address" + // "github.com/xssnick/tonutils-go/tlb" + // "github.com/xssnick/tonutils-go/ton/wallet" chainsel "github.com/smartcontractkit/chain-selectors" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_evm_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/provider" cldf_solana_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana/provider" - cldf_ton_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/ton/provider" - testutils "github.com/smartcontractkit/chainlink-ton/deployment/utils" + // cldf_ton_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/ton/provider" + // testutils "github.com/smartcontractkit/chainlink-ton/deployment/utils" // ccipTon "github.com/smartcontractkit/chainlink-ton/devenv" @@ -165,48 +165,49 @@ func NewCLDFOperationsEnvironment(bc []*blockchain.Input, dataStore datastore.Da } providers = append(providers, p) } else if b.Type == "ton" { - chainID := b.ChainID - rpcHTTPURL := b.Out.Nodes[0].ExternalHTTPUrl - - d, err := chainsel.GetChainDetailsByChainIDAndFamily(chainID, chainsel.FamilyTon) - if err != nil { - return nil, nil, err - } - client, err := testutils.CreateClient(context.Background(), rpcHTTPURL) - if err != nil { - return nil, nil, fmt.Errorf("failed to create TON client: %w", err) - } - - seed := wallet.NewSeed() - w, err := wallet.FromSeed(client, seed, wallet.ConfigV5R1Final{NetworkGlobalID: wallet.MainnetGlobalID, Workchain: 0}) - if err != nil { - return nil, nil, fmt.Errorf("failed to create TON wallet: %w", err) - } - privateKey, err := wallet.SeedToPrivateKey(seed /*password=*/, "" /*isBIP39=*/, false) - if err != nil { - return nil, nil, fmt.Errorf("failed to get private key from seed: %w", err) - } - walletVersion := "V5R1" - deployerSignerGen := cldf_ton_provider.PrivateKeyFromRaw(hex.EncodeToString(privateKey)) - - selectors = append(selectors, d.ChainSelector) - p, err := cldf_ton_provider.NewRPCChainProvider( - d.ChainSelector, - cldf_ton_provider.RPCChainProviderConfig{ - HTTPURL: rpcHTTPURL, - WalletVersion: cldf_ton_provider.WalletVersion(walletVersion), - DeployerSignerGen: deployerSignerGen, - }, - ).Initialize(context.Background()) - if err != nil { - return nil, nil, err - } - - err = testutils.FundWalletsNoT(client, []*address.Address{w.Address()}, []tlb.Coins{tlb.MustFromTON("1000")}) - if err != nil { - return nil, nil, fmt.Errorf("failed to fund TON wallet: %w", err) - } - providers = append(providers, p) + panic("TON support temporarily disabled") + // chainID := b.ChainID + // rpcHTTPURL := b.Out.Nodes[0].ExternalHTTPUrl + + // d, err := chainsel.GetChainDetailsByChainIDAndFamily(chainID, chainsel.FamilyTon) + // if err != nil { + // return nil, nil, err + // } + // client, err := testutils.CreateClient(context.Background(), rpcHTTPURL) + // if err != nil { + // return nil, nil, fmt.Errorf("failed to create TON client: %w", err) + // } + + // seed := wallet.NewSeed() + // w, err := wallet.FromSeed(client, seed, wallet.ConfigV5R1Final{NetworkGlobalID: wallet.MainnetGlobalID, Workchain: 0}) + // if err != nil { + // return nil, nil, fmt.Errorf("failed to create TON wallet: %w", err) + // } + // privateKey, err := wallet.SeedToPrivateKey(seed /*password=*/, "" /*isBIP39=*/, false) + // if err != nil { + // return nil, nil, fmt.Errorf("failed to get private key from seed: %w", err) + // } + // walletVersion := "V5R1" + // deployerSignerGen := cldf_ton_provider.PrivateKeyFromRaw(hex.EncodeToString(privateKey)) + + // selectors = append(selectors, d.ChainSelector) + // p, err := cldf_ton_provider.NewRPCChainProvider( + // d.ChainSelector, + // cldf_ton_provider.RPCChainProviderConfig{ + // HTTPURL: rpcHTTPURL, + // WalletVersion: cldf_ton_provider.WalletVersion(walletVersion), + // DeployerSignerGen: deployerSignerGen, + // }, + // ).Initialize(context.Background()) + // if err != nil { + // return nil, nil, err + // } + + // err = testutils.FundWalletsNoT(client, []*address.Address{w.Address()}, []tlb.Coins{tlb.MustFromTON("1000")}) + // if err != nil { + // return nil, nil, fmt.Errorf("failed to fund TON wallet: %w", err) + // } + // providers = append(providers, p) } } diff --git a/devenv/common/home_chain.go b/devenv/common/home_chain.go index 1d394dfc58..d5666218da 100644 --- a/devenv/common/home_chain.go +++ b/devenv/common/home_chain.go @@ -23,8 +23,8 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-testing-framework/framework/clclient" - tonSeqs "github.com/smartcontractkit/chainlink-ton/deployment/ccip/1_6_0/sequences" - ccip_ton "github.com/smartcontractkit/chainlink-ton/devenv" + // tonSeqs "github.com/smartcontractkit/chainlink-ton/deployment/ccip/1_6_0/sequences" + // ccip_ton "github.com/smartcontractkit/chainlink-ton/devenv" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -405,11 +405,12 @@ func applyAddDonAndSetCandidateChangesetConfig(e deployment.Environment, cfg Add return deployment.ChangesetOutput{}, err } case chain_selectors.FamilyTon: - a := &tonSeqs.TonLaneAdapter{} - offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) - if err != nil { - return deployment.ChangesetOutput{}, err - } + // a := &tonSeqs.TonLaneAdapter{} + // offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) + // if err != nil { + // return deployment.ChangesetOutput{}, err + // } + panic("TON support temporarily disabled") default: return deployment.ChangesetOutput{}, fmt.Errorf("unsupported chain family %s for selector %d", family, chainSelector) } @@ -730,16 +731,17 @@ func getOracleIdentities(clClients []*clclient.ChainlinkClient, nodeKeyBundles m onPrefix = "ocr2on_solana_" cfgPrefix = "ocr2cfg_solana_" case chain_selectors.FamilyTon: - bundle := nodeKeyBundles[family][id.Raw()] - addr, err = ccip_ton.GetNodeAddressFromBundle(&bundle) - if err != nil { - return err - } - ocrKey := bundle.OCR2Key - ocr2Config = ocrKey.Data.Attributes - offPrefix = "ocr2off_ton_" - onPrefix = "ocr2on_ton_" - cfgPrefix = "ocr2cfg_ton_" + panic("TON support temporarily disabled") + // bundle := nodeKeyBundles[family][id.Raw()] + // addr, err = ccip_ton.GetNodeAddressFromBundle(&bundle) + // if err != nil { + // return err + // } + // ocrKey := bundle.OCR2Key + // ocr2Config = ocrKey.Data.Attributes + // offPrefix = "ocr2off_ton_" + // onPrefix = "ocr2on_ton_" + // cfgPrefix = "ocr2cfg_ton_" default: return fmt.Errorf("unsupported chain family %s for selector %d", family, destSelector) } @@ -900,11 +902,12 @@ func applySetCandidateChangesetConfig(e deployment.Environment, cfg SetCandidate return deployment.ChangesetOutput{}, err } case chain_selectors.FamilyTon: - a := &tonSeqs.TonLaneAdapter{} - offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) - if err != nil { - return deployment.ChangesetOutput{}, err - } + panic("TON support temporarily disabled") + // a := &tonSeqs.TonLaneAdapter{} + // offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) + // if err != nil { + // return deployment.ChangesetOutput{}, err + // } default: return deployment.ChangesetOutput{}, fmt.Errorf("unsupported chain family %s for selector %d", family, chainSelector) } diff --git a/devenv/go.mod b/devenv/go.mod index 0cd653d28c..57b8fab4d6 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -57,8 +57,8 @@ require ( require ( github.com/aws/smithy-go v1.24.0 - github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260127214148-d1bc1a4821a9 - github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260127214148-d1bc1a4821a9 +// github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260127214148-d1bc1a4821a9 +// github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260127214148-d1bc1a4821a9 ) require ( @@ -76,7 +76,6 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect - github.com/TyphonHill/go-mermaid v1.0.0 // indirect github.com/VictoriaMetrics/fastcache v1.13.0 // indirect github.com/XSAM/otelsql v0.37.0 // indirect github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect @@ -219,7 +218,6 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.7 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/memberlist v0.5.2 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/yamux v0.1.2 // indirect @@ -338,7 +336,6 @@ require ( github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 // indirect github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect diff --git a/devenv/go.sum b/devenv/go.sum index e95705fc60..fe96324492 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -85,8 +85,6 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= -github.com/TyphonHill/go-mermaid v1.0.0 h1:VtmgQwgZA+KNHJvG/O591ibBVuDkGhg2+F/olVXnXAs= -github.com/TyphonHill/go-mermaid v1.0.0/go.mod h1:BqMEbKnr2HHpZ4lJJvGjL47v6rZAUpJcOaE/db1Ppwc= github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0= github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU= github.com/Workiva/go-datastructures v1.1.5 h1:5YfhQ4ry7bZc2Mc7R0YZyYwpf5c6t1cEFvdAhd6Mkf4= @@ -310,8 +308,8 @@ github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= -github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0= github.com/cucumber/godog v0.15.1 h1:rb/6oHDdvVZKS66hrhpjFQFHjthFSrQBCOI1LwshNTI= @@ -694,8 +692,6 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -1191,8 +1187,6 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 h1:IXF7+k8I1YY/yvXC1wnS3FAAggtCy6ByEQ9hv/F2FvQ= -github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= @@ -1213,10 +1207,6 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1 h1:azdJaWIy github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1/go.mod h1:vB5W8mngbHvDFlpujHY8jIotHr0a8J/8TIsexP/yANo= github.com/smartcontractkit/chainlink-ton v0.0.0-20260127214148-d1bc1a4821a9 h1:kTyV7r7efaxgK8UPhZsTA5aN7+MDZ5wRRWjepOF1GjE= github.com/smartcontractkit/chainlink-ton v0.0.0-20260127214148-d1bc1a4821a9/go.mod h1:jeuUzo8fWXrqnMniJrtfmbbtE8FJr6why+Maj/Xz1ZU= -github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260127214148-d1bc1a4821a9 h1:hm94btVcQN5SdkvzWGNyjxuhNRMWeSRQpI+TeJSxIlU= -github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260127214148-d1bc1a4821a9/go.mod h1:hLqFToTj0HH/mtshMHAI2uT0M1/t3DnjrjyCNoReS2Y= -github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260127214148-d1bc1a4821a9 h1:D6+XFv18qqFLDhqSmKXE7/IFxLXEAnMSAfxj6tlUP2A= -github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260127214148-d1bc1a4821a9/go.mod h1:DCAKd9cHyruJrR1e8FYQ/696baqUxfAHxCC9kdDbX94= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 h1:XRNxgcNqagXu6e4smJuS1crRK5cUAcCVd7u+iLduHDM= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513/go.mod h1:ccjEgNeqOO+bjPddnL4lUrNLzyCvGCxgBjJdhFX3wa8= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20250528121202-292529af39df h1:36e3ROIZyV/qE8SvFOACXtXfMOMd9vG4+zY2v2ScXkI= diff --git a/go.md b/go.md index b5cd80eae3..9c93806412 100644 --- a/go.md +++ b/go.md @@ -95,7 +95,6 @@ flowchart LR click chainlink-ccip/deployment href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-ccip/devenv --> chainlink-ccip/chains/evm/deployment chainlink-ccip/devenv --> chainlink-ccip/chains/solana/deployment - chainlink-ccip/devenv --> chainlink-ton/devenv click chainlink-ccip/devenv href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-ccip/integration-tests --> chainlink-ccip/chains/evm/deployment chainlink-ccip/integration-tests --> chainlink-ccip/chains/solana/deployment @@ -140,7 +139,7 @@ flowchart LR chainlink-framework/chains --> chainlink-common chainlink-framework/chains --> chainlink-framework/multinode click chainlink-framework/chains href "https://github.com/smartcontractkit/chainlink-framework" - chainlink-framework/metrics --> chainlink-common + chainlink-framework/metrics click chainlink-framework/metrics href "https://github.com/smartcontractkit/chainlink-framework" chainlink-framework/multinode click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework" @@ -181,10 +180,6 @@ flowchart LR chainlink-ton --> chainlink-common/pkg/monitoring chainlink-ton --> chainlink-framework/metrics click chainlink-ton href "https://github.com/smartcontractkit/chainlink-ton" - chainlink-ton/deployment --> chainlink-ccip/deployment - click chainlink-ton/deployment href "https://github.com/smartcontractkit/chainlink-ton" - chainlink-ton/devenv --> chainlink-ton/deployment - click chainlink-ton/devenv href "https://github.com/smartcontractkit/chainlink-ton" chainlink-tron/relayer --> chainlink-common chainlink-tron/relayer --> chainlink-common/pkg/values click chainlink-tron/relayer href "https://github.com/smartcontractkit/chainlink-tron" @@ -258,13 +253,6 @@ flowchart LR end click chainlink-testing-framework-repo href "https://github.com/smartcontractkit/chainlink-testing-framework" - subgraph chainlink-ton-repo[chainlink-ton] - chainlink-ton - chainlink-ton/deployment - chainlink-ton/devenv - end - click chainlink-ton-repo href "https://github.com/smartcontractkit/chainlink-ton" - classDef outline stroke-dasharray:6,fill:none; - class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo,chainlink-ton-repo outline + class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo outline ``` From 3d808eb46df743ca694c932003cc142dc6cc4ae7 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:10:41 -0800 Subject: [PATCH 07/41] condense remotes into top level (#1747) * condense remotes into top level * fix test * nilptr * move up check * move up check --- .../v1_6_0/operations/router/router.go | 106 +++++++++--------- .../v1_6_0/operations/token_pools/burnmint.go | 10 +- .../operations/token_pools/lockrelease.go | 10 +- .../tokens/configure_tokens_for_transfers.go | 6 +- .../configure_tokens_for_transfers_test.go | 1 + deployment/tokens/token_expansion.go | 44 +++----- devenv/common/implcommon.go | 15 --- .../deployment/tokens_and_token_pools_test.go | 72 ------------ 8 files changed, 96 insertions(+), 168 deletions(-) diff --git a/chains/solana/deployment/v1_6_0/operations/router/router.go b/chains/solana/deployment/v1_6_0/operations/router/router.go index f12ed868d4..0edd5e1d4c 100644 --- a/chains/solana/deployment/v1_6_0/operations/router/router.go +++ b/chains/solana/deployment/v1_6_0/operations/router/router.go @@ -305,51 +305,9 @@ var SetPool = operations.NewOperation( func(b operations.Bundle, chain cldf_solana.Chain, input PoolParams) (sequences.OnChainOutput, error) { ccip_router.SetProgramID(input.Router) addresses := make([]datastore.AddressRef, 0) - // Only works for BnM and LnR pools for now - tokenAdminRegistryPDA, _, _ := state.FindTokenAdminRegistryPDA(input.TokenMint, input.Router) - if input.TokenPoolLookupTable.IsZero() { - tokenPoolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.TokenPool) - tokenPoolSigner, _ := tokens.TokenPoolSignerAddress(input.TokenMint, input.TokenPool) - poolTokenAccount, _, _ := tokens.FindAssociatedTokenAddress(input.TokenProgramID, input.TokenMint, tokenPoolSigner) - feeTokenConfigPDA, _, _ := state.FindFqBillingTokenConfigPDA(input.TokenMint, input.FeeQuoter) - routerPoolSignerPDA, _, _ := state.FindExternalTokenPoolsSignerPDA(input.TokenPool, input.Router) - table, err := common.CreateLookupTable(b.GetContext(), chain.Client, *chain.DeployerKey) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to create lookup table: %w", err) - } - // link the token + token pool lookup table + token mint - labels := datastore.NewLabelSet(input.TokenPool.String()) - addresses = append(addresses, datastore.AddressRef{ - Address: table.String(), - ChainSelector: chain.Selector, - Labels: labels, - Type: datastore.ContractType(TokenPoolLookupTableType), - Version: Version, - Qualifier: input.TokenMint.String(), - }) - list := solana.PublicKeySlice{ - table, // 0 - tokenAdminRegistryPDA, // 1 - input.TokenPool, // 2 - tokenPoolConfigPDA, // 3 - writable - poolTokenAccount, // 4 - writable - tokenPoolSigner, // 5 - input.TokenProgramID, // 6 - input.TokenMint, // 7 - writable - feeTokenConfigPDA, // 8 - routerPoolSignerPDA, // 9 - } - if err = common.ExtendLookupTable(b.GetContext(), chain.Client, table, *chain.DeployerKey, list); err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to extend lookup table for token pool (mint: %s): %w", input.TokenMint.String(), err) - } - if err := common.AwaitSlotChange(b.GetContext(), chain.Client); err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to await slot change while extending lookup table: %w", err) - } - input.TokenPoolLookupTable = table - } - writableIndexes := []uint8{3, 4, 7} // we can only sign as either the deployer or the token admin // if there is no admin set, we assume the router authority is timelock + tokenAdminRegistryPDA, _, _ := state.FindTokenAdminRegistryPDA(input.TokenMint, input.Router) currentAdmin := GetAuthority(chain, input.Router) var tokenAdminRegistryAccount ccip_common.TokenAdminRegistry if err := chain.GetAccountDataBorshInto(b.GetContext(), tokenAdminRegistryPDA, &tokenAdminRegistryAccount); err == nil { @@ -363,6 +321,45 @@ var SetPool = operations.NewOperation( currentAdmin = tokenAdminRegistryAccount.Administrator } } + // Only works for BnM and LnR pools for now + tokenPoolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.TokenPool) + tokenPoolSigner, _ := tokens.TokenPoolSignerAddress(input.TokenMint, input.TokenPool) + poolTokenAccount, _, _ := tokens.FindAssociatedTokenAddress(input.TokenProgramID, input.TokenMint, tokenPoolSigner) + feeTokenConfigPDA, _, _ := state.FindFqBillingTokenConfigPDA(input.TokenMint, input.FeeQuoter) + routerPoolSignerPDA, _, _ := state.FindExternalTokenPoolsSignerPDA(input.TokenPool, input.Router) + table, err := common.CreateLookupTable(b.GetContext(), chain.Client, *chain.DeployerKey) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create lookup table: %w", err) + } + // link the token + token pool lookup table + token mint + labels := datastore.NewLabelSet(input.TokenPool.String()) + addresses = append(addresses, datastore.AddressRef{ + Address: table.String(), + ChainSelector: chain.Selector, + Labels: labels, + Type: datastore.ContractType(TokenPoolLookupTableType), + Version: Version, + Qualifier: input.TokenMint.String(), + }) + list := solana.PublicKeySlice{ + table, // 0 + tokenAdminRegistryPDA, // 1 + input.TokenPool, // 2 + tokenPoolConfigPDA, // 3 - writable + poolTokenAccount, // 4 - writable + tokenPoolSigner, // 5 + input.TokenProgramID, // 6 + input.TokenMint, // 7 - writable + feeTokenConfigPDA, // 8 + routerPoolSignerPDA, // 9 + } + if err = common.ExtendLookupTable(b.GetContext(), chain.Client, table, *chain.DeployerKey, list); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to extend lookup table for token pool (mint: %s): %w", input.TokenMint.String(), err) + } + if err := common.AwaitSlotChange(b.GetContext(), chain.Client); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to await slot change while extending lookup table: %w", err) + } + writableIndexes := []uint8{3, 4, 7} routerConfigPDA, _, _ := state.FindConfigPDA(input.Router) base := ccip_router.NewSetPoolInstruction( @@ -370,10 +367,10 @@ var SetPool = operations.NewOperation( routerConfigPDA, tokenAdminRegistryPDA, input.TokenMint, - input.TokenPoolLookupTable, + table, currentAdmin, ) - base.AccountMetaSlice = append(base.AccountMetaSlice, solana.Meta(input.TokenPoolLookupTable)) + base.AccountMetaSlice = append(base.AccountMetaSlice, solana.Meta(table)) tempIx, err := base.ValidateAndBuild() if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to build router set pool instruction: %w", err) @@ -566,10 +563,12 @@ var AcceptTokenAdminRegistry = operations.NewOperation( routerConfigPDA, _, _ := state.FindConfigPDA(input.Router) tokenAdminRegistryPDA, _, _ := state.FindTokenAdminRegistryPDA(input.TokenMint, input.Router) var pendingAdmin solana.PublicKey + var currentAdmin solana.PublicKey var tokenAdminRegistryAccount ccip_common.TokenAdminRegistry if err := chain.GetAccountDataBorshInto(b.GetContext(), tokenAdminRegistryPDA, &tokenAdminRegistryAccount); err == nil { // NOTE: only set pendingAdmin if the account exists / fetch succeeds pendingAdmin = tokenAdminRegistryAccount.PendingAdministrator + currentAdmin = tokenAdminRegistryAccount.Administrator } timelockSigner := utils.GetTimelockSignerPDA( input.ExistingAddresses, @@ -579,6 +578,10 @@ var AcceptTokenAdminRegistry = operations.NewOperation( if pendingAdmin.IsZero() { // if there is no pending admin, we assume the authority is timelock // but we need to confirm that timelock is indeed the authority + if currentAdmin == timelockSigner { + b.Logger.Info("No pending admin found, but timelock is already the current admin, skipping accept admin role for token admin registry") + return sequences.OnChainOutput{}, nil + } if input.Admin != timelockSigner { return sequences.OnChainOutput{}, fmt.Errorf("no pending admin found for token admin registry, expected timelock signer %s but got %s", timelockSigner.String(), input.Admin.String()) } @@ -707,13 +710,12 @@ type Params struct { } type PoolParams struct { - Router solana.PublicKey - FeeQuoter solana.PublicKey - TokenMint solana.PublicKey - TokenProgramID solana.PublicKey - TokenPool solana.PublicKey - TokenPoolLookupTable solana.PublicKey - TokenPoolType string + Router solana.PublicKey + FeeQuoter solana.PublicKey + TokenMint solana.PublicKey + TokenProgramID solana.PublicKey + TokenPool solana.PublicKey + TokenPoolType string } type TokenAdminRegistryParams struct { diff --git a/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go b/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go index 3bc3e0446d..b786298ab3 100644 --- a/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go +++ b/chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go @@ -506,6 +506,15 @@ var UpdateRateLimitAdminBurnMint = operations.NewOperation( "Updates the rate limit admin for a BurnMintTokenPool remote chain config", func(b operations.Bundle, chain cldf_solana.Chain, input TokenPoolTransferOwnershipInput) (sequences.OnChainOutput, error) { burnmint_token_pool.SetProgramID(input.Program) + poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) + var chainConfig test_token_pool.State + err := chain.GetAccountDataBorshInto(b.GetContext(), poolConfigPDA, &chainConfig) + if err == nil { + if chainConfig.Config.RateLimitAdmin == input.NewOwner { + b.Logger.Info("New owner is the same as the current rate limit admin for burn mint token pool with token mint:", input.TokenMint.String()) + return sequences.OnChainOutput{}, nil + } + } authority, err := GetAuthorityBurnMint(chain, input.Program, input.TokenMint) if err != nil { // assume the authority is the upgrade authority if we fail to fetch the current authority, since the pool might not be initialized yet and there won't be an authority set on-chain yet (since the config account won't exist until initialization) @@ -521,7 +530,6 @@ var UpdateRateLimitAdminBurnMint = operations.NewOperation( return sequences.OnChainOutput{}, nil } } - poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) ixn, err := burnmint_token_pool.NewSetRateLimitAdminInstruction( input.TokenMint, input.NewOwner, diff --git a/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go b/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go index 4b6c490612..68c8c6ca9a 100644 --- a/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go +++ b/chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go @@ -449,6 +449,15 @@ var UpdateRateLimitAdminLockRelease = operations.NewOperation( "Updates the rate limit admin for a LockReleaseTokenPool remote chain config", func(b operations.Bundle, chain cldf_solana.Chain, input TokenPoolTransferOwnershipInput) (sequences.OnChainOutput, error) { lockrelease_token_pool.SetProgramID(input.Program) + poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) + var chainConfig test_token_pool.State + err := chain.GetAccountDataBorshInto(b.GetContext(), poolConfigPDA, &chainConfig) + if err == nil { + if chainConfig.Config.RateLimitAdmin == input.NewOwner { + b.Logger.Info("New owner is the same as the current rate limit admin for lock release token pool with token mint:", input.TokenMint.String()) + return sequences.OnChainOutput{}, nil + } + } authority, err := GetAuthorityLockRelease(chain, input.Program, input.TokenMint) if err != nil { // assume the authority is the upgrade authority if we fail to fetch the current authority, since the pool might not be initialized yet and there won't be an authority set on-chain yet (since the config account won't exist until initialization) @@ -464,7 +473,6 @@ var UpdateRateLimitAdminLockRelease = operations.NewOperation( return sequences.OnChainOutput{}, nil } } - poolConfigPDA, _ := tokens.TokenPoolConfigAddress(input.TokenMint, input.Program) ixn, err := lockrelease_token_pool.NewSetRateLimitAdminInstruction( input.TokenMint, input.NewOwner, diff --git a/deployment/tokens/configure_tokens_for_transfers.go b/deployment/tokens/configure_tokens_for_transfers.go index d594fec3f9..a949c7a1c4 100644 --- a/deployment/tokens/configure_tokens_for_transfers.go +++ b/deployment/tokens/configure_tokens_for_transfers.go @@ -178,7 +178,11 @@ func convertRemoteChainConfig( if inCfg.RemoteToken != nil { outCfg.RemoteToken, err = datastore_utils.FindAndFormatRef(e.DataStore, *inCfg.RemoteToken, remoteChainSelector, adapter.AddressRefToBytes) if err != nil { - return outCfg, fmt.Errorf("failed to resolve remote token ref %s: %w", datastore_utils.SprintRef(*inCfg.RemoteToken), err) + e.Logger.Warnf("failed to resolve remote token ref %s: %v. Will attempt to derive remote token address from pool reference", datastore_utils.SprintRef(*inCfg.RemoteToken), err) + outCfg.RemoteToken, err = adapter.DeriveTokenAddress(e, remoteChainSelector, fullRemotePoolRef) + if err != nil { + return outCfg, fmt.Errorf("failed to resolve remote token ref via pool ref (%s) for remote chain selector %d: %w", datastore_utils.SprintRef(*inCfg.RemotePool), remoteChainSelector, err) + } } } else { outCfg.RemoteToken, err = adapter.DeriveTokenAddress(e, remoteChainSelector, fullRemotePoolRef) diff --git a/deployment/tokens/configure_tokens_for_transfers_test.go b/deployment/tokens/configure_tokens_for_transfers_test.go index 83ec139f2a..8474fd24b3 100644 --- a/deployment/tokens/configure_tokens_for_transfers_test.go +++ b/deployment/tokens/configure_tokens_for_transfers_test.go @@ -729,6 +729,7 @@ func TestConfigureTokensForTransfers_Apply(t *testing.T) { ) e := deployment.Environment{ OperationsBundle: bundle, + Logger: lggr, DataStore: ds.Seal(), } diff --git a/deployment/tokens/token_expansion.go b/deployment/tokens/token_expansion.go index b49a9acee7..23423006a0 100644 --- a/deployment/tokens/token_expansion.go +++ b/deployment/tokens/token_expansion.go @@ -135,11 +135,13 @@ func tokenExpansionVerify() func(cldf.Environment, TokenExpansionInput) error { } // deploy token deployTokenInput := input.DeployTokenInput - deployTokenInput.ExistingDataStore = e.DataStore - deployTokenInput.ChainSelector = selector - err = tokenPoolAdapter.DeployTokenVerify(e, *deployTokenInput) - if err != nil { - return fmt.Errorf("failed to verify deploy token input for chain selector %d: %w", selector, err) + if deployTokenInput != nil { + deployTokenInput.ExistingDataStore = e.DataStore + deployTokenInput.ChainSelector = selector + err = tokenPoolAdapter.DeployTokenVerify(e, *deployTokenInput) + if err != nil { + return fmt.Errorf("failed to verify deploy token input for chain selector %d: %w", selector, err) + } } } return nil @@ -284,27 +286,6 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha // save the token transfer config for processing after all tokens and token pools have been deployed if input.TokenTransferConfig != nil { input.TokenTransferConfig.ChainSelector = selector - actualPool := tokenPool - if actualPool == nil { - // if token pool is not deployed by this changeset, we expect the user to provide the token pool address in the TokenTransferConfig - actualPool = &input.TokenTransferConfig.TokenPoolRef - } - actualToken := tokenRef - if actualToken == nil { - // if token is not deployed by this changeset, we expect the user to provide the token address in the TokenTransferConfig - actualToken = &input.TokenTransferConfig.TokenRef - } - allRemotes[selector] = RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ - RemoteToken: actualToken, - RemotePool: actualPool, - } - } - } - - // now that we have all the token and token pools, we can loop through the token configs again - // and update the remote chain configs with the correct token and token pool addresses before configuring the tokens for transfers - for selector, input := range cfg.TokenExpansionInputPerChain { - if input.TokenTransferConfig != nil { mergedPool, err := datastore_utils.MergeRefs( &cfg.TokenExpansionInputPerChain[selector].TokenTransferConfig.TokenPoolRef, allRemotes[selector].RemotePool, @@ -321,6 +302,17 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha return cldf.ChangesetOutput{}, fmt.Errorf("failed to merge token refs for chain selector %d: %w", selector, err) } cfg.TokenExpansionInputPerChain[selector].TokenTransferConfig.TokenRef = mergedToken + allRemotes[selector] = RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ + RemoteToken: &mergedToken, + RemotePool: &mergedPool, + } + } + } + + // now that we have all the token and token pools, we can loop through the token configs again + // and update the remote chain configs with the correct token and token pool addresses before configuring the tokens for transfers + for selector, input := range cfg.TokenExpansionInputPerChain { + if input.TokenTransferConfig != nil { for remoteSelector, remoteConfig := range input.TokenTransferConfig.RemoteChains { if _, exists := allRemotes[remoteSelector]; exists { if remoteConfig.RemoteToken == nil { diff --git a/devenv/common/implcommon.go b/devenv/common/implcommon.go index 0b1e528e86..198f4590b2 100644 --- a/devenv/common/implcommon.go +++ b/devenv/common/implcommon.go @@ -712,22 +712,7 @@ func SetupTokensAndTokenPools(env *deployment.Environment, adp []testadapters.Te if srcSel != dstSel { srcCfg.TokenTransferConfig.RemoteChains[dstSel] = tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ - OutboundCCVs: []datastore.AddressRef{}, // not needed for for 1.6 - InboundCCVs: []datastore.AddressRef{}, // not needed for for 1.6 OutboundRateLimiterConfig: disabledRL, - // This is actually optional for 1.6 as the token and token pool addresses are - // inferred after deployment - // RemoteToken: &datastore.AddressRef{ - // Type: datastore.ContractType(dstCfg.DeployTokenInput.Type), - // Qualifier: dstCfg.DeployTokenInput.Symbol, - // ChainSelector: dstSel, - // }, - // RemotePool: &datastore.AddressRef{ - // Type: datastore.ContractType(dstCfg.DeployTokenPoolInput.PoolType), - // Qualifier: dstCfg.DeployTokenPoolInput.TokenPoolQualifier, - // Version: dstCfg.TokenPoolVersion, - // ChainSelector: dstSel, - // }, } } } diff --git a/integration-tests/deployment/tokens_and_token_pools_test.go b/integration-tests/deployment/tokens_and_token_pools_test.go index d486e1c3e0..f36ce84e20 100644 --- a/integration-tests/deployment/tokens_and_token_pools_test.go +++ b/integration-tests/deployment/tokens_and_token_pools_test.go @@ -496,18 +496,6 @@ func TestTokensAndTokenPools(t *testing.T) { RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmB.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Qualifier: evmB.Token.Symbol, - Type: datastore.ContractType(evmB.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Qualifier: evmB.TokenPoolQualifier, - Type: datastore.ContractType(evmTokenPoolType), - }, }, }, }, @@ -530,18 +518,6 @@ func TestTokensAndTokenPools(t *testing.T) { RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmA.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Qualifier: evmA.Token.Symbol, - Type: datastore.ContractType(evmA.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Qualifier: evmA.TokenPoolQualifier, - Type: datastore.ContractType(evmTokenPoolType), - }, }, }, }, @@ -836,33 +812,9 @@ func TestTokensAndTokenPools(t *testing.T) { RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmA.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Qualifier: evmA.Token.Symbol, - Type: datastore.ContractType(evmA.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Qualifier: evmA.TokenPoolQualifier, - Type: datastore.ContractType(evmTokenPoolType), - }, }, evmB.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Qualifier: evmB.Token.Symbol, - Type: datastore.ContractType(evmB.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Qualifier: evmB.TokenPoolQualifier, - Type: datastore.ContractType(evmTokenPoolType), - }, }, }, }, @@ -885,18 +837,6 @@ func TestTokensAndTokenPools(t *testing.T) { RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ solbnm.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: solbnm.Chain.Selector, - Qualifier: solbnm.Token.Symbol, - Type: datastore.ContractType(solbnm.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: solbnm.Chain.Selector, - Qualifier: solbnm.TokenPoolQualifier, - Type: datastore.ContractType(solbnm.TokenPoolType), - }, }, }, }, @@ -919,18 +859,6 @@ func TestTokensAndTokenPools(t *testing.T) { RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ solbnm.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, - OutboundCCVs: []datastore.AddressRef{}, - InboundCCVs: []datastore.AddressRef{}, - RemoteToken: &datastore.AddressRef{ - ChainSelector: solbnm.Chain.Selector, - Qualifier: solbnm.Token.Symbol, - Type: datastore.ContractType(solbnm.Token.Type), - }, - RemotePool: &datastore.AddressRef{ - ChainSelector: solbnm.Chain.Selector, - Qualifier: solbnm.TokenPoolQualifier, - Type: datastore.ContractType(solbnm.TokenPoolType), - }, }, }, }, From f21cb2f233b4bf9d57e8d120b2673972158ce8f1 Mon Sep 17 00:00:00 2001 From: Chris De Leon <147140544+chris-de-leon-cll@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:53:38 -0800 Subject: [PATCH 08/41] Revert "Implement disable lane (#1741)" (#1752) This reverts commit a4824ec152fa7235a1ff770bc617ba5477f25090. --- .gitignore | 1 - .../v1_6_0/sequences/disable_remote_chain.go | 51 ------ .../operations/fee_quoter/fee_quoter.go | 46 ----- .../v1_6_0/operations/offramp/offramp.go | 46 ----- .../v1_6_0/sequences/disable_remote_chain.go | 63 ------- deployment/lanes/disable_lane.go | 130 -------------- deployment/lanes/product.go | 1 - .../deployment/connect_chains_test.go | 160 ------------------ 8 files changed, 498 deletions(-) delete mode 100644 chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go delete mode 100644 chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go delete mode 100644 deployment/lanes/disable_lane.go diff --git a/.gitignore b/.gitignore index 07bd29f106..728c19367d 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,3 @@ gcr_creds.env devenv/tests/e2e/blockscout devenv/env-out.toml .cursorrules -.claude diff --git a/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go deleted file mode 100644 index 77e99804de..0000000000 --- a/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go +++ /dev/null @@ -1,51 +0,0 @@ -package sequences - -import ( - "github.com/Masterminds/semver/v3" - "github.com/ethereum/go-ethereum/common" - - "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" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - "github.com/smartcontractkit/chainlink-deployments-framework/operations" -) - -var DisableRemoteChainSequence = operations.NewSequence( - "DisableRemoteChain", - semver.MustParse("1.6.0"), - "Disables both sending to and receiving from a remote chain on an EVM chain via router updates", - func(b operations.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { - var result sequences.OnChainOutput - b.Logger.Infof("EVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) - - result, err := sequences.RunAndMergeSequence(b, chains, RouterApplyRampUpdatesSequence, RouterApplyRampUpdatesSequenceInput{ - Address: common.BytesToAddress(input.Router), - ChainSelector: input.LocalChainSelector, - UpdatesByChain: router.ApplyRampsUpdatesArgs{ - OnRampUpdates: []router.OnRamp{ - { - DestChainSelector: input.RemoteChainSelector, - OnRamp: common.HexToAddress("0x0"), - }, - }, - OffRampRemoves: []router.OffRamp{ - { - SourceChainSelector: input.RemoteChainSelector, - OffRamp: common.BytesToAddress(input.OffRamp), - }, - }, - }, - }, result) - if err != nil { - return result, err - } - b.Logger.Infof("Remote chain %d disabled on EVM chain %d", input.RemoteChainSelector, input.LocalChainSelector) - - return result, nil - }, -) - -func (a *EVMAdapter) DisableRemoteChain() *operations.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { - return DisableRemoteChainSequence -} diff --git a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go index 5c309f865c..801c235a16 100644 --- a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go +++ b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go @@ -185,52 +185,6 @@ var ConnectChains = operations.NewOperation( }, ) -type DisableDestChainParams struct { - FeeQuoter solana.PublicKey - RemoteChainSelector uint64 -} - -var DisableDestChain = operations.NewOperation( - "fee-quoter:disable-dest-chain", - Version, - "Disables a destination chain on the FeeQuoter, preventing sending to that chain", - func(b operations.Bundle, chain cldf_solana.Chain, input DisableDestChainParams) (sequences.OnChainOutput, error) { - fee_quoter.SetProgramID(input.FeeQuoter) - authority := GetAuthority(chain, input.FeeQuoter) - feeQuoterConfigPDA, _, _ := state.FindFqConfigPDA(input.FeeQuoter) - fqDestChainPDA, _, _ := state.FindFqDestChainPDA(input.RemoteChainSelector, input.FeeQuoter) - - instruction, err := fee_quoter.NewDisableDestChainInstruction( - input.RemoteChainSelector, - feeQuoterConfigPDA, - fqDestChainPDA, - authority, - ).ValidateAndBuild() - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable dest chain instruction: %w", err) - } - - if authority != chain.DeployerKey.PublicKey() { - batches, err := utils.BuildMCMSBatchOperation( - chain.Selector, - []solana.Instruction{instruction}, - input.FeeQuoter.String(), - ContractType.String(), - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable dest chain: %w", err) - } - return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil - } - - err = chain.Confirm([]solana.Instruction{instruction}) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable dest chain: %w", err) - } - return sequences.OnChainOutput{}, nil - }, -) - var TransferOwnership = operations.NewOperation( "fee-quoter:transfer-ownership", Version, diff --git a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go index 42942422f0..26bf4138c5 100644 --- a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go +++ b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go @@ -242,52 +242,6 @@ var ConnectChains = operations.NewOperation( }, ) -type DisableSourceChainParams struct { - OffRamp solana.PublicKey - RemoteChainSelector uint64 -} - -var DisableSourceChain = operations.NewOperation( - "off-ramp:disable-source-chain", - Version, - "Disables a source chain on the OffRamp, preventing receiving from that chain", - func(b operations.Bundle, chain cldf_solana.Chain, input DisableSourceChainParams) (sequences.OnChainOutput, error) { - ccip_offramp.SetProgramID(input.OffRamp) - authority := GetAuthority(chain, input.OffRamp) - offRampConfigPDA, _, _ := state.FindOfframpConfigPDA(input.OffRamp) - offRampSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(input.RemoteChainSelector, input.OffRamp) - - instruction, err := ccip_offramp.NewDisableSourceChainSelectorInstruction( - input.RemoteChainSelector, - offRampSourceChainPDA, - offRampConfigPDA, - authority, - ).ValidateAndBuild() - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable source chain instruction: %w", err) - } - - if authority != chain.DeployerKey.PublicKey() { - batches, err := utils.BuildMCMSBatchOperation( - chain.Selector, - []solana.Instruction{instruction}, - input.OffRamp.String(), - ContractType.String(), - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable source chain: %w", err) - } - return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil - } - - err = chain.Confirm([]solana.Instruction{instruction}) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable source chain: %w", err) - } - return sequences.OnChainOutput{}, nil - }, -) - var SetOcr3 = operations.NewOperation( "off-ramp:set-ocr3", Version, diff --git a/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go deleted file mode 100644 index 87ab822010..0000000000 --- a/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go +++ /dev/null @@ -1,63 +0,0 @@ -package sequences - -import ( - "fmt" - - "github.com/Masterminds/semver/v3" - "github.com/gagliardetto/solana-go" - - fqops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/fee_quoter" - offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" - "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" -) - -var DisableRemoteChainSequence = cldf_ops.NewSequence( - "DisableRemoteChain", - semver.MustParse("1.6.0"), - "Disables both sending to and receiving from a remote chain on a Solana chain", - func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { - var result sequences.OnChainOutput - b.Logger.Infof("SVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) - - feeQuoterAddress := solana.PublicKeyFromBytes(input.FeeQuoter) - offRampAddress := solana.PublicKeyFromBytes(input.OffRamp) - - fqOut, err := cldf_ops.ExecuteOperation( - b, - fqops.DisableDestChain, - chains.SolanaChains()[input.LocalChainSelector], - fqops.DisableDestChainParams{ - FeeQuoter: feeQuoterAddress, - RemoteChainSelector: input.RemoteChainSelector, - }, - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to disable dest chain on FeeQuoter: %w", err) - } - result.BatchOps = append(result.BatchOps, fqOut.Output.BatchOps...) - - offrampOut, err := cldf_ops.ExecuteOperation( - b, - offrampops.DisableSourceChain, - chains.SolanaChains()[input.LocalChainSelector], - offrampops.DisableSourceChainParams{ - OffRamp: offRampAddress, - RemoteChainSelector: input.RemoteChainSelector, - }, - ) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to disable source chain on OffRamp: %w", err) - } - result.BatchOps = append(result.BatchOps, offrampOut.Output.BatchOps...) - - b.Logger.Infof("Remote chain %d disabled on Solana chain %d", input.RemoteChainSelector, input.LocalChainSelector) - return result, nil - }, -) - -func (a *SolanaAdapter) DisableRemoteChain() *cldf_ops.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { - return DisableRemoteChainSequence -} diff --git a/deployment/lanes/disable_lane.go b/deployment/lanes/disable_lane.go deleted file mode 100644 index 1e6ebb3029..0000000000 --- a/deployment/lanes/disable_lane.go +++ /dev/null @@ -1,130 +0,0 @@ -package lanes - -import ( - "fmt" - - "github.com/Masterminds/semver/v3" - chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" - mcms_types "github.com/smartcontractkit/mcms/types" -) - -// DisableRemoteChainInput provides the local and remote chain info -// needed to disable a lane on the local chain. -type DisableRemoteChainInput struct { - LocalChainSelector uint64 - RemoteChainSelector uint64 - OnRamp []byte - OffRamp []byte - Router []byte - FeeQuoter []byte -} - -// DisableLanePair identifies two chains whose bidirectional lane should be disabled. -type DisableLanePair struct { - ChainA uint64 - ChainB uint64 - Version *semver.Version -} - -// DisableLaneConfig is the input for the DisableLane changeset. -type DisableLaneConfig struct { - Lanes []DisableLanePair - MCMS mcms.Input -} - -// DisableLane returns a changeset that disables bidirectional CCIP lanes. -func DisableLane( - laneRegistry *LaneAdapterRegistry, - mcmsRegistry *changesets.MCMSReaderRegistry, -) cldf.ChangeSetV2[DisableLaneConfig] { - return cldf.CreateChangeSet( - makeDisableApply(laneRegistry, mcmsRegistry), - makeDisableVerify(), - ) -} - -func makeDisableVerify() func(cldf.Environment, DisableLaneConfig) error { - return func(_ cldf.Environment, _ DisableLaneConfig) error { - return nil - } -} - -func makeDisableApply( - laneRegistry *LaneAdapterRegistry, - mcmsRegistry *changesets.MCMSReaderRegistry, -) func(cldf.Environment, DisableLaneConfig) (cldf.ChangesetOutput, error) { - return func(e cldf.Environment, cfg DisableLaneConfig) (cldf.ChangesetOutput, error) { - batchOps := make([]mcms_types.BatchOperation, 0) - reports := make([]cldf_ops.Report[any, any], 0) - - for _, lane := range cfg.Lanes { - chainAFamily, err := chain_selectors.GetSelectorFamily(lane.ChainA) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainA, err) - } - chainBFamily, err := chain_selectors.GetSelectorFamily(lane.ChainB) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainB, err) - } - - chainAAdapter, exists := laneRegistry.GetLaneAdapter(chainAFamily, lane.Version) - if !exists { - return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainAFamily, lane.Version) - } - chainBAdapter, exists := laneRegistry.GetLaneAdapter(chainBFamily, lane.Version) - if !exists { - return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainBFamily, lane.Version) - } - - chainADef := &ChainDefinition{Selector: lane.ChainA} - chainBDef := &ChainDefinition{Selector: lane.ChainB} - - err = populateAddresses(e.DataStore, chainADef, chainAAdapter) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainA, err) - } - err = populateAddresses(e.DataStore, chainBDef, chainBAdapter) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainB, err) - } - - type disablePair struct { - local *ChainDefinition - remote *ChainDefinition - adapter LaneAdapter - } - for _, pair := range []disablePair{ - {local: chainADef, remote: chainBDef, adapter: chainAAdapter}, - {local: chainBDef, remote: chainADef, adapter: chainBAdapter}, - } { - report, err := cldf_ops.ExecuteSequence( - e.OperationsBundle, - pair.adapter.DisableRemoteChain(), - e.BlockChains, - DisableRemoteChainInput{ - LocalChainSelector: pair.local.Selector, - RemoteChainSelector: pair.remote.Selector, - OnRamp: pair.local.OnRamp, - OffRamp: pair.local.OffRamp, - Router: pair.local.Router, - FeeQuoter: pair.local.FeeQuoter, - }, - ) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to disable remote chain %d on chain %d: %w", pair.remote.Selector, pair.local.Selector, err) - } - batchOps = append(batchOps, report.Output.BatchOps...) - reports = append(reports, report.ExecutionReports...) - } - } - - return changesets.NewOutputBuilder(e, mcmsRegistry). - WithReports(reports). - WithBatchOps(batchOps). - Build(cfg.MCMS) - } -} diff --git a/deployment/lanes/product.go b/deployment/lanes/product.go index 5508a51d0f..f2a51bcde2 100644 --- a/deployment/lanes/product.go +++ b/deployment/lanes/product.go @@ -16,7 +16,6 @@ type LaneAdapter interface { // high level API ConfigureLaneLegAsSource() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] ConfigureLaneLegAsDest() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] - DisableRemoteChain() *cldf_ops.Sequence[DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] // helpers to expose lower level functionality if needed // needed for populating values in chain specific configs diff --git a/integration-tests/deployment/connect_chains_test.go b/integration-tests/deployment/connect_chains_test.go index 1829f315e0..ccaffcc230 100644 --- a/integration-tests/deployment/connect_chains_test.go +++ b/integration-tests/deployment/connect_chains_test.go @@ -163,52 +163,6 @@ func checkBidirectionalLaneConnectivity( require.Equal(t, solanaChain.GasPrice, price.Value, "price must equal expected") } -func checkLaneDisabled( - t *testing.T, - e *fdeployment.Environment, - solanaChain lanesapi.ChainDefinition, - evmChain lanesapi.ChainDefinition, - solanaAdapter lanesapi.LaneAdapter, - evmAdapter lanesapi.LaneAdapter, -) { - t.Helper() - - // EVM Router: OnRamp must be zeroed for the remote chain - routerOnDestAddr, err := evmAdapter.GetRouterAddress(e.DataStore, evmChain.Selector) - require.NoError(t, err, "must get router from evmAdapter") - routerOnDest, err := router.NewRouter(common.BytesToAddress(routerOnDestAddr), e.BlockChains.EVMChains()[evmChain.Selector].Client) - require.NoError(t, err, "must instantiate router") - - onRampOnRouter, err := routerOnDest.GetOnRamp(nil, solanaChain.Selector) - require.NoError(t, err, "must get onRamp from router") - require.Equal(t, common.Address{}, onRampOnRouter, "onRamp must be zeroed after disable") - - // EVM Router: OffRamp must be removed for the remote chain - offRampDestAddr, err := evmAdapter.GetOffRampAddress(e.DataStore, evmChain.Selector) - require.NoError(t, err, "must get offRamp from evmAdapter") - isOffRamp, err := routerOnDest.IsOffRamp(nil, solanaChain.Selector, common.Address(offRampDestAddr)) - require.NoError(t, err, "must check if router has offRamp") - require.False(t, isOffRamp, "offRamp must be removed from router after disable") - - // Solana FeeQuoter: DestChain must be disabled for the remote chain - feeQuoterOnSrcAddr, err := solanaAdapter.GetFQAddress(e.DataStore, solanaChain.Selector) - require.NoError(t, err, "must get feeQuoter from solanaAdapter") - var destChainFqAccount fee_quoter.DestChain - fqEvmDestChainPDA, _, _ := state.FindFqDestChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(feeQuoterOnSrcAddr)) - err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), fqEvmDestChainPDA, &destChainFqAccount) - require.NoError(t, err, "must get FeeQuoter dest chain account") - require.False(t, destChainFqAccount.Config.IsEnabled, "Solana FeeQuoter dest chain must be disabled") - - // Solana OffRamp: SourceChain must be disabled for the remote chain - offRampOnSrcAddr, err := solanaAdapter.GetOffRampAddress(e.DataStore, solanaChain.Selector) - require.NoError(t, err, "must get offRamp from solanaAdapter") - var offRampSourceChain ccip_offramp.SourceChain - offRampEvmSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(offRampOnSrcAddr)) - err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), offRampEvmSourceChainPDA, &offRampSourceChain) - require.NoError(t, err, "must get OffRamp source chain account") - require.False(t, offRampSourceChain.Config.IsEnabled, "Solana OffRamp source chain must be disabled") -} - func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { t.Parallel() programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) @@ -308,117 +262,3 @@ func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { // should add a new entry for remote source and remote dest in solana require.Equal(t, 2, len(connectOut.DataStore.Addresses().Filter())) } - -func TestDisableLane_EVM2SVM(t *testing.T) { - t.Parallel() - programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) - require.NoError(t, err, "Failed to set up Solana environment") - require.NotNil(t, ds, "Datastore should be created") - - evmChains := []uint64{ - chain_selectors.ETHEREUM_MAINNET.Selector, - } - solanaChains := []uint64{ - chain_selectors.SOLANA_MAINNET.Selector, - } - allChains := append(evmChains, solanaChains...) - e, err := environment.New(t.Context(), - environment.WithEVMSimulated(t, evmChains), - environment.WithSolanaContainer(t, solanaChains, programsPath, solanaProgramIDs), - ) - require.NoError(t, err, "Failed to create test environment") - require.NotNil(t, e, "Environment should be created") - e.DataStore = ds.Seal() - - mcmsRegistry := cs_core.GetRegistry() - dReg := deployops.GetRegistry() - version := semver.MustParse("1.6.0") - for _, chainSel := range allChains { - mint, _ := solana.NewRandomPrivateKey() - out, err := deployops.DeployContracts(dReg).Apply(*e, deployops.ContractDeploymentConfig{ - MCMS: mcms.Input{}, - Chains: map[uint64]deployops.ContractDeploymentConfigPerChain{ - chainSel: { - Version: version, - TokenPrivKey: mint.String(), - TokenDecimals: 9, - MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1e18)), - TokenPriceStalenessThreshold: uint32(24 * 60 * 60), - LinkPremiumMultiplier: 9e17, - NativeTokenPremiumMultiplier: 1e18, - PermissionLessExecutionThresholdSeconds: uint32((20 * time.Minute).Seconds()), - GasForCallExactCheck: uint16(5000), - }, - }, - }) - require.NoError(t, err, "Failed to apply DeployChainContracts changeset") - out.DataStore.Merge(e.DataStore) - e.DataStore = out.DataStore.Seal() - } - DeployMCMS(t, e, chain_selectors.SOLANA_MAINNET.Selector, []string{cciputils.CLLQualifier}) - SolanaTransferOwnership(t, e, chain_selectors.SOLANA_MAINNET.Selector) - - chain1 := lanesapi.ChainDefinition{ - Selector: chain_selectors.SOLANA_MAINNET.Selector, - GasPrice: big.NewInt(1e17), - FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.SOLANA_MAINNET.Selector), - } - chain2 := lanesapi.ChainDefinition{ - Selector: chain_selectors.ETHEREUM_MAINNET.Selector, - GasPrice: big.NewInt(1e9), - FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.ETHEREUM_MAINNET.Selector), - } - - connectOut, err := lanesapi.ConnectChains(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.ConnectChainsConfig{ - Lanes: []lanesapi.LaneConfig{ - { - Version: version, - ChainA: chain1, - ChainB: chain2, - }, - }, - MCMS: mcms.Input{ - OverridePreviousRoot: false, - ValidUntil: 3759765795, - TimelockDelay: mcms_types.MustParseDuration("1s"), - TimelockAction: mcms_types.TimelockActionSchedule, - Qualifier: cciputils.CLLQualifier, - Description: "Connect Chains", - }, - }) - require.NoError(t, err, "Failed to apply ConnectChains changeset") - testhelpers.ProcessTimelockProposals(t, *e, connectOut.MCMSTimelockProposals, false) - - laneRegistry := lanesapi.GetLaneAdapterRegistry() - srcFamily, err := chain_selectors.GetSelectorFamily(chain1.Selector) - require.NoError(t, err, "must get selector family for src") - srcAdapter, exists := laneRegistry.GetLaneAdapter(srcFamily, version) - require.True(t, exists, "must have ChainAdapter registered for src chain family") - destFamily, err := chain_selectors.GetSelectorFamily(chain2.Selector) - require.NoError(t, err, "must get selector family for dest") - destAdapter, exists := laneRegistry.GetLaneAdapter(destFamily, version) - require.True(t, exists, "must have ChainAdapter registered for dest chain family") - checkBidirectionalLaneConnectivity(t, e, chain1, chain2, srcAdapter, destAdapter, false, false) - - disableOut, err := lanesapi.DisableLane(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.DisableLaneConfig{ - Lanes: []lanesapi.DisableLanePair{ - { - ChainA: chain_selectors.SOLANA_MAINNET.Selector, - ChainB: chain_selectors.ETHEREUM_MAINNET.Selector, - Version: version, - }, - }, - MCMS: mcms.Input{ - OverridePreviousRoot: true, - ValidUntil: 3759765795, - TimelockDelay: mcms_types.MustParseDuration("1s"), - TimelockAction: mcms_types.TimelockActionSchedule, - Qualifier: cciputils.CLLQualifier, - Description: "Disable Lane", - }, - }) - require.NoError(t, err, "Failed to apply DisableLane changeset") - testhelpers.ProcessTimelockProposals(t, *e, disableOut.MCMSTimelockProposals, false) - - checkLaneDisabled(t, e, chain1, chain2, srcAdapter, destAdapter) -} From db986ffabbb2f2dbca7cdae5e97dd8d8a72b7d47 Mon Sep 17 00:00:00 2001 From: kylesmartin <54827727+kylesmartin@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:50:36 -0500 Subject: [PATCH 09/41] Add various read ops (#1753) --- .../evm/deployment/operations_gen_config.yaml | 3 + .../v1_0_0/operations/rmn_proxy/rmn_proxy.go | 11 +++ .../type_and_version/type_and_version.go | 87 +++++++++++++++++++ .../v1_2_0/operations/router/router.go | 25 ++++++ .../lock_release_token_pool.go | 21 +++++ 5 files changed, 147 insertions(+) create mode 100644 chains/evm/deployment/v1_0_0/operations/type_and_version/type_and_version.go diff --git a/chains/evm/deployment/operations_gen_config.yaml b/chains/evm/deployment/operations_gen_config.yaml index 010ce3b809..cdeec79958 100644 --- a/chains/evm/deployment/operations_gen_config.yaml +++ b/chains/evm/deployment/operations_gen_config.yaml @@ -106,6 +106,9 @@ contracts: - contract_name: LockReleaseTokenPool version: "1.6.1" + functions: + - name: getRebalancer + access: public - contract_name: SiloedLockReleaseTokenPool version: "1.6.1" diff --git a/chains/evm/deployment/v1_0_0/operations/rmn_proxy/rmn_proxy.go b/chains/evm/deployment/v1_0_0/operations/rmn_proxy/rmn_proxy.go index 7b0f32e32e..986ee4532e 100644 --- a/chains/evm/deployment/v1_0_0/operations/rmn_proxy/rmn_proxy.go +++ b/chains/evm/deployment/v1_0_0/operations/rmn_proxy/rmn_proxy.go @@ -47,3 +47,14 @@ var SetRMN = contract.NewWrite(contract.WriteParams[SetRMNArgs, *rmn_proxy_contr return rmnProxy.SetARM(opts, args.RMN) }, }) + +var GetRMN = contract.NewRead(contract.ReadParams[struct{}, common.Address, *rmn_proxy_contract.RMNProxy]{ + Name: "rmn_proxy:get-rmn", + Version: semver.MustParse("1.0.0"), + Description: "Gets the RMN address set on the RMNProxy", + ContractType: ContractType, + NewContract: rmn_proxy_contract.NewRMNProxy, + CallContract: func(rmnProxy *rmn_proxy_contract.RMNProxy, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return rmnProxy.GetARM(opts) + }, +}) diff --git a/chains/evm/deployment/v1_0_0/operations/type_and_version/type_and_version.go b/chains/evm/deployment/v1_0_0/operations/type_and_version/type_and_version.go new file mode 100644 index 0000000000..94e9a9cb0c --- /dev/null +++ b/chains/evm/deployment/v1_0_0/operations/type_and_version/type_and_version.go @@ -0,0 +1,87 @@ +package type_and_version + +import ( + "fmt" + "strings" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" +) + +var ContractType cldf_deployment.ContractType = "ITypeAndVersion" +var Version = utils.Version_1_0_0 + +const TypeAndVersionABI = `[ { "type": "function", "name": "typeAndVersion", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" } ]` + +type TypeAndVersionContract struct { + address common.Address + abi abi.ABI + backend bind.ContractBackend + contract *bind.BoundContract +} + +func NewTypeAndVersionContract( + address common.Address, + backend bind.ContractBackend, +) (*TypeAndVersionContract, error) { + parsed, err := abi.JSON(strings.NewReader(TypeAndVersionABI)) + if err != nil { + return nil, err + } + return &TypeAndVersionContract{ + address: address, + abi: parsed, + backend: backend, + contract: bind.NewBoundContract(address, parsed, backend, backend, backend), + }, nil +} + +func (c *TypeAndVersionContract) Address() common.Address { + return c.address +} + +func (c *TypeAndVersionContract) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []any + err := c.contract.Call(opts, &out, "typeAndVersion") + if err != nil { + return "", err + } + return *abi.ConvertType(out[0], new(string)).(*string), nil +} + +type TypeAndVersion struct { + Type cldf_deployment.ContractType + Version *semver.Version +} + +var GetTypeAndVersion = contract.NewRead(contract.ReadParams[struct{}, TypeAndVersion, *TypeAndVersionContract]{ + Name: "type-and-version:get-type-and-version", + Version: Version, + Description: "Gets the type and version of the contract", + ContractType: ContractType, + NewContract: NewTypeAndVersionContract, + CallContract: func(c *TypeAndVersionContract, opts *bind.CallOpts, args struct{}) (TypeAndVersion, error) { + typeAndVersion, err := c.TypeAndVersion(opts) + if err != nil { + return TypeAndVersion{}, err + } + typeAndVersionValues := strings.Split(typeAndVersion, " ") + if len(typeAndVersionValues) < 2 { + return TypeAndVersion{}, fmt.Errorf("invalid type and version %s, expected format: ", typeAndVersion) + } + version, err := semver.NewVersion(typeAndVersionValues[1]) + if err != nil { + return TypeAndVersion{}, fmt.Errorf("failed parsing version %s: %w", typeAndVersionValues[1], err) + } + return TypeAndVersion{ + Type: cldf_deployment.ContractType(typeAndVersionValues[0]), + Version: version, + }, nil + }, +}) diff --git a/chains/evm/deployment/v1_2_0/operations/router/router.go b/chains/evm/deployment/v1_2_0/operations/router/router.go index f54530e0dd..2714723c29 100644 --- a/chains/evm/deployment/v1_2_0/operations/router/router.go +++ b/chains/evm/deployment/v1_2_0/operations/router/router.go @@ -141,3 +141,28 @@ var IsChainSupported = contract.NewRead(contract.ReadParams[uint64, bool, *route return router.IsChainSupported(opts, args) }, }) + +var GetWrappedNative = contract.NewRead(contract.ReadParams[struct{}, common.Address, *router.Router]{ + Name: "router:get-wrapped-native", + Version: Version, + Description: "Gets the wrapped native address", + ContractType: ContractType, + NewContract: router.NewRouter, + CallContract: func(router *router.Router, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return router.GetWrappedNative(opts) + }, +}) + +var SetWrappedNative = contract.NewWrite(contract.WriteParams[common.Address, *router.Router]{ + Name: "router:set-wrapped-native", + Version: Version, + Description: "Sets the wrapped native address", + ContractType: ContractType, + ContractABI: router.RouterABI, + NewContract: router.NewRouter, + IsAllowedCaller: contract.OnlyOwner[*router.Router, common.Address], + Validate: func(common.Address) error { return nil }, + CallContract: func(router *router.Router, opts *bind.TransactOpts, args common.Address) (*types.Transaction, error) { + return router.SetWrappedNative(opts, args) + }, +}) diff --git a/chains/evm/deployment/v1_6_1/operations/lock_release_token_pool/lock_release_token_pool.go b/chains/evm/deployment/v1_6_1/operations/lock_release_token_pool/lock_release_token_pool.go index 85c5cb4dfc..d179337ae2 100644 --- a/chains/evm/deployment/v1_6_1/operations/lock_release_token_pool/lock_release_token_pool.go +++ b/chains/evm/deployment/v1_6_1/operations/lock_release_token_pool/lock_release_token_pool.go @@ -57,6 +57,16 @@ func (c *LockReleaseTokenPoolContract) Owner(opts *bind.CallOpts) (common.Addres return *abi.ConvertType(out[0], new(common.Address)).(*common.Address), nil } +func (c *LockReleaseTokenPoolContract) GetRebalancer(opts *bind.CallOpts) (common.Address, error) { + var out []any + err := c.contract.Call(opts, &out, "getRebalancer") + if err != nil { + var zero common.Address + return zero, err + } + return *abi.ConvertType(out[0], new(common.Address)).(*common.Address), nil +} + type ConstructorArgs struct { Token common.Address LocalTokenDecimals uint8 @@ -80,3 +90,14 @@ var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ }, Validate: func(ConstructorArgs) error { return nil }, }) + +var GetRebalancer = contract.NewRead(contract.ReadParams[struct{}, common.Address, *LockReleaseTokenPoolContract]{ + Name: "lock-release-token-pool:get-rebalancer", + Version: Version, + Description: "Calls getRebalancer on the contract", + ContractType: ContractType, + NewContract: NewLockReleaseTokenPoolContract, + CallContract: func(c *LockReleaseTokenPoolContract, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return c.GetRebalancer(opts) + }, +}) From b1e525daa970b34e11faf2c2984774c87b0d7741 Mon Sep 17 00:00:00 2001 From: Matthew Romage <33700623+ma33r@users.noreply.github.com> Date: Fri, 27 Feb 2026 14:56:30 -0400 Subject: [PATCH 10/41] Add Changeset to Update MCMSConfig (#1748) * add EVM implementation * fix tests * handle error * add Solana implementation * add solana test * naming convention * update test to use correct Solana mcm program type * test * try removing qualifier * fix test * remove duplicate import --- .../deployment/v1_0_0/adapters/deployer.go | 29 +++- .../v1_0_0/adapters/deployer_test.go | 133 ++++++++++++++++++ .../evm/deployment/v1_0_0/sequences/mcms.go | 43 ++++++ .../sequences/deploy_chain_contracts.go | 26 ++-- .../deployment/v1_6_0/sequences/mcms.go | 40 ++++++ deployment/deploy/mcms.go | 117 ++++++++++++++- deployment/deploy/product.go | 1 + deployment/testhelpers/proposal.go | 23 ++- integration-tests/deployment/mcms_test.go | 127 +++++++++++++++++ 9 files changed, 525 insertions(+), 14 deletions(-) create mode 100644 integration-tests/deployment/mcms_test.go diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer.go b/chains/evm/deployment/v1_0_0/adapters/deployer.go index 3b5f32a113..81cd75c723 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer.go @@ -32,6 +32,33 @@ func (a *EVMDeployer) SetOCR3Config() *cldf_ops.Sequence[ccipapi.SetOCR3ConfigIn return nil } +func (a *EVMDeployer) UpdateMCMSConfig() *cldf_ops.Sequence[ccipapi.UpdateMCMSConfigInputPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { + return cldf_ops.NewSequence( + "update-mcms-config", + semver.MustParse("1.0.0"), + "Updates MCMS Configs of the specified contracts with the specified configs", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequtil.OnChainOutput, err error) { + evmChain, ok := chains.EVMChains()[in.ChainSelector] + if !ok { + return sequtil.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) + } + + // create sequence input + seqInput := seq.SeqSetMCMSConfigInput{ + ChainSelector: in.ChainSelector, + MCMConfig: &in.MCMConfig, + MCMContracts: in.MCMContracts, + } + report, err := cldf_ops.ExecuteSequence(b, seq.SeqSetMCMSConfigs, evmChain, seqInput) + if err != nil { + return sequtil.OnChainOutput{}, fmt.Errorf("failed to update mcms config on chain %d: %w", in.ChainSelector, err) + } + output.BatchOps = append(output.BatchOps, report.Output.BatchOps...) + + return output, nil + }) +} + func (a *EVMDeployer) GrantAdminRoleToTimelock() *cldf_ops.Sequence[ccipapi.GrantAdminRoleToTimelockConfigPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "grant-admin-role-of-timelock-to-timelock", @@ -51,7 +78,7 @@ func (a *EVMDeployer) GrantAdminRoleToTimelock() *cldf_ops.Sequence[ccipapi.Gran } report, err := cldf_ops.ExecuteSequence(b, seq.SeqGrantAdminRoleOfTimelockToTimelock, evmChain, seqInput) if err != nil { - return sequtil.OnChainOutput{}, fmt.Errorf("failed to deploy and configure proposer MCM on chain %d: %w", in.ChainSelector, err) + return sequtil.OnChainOutput{}, fmt.Errorf("failed to grant admin role to timelock on chain %d: %w", in.ChainSelector, err) } return report.Output, nil diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go index 0865ef8f20..d2f7c617e5 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/mcms/sdk/evm/bindings" + mcms_types "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" @@ -22,6 +23,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/deployment/utils" deploymentutils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" ) func TestDeployMCMS(t *testing.T) { @@ -124,6 +126,137 @@ func TestDeployMCMS(t *testing.T) { require.True(t, hasRole, "Call Proxy should have admin role for EXECUTOR_ROLE") } +func TestUpdateMCMSConfig(t *testing.T) { + t.Parallel() + selector1 := chainsel.TEST_90000001.Selector + selector2 := chainsel.TEST_90000002.Selector + env, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, []uint64{selector1, selector2}), + ) + require.NoError(t, err) + env.Logger = logger.Test(t) + evmChain1 := env.BlockChains.EVMChains()[selector1] + evmChain2 := env.BlockChains.EVMChains()[selector2] + + evmDeployer := &adapters.EVMDeployer{} + dReg := deployops.GetRegistry() + dReg.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) + + // deploy one set of timelock and MCMS contracts on each chain + deployMCMS := deployops.DeployMCMS(dReg, nil) + output, err := deployMCMS.Apply(*env, deployops.MCMSDeploymentConfig{ + AdapterVersion: semver.MustParse("1.0.0"), + Chains: map[uint64]deployops.MCMSDeploymentConfigPerChain{ + selector1: { + Canceller: testhelpers.SingleGroupMCMS(), + Bypasser: testhelpers.SingleGroupMCMS(), + Proposer: testhelpers.SingleGroupMCMS(), + TimelockMinDelay: big.NewInt(0), + Qualifier: ptr.String("CLLCCIP"), + TimelockAdmin: evmChain1.DeployerKey.From, + }, + selector2: { + Canceller: testhelpers.SingleGroupMCMS(), + Bypasser: testhelpers.SingleGroupMCMS(), + Proposer: testhelpers.SingleGroupMCMS(), + TimelockMinDelay: big.NewInt(0), + Qualifier: ptr.String("CLLCCIP"), + TimelockAdmin: evmChain2.DeployerKey.From, + }, + }, + }) + require.NoError(t, err) + require.Greater(t, len(output.Reports), 0) + env.DataStore = output.DataStore.Seal() + + // get recently deployed MCMS addresses + mcmsRefs := make(map[uint64][]datastore.AddressRef) + for _, sel := range []uint64{selector1, selector2} { + cancellerRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: sel, + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: "CLLCCIP", + Version: semver.MustParse("1.0.0"), + }, sel, datastore_utils.FullRef) + require.NoError(t, err) + bypasserRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: sel, + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: "CLLCCIP", + Version: semver.MustParse("1.0.0"), + }, sel, datastore_utils.FullRef) + require.NoError(t, err) + proposerRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: sel, + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: "CLLCCIP", + Version: semver.MustParse("1.0.0"), + }, sel, datastore_utils.FullRef) + require.NoError(t, err) + mcmsRefs[sel] = append(mcmsRefs[sel], cancellerRef, bypasserRef, proposerRef) + } + + // check that deployed config is correct + for _, sel := range []uint64{selector1, selector2} { + for _, ref := range mcmsRefs[sel] { + evmChain := env.BlockChains.EVMChains()[sel] + mcmsContract, err := bindings.NewManyChainMultiSig(common.HexToAddress(ref.Address), evmChain.Client) + require.NoError(t, err) + + // binding is done, now check config + config, err := mcmsContract.GetConfig(&bind.CallOpts{ + Context: t.Context(), + }) + require.NoError(t, err) + + numOfSigners := len(config.Signers) + require.Equal(t, numOfSigners, len(testhelpers.SingleGroupMCMS().Signers)) // should be 1 + } + } + + // update the config for each MCMS contract + updateMcmsConfigMCMS := deployops.UpdateMCMSConfig(dReg, nil) + output, err = updateMcmsConfigMCMS.Apply(*env, deployops.UpdateMCMSConfigInput{ + AdapterVersion: semver.MustParse("1.0.0"), + Chains: map[uint64]deployops.UpdateMCMSConfigInputPerChain{ + selector1: { + MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), + MCMContracts: mcmsRefs[selector1], + }, + selector2: { + MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), + MCMContracts: mcmsRefs[selector2], + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: false, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("0s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: "CLLCCIP", + Description: "update mcms config test", + }, + }) + require.NoError(t, err) + require.Greater(t, len(output.Reports), 0) + + // check that MCMS configs are updated correctly + for _, sel := range []uint64{selector1, selector2} { + for _, ref := range mcmsRefs[sel] { + evmChain := env.BlockChains.EVMChains()[sel] + mcmsContract, err := bindings.NewManyChainMultiSig(common.HexToAddress(ref.Address), evmChain.Client) + require.NoError(t, err) + config, err := mcmsContract.GetConfig(&bind.CallOpts{ + Context: t.Context(), + }) + require.NoError(t, err) + + numOfSigners := len(config.Signers) + require.Equal(t, numOfSigners, len(testhelpers.SingleGroupMCMSTwoSigners().Signers)) // should be 2 + } + } +} + func TestGrantAdminRoleToTimelock(t *testing.T) { t.Parallel() selector1 := chainsel.TEST_90000001.Selector diff --git a/chains/evm/deployment/v1_0_0/sequences/mcms.go b/chains/evm/deployment/v1_0_0/sequences/mcms.go index b5c643b664..acdce4237c 100644 --- a/chains/evm/deployment/v1_0_0/sequences/mcms.go +++ b/chains/evm/deployment/v1_0_0/sequences/mcms.go @@ -42,6 +42,12 @@ type SeqGrantAdminRoleOfTimelockToTimelockInput struct { NewAdminTimelockAddress common.Address } +type SeqSetMCMSConfigInput struct { + ChainSelector uint64 + MCMConfig *types.Config + MCMContracts []datastore.AddressRef +} + var SeqDeployMCMWithConfig = cldf_ops.NewSequence( "seq-deploy-mcm-with-config", semver.MustParse("1.0.0"), @@ -108,6 +114,43 @@ var SeqDeployMCMWithConfig = cldf_ops.NewSequence( }, ) +var SeqSetMCMSConfigs = cldf_ops.NewSequence( + "seq-set-mcm-config", + semver.MustParse("1.0.0"), + "Sets config on previously deployed MCM contract", + func(b cldf_ops.Bundle, chain cldf_evm.Chain, in SeqSetMCMSConfigInput) (output sequences.OnChainOutput, err error) { + for _, mcmContract := range in.MCMContracts { + // Set config on contract + groupQuorums, groupParents, signerAddresses, signerGroups, err := sdk.ExtractSetConfigInputs(in.MCMConfig) + if err != nil { + return sequences.OnChainOutput{}, err + } + report, err := cldf_ops.ExecuteOperation(b, ops.OpEVMSetConfigMCM, chain, + contract.FunctionInput[ops.OpSetConfigMCMInput]{ + ChainSelector: in.ChainSelector, + Address: common.HexToAddress(mcmContract.Address), + Args: ops.OpSetConfigMCMInput{ + SignerAddresses: signerAddresses, + SignerGroups: signerGroups, + GroupQuorums: groupQuorums, + GroupParents: groupParents, + }, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to update mcms config on chain %d for contract with address %s: %w", + in.ChainSelector, mcmContract.Address, err) + } + batchOp, err := contract.NewBatchOperationFromWrites([]contract.WriteOutput{report.Output}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation from writes: %w", err) + } + output.BatchOps = append(output.BatchOps, batchOp) + } + + return output, nil + }, +) + var SeqGrantAdminRoleOfTimelockToTimelock = cldf_ops.NewSequence( "seq-grant-admin-role-of-timelock-to-timelock", semver.MustParse("1.0.0"), diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go index b2b37994cb..354f725680 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go @@ -56,6 +56,12 @@ func (a *EVMAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.G return evmDeployer.GrantAdminRoleToTimelock() } +// Updates MCMs Config on specified MCMS contracts +func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { + evmDeployer := &evm1_0_0.EVMDeployer{} + return evmDeployer.UpdateMCMSConfig() +} + var DeployChainContracts = cldf_ops.NewSequence( "deploy-chain-contracts", semver.MustParse("1.6.0"), @@ -196,8 +202,8 @@ var DeployChainContracts = cldf_ops.NewSequence( common.HexToAddress(linkRef.Address), common.HexToAddress(wethRef.Address), }, - TokenPriceFeeds: []fqops.TokenPriceFeedUpdate{}, - TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{}, + TokenPriceFeeds: []fqops.TokenPriceFeedUpdate{}, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{}, PremiumMultiplierWeiPerEthArgs: []fqops.PremiumMultiplierWeiPerEthArgs{ { PremiumMultiplierWeiPerEth: input.LinkPremiumMultiplier, @@ -339,14 +345,14 @@ var DeployChainContracts = cldf_ops.NewSequence( return sequences.OnChainOutput{}, err } - // Add Authorized Caller to FQ - _, err = cldf_ops.ExecuteOperation(b, fqops.ApplyAuthorizedCallerUpdates, chain, contract.FunctionInput[fqops.AuthorizedCallerArgs]{ - ChainSelector: chain.Selector, - Address: common.HexToAddress(feeQuoterRef.Address), - Args: fqops.AuthorizedCallerArgs{ - AddedCallers: []common.Address{ - common.HexToAddress(offRampRef.Address), - }, + // Add Authorized Caller to FQ + _, err = cldf_ops.ExecuteOperation(b, fqops.ApplyAuthorizedCallerUpdates, chain, contract.FunctionInput[fqops.AuthorizedCallerArgs]{ + ChainSelector: chain.Selector, + Address: common.HexToAddress(feeQuoterRef.Address), + Args: fqops.AuthorizedCallerArgs{ + AddedCallers: []common.Address{ + common.HexToAddress(offRampRef.Address), + }, }, }) if err != nil { diff --git a/chains/solana/deployment/v1_6_0/sequences/mcms.go b/chains/solana/deployment/v1_6_0/sequences/mcms.go index 45d6a5a165..6cf97e7a94 100644 --- a/chains/solana/deployment/v1_6_0/sequences/mcms.go +++ b/chains/solana/deployment/v1_6_0/sequences/mcms.go @@ -360,6 +360,46 @@ func (a *SolanaAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployop return nil } +func (a *SolanaAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { + return operations.NewSequence( + "update-mcms-config", + semver.MustParse("1.0.0"), + "Updates Config of specified MCMS Contracts", + func(b operations.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequences.OnChainOutput, err error) { + chain, ok := chains.SolanaChains()[in.ChainSelector] + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) + } + + // Set config for each inputted contract + for _, contract := range in.MCMContracts { + deps := mcmsops.Deps{ + Chain: chain, + ExistingAddresses: in.ExistingAddresses, + Qualifier: contract.Qualifier, + } + configureOpInput := ccipapi.MCMSDeploymentConfigPerChain{ + Canceller: in.MCMConfig, + Bypasser: in.MCMConfig, + Proposer: in.MCMConfig, + Qualifier: &contract.Qualifier, + ContractVersion: contract.Version.String(), + } + id, _, _ := mcms_solana.ParseContractAddress(contract.Address) + configureOpOutput, err := configureMCM(b, deps, configureOpInput, id) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to configure MCMs: %w", err) + } + + output.Addresses = append(output.Addresses, configureOpOutput.NewAddresses...) + output.BatchOps = append(output.BatchOps, configureOpOutput.BatchOps...) + } + + return output, nil + }, + ) +} + func getRefsAsOwnable( refs []cldf_datastore.AddressRef, transferAccessController bool) []mcmsops.OwnableContract { diff --git a/deployment/deploy/mcms.go b/deployment/deploy/mcms.go index 0c6c543ebc..a8606eeddd 100644 --- a/deployment/deploy/mcms.go +++ b/deployment/deploy/mcms.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math/big" + "slices" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" @@ -11,7 +12,6 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" - mcms_types "github.com/smartcontractkit/mcms/types" mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -62,6 +62,119 @@ type GrantAdminRoleToTimelockConfig struct { AdapterVersion *semver.Version `json:"adapterVersion"` } +type UpdateMCMSConfigInputPerChainWithSelector struct { + UpdateMCMSConfigInputPerChain + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef // needed for Solana +} + +type UpdateMCMSConfigInputPerChain struct { + MCMConfig mcmstypes.Config + MCMContracts []datastore.AddressRef +} + +type UpdateMCMSConfigInput struct { + Chains map[uint64]UpdateMCMSConfigInputPerChain `json:"chains"` + AdapterVersion *semver.Version `json:"adapterVersion"` + MCMS mcms.Input `json:"mcms"` +} + +func UpdateMCMSConfig(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateMCMSConfigInput] { + return cldf.CreateChangeSet( + updateMCMSConfigApply(deployerReg, mcmsRegistry), + updateMCMSConfigVerify(deployerReg, mcmsRegistry), + ) +} + +func updateMCMSConfigVerify(_ *DeployerRegistry, _ *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) error { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) error { + if cfg.AdapterVersion == nil { + return errors.New("adapter version is required") + } + + // validate mcms input + if err := cfg.MCMS.Validate(); err != nil { + return err + } + + validTypes := []string{utils.BypasserManyChainMultisig.String(), utils.ProposerManyChainMultisig.String(), + utils.CancellerManyChainMultisig.String()} + + // validate each contract + for _, chainCfg := range cfg.Chains { + for _, contract := range chainCfg.MCMContracts { + if !slices.Contains(validTypes, contract.Type.String()) { + return errors.New("type of contract needs to be mcms") + } + if len(contract.Qualifier) == 0 { + return errors.New("mcms contract qualifier cannot be empty") + } + if len(contract.Version.String()) == 0 { + return errors.New("mcms contract version cannot be empty") + } + } + } + + return nil + } +} + +func updateMCMSConfigApply(d *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + batchOps := make([]mcmstypes.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + for selector, chainCfg := range cfg.Chains { + family, err := chain_selectors.GetSelectorFamily(selector) + if err != nil { + return cldf.ChangesetOutput{}, err + } + deployer, exists := d.GetDeployer(family, cfg.AdapterVersion) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no deployer registered for chain family %s and version %s", family, cfg.AdapterVersion.String()) + } + + // If partial refs are provided, resolve to full refs + mcmsContracts := []datastore.AddressRef{} + for _, contract := range chainCfg.MCMContracts { + mcmsQualifier := contract.Qualifier + mcmsRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: selector, + Type: contract.Type, + Version: contract.Version, + Qualifier: mcmsQualifier, + }, selector, datastore_utils.FullRef) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to find mcms ref with qualifier %s on chain with selector %d", mcmsQualifier, selector) + } + + mcmsContracts = append(mcmsContracts, mcmsRef) + } + + // find existing addresses for this chain from the env + existingAddrs := d.ExistingAddressesForChain(e, selector) + + // Call the set mcms config sequence + seqCfg := UpdateMCMSConfigInputPerChainWithSelector{ + UpdateMCMSConfigInputPerChain: chainCfg, + ChainSelector: selector, + ExistingAddresses: existingAddrs, + } + + report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, deployer.UpdateMCMSConfig(), e.BlockChains, seqCfg) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to Update MCMS Config on chain with selector %d: %w", selector, err) + } + batchOps = append(batchOps, report.Output.BatchOps...) + reports = append(reports, report.ExecutionReports...) + } + + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + Build(cfg.MCMS) + } +} + func GrantAdminRoleToTimelock(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[GrantAdminRoleToTimelockConfig] { return cldf.CreateChangeSet( grantAdminRoleToTimelockApply(deployerReg, mcmsRegistry), @@ -184,7 +297,7 @@ func deployMCMSApply( finalize bool) func(cldf.Environment, MCMSDeploymentConfig) (cldf.ChangesetOutput, error) { return func(e cldf.Environment, cfg MCMSDeploymentConfig) (cldf.ChangesetOutput, error) { reports := make([]cldf_ops.Report[any, any], 0) - batchOps := make([]mcms_types.BatchOperation, 0) + batchOps := make([]mcmstypes.BatchOperation, 0) ds := datastore.NewMemoryDataStore() for selector, mcmsCfg := range cfg.Chains { family, err := chain_selectors.GetSelectorFamily(selector) diff --git a/deployment/deploy/product.go b/deployment/deploy/product.go index d42a9c84d8..64adf7f31a 100644 --- a/deployment/deploy/product.go +++ b/deployment/deploy/product.go @@ -33,6 +33,7 @@ type Deployer interface { FinalizeDeployMCMS() *cldf_ops.Sequence[MCMSDeploymentConfigPerChainWithAddress, sequences.OnChainOutput, cldf_chain.BlockChains] SetOCR3Config() *cldf_ops.Sequence[SetOCR3ConfigInput, sequences.OnChainOutput, cldf_chain.BlockChains] GrantAdminRoleToTimelock() *cldf_ops.Sequence[GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] + UpdateMCMSConfig() *cldf_ops.Sequence[UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] } type DeployerRegistry struct { diff --git a/deployment/testhelpers/proposal.go b/deployment/testhelpers/proposal.go index 6fe69aea7c..ae9a00d329 100644 --- a/deployment/testhelpers/proposal.go +++ b/deployment/testhelpers/proposal.go @@ -31,7 +31,8 @@ import ( var ( // TestXXXMCMSSigner is a throwaway private key used for signing MCMS proposals. // in tests. - TestXXXMCMSSigner *ecdsa.PrivateKey + TestXXXMCMSSigner *ecdsa.PrivateKey + TestXXXMCMSSignerTwo *ecdsa.PrivateKey ) func init() { @@ -40,6 +41,13 @@ func init() { panic(err) } TestXXXMCMSSigner = key + + keyTwo, err := crypto.GenerateKey() + if err != nil { + panic(err) + } + TestXXXMCMSSignerTwo = keyTwo + } func SingleGroupMCMS() mcmstypes.Config { @@ -53,6 +61,19 @@ func SingleGroupMCMS() mcmstypes.Config { return c } +func SingleGroupMCMSTwoSigners() mcmstypes.Config { + publicKey := TestXXXMCMSSigner.Public().(*ecdsa.PublicKey) + publicKeyTwo := TestXXXMCMSSignerTwo.Public().(*ecdsa.PublicKey) + // Convert the public key to an Ethereum address + address := crypto.PubkeyToAddress(*publicKey) + addressTwo := crypto.PubkeyToAddress(*publicKeyTwo) + c, err := mcmstypes.NewConfig(1, []common.Address{address, addressTwo}, []mcmstypes.Config{}) + if err != nil { + panic(err) + } + return c +} + // SignMCMSTimelockProposal - Signs an MCMS timelock proposal. func SignMCMSTimelockProposal(t *testing.T, env cldf.Environment, proposal *mcmslib.TimelockProposal, realBackend bool) *mcmslib.Proposal { converters := make(map[mcmstypes.ChainSelector]mcmssdk.TimelockConverter) diff --git a/integration-tests/deployment/mcms_test.go b/integration-tests/deployment/mcms_test.go new file mode 100644 index 0000000000..e06cd73dd7 --- /dev/null +++ b/integration-tests/deployment/mcms_test.go @@ -0,0 +1,127 @@ +package deployment + +import ( + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/gagliardetto/solana-go" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/utils" + solseqV1_6_0 "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/mcm" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + mcmsapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" + + _ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" + deploymentutils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + + mcms_solana "github.com/smartcontractkit/mcms/sdk/solana" + mcms_types "github.com/smartcontractkit/mcms/types" +) + +func TestUpdateMCMSConfigSolana(t *testing.T) { + programsPath, dstr, err := PreloadSolanaEnvironment(t, chainsel.SOLANA_MAINNET.Selector) + require.NoError(t, err, "Failed to set up Solana environment") + require.NotNil(t, dstr, "Datastore should be created") + solanaChains := []uint64{ + chainsel.SOLANA_MAINNET.Selector, + } + env, err := environment.New(t.Context(), + environment.WithSolanaContainer(t, solanaChains, programsPath, solanaProgramIDs), + ) + require.NoError(t, err) + require.NotNil(t, env, "Environment should be created") + env.DataStore = dstr.Seal() // Add preloaded contracts to env datastore + chain := env.BlockChains.SolanaChains()[chainsel.SOLANA_MAINNET.Selector] + dReg := mcmsapi.GetRegistry() + solAdapter := solseqV1_6_0.SolanaAdapter{} + dReg.RegisterDeployer(chainsel.FamilySolana, deployops.MCMSVersion, &solAdapter) + err = utils.FundSolanaAccounts( + t.Context(), + []solana.PublicKey{chain.DeployerKey.PublicKey()}, + 100, + chain.Client, + ) + require.NoError(t, err) + + // deploy MCMS Contracts + DeployMCMS(t, env, solanaChains[0], []string{deploymentutils.CLLQualifier}) + + // get recently deployed MCMS addresses + mcmsRefs := []datastore.AddressRef{} + cancellerRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: solanaChains[0], + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: deploymentutils.CLLQualifier, + Version: semver.MustParse("1.6.0"), + }, solanaChains[0], datastore_utils.FullRef) + require.NoError(t, err) + bypasserRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: solanaChains[0], + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: deploymentutils.CLLQualifier, + Version: semver.MustParse("1.6.0"), + }, solanaChains[0], datastore_utils.FullRef) + require.NoError(t, err) + proposerRef, err := datastore_utils.FindAndFormatRef(env.DataStore, datastore.AddressRef{ + ChainSelector: solanaChains[0], + Type: datastore.ContractType(deploymentutils.CancellerManyChainMultisig), + Qualifier: deploymentutils.CLLQualifier, + Version: semver.MustParse("1.6.0"), + }, solanaChains[0], datastore_utils.FullRef) + require.NoError(t, err) + mcmsRefs = append(mcmsRefs, cancellerRef, bypasserRef, proposerRef) + + // check that deployed config is correct + for _, ref := range mcmsRefs { + var mcmConfig mcm.MultisigConfig + id, seed, _ := mcms_solana.ParseContractAddress(ref.Address) + err := chain.GetAccountDataBorshInto(env.GetContext(), state.GetMCMConfigPDA(id, state.PDASeed([]byte(seed[:]))), &mcmConfig) + require.NoError(t, err) + + numOfSigners := len(mcmConfig.Signers) + require.Equal(t, numOfSigners, len(testhelpers.SingleGroupMCMS().Signers)) // should be 1 + } + + // update the config for each MCMS contract + updateMcmsConfigMCMS := mcmsapi.UpdateMCMSConfig(dReg, nil) + output, err := updateMcmsConfigMCMS.Apply(*env, mcmsapi.UpdateMCMSConfigInput{ + AdapterVersion: semver.MustParse("1.0.0"), + Chains: map[uint64]mcmsapi.UpdateMCMSConfigInputPerChain{ + solanaChains[0]: { + MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), + MCMContracts: mcmsRefs, + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: false, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("0s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: deploymentutils.CLLQualifier, + Description: "update mcms config test", + }, + }) + require.NoError(t, err) + require.Greater(t, len(output.Reports), 0) + + // check that MCMS configs are updated correctly + for _, ref := range mcmsRefs { + var mcmConfig mcm.MultisigConfig + id, seed, _ := mcms_solana.ParseContractAddress(ref.Address) + err := chain.GetAccountDataBorshInto(env.GetContext(), state.GetMCMConfigPDA(id, state.PDASeed([]byte(seed[:]))), &mcmConfig) + require.NoError(t, err) + + numOfSigners := len(mcmConfig.Signers) + require.Equal(t, numOfSigners, len(testhelpers.SingleGroupMCMSTwoSigners().Signers)) // should be 2 + } + +} From 96c2394678f9164f175cf85b0a6a4a4f9e49d525 Mon Sep 17 00:00:00 2001 From: Matthew Romage <33700623+ma33r@users.noreply.github.com> Date: Fri, 27 Feb 2026 17:09:48 -0400 Subject: [PATCH 11/41] add interface (#1760) --- .../deployment/v1_0_0/adapters/deployer.go | 5 +- .../v1_0_0/adapters/deployer_test.go | 10 +- .../sequences/deploy_chain_contracts.go | 3 +- .../deployment/v1_6_0/sequences/mcms.go | 12 +- deployment/deploy/mcms.go | 114 --------------- deployment/deploy/product.go | 1 - deployment/deployTmp/README.md | 1 + deployment/deployTmp/mcms.go | 134 ++++++++++++++++++ deployment/deployTmp/product.go | 79 +++++++++++ integration-tests/deployment/mcms_test.go | 12 +- 10 files changed, 238 insertions(+), 133 deletions(-) create mode 100644 deployment/deployTmp/README.md create mode 100644 deployment/deployTmp/mcms.go create mode 100644 deployment/deployTmp/product.go diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer.go b/chains/evm/deployment/v1_0_0/adapters/deployer.go index 81cd75c723..de6f085d53 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer.go @@ -10,6 +10,7 @@ import ( cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" ccipapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + ccipapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" sequtil "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -32,12 +33,12 @@ func (a *EVMDeployer) SetOCR3Config() *cldf_ops.Sequence[ccipapi.SetOCR3ConfigIn return nil } -func (a *EVMDeployer) UpdateMCMSConfig() *cldf_ops.Sequence[ccipapi.UpdateMCMSConfigInputPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { +func (a *EVMDeployer) UpdateMCMSConfig() *cldf_ops.Sequence[ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "update-mcms-config", semver.MustParse("1.0.0"), "Updates MCMS Configs of the specified contracts with the specified configs", - func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequtil.OnChainOutput, err error) { + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, in ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector) (output sequtil.OnChainOutput, err error) { evmChain, ok := chains.EVMChains()[in.ChainSelector] if !ok { return sequtil.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go index d2f7c617e5..6759166fdc 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go @@ -19,6 +19,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + deployopsTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" deploymentutils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -142,6 +143,9 @@ func TestUpdateMCMSConfig(t *testing.T) { dReg := deployops.GetRegistry() dReg.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) + dRegTmp := deployopsTmp.GetRegistry() + dRegTmp.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) + // deploy one set of timelock and MCMS contracts on each chain deployMCMS := deployops.DeployMCMS(dReg, nil) output, err := deployMCMS.Apply(*env, deployops.MCMSDeploymentConfig{ @@ -215,10 +219,10 @@ func TestUpdateMCMSConfig(t *testing.T) { } // update the config for each MCMS contract - updateMcmsConfigMCMS := deployops.UpdateMCMSConfig(dReg, nil) - output, err = updateMcmsConfigMCMS.Apply(*env, deployops.UpdateMCMSConfigInput{ + updateMcmsConfigMCMS := deployopsTmp.UpdateMCMSConfig(dRegTmp, nil) + output, err = updateMcmsConfigMCMS.Apply(*env, deployopsTmp.UpdateMCMSConfigInput{ AdapterVersion: semver.MustParse("1.0.0"), - Chains: map[uint64]deployops.UpdateMCMSConfigInputPerChain{ + Chains: map[uint64]deployopsTmp.UpdateMCMSConfigInputPerChain{ selector1: { MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), MCMContracts: mcmsRefs[selector1], diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go index 354f725680..d0b9ec93e3 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go @@ -31,6 +31,7 @@ import ( onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/rmn_remote" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + deployopsTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" ) @@ -57,7 +58,7 @@ func (a *EVMAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.G } // Updates MCMs Config on specified MCMS contracts -func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployopsTmp.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { evmDeployer := &evm1_0_0.EVMDeployer{} return evmDeployer.UpdateMCMSConfig() } diff --git a/chains/solana/deployment/v1_6_0/sequences/mcms.go b/chains/solana/deployment/v1_6_0/sequences/mcms.go index 6cf97e7a94..3872e01e68 100644 --- a/chains/solana/deployment/v1_6_0/sequences/mcms.go +++ b/chains/solana/deployment/v1_6_0/sequences/mcms.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/timelock" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" ccipapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + ccipapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" common_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -308,7 +308,7 @@ func setupRoles(b operations.Bundle, deps mcmsops.Deps, mcmProgram solana.Public func transferAllMCMS( b operations.Bundle, chain cldf_solana.Chain, - in deployops.TransferOwnershipPerChainInput, + in ccipapi.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { var output sequences.OnChainOutput deps := mcmsops.Deps{ @@ -333,7 +333,7 @@ func transferAllMCMS( } // assume refs are in the order returned by GetAllMCMS -func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in deployops.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { +func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in ccipapi.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { var output sequences.OnChainOutput deps := mcmsops.Deps{ Chain: chain, @@ -355,17 +355,17 @@ func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in deployops.Tr return output, nil } -func (a *SolanaAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *SolanaAdapter) GrantAdminRoleToTimelock() *operations.Sequence[ccipapi.GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { // Not implemented for Solana return nil } -func (a *SolanaAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *SolanaAdapter) UpdateMCMSConfig() *operations.Sequence[ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { return operations.NewSequence( "update-mcms-config", semver.MustParse("1.0.0"), "Updates Config of specified MCMS Contracts", - func(b operations.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequences.OnChainOutput, err error) { + func(b operations.Bundle, chains cldf_chain.BlockChains, in ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector) (output sequences.OnChainOutput, err error) { chain, ok := chains.SolanaChains()[in.ChainSelector] if !ok { return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) diff --git a/deployment/deploy/mcms.go b/deployment/deploy/mcms.go index a8606eeddd..a87c8eca73 100644 --- a/deployment/deploy/mcms.go +++ b/deployment/deploy/mcms.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "math/big" - "slices" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" @@ -62,119 +61,6 @@ type GrantAdminRoleToTimelockConfig struct { AdapterVersion *semver.Version `json:"adapterVersion"` } -type UpdateMCMSConfigInputPerChainWithSelector struct { - UpdateMCMSConfigInputPerChain - ChainSelector uint64 - ExistingAddresses []datastore.AddressRef // needed for Solana -} - -type UpdateMCMSConfigInputPerChain struct { - MCMConfig mcmstypes.Config - MCMContracts []datastore.AddressRef -} - -type UpdateMCMSConfigInput struct { - Chains map[uint64]UpdateMCMSConfigInputPerChain `json:"chains"` - AdapterVersion *semver.Version `json:"adapterVersion"` - MCMS mcms.Input `json:"mcms"` -} - -func UpdateMCMSConfig(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateMCMSConfigInput] { - return cldf.CreateChangeSet( - updateMCMSConfigApply(deployerReg, mcmsRegistry), - updateMCMSConfigVerify(deployerReg, mcmsRegistry), - ) -} - -func updateMCMSConfigVerify(_ *DeployerRegistry, _ *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) error { - return func(e cldf.Environment, cfg UpdateMCMSConfigInput) error { - if cfg.AdapterVersion == nil { - return errors.New("adapter version is required") - } - - // validate mcms input - if err := cfg.MCMS.Validate(); err != nil { - return err - } - - validTypes := []string{utils.BypasserManyChainMultisig.String(), utils.ProposerManyChainMultisig.String(), - utils.CancellerManyChainMultisig.String()} - - // validate each contract - for _, chainCfg := range cfg.Chains { - for _, contract := range chainCfg.MCMContracts { - if !slices.Contains(validTypes, contract.Type.String()) { - return errors.New("type of contract needs to be mcms") - } - if len(contract.Qualifier) == 0 { - return errors.New("mcms contract qualifier cannot be empty") - } - if len(contract.Version.String()) == 0 { - return errors.New("mcms contract version cannot be empty") - } - } - } - - return nil - } -} - -func updateMCMSConfigApply(d *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { - return func(e cldf.Environment, cfg UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { - batchOps := make([]mcmstypes.BatchOperation, 0) - reports := make([]cldf_ops.Report[any, any], 0) - for selector, chainCfg := range cfg.Chains { - family, err := chain_selectors.GetSelectorFamily(selector) - if err != nil { - return cldf.ChangesetOutput{}, err - } - deployer, exists := d.GetDeployer(family, cfg.AdapterVersion) - if !exists { - return cldf.ChangesetOutput{}, fmt.Errorf("no deployer registered for chain family %s and version %s", family, cfg.AdapterVersion.String()) - } - - // If partial refs are provided, resolve to full refs - mcmsContracts := []datastore.AddressRef{} - for _, contract := range chainCfg.MCMContracts { - mcmsQualifier := contract.Qualifier - mcmsRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - ChainSelector: selector, - Type: contract.Type, - Version: contract.Version, - Qualifier: mcmsQualifier, - }, selector, datastore_utils.FullRef) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to find mcms ref with qualifier %s on chain with selector %d", mcmsQualifier, selector) - } - - mcmsContracts = append(mcmsContracts, mcmsRef) - } - - // find existing addresses for this chain from the env - existingAddrs := d.ExistingAddressesForChain(e, selector) - - // Call the set mcms config sequence - seqCfg := UpdateMCMSConfigInputPerChainWithSelector{ - UpdateMCMSConfigInputPerChain: chainCfg, - ChainSelector: selector, - ExistingAddresses: existingAddrs, - } - - report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, deployer.UpdateMCMSConfig(), e.BlockChains, seqCfg) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to Update MCMS Config on chain with selector %d: %w", selector, err) - } - batchOps = append(batchOps, report.Output.BatchOps...) - reports = append(reports, report.ExecutionReports...) - } - - return changesets.NewOutputBuilder(e, mcmsRegistry). - WithReports(reports). - WithBatchOps(batchOps). - Build(cfg.MCMS) - } -} - func GrantAdminRoleToTimelock(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[GrantAdminRoleToTimelockConfig] { return cldf.CreateChangeSet( grantAdminRoleToTimelockApply(deployerReg, mcmsRegistry), diff --git a/deployment/deploy/product.go b/deployment/deploy/product.go index 64adf7f31a..d42a9c84d8 100644 --- a/deployment/deploy/product.go +++ b/deployment/deploy/product.go @@ -33,7 +33,6 @@ type Deployer interface { FinalizeDeployMCMS() *cldf_ops.Sequence[MCMSDeploymentConfigPerChainWithAddress, sequences.OnChainOutput, cldf_chain.BlockChains] SetOCR3Config() *cldf_ops.Sequence[SetOCR3ConfigInput, sequences.OnChainOutput, cldf_chain.BlockChains] GrantAdminRoleToTimelock() *cldf_ops.Sequence[GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] - UpdateMCMSConfig() *cldf_ops.Sequence[UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] } type DeployerRegistry struct { diff --git a/deployment/deployTmp/README.md b/deployment/deployTmp/README.md new file mode 100644 index 0000000000..6167701062 --- /dev/null +++ b/deployment/deployTmp/README.md @@ -0,0 +1 @@ +This is a temporary extension of the deploy registry. This should be removed once TON stops importing the existing deploy registry. diff --git a/deployment/deployTmp/mcms.go b/deployment/deployTmp/mcms.go new file mode 100644 index 0000000000..e2ad5e0c3b --- /dev/null +++ b/deployment/deployTmp/mcms.go @@ -0,0 +1,134 @@ +package deploytmp + +import ( + "errors" + "fmt" + "slices" + + "github.com/Masterminds/semver/v3" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + + mcmstypes "github.com/smartcontractkit/mcms/types" + + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" +) + +type UpdateMCMSConfigInputPerChainWithSelector struct { + UpdateMCMSConfigInputPerChain + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef // needed for Solana +} + +type UpdateMCMSConfigInputPerChain struct { + MCMConfig mcmstypes.Config + MCMContracts []datastore.AddressRef +} + +type UpdateMCMSConfigInput struct { + Chains map[uint64]UpdateMCMSConfigInputPerChain `json:"chains"` + AdapterVersion *semver.Version `json:"adapterVersion"` + MCMS mcms.Input `json:"mcms"` +} + +func UpdateMCMSConfig(deployerReg *DeployerTmpRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateMCMSConfigInput] { + return cldf.CreateChangeSet( + updateMCMSConfigApply(deployerReg, mcmsRegistry), + updateMCMSConfigVerify(deployerReg, mcmsRegistry), + ) +} + +func updateMCMSConfigVerify(_ *DeployerTmpRegistry, _ *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) error { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) error { + if cfg.AdapterVersion == nil { + return errors.New("adapter version is required") + } + + // validate mcms input + if err := cfg.MCMS.Validate(); err != nil { + return err + } + + validTypes := []string{utils.BypasserManyChainMultisig.String(), utils.ProposerManyChainMultisig.String(), + utils.CancellerManyChainMultisig.String()} + + // validate each contract + for _, chainCfg := range cfg.Chains { + for _, contract := range chainCfg.MCMContracts { + if !slices.Contains(validTypes, contract.Type.String()) { + return errors.New("type of contract needs to be mcms") + } + if len(contract.Qualifier) == 0 { + return errors.New("mcms contract qualifier cannot be empty") + } + if len(contract.Version.String()) == 0 { + return errors.New("mcms contract version cannot be empty") + } + } + } + + return nil + } +} + +func updateMCMSConfigApply(d *DeployerTmpRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + batchOps := make([]mcmstypes.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + for selector, chainCfg := range cfg.Chains { + family, err := chain_selectors.GetSelectorFamily(selector) + if err != nil { + return cldf.ChangesetOutput{}, err + } + deployer, exists := d.GetDeployer(family, cfg.AdapterVersion) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no deployer registered for chain family %s and version %s", family, cfg.AdapterVersion.String()) + } + + // If partial refs are provided, resolve to full refs + mcmsContracts := []datastore.AddressRef{} + for _, contract := range chainCfg.MCMContracts { + mcmsQualifier := contract.Qualifier + mcmsRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: selector, + Type: contract.Type, + Version: contract.Version, + Qualifier: mcmsQualifier, + }, selector, datastore_utils.FullRef) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to find mcms ref with qualifier %s on chain with selector %d", mcmsQualifier, selector) + } + + mcmsContracts = append(mcmsContracts, mcmsRef) + } + + // find existing addresses for this chain from the env + existingAddrs := d.ExistingAddressesForChain(e, selector) + + // Call the set mcms config sequence + seqCfg := UpdateMCMSConfigInputPerChainWithSelector{ + UpdateMCMSConfigInputPerChain: chainCfg, + ChainSelector: selector, + ExistingAddresses: existingAddrs, + } + + report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, deployer.UpdateMCMSConfig(), e.BlockChains, seqCfg) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to Update MCMS Config on chain with selector %d: %w", selector, err) + } + batchOps = append(batchOps, report.Output.BatchOps...) + reports = append(reports, report.ExecutionReports...) + } + + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + Build(cfg.MCMS) + } +} diff --git a/deployment/deployTmp/product.go b/deployment/deployTmp/product.go new file mode 100644 index 0000000000..ff7e764935 --- /dev/null +++ b/deployment/deployTmp/product.go @@ -0,0 +1,79 @@ +package deploytmp + +import ( + "fmt" + "sync" + + "github.com/Masterminds/semver/v3" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +var ( + MCMSVersion = semver.MustParse("1.0.0") + singletonRegistry *DeployerTmpRegistry + once sync.Once + chainAdapterOnce sync.Once +) + +type DeployerTmp interface { + UpdateMCMSConfig() *cldf_ops.Sequence[UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] +} + +type DeployerTmpRegistry struct { + mu sync.Mutex + deployers map[string]DeployerTmp +} + +func (r *DeployerTmpRegistry) RegisterDeployer(chainFamily string, version *semver.Version, deployer DeployerTmp) { + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(chainFamily, version) + if _, exists := r.deployers[id]; !exists { + r.deployers[id] = deployer + } +} + +func newDeployerTmpRegistry() *DeployerTmpRegistry { + return &DeployerTmpRegistry{ + mu: sync.Mutex{}, + deployers: make(map[string]DeployerTmp), + } +} + +// GetRegistry returns the global singleton instance. +// The first call creates the registry; subsequent calls return the same pointer. +func GetRegistry() *DeployerTmpRegistry { + once.Do(func() { + singletonRegistry = newDeployerTmpRegistry() + }) + return singletonRegistry +} + +func (r *DeployerTmpRegistry) GetDeployer(chainFamily string, version *semver.Version) (DeployerTmp, bool) { + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(chainFamily, version) + deployer, ok := r.deployers[id] + return deployer, ok +} + +func (r *DeployerTmpRegistry) Blockchain(e cldf.Environment, chainSelector uint64) (cldf_chain.BlockChain, error) { + allChains := e.BlockChains.All() + for sel, chain := range allChains { + if sel == chainSelector { + return chain, nil + } + } + return nil, fmt.Errorf("no blockchain found in environment for selector %d", chainSelector) +} + +func (r *DeployerTmpRegistry) ExistingAddressesForChain(e cldf.Environment, chainSelector uint64) []datastore.AddressRef { + // filter addresses for the given chain selector + return e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSelector)) +} diff --git a/integration-tests/deployment/mcms_test.go b/integration-tests/deployment/mcms_test.go index e06cd73dd7..f735e340fe 100644 --- a/integration-tests/deployment/mcms_test.go +++ b/integration-tests/deployment/mcms_test.go @@ -14,8 +14,8 @@ import ( solseqV1_6_0 "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/mcm" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" - deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" mcmsapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + mcmsapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" _ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" @@ -41,9 +41,9 @@ func TestUpdateMCMSConfigSolana(t *testing.T) { require.NotNil(t, env, "Environment should be created") env.DataStore = dstr.Seal() // Add preloaded contracts to env datastore chain := env.BlockChains.SolanaChains()[chainsel.SOLANA_MAINNET.Selector] - dReg := mcmsapi.GetRegistry() + dRegTmp := mcmsapiTmp.GetRegistry() solAdapter := solseqV1_6_0.SolanaAdapter{} - dReg.RegisterDeployer(chainsel.FamilySolana, deployops.MCMSVersion, &solAdapter) + dRegTmp.RegisterDeployer(chainsel.FamilySolana, mcmsapi.MCMSVersion, &solAdapter) err = utils.FundSolanaAccounts( t.Context(), []solana.PublicKey{chain.DeployerKey.PublicKey()}, @@ -92,10 +92,10 @@ func TestUpdateMCMSConfigSolana(t *testing.T) { } // update the config for each MCMS contract - updateMcmsConfigMCMS := mcmsapi.UpdateMCMSConfig(dReg, nil) - output, err := updateMcmsConfigMCMS.Apply(*env, mcmsapi.UpdateMCMSConfigInput{ + updateMcmsConfigMCMS := mcmsapiTmp.UpdateMCMSConfig(dRegTmp, nil) + output, err := updateMcmsConfigMCMS.Apply(*env, mcmsapiTmp.UpdateMCMSConfigInput{ AdapterVersion: semver.MustParse("1.0.0"), - Chains: map[uint64]mcmsapi.UpdateMCMSConfigInputPerChain{ + Chains: map[uint64]mcmsapiTmp.UpdateMCMSConfigInputPerChain{ solanaChains[0]: { MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), MCMContracts: mcmsRefs, From bd4164682ffb066e5b05ea89e64f8b94034a7dde Mon Sep 17 00:00:00 2001 From: Chris De Leon <147140544+chris-de-leon-cll@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:16:07 -0800 Subject: [PATCH 12/41] More Token Expansion Improvements (#1758) * fix: use full token ref for filtering * add interface * fix: use full token ref for filtering for getTokenMintAndTokenProgram * chore: refactor convertRemoteChainConfig * chore: refactor * chore: revert configure_tokens_for_transfers * merge token refs * transfer if needed * transfer if needed --------- Co-authored-by: Matthew Romage Co-authored-by: Terry Tata --- .../sequences/deploy_token_pool_contracts.go | 5 +-- .../v1_6_0/operations/router/router.go | 40 +++++++++++++++---- .../deployment/v1_6_0/sequences/tokens.go | 13 +----- deployment/tokens/token_expansion.go | 24 ++++------- 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_token_pool_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_token_pool_contracts.go index 3d8bab11aa..7d2ffb71ea 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_token_pool_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_token_pool_contracts.go @@ -67,10 +67,7 @@ var DeployTokenPool = cldf_ops.NewSequence( // but will error if the provided address is incorrect or not provided at all if input.TokenRef != nil && input.TokenRef.Qualifier != "" { // find token address from the data store - storedAddr, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, datastore.AddressRef{ - ChainSelector: input.ChainSelector, - Qualifier: input.TokenRef.Qualifier, - }, input.ChainSelector, datastore_utils.FullRef) + storedAddr, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, *input.TokenRef, input.ChainSelector, datastore_utils.FullRef) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("token with symbol '%s' is not found in datastore, %v", input.TokenRef.Qualifier, err) } diff --git a/chains/solana/deployment/v1_6_0/operations/router/router.go b/chains/solana/deployment/v1_6_0/operations/router/router.go index 0edd5e1d4c..404c200fec 100644 --- a/chains/solana/deployment/v1_6_0/operations/router/router.go +++ b/chains/solana/deployment/v1_6_0/operations/router/router.go @@ -430,6 +430,15 @@ var RegisterTokenAdminRegistry = operations.NewOperation( return TokenAdminRegistryOut{}, nil } pendingAdmin = tokenAdminRegistryAccount.PendingAdministrator + // there is already an admin registered, we need to transfer + if !tokenAdminRegistryAccount.Administrator.IsZero() { + out, err := operations.ExecuteOperation(b, TransferTokenAdminRegistry, chain, input) + if err != nil { + return TokenAdminRegistryOut{}, fmt.Errorf("failed to transfer token admin registry: %w", err) + } + b.Logger.Infof("Token admin registry transfer initiated. Pending admin: %s", out.Output.PendingSigner.String()) + return out.Output, nil + } } // this is the key that will need to accept the admin registration pendingSigner := input.Admin @@ -635,7 +644,7 @@ var TransferTokenAdminRegistry = operations.NewOperation( "router:transfer-token-admin-registry", Version, "Transfers a Token Admin Registry with the Router 1.6.0 contract", - func(b operations.Bundle, chain cldf_solana.Chain, input TokenAdminRegistryParams) (sequences.OnChainOutput, error) { + func(b operations.Bundle, chain cldf_solana.Chain, input TokenAdminRegistryParams) (TokenAdminRegistryOut, error) { ccip_router.SetProgramID(input.Router) routerConfigPDA, _, _ := state.FindConfigPDA(input.Router) tokenAdminRegistryPDA, _, _ := state.FindTokenAdminRegistryPDA(input.TokenMint, input.Router) @@ -643,6 +652,12 @@ var TransferTokenAdminRegistry = operations.NewOperation( var tokenAdminRegistryAccount ccip_common.TokenAdminRegistry if err := chain.GetAccountDataBorshInto(b.GetContext(), tokenAdminRegistryPDA, &tokenAdminRegistryAccount); err == nil { currentAdmin = tokenAdminRegistryAccount.Administrator + if currentAdmin.IsZero() { + return TokenAdminRegistryOut{}, fmt.Errorf("no admin found for token admin registry") + } + b.Logger.Infof("Current token admin registry account: %+v", tokenAdminRegistryAccount) + } else { + return TokenAdminRegistryOut{}, fmt.Errorf("failed to fetch token admin registry account: %w", err) } // we can only sign as either the deployer or timelock // ccip admin should be timelock @@ -651,6 +666,10 @@ var TransferTokenAdminRegistry = operations.NewOperation( if input.Admin.IsZero() { input.Admin = ccipAdmin } + if currentAdmin == input.Admin { + b.Logger.Info("Token admin registry already registered with the given admin:", tokenAdminRegistryAccount) + return TokenAdminRegistryOut{}, nil + } // sign as the current admin to transfer tempIx, err := ccip_router.NewTransferAdminRoleTokenAdminRegistryInstruction( input.Admin, @@ -660,11 +679,11 @@ var TransferTokenAdminRegistry = operations.NewOperation( currentAdmin, ).ValidateAndBuild() if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to generate instructions: %w", err) + return TokenAdminRegistryOut{}, fmt.Errorf("failed to generate instructions: %w", err) } ixData, err := tempIx.Data() if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to extract data payload router accept admin role token admin registry instruction: %w", err) + return TokenAdminRegistryOut{}, fmt.Errorf("failed to extract data payload router accept admin role token admin registry instruction: %w", err) } ixn := solana.NewInstruction(input.Router, tempIx.Accounts(), ixData) // now we need a proposal if the admin is not the deployer @@ -676,19 +695,24 @@ var TransferTokenAdminRegistry = operations.NewOperation( ContractType.String(), ) if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to execute or create batch: %w", err) + return TokenAdminRegistryOut{}, fmt.Errorf("failed to execute or create batch: %w", err) } - return sequences.OnChainOutput{ - BatchOps: []types.BatchOperation{batches}, + return TokenAdminRegistryOut{ + PendingSigner: input.Admin, + OnChainOutput: sequences.OnChainOutput{ + BatchOps: []types.BatchOperation{batches}, + }, }, nil } err = chain.Confirm([]solana.Instruction{ixn}) if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm register token admin registry: %w", err) + return TokenAdminRegistryOut{}, fmt.Errorf("failed to confirm register token admin registry: %w", err) } - return sequences.OnChainOutput{}, nil + return TokenAdminRegistryOut{ + PendingSigner: input.Admin, + }, nil }, ) diff --git a/chains/solana/deployment/v1_6_0/sequences/tokens.go b/chains/solana/deployment/v1_6_0/sequences/tokens.go index 1f82af18cc..f769a2f934 100644 --- a/chains/solana/deployment/v1_6_0/sequences/tokens.go +++ b/chains/solana/deployment/v1_6_0/sequences/tokens.go @@ -550,18 +550,9 @@ func (a *SolanaAdapter) DeployTokenPoolForToken() *cldf_ops.Sequence[tokenapi.De } func getTokenMintAndTokenProgram(store datastore.DataStore, tokenRef datastore.AddressRef, chain cldf_solana.Chain) (datastore.AddressRef, solana.PublicKey, error) { - ref := datastore.AddressRef{ - ChainSelector: chain.Selector, - } - if tokenRef.Address != "" { - ref.Address = tokenRef.Address - } - if tokenRef.Qualifier != "" { - ref.Qualifier = tokenRef.Qualifier - } - tokenAddr, err := datastore_utils.FindAndFormatRef(store, ref, chain.Selector, datastore_utils.FullRef) + tokenAddr, err := datastore_utils.FindAndFormatRef(store, tokenRef, chain.Selector, datastore_utils.FullRef) if err != nil { - return datastore.AddressRef{}, solana.PublicKey{}, fmt.Errorf("failed to find token address for ref '%+v': %w", ref, err) + return datastore.AddressRef{}, solana.PublicKey{}, fmt.Errorf("failed to find token address for ref '%+v': %w", tokenRef, err) } tokenProgramId, err := utils.GetTokenProgramID(deployment.ContractType(tokenAddr.Type)) if err != nil { diff --git a/deployment/tokens/token_expansion.go b/deployment/tokens/token_expansion.go index 23423006a0..f730289e2c 100644 --- a/deployment/tokens/token_expansion.go +++ b/deployment/tokens/token_expansion.go @@ -225,26 +225,18 @@ func tokenExpansionApply() func(cldf.Environment, TokenExpansionInput) (cldf.Cha } if input.DeployTokenPoolInput != nil { - refToConnect := tokenRef - providedRef := input.DeployTokenPoolInput.TokenRef - if refToConnect == nil && providedRef == nil { - return cldf.ChangesetOutput{}, fmt.Errorf("no token deployed or provided for chain selector %d, cannot deploy token pool without token address", selector) - } else if refToConnect != nil && providedRef != nil { - // cross check the deployed token address with the provided token ref address - if refToConnect.Address != providedRef.Address { - return cldf.ChangesetOutput{}, fmt.Errorf("token address deployed does not match the provided token ref address for chain selector %d: deployed token address %s, provided token ref address %s", selector, refToConnect.Address, providedRef.Address) - } - if refToConnect.Qualifier != providedRef.Qualifier { - return cldf.ChangesetOutput{}, fmt.Errorf("token qualifier deployed does not match the provided token ref qualifier for chain selector %d: deployed token qualifier %s, provided token ref qualifier %s", selector, refToConnect.Qualifier, providedRef.Qualifier) - } - } else if refToConnect == nil { - // if token is not deployed by this changeset but token ref is provided, use the provided token ref - refToConnect = input.DeployTokenPoolInput.TokenRef + newTokenRef, err := datastore_utils.MergeRefs( + tokenRef, + input.DeployTokenPoolInput.TokenRef, + ) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to merge token refs for chain selector %d: %w", selector, err) } + tokenRef = &newTokenRef // deploy token pool tmpDatastore = datastore.NewMemoryDataStore() deployTokenPoolInput := DeployTokenPoolInput{ - TokenRef: refToConnect, + TokenRef: tokenRef, TokenPoolVersion: input.TokenPoolVersion, TokenPoolQualifier: input.DeployTokenPoolInput.TokenPoolQualifier, PoolType: input.DeployTokenPoolInput.PoolType, From 6caf8c4ea3b40f3227a88f200603c0e348ec8bf9 Mon Sep 17 00:00:00 2001 From: Makram Date: Tue, 3 Mar 2026 12:27:08 +0200 Subject: [PATCH 13/41] pkg: remove feeQuoter GetStaticConfig calls (#1770) These calls were being made but the results were not being used by the plugin code anywhere. Since this is the only call that causes issues w/ the newer fee quoter we need can cleanly remove it and be compatible w/ the newer contract. --- pkg/chainaccessor/config_processors.go | 21 ------------- pkg/chainaccessor/default_accessor.go | 6 ---- pkg/reader/ccip.go | 15 ---------- pkg/reader/ccip_test.go | 41 -------------------------- pkg/reader/config_poller_v2.go | 3 +- 5 files changed, 2 insertions(+), 84 deletions(-) diff --git a/pkg/chainaccessor/config_processors.go b/pkg/chainaccessor/config_processors.go index f00953516f..dab6023e62 100644 --- a/pkg/chainaccessor/config_processors.go +++ b/pkg/chainaccessor/config_processors.go @@ -29,8 +29,6 @@ func processConfigResults( config.RMNProxy, err = processRMNProxyResults(results) case consts.ContractNameRMNRemote: config.RMNRemote, config.CurseInfo, err = processRMNRemoteResults(results, destChainSelector) - case consts.ContractNameFeeQuoter: - config.FeeQuoter, err = processFeeQuoterResults(results) case consts.ContractNameOnRamp: // Only process OnRamp results for source chains if resultsChainSelector != destChainSelector { @@ -286,25 +284,6 @@ func processRMNRemoteResults( return config, curseInfo, nil } -func processFeeQuoterResults(results []types.BatchReadResult) (cciptypes.FeeQuoterConfig, error) { - if len(results) != 1 { - return cciptypes.FeeQuoterConfig{}, fmt.Errorf("expected 1 fee quoter result, got %d", len(results)) - } - - val, err := results[0].GetResult() - if err != nil { - return cciptypes.FeeQuoterConfig{}, fmt.Errorf("get fee quoter result: %w", err) - } - - if typed, ok := val.(*cciptypes.FeeQuoterStaticConfig); ok { - return cciptypes.FeeQuoterConfig{ - StaticConfig: *typed, - }, nil - } - - return cciptypes.FeeQuoterConfig{}, fmt.Errorf("invalid type for fee quoter static config: %T", val) -} - func processRouterResults(results []types.BatchReadResult) (cciptypes.RouterConfig, error) { if len(results) != 1 { return cciptypes.RouterConfig{}, fmt.Errorf("expected 1 router result, got %d", len(results)) diff --git a/pkg/chainaccessor/default_accessor.go b/pkg/chainaccessor/default_accessor.go index ba7e62b34d..fb17c3b470 100644 --- a/pkg/chainaccessor/default_accessor.go +++ b/pkg/chainaccessor/default_accessor.go @@ -158,7 +158,6 @@ func prepareDestChainRequest( rmnRemoteAddress []byte rmnDigestHeader cciptypes.RMNDigestHeader rmnVersionConfig cciptypes.VersionedConfig - feeQuoterStaticConfig cciptypes.FeeQuoterStaticConfig cursedSubjects cciptypes.RMNCurseResponse ) @@ -212,11 +211,6 @@ func prepareDestChainRequest( ReturnVal: &cursedSubjects, }, }, - consts.ContractNameFeeQuoter: {{ - ReadName: consts.MethodNameFeeQuoterGetStaticConfig, - Params: map[string]any{}, - ReturnVal: &feeQuoterStaticConfig, - }}, } // Get source chain config requests and append them to requests diff --git a/pkg/reader/ccip.go b/pkg/reader/ccip.go index 6bd102f509..30fe75a96e 100644 --- a/pkg/reader/ccip.go +++ b/pkg/reader/ccip.go @@ -831,21 +831,6 @@ func (r *ccipChainReader) GetContractAddress(contractName string, chain cciptype return r.donAddressBook.GetContractAddress(addressbook.ContractName(contractName), chain) } -// getDestFeeQuoterStaticConfig returns the destination chain's Fee Quoter's StaticConfig -func (r *ccipChainReader) getDestFeeQuoterStaticConfig(ctx context.Context) (cciptypes.FeeQuoterStaticConfig, error) { - // Get from cache - config, err := r.configPoller.GetChainConfig(ctx, r.destChain) - if err != nil { - return cciptypes.FeeQuoterStaticConfig{}, fmt.Errorf("get chain config: %w", err) - } - - if len(config.FeeQuoter.StaticConfig.LinkToken) == 0 { - return cciptypes.FeeQuoterStaticConfig{}, fmt.Errorf("link token address is empty") - } - - return config.FeeQuoter.StaticConfig, nil -} - // getFeeQuoterTokenPriceUSD gets the token price in USD of the given token address from the FeeQuoter contract on the // destination chain. func (r *ccipChainReader) getFeeQuoterTokenPriceUSD(ctx context.Context, tokenAddr []byte) (cciptypes.BigInt, error) { diff --git a/pkg/reader/ccip_test.go b/pkg/reader/ccip_test.go index 12e16a2e9d..eea9a8528e 100644 --- a/pkg/reader/ccip_test.go +++ b/pkg/reader/ccip_test.go @@ -592,47 +592,6 @@ func TestCCIPChainReader_DiscoverContracts_GetOfframpStaticConfig_Errors(t *test mockCache.AssertExpectations(t) } -func TestCCIPChainReader_getDestFeeQuoterStaticConfig(t *testing.T) { - ctx := context.Background() - - // Setup expected values - offrampAddress := []byte{0x3} - expectedConfig := cciptypes.FeeQuoterStaticConfig{ - MaxFeeJuelsPerMsg: cciptypes.NewBigIntFromInt64(10), - LinkToken: []byte{0x3, 0x4}, - StalenessThreshold: 12, - } - - // Setup cache with the expected config - mockCache := new(mockConfigCache) - chainConfig := cciptypes.ChainConfigSnapshot{ - FeeQuoter: cciptypes.FeeQuoterConfig{ - StaticConfig: expectedConfig, - }, - } - mockCache.On("GetChainConfig", mock.Anything, chainC).Return(chainConfig, nil) - - mockAddrCodec := internal.NewMockAddressCodecHex(t) - - offrampAddressStr, err := mockAddrCodec.AddressBytesToString(offrampAddress, chainC) - require.NoError(t, err) - ccipReader := &ccipChainReader{ - lggr: logger.Test(t), - destChain: chainC, - configPoller: mockCache, - offrampAddress: offrampAddressStr, - } - - cfg, err := ccipReader.getDestFeeQuoterStaticConfig(ctx) - require.NoError(t, err) - - assert.Equal(t, expectedConfig.MaxFeeJuelsPerMsg, cfg.MaxFeeJuelsPerMsg) - assert.Equal(t, expectedConfig.LinkToken, cfg.LinkToken) - assert.Equal(t, expectedConfig.StalenessThreshold, cfg.StalenessThreshold) - - mockCache.AssertExpectations(t) -} - func TestCCIPChainReader_getFeeQuoterTokenPriceUSD(t *testing.T) { tokenAddr := []byte{0x3, 0x4} offrampAddress := []byte{0x3} diff --git a/pkg/reader/config_poller_v2.go b/pkg/reader/config_poller_v2.go index 5b7ca87447..85cd296736 100644 --- a/pkg/reader/config_poller_v2.go +++ b/pkg/reader/config_poller_v2.go @@ -191,7 +191,8 @@ func (c *configPollerV2) startBackgroundPolling() { // - chainSel: The chain selector to retrieve configuration for // // Returns: -// - ChainConfigSnapshot containing the chain's configuration data +// - ChainConfigSnapshot containing the chain's configuration data. +// Deprecated: ChainConfigSnapshot.FeeQuoter is no longer populated; do not use it. // - Error if no chain accessor exists, cache creation fails, or batch refresh fails func (c *configPollerV2) GetChainConfig( ctx context.Context, From 2209fe326e3296276fd0b8a7653412b853e16f86 Mon Sep 17 00:00:00 2001 From: Agustina Aldasoro Date: Tue, 3 Mar 2026 12:08:56 -0500 Subject: [PATCH 14/41] Add docs for ccip tooling api (#1774) --- chains/evm/deployment/docs/_category_.yaml | 2 + chains/evm/deployment/docs/adapter.md | 182 ++++ chains/evm/deployment/docs/index.md | 72 ++ chains/evm/deployment/docs/operations.md | 245 +++++ chains/evm/deployment/docs/sequences.md | 211 +++++ chains/solana/deployment/docs/_category_.yaml | 2 + chains/solana/deployment/docs/adapter.md | 195 ++++ chains/solana/deployment/docs/index.md | 73 ++ .../docs/operations-and-sequences.md | 397 +++++++++ deployment/docs/_category_.yaml | 2 + deployment/docs/architecture.md | 220 +++++ deployment/docs/changesets.md | 441 +++++++++ deployment/docs/implementing-adapters.md | 313 +++++++ deployment/docs/index.md | 129 +++ deployment/docs/interfaces.md | 524 +++++++++++ deployment/docs/mcms-and-utilities.md | 281 ++++++ deployment/docs/types.md | 838 ++++++++++++++++++ 17 files changed, 4127 insertions(+) create mode 100644 chains/evm/deployment/docs/_category_.yaml create mode 100644 chains/evm/deployment/docs/adapter.md create mode 100644 chains/evm/deployment/docs/index.md create mode 100644 chains/evm/deployment/docs/operations.md create mode 100644 chains/evm/deployment/docs/sequences.md create mode 100644 chains/solana/deployment/docs/_category_.yaml create mode 100644 chains/solana/deployment/docs/adapter.md create mode 100644 chains/solana/deployment/docs/index.md create mode 100644 chains/solana/deployment/docs/operations-and-sequences.md create mode 100644 deployment/docs/_category_.yaml create mode 100644 deployment/docs/architecture.md create mode 100644 deployment/docs/changesets.md create mode 100644 deployment/docs/implementing-adapters.md create mode 100644 deployment/docs/index.md create mode 100644 deployment/docs/interfaces.md create mode 100644 deployment/docs/mcms-and-utilities.md create mode 100644 deployment/docs/types.md diff --git a/chains/evm/deployment/docs/_category_.yaml b/chains/evm/deployment/docs/_category_.yaml new file mode 100644 index 0000000000..16ee0f9aec --- /dev/null +++ b/chains/evm/deployment/docs/_category_.yaml @@ -0,0 +1,2 @@ +label: "EVM Implementation" +position: 2 diff --git a/chains/evm/deployment/docs/adapter.md b/chains/evm/deployment/docs/adapter.md new file mode 100644 index 0000000000..17a4c4db8f --- /dev/null +++ b/chains/evm/deployment/docs/adapter.md @@ -0,0 +1,182 @@ +--- +title: "EVMAdapter Reference" +sidebar_label: "Adapter" +sidebar_position: 2 +--- + +# EVMAdapter Reference + +The `EVMAdapter` is a stateless struct that implements all required shared interfaces for the EVM chain family. + +**Source:** [v1_6_0/sequences/adapter.go](../v1_6_0/sequences/adapter.go) + +For the interfaces it implements, see [Interfaces Reference](../../../../deployment/docs/interfaces.md). + +--- + +## Struct Definition + +```go +type EVMAdapter struct{} +``` + +The EVM adapter is intentionally stateless -- all state is resolved from the DataStore and environment at execution time. + +--- + +## Registration + +### Main Adapter (`sequences/adapter.go`) + +**Source:** [v1_6_0/sequences/adapter.go](../v1_6_0/sequences/adapter.go) + +```go +func init() { + v, _ := semver.NewVersion("1.6.0") + + laneapi.GetLaneAdapterRegistry().RegisterLaneAdapter(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + deployapi.GetRegistry().RegisterDeployer(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + deployapi.GetTransferOwnershipRegistry().RegisterAdapter(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + mcmsreaderapi.GetRegistry().RegisterMCMSReader(chain_selectors.FamilyEVM, &EVMAdapter{}) + tokensapi.GetTokenAdapterRegistry().RegisterTokenAdapter(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + lanes.GetPingPongAdapterRegistry().RegisterPingPongAdapter(chain_selectors.FamilyEVM, v, &EVMAdapter{}) +} +``` + +### Separate Adapters (`adapters/init.go`) + +**Source:** [v1_6_0/adapters/init.go](../v1_6_0/adapters/init.go) + +```go +func init() { + // Curse adapter + fastcurse.GetCurseRegistry().RegisterNewCurse(fastcurse.CurseRegistryInput{ + CursingFamily: chain_selectors.FamilyEVM, + CursingVersion: semver.MustParse("1.6.0"), + CurseAdapter: NewCurseAdapter(), + CurseSubjectAdapter: NewCurseAdapter(), + }) + + // Lane migration adapters + deploy.GetLaneMigratorRegistry().RegisterRampUpdater(chain_selectors.FamilyEVM, semver.MustParse("1.6.0"), &LaneMigrater{}) + deploy.GetLaneMigratorRegistry().RegisterRouterUpdater(chain_selectors.FamilyEVM, semver.MustParse("1.2.0"), &RouterUpdater{}) +} +``` + +--- + +## Interface Implementations + +### Deployer + +| Method | Delegates To | +|--------|-------------| +| `DeployChainContracts()` | `DeployChainContracts` sequence | +| `DeployMCMS()` | v1.0.0 MCMS deployer | +| `FinalizeDeployMCMS()` | v1.0.0 MCMS finalize (no-op for EVM) | +| `SetOCR3Config()` | OCR3 configuration sequence | +| `GrantAdminRoleToTimelock()` | Timelock admin role sequence | + +EVM delegates MCMS deployment to the v1.0.0 implementation since MCMS contracts are version-agnostic on EVM. + +### LaneAdapter + +| Method | Behavior | +|--------|----------| +| `GetOnRampAddress()` | Looks up OnRamp v1.6.0 from DataStore | +| `GetOffRampAddress()` | Looks up OffRamp v1.6.0 from DataStore | +| `GetRouterAddress()` | Looks up Router from DataStore | +| `GetFQAddress()` | Looks up latest FeeQuoter (v1.6.0 -- v1.7.0 range) | +| `ConfigureLaneLegAsSource()` | OnRamp dest config + FeeQuoter dest config + price updates | +| `ConfigureLaneLegAsDest()` | OffRamp source config + Router ramp updates | + +All `Get*Address` methods return 20-byte EVM addresses. + +### TokenAdapter + +| Method | Behavior | +|--------|----------| +| `AddressRefToBytes()` | Hex-decodes the address string to bytes | +| `DeriveTokenAddress()` | Reads token address from the pool contract on-chain | +| `DeriveTokenDecimals()` | Reads decimals from the token contract on-chain | +| `DeriveTokenPoolCounterpart()` | Returns tokenPool unchanged (no PDA derivation needed on EVM) | +| `ConfigureTokenForTransfersSequence()` | Registers token + sets remote chain configs | +| `ManualRegistration()` | Registers customer token via proposeAdministrator | +| `SetTokenPoolRateLimits()` | Sets inbound/outbound rate limits | +| `DeployToken()` | Deploys ERC20 BurnMint token | +| `DeployTokenPoolForToken()` | Deploys token pool for existing token | +| `UpdateAuthorities()` | Transfers token/pool ownership to timelock | + +### TokenPriceProvider (Optional) + +```go +func (e *EVMAdapter) GetDefaultTokenPrices() map[datastore.ContractType]*big.Int +``` + +Returns a default price of $20 per token (18 decimals) for WETH and LINK. + +### TransferOwnershipAdapter + +| Method | Behavior | +|--------|----------| +| `InitializeTimelockAddress()` | No-op on EVM (timelock resolved at execution time) | +| `SequenceTransferOwnershipViaMCMS()` | Calls `transferOwnership()` on each contract | +| `SequenceAcceptOwnership()` | Calls `acceptOwnership()` on each contract | +| `ShouldAcceptOwnershipWithTransferOwnership()` | Returns `false` (two-step ownership on EVM) | + +### MCMSReader + +| Method | Behavior | +|--------|----------| +| `GetChainMetadata()` | Reads MCM starting op count from on-chain | +| `GetTimelockRef()` | Resolves RBACTimelock AddressRef from DataStore | +| `GetMCMSRef()` | Resolves ProposerManyChainMultiSig AddressRef | + +--- + +## Specialized Adapters + +### CurseAdapter (`adapters/fastcurse.go`) + +Implements `CurseAdapter` and `CurseSubjectAdapter` for EVM RMN operations. + +- `Initialize()` -- loads RMNRemote contract address +- `IsSubjectCursedOnChain()` -- calls `isCursed(subject)` on RMNRemote +- `Curse()` / `Uncurse()` -- returns sequences that call `curse()`/`uncurse()` on RMNRemote +- `SelectorToSubject()` -- converts chain selector to 16-byte curse subject +- `SubjectToSelector()` -- reverses the conversion + +### FeeAdapter (`adapters/fees.go`) + +Implements `FeeAdapter` for EVM fee configuration. + +- `SetTokenTransferFee()` -- returns sequence that calls `applyTokenTransferFeeConfigUpdates` on FeeQuoter +- `GetOnchainTokenTransferFeeConfig()` -- reads current fee config from FeeQuoter +- `GetDefaultTokenTransferFeeConfig()` -- returns sensible defaults + +### ConfigImporter (`adapters/configimport.go`) + +Implements `ConfigImporter` for importing existing on-chain state into the DataStore. + +### LaneMigrater (`adapters/lanemigrator.go`) + +Implements `RampUpdateInRouter` and `RouterUpdateInRamp` for lane migration scenarios. + +--- + +## EVM Utilities + +### Address Conversion (`utils/datastore/datastore.go`) + +```go +func ToByteArray(ref datastore.AddressRef) ([]byte, error) // Hex string -> bytes +func ToEVMAddress(ref datastore.AddressRef) (common.Address, error) // Hex string -> common.Address +func ToPaddedEVMAddress(ref datastore.AddressRef) ([]byte, error) // 32-byte left-padded +``` + +### Contract Introspection (`utils/common.go`) + +```go +func TypeAndVersion(addr common.Address, client bind.ContractBackend) (string, *semver.Version, error) +func ValidateEVMAddress(addr string, fieldName string) error +``` diff --git a/chains/evm/deployment/docs/index.md b/chains/evm/deployment/docs/index.md new file mode 100644 index 0000000000..4658ee995f --- /dev/null +++ b/chains/evm/deployment/docs/index.md @@ -0,0 +1,72 @@ +--- +title: "EVM Implementation" +sidebar_label: "Overview" +sidebar_position: 1 +--- + +# EVM Deployment Implementation + +This documentation covers the EVM-specific implementation of the CCIP Deployment Tooling API. The EVM adapter is the most comprehensive reference implementation, supporting contract versions from v1.0.0 through v1.6.5. + +For the shared interfaces this implementation fulfills, see [Interfaces Reference](../../../../deployment/docs/interfaces.md). For the shared types, see [Types Reference](../../../../deployment/docs/types.md). + +--- + +## Package Layout + +``` +chains/evm/deployment/ +├── utils/ +│ ├── common.go # Address/version utilities +│ ├── datastore/ +│ │ └── datastore.go # EVM address format conversions +│ └── operations/ +│ └── contract/ +│ ├── read.go # NewRead operation pattern +│ ├── write.go # NewWrite operation pattern +│ ├── deploy.go # NewDeploy operation pattern +│ └── function.go # FunctionInput struct +├── v1_0_0/ # Core infrastructure (MCMS, Router basics) +│ ├── adapters/ +│ ├── operations/ +│ └── sequences/ +├── v1_2_0/ # Router enhancements +│ ├── adapters/ +│ └── operations/ +├── v1_5_0/ # Token support +│ ├── adapters/ +│ ├── changesets/ +│ ├── operations/ +│ └── sequences/ +├── v1_5_1/ # Token pool patch +│ ├── operations/ +│ └── sequences/ +├── v1_6_0/ # Complete implementation +│ ├── adapters/ # Registration + specialized adapters +│ ├── operations/ # All contract operations +│ ├── sequences/ # All sequence compositions +│ └── testadapter/ # Test utilities +├── v1_6_1/ # Operations + sequences +├── v1_6_2/ # Operations only +├── v1_6_3/ # Operations only +└── v1_6_5/ # Operations only +``` + +## Version Support + +| Version | Scope | Contents | +|---------|-------|----------| +| **v1.0.0** | Core infrastructure | MCMS deployment, Router, WETH, LINK | +| **v1.2.0** | Router updates | Router operations for lane migration | +| **v1.5.0** | Token support | Token pools, token admin registry | +| **v1.5.1** | Token pool patch | LockRelease pool enhancements | +| **v1.6.0** | Complete implementation | Full adapter, all contracts, all sequences | +| **v1.6.1 -- v1.6.5** | Incremental updates | Additional operations and sequences | + +The v1.6.0 version is the primary implementation that registers the `EVMAdapter` with all shared registries. Newer versions add operations and sequences that build upon the v1.6.0 foundation. + +## Documentation + +- [EVMAdapter Reference](adapter.md) -- adapter struct, interface implementations, registration +- [Operations Reference](operations.md) -- operation framework and all contract operations +- [Sequences Reference](sequences.md) -- all sequences and EVM-specific changesets diff --git a/chains/evm/deployment/docs/operations.md b/chains/evm/deployment/docs/operations.md new file mode 100644 index 0000000000..991fb569a8 --- /dev/null +++ b/chains/evm/deployment/docs/operations.md @@ -0,0 +1,245 @@ +--- +title: "EVM Operations Reference" +sidebar_label: "Operations" +sidebar_position: 3 +--- + +# EVM Operations Reference + +Operations are atomic building blocks that perform a single contract interaction. The EVM implementation provides a typed framework for creating read, write, and deploy operations with built-in MCMS support. + +**Source:** [utils/operations/contract/](../utils/operations/contract/) + +--- + +## Operation Framework + +### NewRead + +Creates a read-only contract call operation. + +**Source:** [utils/operations/contract/read.go](../utils/operations/contract/read.go) + +```go +func NewRead[ARGS any, RET any, C any](params ReadParams[ARGS, RET, C]) *Operation[FunctionInput[ARGS], RET, evm.Chain] +``` + +**Parameters:** +```go +type ReadParams[ARGS any, RET any, C any] struct { + Name string // Operation ID + Version *semver.Version // Contract version + Description string + ContractType deployment.ContractType + NewContract func(address common.Address, backend bind.ContractBackend) (C, error) + CallContract func(contract C, opts *bind.CallOpts, input ARGS) (RET, error) +} +``` + +**Behavior:** Instantiates the contract using `NewContract`, then calls `CallContract` with the provided args. Returns the result directly. + +### NewWrite + +Creates a state-modifying contract call operation with automatic MCMS fallback. + +**Source:** [utils/operations/contract/write.go](../utils/operations/contract/write.go) + +```go +func NewWrite[ARGS any, C any](params WriteParams[ARGS, C]) *Operation[FunctionInput[ARGS], WriteOutput, evm.Chain] +``` + +**Parameters:** +```go +type WriteParams[ARGS any, C any] struct { + Name string + Version *semver.Version + Description string + ContractType deployment.ContractType + ContractABI string + NewContract func(address common.Address, backend bind.ContractBackend) (C, error) + IsAllowedCaller func(contract C, opts *bind.CallOpts, caller common.Address, input ARGS) (bool, error) + Validate func(input ARGS) error + CallContract func(contract C, opts *bind.TransactOpts, input ARGS) (*eth_types.Transaction, error) +} +``` + +**Behavior:** +1. Validates input via `Validate` (if provided) +2. Checks if the deployer key is an allowed caller via `IsAllowedCaller` +3. **If allowed:** Executes the transaction directly, waits for confirmation, returns `WriteOutput` with `ExecInfo` populated +4. **If not allowed:** Encodes the transaction as an MCMS batch operation, returns `WriteOutput` without `ExecInfo` + +**Output:** +```go +type WriteOutput struct { + ChainSelector uint64 + Tx mcms_types.Transaction + ExecInfo *ExecInfo // nil if transaction was deferred to MCMS +} + +func (o WriteOutput) Executed() bool // Returns true if executed directly +``` + +**Common Caller Checks:** +- `OnlyOwner()` -- checks if caller is the contract owner (with retry for testnet flakiness) +- `AllCallersAllowed()` -- always returns true (permissive) + +### NewDeploy + +Creates a contract deployment operation. + +**Source:** [utils/operations/contract/deploy.go](../utils/operations/contract/deploy.go) + +```go +func NewDeploy[ARGS any](params DeployParams[ARGS]) *Operation[DeployInput[ARGS], datastore.AddressRef, evm.Chain] +``` + +**Parameters:** +```go +type DeployParams[ARGS any] struct { + Name string + Version *semver.Version + Description string + ContractMetadata *bind.MetaData + BytecodeByTypeAndVersion map[string]Bytecode + Validate func(input ARGS) error +} +``` + +**Behavior:** Deploys the contract using the chain's deployer key. Supports both standard EVM and ZkSync VM bytecodes. Returns a `datastore.AddressRef` with the deployed address, type, and version. + +### Common Input Type + +```go +type FunctionInput[ARGS any] struct { + Address common.Address + ChainSelector uint64 + Args ARGS +} +``` + +### Batch Operation Helper + +```go +func NewBatchOperationFromWrites(writes []WriteOutput) (mcms_types.BatchOperation, error) +``` + +Converts a slice of `WriteOutput` into an MCMS `BatchOperation`. Filters out already-executed transactions. + +--- + +## Operations by Contract + +All operations are in [v1_6_0/operations/](../v1_6_0/operations/). + +### OnRamp (`operations/onramp/`) + +| Operation | Type | Description | +|-----------|------|-------------| +| Deploy | Deploy | Deploys OnRamp contract | +| GetDestChainConfig | Read | Gets destination chain configuration | +| GetDynamicConfig | Read | Gets dynamic configuration | +| GetStaticConfig | Read | Gets static configuration | +| ApplyDestChainConfigUpdates | Write | Updates destination chain configs for remote chains | + +### OffRamp (`operations/offramp/`) + +| Operation | Type | Description | +|-----------|------|-------------| +| Deploy | Deploy | Deploys OffRamp contract | +| GetSourceChainConfig | Read | Gets source chain configuration | +| GetStaticConfig | Read | Gets static configuration | +| GetDynamicConfig | Read | Gets dynamic configuration | +| ApplySourceChainConfigUpdates | Write | Updates source chain configs for remote chains | + +### FeeQuoter (`operations/fee_quoter/`) + +| Operation | Type | Description | +|-----------|------|-------------| +| Deploy | Deploy | Deploys FeeQuoter contract | +| ApplyDestChainConfigUpdates | Write | Updates destination chain fee configs | +| UpdatePrices | Write | Updates gas and token prices | +| ApplyTokenTransferFeeConfigUpdates | Write | Sets per-token transfer fee configurations | +| GetDestChainConfig | Read | Gets destination chain fee config | +| GetTokenTransferFeeConfig | Read | Gets token transfer fee configuration | + +### NonceManager (`operations/nonce_manager/`) + +| Operation | Type | Description | +|-----------|------|-------------| +| Deploy | Deploy | Deploys NonceManager contract | +| ApplyAuthorizedCallerUpdates | Write | Authorizes OnRamp/OffRamp as callers | + +### RMN Remote (`operations/rmn_remote/`) + +| Operation | Type | Description | +|-----------|------|-------------| +| Deploy | Deploy | Deploys RMNRemote contract | + +### CCIP Home (`operations/ccip_home/`) + +Operations for the CCIPHome contract on the home chain. + +### Token Pool Operations + +| Module | Description | +|--------|-------------| +| `burn_mint_with_external_minter_token_pool/` | BurnMint pool with external minter | +| `hybrid_with_external_minter_token_pool/` | Hybrid pool with external minter | + +### Token Governor (`operations/token_governor/`) + +Operations for the Token Governor contract. + +--- + +## Creating New Operations + +### Read Operation Example + +```go +var GetDestChainConfig = contract.NewRead(contract.ReadParams[uint64, DestChainConfig, *onramp.OnRamp]{ + Name: "onramp:getDestChainConfig", + Version: semver.MustParse("1.6.0"), + Description: "Gets the destination chain config for a remote chain", + ContractType: "OnRamp", + NewContract: onramp.NewOnRamp, + CallContract: func(c *onramp.OnRamp, opts *bind.CallOpts, destChainSelector uint64) (DestChainConfig, error) { + return c.GetDestChainConfig(opts, destChainSelector) + }, +}) +``` + +### Write Operation Example + +```go +var ApplyDestChainConfigUpdates = contract.NewWrite(contract.WriteParams[[]DestChainConfigArgs, *onramp.OnRamp]{ + Name: "onramp:applyDestChainConfigUpdates", + Version: semver.MustParse("1.6.0"), + Description: "Updates destination chain configurations", + ContractType: "OnRamp", + ContractABI: onramp.OnRampABI, + NewContract: onramp.NewOnRamp, + IsAllowedCaller: contract.OnlyOwner[[]DestChainConfigArgs](), + CallContract: func(c *onramp.OnRamp, opts *bind.TransactOpts, args []DestChainConfigArgs) (*types.Transaction, error) { + return c.ApplyDestChainConfigUpdates(opts, args) + }, +}) +``` + +### Deploy Operation Example + +```go +var Deploy = contract.NewDeploy(contract.DeployParams[DeployInput]{ + Name: "onramp:deploy", + Version: semver.MustParse("1.6.0"), + Description: "Deploys the OnRamp contract", + ContractMetadata: onramp.OnRampMetaData, +}) +``` + +--- + +## Code Generation + +Many EVM operations are auto-generated from Go bindings (gethwrappers). The generation configuration is in `operations_gen_config.yaml`. Generated operations follow the same `NewRead`/`NewWrite`/`NewDeploy` patterns but are produced automatically from the contract ABI. diff --git a/chains/evm/deployment/docs/sequences.md b/chains/evm/deployment/docs/sequences.md new file mode 100644 index 0000000000..e574da7d68 --- /dev/null +++ b/chains/evm/deployment/docs/sequences.md @@ -0,0 +1,211 @@ +--- +title: "EVM Sequences Reference" +sidebar_label: "Sequences" +sidebar_position: 4 +--- + +# EVM Sequences Reference + +Sequences compose multiple operations into complete workflows. Each sequence is defined as a package-level variable using `operations.NewSequence`. + +**Source:** [v1_6_0/sequences/](../v1_6_0/sequences/) + +--- + +## Sequence Catalog + +### Deploy Chain Contracts + +**Source:** [v1_6_0/sequences/deploy_chain_contracts.go](../v1_6_0/sequences/deploy_chain_contracts.go) + +Deploys all CCIP infrastructure contracts on a single EVM chain. This is the primary deployment sequence. + +**Variable:** `DeployChainContracts` +**Input:** `ContractDeploymentConfigPerChainWithAddress` +**Output:** `OnChainOutput` + +**Deployment order:** +1. WETH9 (wrapped native token) +2. LINK token (or use existing) +3. RMNRemote + RMNProxy (set ARM on proxy) +4. Router + TestRouter +5. TokenAdminRegistry + RegistryModule +6. NonceManager (authorize OnRamp/OffRamp as callers) +7. FeeQuoter (configure authorized callers, LINK/native token pricing) +8. OffRamp (set source chain configs) +9. OnRamp (set destination chain configs) +10. PingPongDemo (optional, if `DeployPingPongDapp` is true) + +### MCMS Sequences + +**Source:** [v1_6_0/sequences/mcms.go](../v1_6_0/sequences/mcms.go) + +EVM delegates MCMS deployment to the v1.0.0 deployer since MCMS contracts are not version-specific on EVM. + +| Method | Behavior | +|--------|----------| +| `DeployMCMS()` | Returns v1.0.0 deployer's `DeployMCMS()` sequence | +| `FinalizeDeployMCMS()` | Returns v1.0.0 deployer's `FinalizeDeployMCMS()` (no-op) | +| `UpdateMCMSConfig()` | Returns v1.0.0 update config sequence | +| `GrantAdminRoleToTimelock()` | Returns admin role granting sequence | + +### Lane Configuration + +**Source:** [v1_6_0/sequences/update_lanes.go](../v1_6_0/sequences/update_lanes.go) + +#### ConfigureLaneLegAsSource + +Configures this chain as the source end of a lane. + +**Input:** `UpdateLanesInput` + +**Steps:** +1. Apply OnRamp destination chain config updates +2. Apply FeeQuoter destination chain config updates +3. Update gas and token prices on FeeQuoter + +#### ConfigureLaneLegAsDest + +Configures this chain as the destination end of a lane. + +**Input:** `UpdateLanesInput` + +**Steps:** +1. Apply OffRamp source chain config updates +2. Apply Router ramp updates (register OnRamp/OffRamp for remote chain) + +### FeeQuoter Sequences + +**Source:** [v1_6_0/sequences/fee_quoter.go](../v1_6_0/sequences/fee_quoter.go) + +| Sequence | Description | +|----------|-------------| +| `FeeQuoterApplyDestChainConfigUpdatesSequence` | Updates destination chain fee configs | +| `FeeQuoterUpdatePricesSequence` | Updates gas and token prices | +| `FeeQuoterApplyTokenTransferFeeConfigUpdatesSequence` | Sets per-token transfer fees | +| `FeeQuoterImportConfigSequence` | Imports existing on-chain fee config | + +### OnRamp Sequences + +**Source:** [v1_6_0/sequences/onramp.go](../v1_6_0/sequences/onramp.go) + +| Sequence | Description | +|----------|-------------| +| `OnRampApplyDestChainConfigUpdatesSequence` | Applies destination chain config | +| `OnRampImportConfigSequence` | Imports existing on-chain config | + +### OffRamp Sequences + +**Source:** [v1_6_0/sequences/offramp.go](../v1_6_0/sequences/offramp.go) + +| Sequence | Description | +|----------|-------------| +| `OffRampApplySourceChainConfigUpdatesSequence` | Applies source chain config | +| `OffRampImportConfigSequence` | Imports existing on-chain config | + +### Router Sequences + +**Source:** [v1_6_0/sequences/router.go](../v1_6_0/sequences/router.go) + +| Sequence | Description | +|----------|-------------| +| `RouterApplyRampUpdatesSequence` | Updates OnRamp/OffRamp references on Router | + +### RMN Remote Sequences + +**Source:** [v1_6_0/sequences/rmn_remote.go](../v1_6_0/sequences/rmn_remote.go) + +RMN configuration sequences for blessed/cursed state management. + +### OCR3 Sequences + +**Source:** [v1_6_0/sequences/ocr.go](../v1_6_0/sequences/ocr.go) + +Sets OCR3 configuration on the OffRamp contract. + +### Token Sequences + +**Source:** [v1_6_0/sequences/token.go](../v1_6_0/sequences/token.go), [v1_6_0/sequences/token_and_pools.go](../v1_6_0/sequences/token_and_pools.go) + +| Sequence | Description | +|----------|-------------| +| `DeployToken` | Deploys ERC20 BurnMint/BurnMintWithDrip token | +| `ConfigureTokenForTransfersSequence` | Registers token + configures remote chains | +| `ManualRegistration` | Registers customer token via proposeAdministrator | +| `SetTokenPoolRateLimits` | Sets inbound/outbound rate limits | +| `DeployTokenPoolForToken` | Deploys token pool for existing token | +| `UpdateAuthorities` | Transfers token/pool ownership to timelock | + +### Token Pool Sequences + +**Source:** [v1_6_0/sequences/deploy_token_pool_contracts.go](../v1_6_0/sequences/deploy_token_pool_contracts.go) + +Handles deployment of various token pool types: +- BurnMintTokenPool +- BurnWithFromMintTokenPool +- BurnFromMintTokenPool +- LockReleaseTokenPool +- BurnMintWithExternalMinterTokenPool +- CCTPTokenPool + +Supports both v1.5.1 and v1.6.1 pool versions. + +### Token Governor Sequences + +**Source:** [v1_6_0/sequences/token_governor.go](../v1_6_0/sequences/token_governor.go) + +Sequences for deploying and configuring the Token Governor contract. + +### PingPong Sequences + +| Sequence | Description | +|----------|-------------| +| `ConfigurePingPongSequence` | Configures PingPong demo for a lane | + +--- + +## Sequence Composition Pattern + +EVM sequences follow a consistent pattern: + +```go +var MySequence = operations.NewSequence( + "my-sequence", + semver.MustParse("1.6.0"), + "Description of what this sequence does", + func(b operations.Bundle, chains cldf_chain.BlockChains, input MyInput) (sequences.OnChainOutput, error) { + var output sequences.OnChainOutput + + // Execute operations + writeResult, err := operations.ExecuteOperation(b, MyWriteOp, chain, contract.FunctionInput[Args]{ + Address: contractAddr, + ChainSelector: input.ChainSelector, + Args: myArgs, + }) + if err != nil { + return output, err + } + + // Collect MCMS batch operations from writes + batchOp, err := contract.NewBatchOperationFromWrites([]contract.WriteOutput{writeResult.Output}) + if err != nil { + return output, err + } + output.BatchOps = append(output.BatchOps, batchOp) + + return output, nil + }, +) +``` + +Key patterns: +- Operations return `WriteOutput` which may or may not have been executed directly +- `NewBatchOperationFromWrites` collects un-executed writes into MCMS proposals +- Deploy operations return `datastore.AddressRef` which gets added to `output.Addresses` +- Sub-sequences can be composed via `sequences.RunAndMergeSequence` + +--- + +## EVM-Specific Changesets + +The EVM implementation also provides version-specific changesets in `v1_5_0/changesets/` and `v1_6_0/changesets/` for MCMS configuration updates and other EVM-specific operations not covered by the shared changeset layer. diff --git a/chains/solana/deployment/docs/_category_.yaml b/chains/solana/deployment/docs/_category_.yaml new file mode 100644 index 0000000000..3b43de19d2 --- /dev/null +++ b/chains/solana/deployment/docs/_category_.yaml @@ -0,0 +1,2 @@ +label: "Solana Implementation" +position: 3 diff --git a/chains/solana/deployment/docs/adapter.md b/chains/solana/deployment/docs/adapter.md new file mode 100644 index 0000000000..ddf31f665f --- /dev/null +++ b/chains/solana/deployment/docs/adapter.md @@ -0,0 +1,195 @@ +--- +title: "SolanaAdapter Reference" +sidebar_label: "Adapter" +sidebar_position: 2 +--- + +# SolanaAdapter Reference + +The `SolanaAdapter` implements the shared deployment interfaces for the Solana Virtual Machine (SVM). Unlike the stateless EVM adapter, the Solana adapter carries state for timelock addresses. + +**Source:** [v1_6_0/sequences/adapter.go](../v1_6_0/sequences/adapter.go) + +--- + +## Struct Definition + +```go +type SolanaAdapter struct { + timelockAddr map[uint64]solana.PublicKey +} +``` + +The `timelockAddr` map caches resolved timelock public keys by chain selector, avoiding repeated datastore lookups. + +--- + +## Registration + +The Solana adapter registers itself with **5 shared registries** via two `init()` functions: + +### Main Registration (`v1_6_0/sequences/adapter.go`) + +**Source:** [v1_6_0/sequences/adapter.go](../v1_6_0/sequences/adapter.go) + +```go +func init() { + v := semver.MustParse("1.6.0") + laneapi.GetLaneAdapterRegistry().RegisterLaneAdapter(chain_selectors.FamilySolana, v, &SolanaAdapter{}) + deployapi.GetRegistry().RegisterDeployer(chain_selectors.FamilySolana, v, &SolanaAdapter{}) + deployapi.GetTransferOwnershipRegistry().RegisterAdapter(chain_selectors.FamilySolana, v, &SolanaAdapter{}) + mcmsreaderapi.GetRegistry().RegisterMCMSReader(chain_selectors.FamilySolana, &SolanaAdapter{}) + tokensapi.GetTokenAdapterRegistry().RegisterTokenAdapter(chain_selectors.FamilySolana, v, &SolanaAdapter{}) +} +``` + +### Curse Adapter Registration (`v1_6_0/adapters/init.go`) + +**Source:** [v1_6_0/adapters/init.go](../v1_6_0/adapters/init.go) + +```go +func init() { + curseRegistry := fastcurse.GetCurseRegistry() + curseRegistry.RegisterNewCurse(fastcurse.CurseRegistryInput{ + CursingFamily: chainsel.FamilySolana, + CursingVersion: semver.MustParse("1.6.0"), + CurseAdapter: NewCurseAdapter(), + CurseSubjectAdapter: NewCurseAdapter(), + }) +} +``` + +### Registration Summary + +| Registry | Interface | Key | +|----------|-----------|-----| +| `LaneAdapterRegistry` | `LaneAdapter` | `solana-1.6.0` | +| `DeployerRegistry` | `Deployer` | `solana-1.6.0` | +| `TransferOwnershipAdapterRegistry` | `TransferOwnershipAdapter` | `solana-1.6.0` | +| `MCMSReaderRegistry` | `MCMSReader` | `solana` (no version) | +| `TokenAdapterRegistry` | `TokenAdapter` | `solana-1.6.0` | +| `CurseRegistry` | `CurseAdapter` + `CurseSubjectAdapter` | `solana-1.6.0` | + +--- + +## Interface Implementations + +### Deployer Interface + +| Method | Implementation | +|--------|---------------| +| `DeployChainContracts()` | Returns `DeployChainContracts` sequence (deploys LINK, Router, FeeQuoter, OffRamp, RMNRemote, BurnMint/LockRelease token pools, TestReceiver; initializes all; extends lookup table) | +| `DeployMCMS()` | Deploys Access Controller, MCM, and Timelock programs; initializes access controller roles, MCM configs, and timelock | +| `FinalizeDeployMCMS()` | Configures MCM (set_config), sets up timelock roles (Proposer, Executor, Canceller, Bypasser) | +| `SetOCR3Config()` | Returns `SetOCR3Config` sequence (sets OCR3 config on OffRamp) | +| `GrantAdminRoleToTimelock()` | Returns `nil` (not implemented for Solana) | +| `UpdateMCMSConfig()` | Updates config of specified MCMS contracts | + +### LaneAdapter Interface + +| Method | Implementation | +|--------|---------------| +| `ConfigureLaneLegAsSource()` | Adds destination chain config to FeeQuoter, adds destination chain to Router | +| `ConfigureLaneLegAsDest()` | Adds OffRamp to Router for remote chain, adds source chain config to OffRamp | +| `GetOnRampAddress()` | **Delegates to `GetRouterAddress()`** -- on Solana, the Router serves as the OnRamp | +| `GetOffRampAddress()` | Looks up OffRamp from DataStore | +| `GetFQAddress()` | Looks up FeeQuoter from DataStore | +| `GetRouterAddress()` | Looks up Router from DataStore | +| `GetRMNRemoteAddress()` | Looks up RMNRemote from DataStore | + +### TokenAdapter Interface + +| Method | Implementation | +|--------|---------------| +| `ConfigureTokenForTransfersSequence()` | Registers token in admin registry, accepts admin, sets pool on Router, configures remote chains with rate limits | +| `AddressRefToBytes()` | Converts base58 address to `[]byte` via `solana.MustPublicKeyFromBase58` | +| `DeriveTokenAddress()` | Not implemented (returns error) | +| `DeriveTokenDecimals()` | Reads decimals from on-chain mint account data | +| `DeriveTokenPoolCounterpart()` | Derives PDA using `TokenPoolConfigAddress(tokenMint, tokenPool)` | +| `ManualRegistration()` | Registers token admin registry, initializes token pool, optionally creates token multisig with customer mint authorities | +| `SetTokenPoolRateLimits()` | Sets inbound/outbound rate limits for BurnMint or LockRelease pools | +| `DeployToken()` | Deploys SPL/SPL2022 token, creates ATAs for senders, optionally uploads metadata | +| `DeployTokenVerify()` | No-op (returns nil) | +| `DeployTokenPoolForToken()` | Initializes pool account (BurnMint or LockRelease), creates pool signer ATA, sets mint authority for BurnMint pools | +| `UpdateAuthorities()` | Transfers token pool ownership to timelock signer PDA, updates rate limit admin | + +### TransferOwnershipAdapter Interface + +| Method | Implementation | +|--------|---------------| +| `InitializeTimelockAddress()` | No-op (returns nil) | +| `SequenceTransferOwnershipViaMCMS()` | Dispatches per contract type: Router, OffRamp, FeeQuoter, RMNRemote, AccessController, RBACTimelock | +| `ShouldAcceptOwnershipWithTransferOwnership()` | Returns `true` when current owner equals the chain's deployer key | +| `SequenceAcceptOwnership()` | Dispatches accept-ownership per contract type (same types as transfer) | + +### MCMSReader Interface + +| Method | Implementation | +|--------|---------------| +| `GetChainMetadata()` | Resolves MCM contract address based on timelock action (Schedule/Cancel/Bypass), gets op count from inspector, builds Solana MCMS chain metadata with access controller accounts | +| `GetTimelockRef()` | Looks up RBACTimelock from DataStore | +| `GetMCMSRef()` | Looks up MCM program from DataStore | + +--- + +## Solana-Specific Patterns + +### Router = OnRamp + +On Solana, the Router program functions as both the Router and OnRamp. `GetOnRampAddress()` delegates directly to `GetRouterAddress()`: + +```go +func (a *SolanaAdapter) GetOnRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { + return a.GetRouterAddress(ds, chainSelector) +} +``` + +### Two-Phase MCMS Deployment + +Unlike EVM where `FinalizeDeployMCMS()` is a no-op, Solana requires: + +1. **Phase 1 (`DeployMCMS`)**: Deploy programs + initialize (Access Controller accounts, MCM init, Timelock init) +2. **Phase 2 (`FinalizeDeployMCMS`)**: Configure MCM (set_config for Proposer/Canceller/Bypasser) + set up timelock roles + +### PDA-Based Address Derivation + +Solana uses Program Derived Addresses (PDAs) extensively: + +- `FindConfigPDA(routerProgram)` -- Router config +- `FindOfframpConfigPDA(offRampProgram)` -- OffRamp config +- `FindFqConfigPDA(feeQuoterProgram)` -- FeeQuoter config +- `FindRMNRemoteConfigPDA(rmnRemoteProgram)` -- RMN Remote config +- `state.GetTimelockSignerPDA(timelockID, seed)` -- Timelock signer +- `state.GetMCMSignerPDA(mcmID, seed)` -- MCM signer +- `tokens.TokenPoolConfigAddress(tokenMint, tokenPool)` -- Token pool config +- `tokens.TokenPoolSignerAddress(tokenMint, tokenPool)` -- Token pool signer + +### Base58 Address Handling + +All Solana addresses use base58 encoding. The adapter converts between `datastore.AddressRef` (string addresses) and `solana.PublicKey`: + +```go +func (a *SolanaAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error) { + return solana.MustPublicKeyFromBase58(ref.Address).Bytes(), nil +} +``` + +### Solana-Specific Contract Types + +Defined in `utils/common.go`: + +| Constant | Type | +|----------|------| +| `TimelockProgramType` | `"RBACTimelockProgram"` | +| `McmProgramType` | `"ManyChainMultiSigProgram"` | +| `AccessControllerProgramType` | `"AccessControllerProgram"` | +| `ProposerSeed` | `"ProposerSeed"` | +| `CancellerSeed` | `"CancellerSeed"` | +| `BypasserSeed` | `"BypasserSeed"` | +| `RBACTimelockSeed` | `"RBACTimelockSeed"` | +| `ProposerAccessControllerAccount` | `"ProposerAccessControllerAccount"` | +| `ExecutorAccessControllerAccount` | `"ExecutorAccessControllerAccount"` | +| `CancellerAccessControllerAccount` | `"CancellerAccessControllerAccount"` | +| `BypasserAccessControllerAccount` | `"BypasserAccessControllerAccount"` | +| `SPLTokens` | `"SPLTokens"` | +| `SPL2022Tokens` | `"SPL2022Tokens"` | diff --git a/chains/solana/deployment/docs/index.md b/chains/solana/deployment/docs/index.md new file mode 100644 index 0000000000..733acd961f --- /dev/null +++ b/chains/solana/deployment/docs/index.md @@ -0,0 +1,73 @@ +--- +title: "Solana Implementation" +sidebar_label: "Overview" +sidebar_position: 1 +--- + +# Solana Deployment Implementation + +This documentation covers the Solana-specific implementation of the CCIP Deployment Tooling API. The Solana adapter handles the unique requirements of the Solana Virtual Machine (SVM), including account-based program deployment, PDA-derived addresses, and two-phase MCMS initialization. + +For the shared interfaces this implementation fulfills, see [Interfaces Reference](../../../../deployment/docs/interfaces.md). For the shared types, see [Types Reference](../../../../deployment/docs/types.md). + +--- + +## Package Layout + +``` +chains/solana/deployment/ +├── utils/ +│ ├── common.go # Contract types, PDA helpers, MCMS builders +│ ├── deploy.go # MaybeDeployContract, artifact download +│ ├── mcms.go # GetAllMCMS helper +│ ├── utils.go # Lookup tables, token utilities, program data +│ ├── upgrade_authority.go # Upgrade authority management +│ ├── datastore.go # Address format conversions (base58) +│ ├── sequences.go # Shared sequence utilities +│ └── artifact_versions.go # Program artifact version mappings +├── v1_6_0/ +│ ├── adapters/ +│ │ └── init.go # CurseAdapter registration +│ ├── operations/ +│ │ ├── router/ # Router program operations +│ │ ├── offramp/ # OffRamp program operations +│ │ ├── fee_quoter/ # FeeQuoter program operations +│ │ ├── tokens/ # Token deployment operations +│ │ ├── token_pools/ # Token pool operations +│ │ ├── mcms/ # MCMS operations +│ │ ├── rmn_remote/ # RMN Remote operations +│ │ └── test_receiver/ # Test receiver operations +│ └── sequences/ +│ ├── adapter.go # SolanaAdapter struct + init() registration +│ ├── deploy_chain_contracts.go # Full chain deployment sequence +│ ├── connect_chains.go # Lane configuration sequences +│ ├── mcms.go # MCMS deploy + finalize sequences +│ ├── ocr.go # OCR3 configuration +│ ├── fee_quoter.go # Fee configuration sequences +│ ├── tokens.go # Token deployment + configuration +│ └── transfer_ownership.go # Ownership transfer sequences +└── idl/ # Anchor IDL definitions +``` + +## Key Differences from EVM + +| Aspect | EVM | Solana | +|--------|-----|--------| +| **Address format** | Hex (20 bytes) | Base58 (32 bytes, `solana.PublicKey`) | +| **Adapter state** | Stateless empty struct | Stateful: `timelockAddr map[uint64]solana.PublicKey` | +| **Router = OnRamp** | Separate OnRamp contract | Router serves as OnRamp (`GetOnRampAddress` delegates to `GetRouterAddress`) | +| **Contract deployment** | Single-step `CREATE`/`CREATE2` | Program deployment with `DeployProgram` + separate initialization | +| **Address derivation** | Deployed address known at creation | PDAs derived from seeds (`FindConfigPDA`, `FindOfframpConfigPDA`, etc.) | +| **MCMS deployment** | Single-phase (EVM returns no-op for finalize) | Two-phase: `DeployMCMS` deploys + initializes, `FinalizeDeployMCMS` configures + sets up roles | +| **Token standards** | ERC-20 only | SPL Tokens + SPL 2022 Tokens | +| **Token pool deployment** | New contract deployed per pool | Token pools are program accounts (initialized, not deployed) | +| **Lookup tables** | Not needed | Address lookup tables required for OffRamp (extended during deployment) | +| **Ownership acceptance** | Atomic with transfer when caller is deployer | `ShouldAcceptOwnershipWithTransferOwnership` returns true when current owner is deployer key | +| **MCMS contract types** | Single MCM, Timelock | Access Controller + MCM + Timelock with PDA seeds (Proposer, Canceller, Bypasser, RBACTimelock) | +| **Token configuration** | Register via TokenAdminRegistry contract | Register via Router's TokenAdminRegistry + initialize pool with Router/RMN references | +| **Associated Token Accounts** | Not applicable | ATAs must be created for token pool signers before use | + +## Documentation + +- [SolanaAdapter Reference](adapter.md) -- adapter struct, interface implementations, registration +- [Operations and Sequences Reference](operations-and-sequences.md) -- all operations by program, all sequences, utilities diff --git a/chains/solana/deployment/docs/operations-and-sequences.md b/chains/solana/deployment/docs/operations-and-sequences.md new file mode 100644 index 0000000000..0c44facc41 --- /dev/null +++ b/chains/solana/deployment/docs/operations-and-sequences.md @@ -0,0 +1,397 @@ +--- +title: "Solana Operations and Sequences Reference" +sidebar_label: "Operations & Sequences" +sidebar_position: 3 +--- + +# Solana Operations and Sequences Reference + +This document covers all Solana-specific operations (atomic on-chain interactions) and sequences (composed workflows) for the CCIP deployment tooling. + +For the shared interfaces these implement, see [Interfaces Reference](../../../../deployment/docs/interfaces.md). For the adapter that exposes these, see [SolanaAdapter Reference](adapter.md). + +--- + +## Table of Contents + +- [Operations by Program](#operations-by-program) +- [Sequences](#sequences) +- [Utilities](#utilities) + +--- + +## Operations by Program + +Solana operations are organized by the on-chain program they interact with. Each operation directory contains deploy, initialize, and state-modifying operations specific to that program. + +**Source:** [v1_6_0/operations/](../v1_6_0/operations/) + +### Router Operations + +**Source:** [v1_6_0/operations/router/](../v1_6_0/operations/router/) + +| Operation | Description | +|-----------|-------------| +| `Deploy` | Deploys the Router program using `MaybeDeployContract` | +| `Initialize` | Initializes the Router with FeeQuoter, LINK token, and RMN Remote references | +| `ConnectChains` | Adds a destination chain config to the Router (source-side lane setup) | +| `AddOffRamp` | Registers an OffRamp for a remote chain on the Router (dest-side lane setup) | +| `RegisterTokenAdminRegistry` | Registers a token in the admin registry via the Router | +| `AcceptTokenAdminRegistry` | Accepts token admin registration | +| `SetPool` | Associates a token pool with a token on the Router and FeeQuoter | +| `TransferOwnership` | Proposes ownership transfer to a new owner | +| `AcceptOwnership` | Accepts a proposed ownership transfer | + +### OffRamp Operations + +**Source:** [v1_6_0/operations/offramp/](../v1_6_0/operations/offramp/) + +| Operation | Description | +|-----------|-------------| +| `Deploy` | Deploys the OffRamp program | +| `Initialize` | Initializes with FeeQuoter, Router, and RMN Remote references | +| `InitializeConfig` | Sets OffRamp config (e.g., `EnableExecutionAfter` threshold) | +| `ConnectChains` | Adds a source chain config to the OffRamp (dest-side lane setup) | +| `SetOcr3` | Sets OCR3 configuration on the OffRamp | +| `TransferOwnership` | Proposes ownership transfer | +| `AcceptOwnership` | Accepts ownership transfer | + +### FeeQuoter Operations + +**Source:** [v1_6_0/operations/fee_quoter/](../v1_6_0/operations/fee_quoter/) + +| Operation | Description | +|-----------|-------------| +| `Deploy` | Deploys the FeeQuoter program | +| `Initialize` | Initializes with max fee, Router, OffRamp, and LINK token | +| `AddPriceUpdater` | Adds the OffRamp as a price updater | +| `ConnectChains` | Adds a destination chain config on the FeeQuoter (source-side lane setup) | +| `SetTokenTransferFeeConfig` | Sets per-token transfer fee configuration for a destination chain | +| `TransferOwnership` | Proposes ownership transfer | +| `AcceptOwnership` | Accepts ownership transfer | + +### Token Operations + +**Source:** [v1_6_0/operations/tokens/](../v1_6_0/operations/tokens/) + +| Operation | Description | +|-----------|-------------| +| `DeployLINK` | Deploys a LINK token (SPL token with configurable decimals and private key) | +| `DeploySolanaToken` | Deploys an SPL or SPL2022 token with optional ATAs and pre-minting | +| `UpsertTokenMetadata` | Uploads or updates token metadata on-chain | +| `CreateTokenMultisig` | Creates a multisig authority for token operations (used for customer mint authorities) | + +### Token Pool Operations + +**Source:** [v1_6_0/operations/token_pools/](../v1_6_0/operations/token_pools/) + +| Operation | Description | +|-----------|-------------| +| `DeployBurnMint` | Deploys BurnMint token pool program | +| `DeployLockRelease` | Deploys LockRelease token pool program | +| `InitializeBurnMint` | Initializes a BurnMint pool account with Router and RMN references | +| `InitializeLockRelease` | Initializes a LockRelease pool account with Router and RMN references | +| `UpsertRemoteChainConfigBurnMint` | Configures remote chain on a BurnMint pool | +| `UpsertRemoteChainConfigLockRelease` | Configures remote chain on a LockRelease pool | +| `UpsertRateLimitsBurnMint` | Sets rate limits on a BurnMint pool | +| `UpsertRateLimitsLockRelease` | Sets rate limits on a LockRelease pool | +| `TransferOwnershipBurnMint` | Proposes ownership transfer for BurnMint pool | +| `TransferOwnershipLockRelease` | Proposes ownership transfer for LockRelease pool | +| `AcceptOwnershipBurnMint` | Accepts ownership for BurnMint pool | +| `AcceptOwnershipLockRelease` | Accepts ownership for LockRelease pool | +| `UpdateRateLimitAdminBurnMint` | Updates the rate limit admin on a BurnMint pool | +| `UpdateRateLimitAdminLockRelease` | Updates the rate limit admin on a LockRelease pool | + +### MCMS Operations + +**Source:** [v1_6_0/operations/mcms/](../v1_6_0/operations/mcms/) + +| Operation | Description | +|-----------|-------------| +| `AccessControllerDeploy` | Deploys Access Controller program | +| `McmDeploy` | Deploys MCM (ManyChainMultiSig) program | +| `TimelockDeploy` | Deploys Timelock program | +| `InitAccessControllerOp` | Initializes an access controller account for a specific role | +| `InitMCMOp` | Initializes MCM for a specific config type (Proposer, Canceller, Bypasser) | +| `ConfigureMCMOp` | Reconfigures MCM after deployment (used in `FinalizeDeployMCMS`) | +| `InitTimelockOp` | Initializes the Timelock with minimum delay | +| `AddAccessOp` | Grants access roles on Timelock (Proposer, Executor, Canceller, Bypasser) | +| `TransferOwnershipOp` | Proposes ownership transfer for an ownable MCMS contract | +| `AcceptOwnershipOp` | Accepts ownership for an ownable MCMS contract | + +### RMN Remote Operations + +**Source:** [v1_6_0/operations/rmn_remote/](../v1_6_0/operations/rmn_remote/) + +| Operation | Description | +|-----------|-------------| +| `Deploy` | Deploys the RMN Remote program | +| `Initialize` | Initializes the RMN Remote | +| `TransferOwnership` | Proposes ownership transfer | +| `AcceptOwnership` | Accepts ownership transfer | + +### Test Receiver Operations + +**Source:** [v1_6_0/operations/test_receiver/](../v1_6_0/operations/test_receiver/) + +| Operation | Description | +|-----------|-------------| +| `Deploy` | Deploys the Test Receiver program | +| `Initialize` | Initializes with Router reference | + +--- + +## Sequences + +Sequences compose multiple operations into complete workflows. + +**Source:** [v1_6_0/sequences/](../v1_6_0/sequences/) + +### Deploy Chain Contracts + +**Source:** [v1_6_0/sequences/deploy_chain_contracts.go](../v1_6_0/sequences/deploy_chain_contracts.go) + +**Variable:** `DeployChainContracts` +**Input:** `ContractDeploymentConfigPerChainWithAddress` +**Output:** `OnChainOutput` + +Deploys and initializes all CCIP infrastructure on a Solana chain: + +1. Deploy LINK token (SPL token with configurable private key/decimals) +2. Deploy Router program +3. Deploy FeeQuoter program +4. Deploy OffRamp program +5. Deploy RMN Remote program +6. Deploy BurnMint Token Pool program +7. Deploy LockRelease Token Pool program +8. Initialize FeeQuoter (with max fee, Router, OffRamp, LINK references; add OffRamp as price updater) +9. Initialize Router (with FeeQuoter, LINK, RMN Remote references) +10. Initialize OffRamp (with FeeQuoter, Router, RMN Remote references; set config with execution threshold) +11. Initialize RMN Remote +12. **Extend OffRamp lookup table** with PDAs for all deployed programs (OffRamp config, FeeQuoter config, Router config, RMN Remote config, token pool addresses) +13. Deploy and initialize Test Receiver + +### Lane Configuration + +**Source:** [v1_6_0/sequences/connect_chains.go](../v1_6_0/sequences/connect_chains.go) + +#### ConfigureLaneLegAsSource + +Configures this chain as the source end of a lane. + +**Input:** `UpdateLanesInput` + +**Steps:** +1. Add destination chain config to FeeQuoter (translates shared `FeeQuoterDestChainConfig` to Solana-specific `fee_quoter.DestChainConfig`) +2. Add destination chain to Router (with allowlist configuration) + +#### ConfigureLaneLegAsDest + +Configures this chain as the destination end of a lane. + +**Input:** `UpdateLanesInput` + +**Steps:** +1. Add OffRamp to Router for the remote chain +2. Add source chain config to OffRamp (with source OnRamp address, enabled state, RMN verification flag) + +### MCMS Deployment + +**Source:** [v1_6_0/sequences/mcms.go](../v1_6_0/sequences/mcms.go) + +#### DeployMCMS (Phase 1) + +Deploys and initializes MCMS infrastructure: + +1. Deploy Access Controller program +2. Deploy MCM program +3. Deploy Timelock program +4. Initialize Access Controller accounts (Proposer, Executor, Canceller, Bypasser) +5. Initialize MCM for each config type (Proposer, Canceller, Bypasser) +6. Initialize Timelock with minimum delay + +#### FinalizeDeployMCMS (Phase 2) + +Completes MCMS setup after deployment: + +1. Configure MCM (set_config for Proposer, Canceller, Bypasser -- updates signer/quorum config) +2. Set up Timelock roles: + - Proposer role: MCM proposer signer PDA + - Executor role: Deployer key + - Canceller role: Canceller PDA + Proposer PDA + Bypasser PDA + - Bypasser role: Bypasser PDA + +#### UpdateMCMSConfig + +Updates config of specified MCMS contracts. Applies the same MCM config to Canceller, Bypasser, and Proposer for each specified MCM contract. + +#### GrantAdminRoleToTimelock + +Not implemented for Solana (returns `nil`). + +### OCR3 Configuration + +**Source:** [v1_6_0/sequences/ocr.go](../v1_6_0/sequences/ocr.go) + +**Variable:** `SetOCR3Config` + +Sets OCR3 configuration on the OffRamp. Resolves the OffRamp address from the DataStore and delegates to `offrampops.SetOcr3`. + +### Fee Configuration + +**Source:** [v1_6_0/sequences/fee_quoter.go](../v1_6_0/sequences/fee_quoter.go) + +#### SetTokenTransferFeeConfig + +**Variable:** `SetTokenTransferFeeConfig` +**Input:** `FeeQuoterSetTokenTransferFeeConfigSequenceInput` + +Sets per-token transfer fee configs on the FeeQuoter. Iterates over remote chain configs and applies fee config for each token/destination pair. + +### Token Sequences + +**Source:** [v1_6_0/sequences/tokens.go](../v1_6_0/sequences/tokens.go) + +#### DeployToken + +Deploys an SPL or SPL2022 token: +1. Checks if token already exists in DataStore (skips deployment if found) +2. Creates token with optional private key, ATAs for senders, pre-mint amount, and freeze authority disable +3. Optionally uploads token metadata + +#### DeployTokenPoolForToken + +Initializes a token pool account for an existing token: +1. Initializes BurnMint or LockRelease pool with Router and RMN Remote references +2. Creates associated token account (ATA) for the pool signer PDA +3. For BurnMint pools: sets mint authority to pool signer PDA (if deployer owns it) + +#### ConfigureTokenForTransfersSequence + +Full token configuration workflow: +1. Register token in admin registry via Router +2. Accept token admin registration +3. Set token pool on Router (associates pool with token on Router and FeeQuoter) +4. For each remote chain: + - Upsert remote chain config on token pool (BurnMint or LockRelease variant) + - Set inbound/outbound rate limits + +#### ManualRegistration + +For externally-owned tokens where mint authority is unavailable: +1. Register token admin registry (optionally with external admin) +2. Initialize token pool (BurnMint or LockRelease) +3. Transfer token pool ownership to proposed owner +4. Optionally create token multisig with customer mint authorities + pool signer PDA + +#### SetTokenPoolRateLimits + +Sets rate limits on a BurnMint or LockRelease token pool for a specific remote chain. + +#### UpdateAuthorities + +Transfers token pool ownership to the timelock signer PDA: +1. Update rate limit admin to timelock signer +2. Transfer ownership to timelock signer +3. Accept ownership (immediate acceptance since deployer is current owner) + +### Ownership Transfer + +**Source:** [v1_6_0/sequences/transfer_ownership.go](../v1_6_0/sequences/transfer_ownership.go) + +#### SequenceTransferOwnershipViaMCMS + +Dispatches ownership transfer based on contract type: +- **Router, OffRamp, FeeQuoter, RMN Remote**: Direct per-program transfer operation +- **AccessController type**: Transfers all MCMS contracts including access controller accounts +- **RBACTimelock type**: Transfers MCMS contracts (Timelock, Proposer, Canceller, Bypasser MCM accounts) + +#### SequenceAcceptOwnership + +Mirrors `SequenceTransferOwnershipViaMCMS` but calls accept-ownership operations for each contract type. + +--- + +## Utilities + +**Source:** [utils/](../utils/) + +### Contract Deployment (`deploy.go`) + +| Function | Description | +|----------|-------------| +| `MaybeDeployContract` | Checks DataStore for existing contract; deploys via `chain.DeployProgram` only if not found | +| `DownloadSolanaCCIPProgramArtifacts` | Downloads pre-built program artifacts from GitHub releases | + +### MCMS Helpers (`common.go`) + +| Function | Description | +|----------|-------------| +| `BuildMCMSBatchOperation` | Converts Solana instructions into MCMS `BatchOperation` transactions | +| `GetTimelockSignerPDA` | Resolves the timelock signer PDA from DataStore refs | +| `GetMCMSignerPDA` | Resolves an MCM signer PDA for a given signer type | +| `FundSolanaAccounts` | Airdrops SOL to accounts (testnet utility) | +| `FundFromDeployerKey` | Transfers SOL from deployer to accounts | +| `FundFromAddressIxs` | Creates SOL transfer instructions | + +### MCMS Ref Resolution (`mcms.go`) + +| Function | Description | +|----------|-------------| +| `GetAllMCMS` | Returns all MCMS-related address refs for a chain (access controller + accounts + timelock + MCM accounts) | + +### Program Utilities (`utils.go`) + +| Function | Description | +|----------|-------------| +| `ExtendLookupTable` | Extends an OffRamp address lookup table with new entries (deduplicates) | +| `GetTokenProgramID` | Maps `SPLTokens`/`SPL2022Tokens` contract types to Solana program IDs | +| `GetSolProgramSize` | Gets the byte size of a deployed program | +| `GetSolProgramData` | Reads program data account (data type + address) | +| `GetTokenDecimals` | Reads token decimals from on-chain mint account | +| `GetTokenMintAuthority` | Reads the current mint authority of a token | +| `MintTokens` | Mints tokens to specified addresses via their ATAs | +| `DisableFreezeAuthority` | Permanently disables freeze authority on token mints | + +### DataStore Utilities (`datastore.go`) + +Provides Solana-specific address format conversion functions, including `ToByteArray` for converting DataStore address refs to `[]byte` via base58 decoding. + +### Upgrade Authority (`upgrade_authority.go`) + +Manages Solana program upgrade authority for production deployments. + +--- + +## Operation Pattern + +Solana operations follow the same framework as EVM but interact with Solana chains: + +```go +var MyOperation = operations.NewOperation( + "my-operation", + semver.MustParse("1.6.0"), + "Description of what this operation does", + func(b operations.Bundle, chain cldf_solana.Chain, input MyInput) (MyOutput, error) { + // Build Solana instruction + ixn, err := program.NewMyInstruction(input.Param, /* accounts */).ValidateAndBuild() + if err != nil { + return MyOutput{}, err + } + + // Execute on-chain + if err := chain.Confirm([]solana.Instruction{ixn}); err != nil { + return MyOutput{}, err + } + + return MyOutput{/* ... */}, nil + }, +) +``` + +Key differences from EVM operations: +- Uses `cldf_solana.Chain` instead of EVM chain type +- Builds Solana `Instruction` objects (not EVM transactions) +- Executes via `chain.Confirm(instructions)` (not contract bindings) +- No automatic MCMS fallback -- MCMS batch ops are built explicitly via `BuildMCMSBatchOperation` +- Deploy operations use `MaybeDeployContract` which calls `chain.DeployProgram` diff --git a/deployment/docs/_category_.yaml b/deployment/docs/_category_.yaml new file mode 100644 index 0000000000..29bf607e90 --- /dev/null +++ b/deployment/docs/_category_.yaml @@ -0,0 +1,2 @@ +label: "CCIP Deployment Tooling" +position: 1 diff --git a/deployment/docs/architecture.md b/deployment/docs/architecture.md new file mode 100644 index 0000000000..6858138b18 --- /dev/null +++ b/deployment/docs/architecture.md @@ -0,0 +1,220 @@ +--- +title: "Architecture Guide" +sidebar_label: "Architecture" +sidebar_position: 2 +--- + +# Architecture Guide + +This document describes the design principles, patterns, and data flow of the CCIP Deployment Tooling API. + +## Design Principles + +1. **Chain Agnosticism**: Changesets operate without knowledge of chain-specific details. All chain-specific logic is encapsulated in adapters. +2. **Version-Aware Adapters**: Different contract versions have different adapters registering under the same interface. This allows multiple versions to coexist. +3. **Singleton Registries**: All adapter registries are global singletons, initialized once via Go `init()` functions and accessed thread-safely. +4. **Stateful Retry via Operations**: Operations produce reports that enable resuming long-running sequences from the point of failure. +5. **MCMS-First Governance**: All write operations can be routed through Multi-Chain Multi-Sig (MCMS) proposals when the deployer key is not the contract owner. + +## Adapter-Registry Pattern + +The core architectural pattern is a registry of chain-family adapters keyed by `chainFamily-version`: + +``` +Changeset (entry point) + | + v +Registry.GetAdapter(chainFamily, version) + | + v +Adapter (implements interface) + | + v +Sequence (ordered operations) + | + v +Operations (single side-effects) +``` + +### How Registries Work + +Each registry is a singleton created via `sync.Once`: + +```go +var ( + singletonRegistry *DeployerRegistry + once sync.Once +) + +func GetRegistry() *DeployerRegistry { + once.Do(func() { + singletonRegistry = newDeployerRegistry() + }) + return singletonRegistry +} +``` + +Adapters register themselves in Go `init()` functions, which run automatically when the package is imported: + +```go +func init() { + v := semver.MustParse("1.6.0") + deploy.GetRegistry().RegisterDeployer(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + lanes.GetLaneAdapterRegistry().RegisterLaneAdapter(chain_selectors.FamilyEVM, v, &EVMAdapter{}) + // ... more registrations +} +``` + +Registry keys are constructed using `utils.NewRegistererID(chainFamily, version)`, which produces strings like `"evm-1.6.0"` or `"solana-1.6.0"`. The `MCMSReaderRegistry` is the exception -- it uses only `chainFamily` as the key (one reader per family, not per version). + +All registries use `sync.Mutex` for thread-safe concurrent access. + +### Available Registries + +| Registry | Key Format | Singleton Accessor | Source | +|----------|------------|-------------------|--------| +| `DeployerRegistry` | `chainFamily-version` | `deploy.GetRegistry()` | `deploy/product.go` | +| `LaneAdapterRegistry` | `chainFamily-version` | `lanes.GetLaneAdapterRegistry()` | `lanes/product.go` | +| `TokenAdapterRegistry` | `chainFamily-version` | `tokens.GetTokenAdapterRegistry()` | `tokens/product.go` | +| `FeeAdapterRegistry` | `chainFamily-version` | `fees.GetRegistry()` | `fees/product.go` | +| `MCMSReaderRegistry` | `chainFamily` | `changesets.GetRegistry()` | `utils/changesets/output.go` | +| `TransferOwnershipAdapterRegistry` | `chainFamily-version` | `deploy.GetTransferOwnershipRegistry()` | `deploy/product.go` | +| `CurseRegistry` | `chainFamily-version` | `fastcurse.GetCurseRegistry()` | `fastcurse/product.go` | + +## The Three-Level Hierarchy + +### Operations + +An Operation is the most granular executable action -- a single contract deployment, transaction, or read call. Each operation has **at most one side effect**. + +Operations produce reports that serialize their inputs and outputs, enabling stateful retries. If a sequence fails partway through, it can resume from the last successful operation. + +Chain-specific implementations define operations differently: +- **EVM**: Uses `contract.NewRead`, `contract.NewWrite`, `contract.NewDeploy` helpers that wrap gethwrapper methods +- **Solana**: Uses `operations.NewOperation` with chain-specific transaction building + +### Sequences + +A Sequence is an ordered collection of operations that represents a complete workflow (e.g., "deploy all CCIP contracts on a chain" or "configure a lane between two chains"). + +Key properties: +- Accept a **serializable input** and return `OnChainOutput` +- Depend on minimal infrastructure (typically just `cldf_chain.BlockChains`) +- Target a **single chain** for simplicity +- Can be composed using `RunAndMergeSequence` to aggregate outputs + +```go +type OnChainOutput struct { + Addresses []datastore.AddressRef // Deployed/managed contracts + Metadata Metadata // Contract, chain, and env metadata + BatchOps []mcms_types.BatchOperation // Operations for MCMS proposals +} +``` + +### Changesets + +A Changeset wraps a sequence with deployment environment context. It handles: +1. Reading addresses from a DataStore +2. Passing resolved addresses into sequences as input +3. Producing MCMS proposals from sequence output using `OutputBuilder` +4. Writing new addresses and metadata back to the DataStore + +Changesets follow the `cldf.ChangeSetV2[Config]` pattern from chainlink-deployments-framework, with a `verify` function (validates config) and an `apply` function (executes the logic). + +## Cross-Chain Dispatch Flow + +When a changeset needs to operate across multiple chains, it follows this dispatch pattern: + +1. The changeset receives a config with `map[uint64]PerChainConfig` (chain selector -> per-chain config) +2. For each chain selector, it resolves the chain family using `chain_selectors.GetSelectorFamily(chainSelector)` +3. It looks up the correct adapter from the registry using the family and version +4. It delegates to that adapter's sequence, passing chain-specific input +5. It aggregates outputs from all chains into a single `ChangesetOutput` + +Example flow from `DeployContracts`: + +```go +for chainSelector, chainConfig := range config.Chains { + family, _ := chain_selectors.GetSelectorFamily(chainSelector) + deployer, _ := registry.GetDeployer(family, chainConfig.Version) + // Execute the deployer's sequence for this chain + seq := deployer.DeployChainContracts() + report, _ := operations.ExecuteSequence(bundle, seq, blockchains, input) +} +``` + +## DataStore Integration + +The DataStore is the central persistence layer for deployment state. It stores contract addresses, metadata, and environment information. + +### AddressRef + +`datastore.AddressRef` is the universal contract pointer: + +```go +type AddressRef struct { + ChainSelector uint64 + Address string + Type ContractType + Version *semver.Version + Qualifier string +} +``` + +### Flow + +1. **Read**: Changesets read existing addresses from the DataStore to resolve dependencies (e.g., finding the Router address to pass to OffRamp deployment) +2. **Write**: Sequence outputs (`OnChainOutput.Addresses`) are written back to the DataStore after execution +3. **Metadata**: Contract, chain, and environment metadata is upserted via `WriteMetadataToDatastore` + +## MCMS Proposal Construction + +The `OutputBuilder` is a builder pattern for constructing changeset outputs that include MCMS (Multi-Chain Multi-Sig) proposals. + +### Flow + +1. Sequences return `BatchOperation` objects for write operations that require MCMS approval +2. The `OutputBuilder` collects all batch operations across sequences +3. On `Build(mcms.Input)`, it: + - Resolves timelock addresses per chain via `MCMSReader.GetTimelockRef` + - Fetches chain metadata via `MCMSReader.GetChainMetadata` + - Constructs a `TimelockProposal` containing all batch operations +4. The proposal is included in the `ChangesetOutput.MCMSTimelockProposals` + +```go +output, err := changesets.NewOutputBuilder(env, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + WithDataStore(ds). + Build(mcmsInput) +``` + +The `MCMSReader` interface is what allows this to work across chain families -- each family implements its own way of resolving timelock addresses and chain metadata. + +## Versioning Strategy + +### Contract Versions + +Multiple contract versions coexist in the system: +- **Version constants**: `Version_1_0_0`, `Version_1_5_0`, `Version_1_5_1`, `Version_1_6_0`, `Version_1_6_1` (defined in `utils/common.go`) +- **Adapter registration**: Each version registers its own adapter (e.g., EVM has adapters from v1_0_0 through v1_6_5) + +### Token Adapter Versioning + +Token adapters have a special versioning requirement: any token pool version must be connectable to any other. This means there is one `TokenAdapterRegistry` (not version-scoped), and each chain-family-version combination registers separately. + +### Lane Adapter Versioning + +Lane adapters are version-scoped -- a v1.6.0 lane and a v1.7.0 lane may have different configuration requirements. Separate registries can exist per major API version. + +### Chain Family Selectors + +Each chain family has a unique 4-byte selector used on-chain: + +| Family | Selector | Constant | +|--------|----------|----------| +| EVM | `0x2812d52c` | `EVMFamilySelector` | +| SVM (Solana) | `0x1e10bdc4` | `SVMFamilySelector` | +| Aptos | `0xac77ffec` | `AptosFamilySelector` | +| TVM (TON) | `0x647e2ba9` | `TVMFamilySelector` | +| Sui | `0xc4e05953` | `SuiFamilySelector` | diff --git a/deployment/docs/changesets.md b/deployment/docs/changesets.md new file mode 100644 index 0000000000..1b45f698fe --- /dev/null +++ b/deployment/docs/changesets.md @@ -0,0 +1,441 @@ +--- +title: "Changesets Reference" +sidebar_label: "Changesets" +sidebar_position: 5 +--- + +# Changesets Reference + +Changesets are the top-level entry points for the CCIP Deployment Tooling API. Each changeset accepts a configuration input, resolves the appropriate chain-family adapters, executes sequences, and returns a `ChangesetOutput` that may include DataStore updates and MCMS proposals. + +For the types used by these changesets, see [Types Reference](types.md). For the adapter interfaces they delegate to, see [Interfaces Reference](interfaces.md). + +--- + +## Table of Contents + +- [Contract Deployment](#contract-deployment) +- [MCMS Deployment](#mcms-deployment) +- [Lane Configuration](#lane-configuration) +- [OCR3 Configuration](#ocr3-configuration) +- [Token Configuration](#token-configuration) +- [Fee Configuration](#fee-configuration) +- [Ownership Management](#ownership-management) +- [RMN Curse Operations](#rmn-curse-operations) +- [Lane Migration](#lane-migration) + +--- + +## Contract Deployment + +### DeployContracts + +Deploys all CCIP infrastructure contracts (Router, OnRamp, OffRamp, FeeQuoter, RMNRemote, etc.) on one or more chains. + +**Source:** [deploy/contracts.go](../deploy/contracts.go) + +**Constructor:** +```go +func DeployContracts(deployerReg *DeployerRegistry) cldf.ChangeSetV2[ContractDeploymentConfig] +``` + +**Input:** [`ContractDeploymentConfig`](types.md#contractdeploymentconfig) + +**Behavior:** +1. For each chain in `Chains`, resolves the chain family from the selector +2. Looks up the `Deployer` adapter from the `DeployerRegistry` using family + version +3. Executes `deployer.DeployChainContracts()` sequence +4. Collects deployed addresses into a DataStore +5. Returns output via `OutputBuilder` + +**Example:** +```go +changeset := deploy.DeployContracts(deploy.GetRegistry()) +output, err := changeset.Apply(env, deploy.ContractDeploymentConfig{ + Chains: map[uint64]deploy.ContractDeploymentConfigPerChain{ + chainSelector: { + Version: semver.MustParse("1.6.0"), + MaxFeeJuelsPerMsg: big.NewInt(1e18), + TokenPriceStalenessThreshold: 86400, + LinkPremiumMultiplier: 9e17, + NativeTokenPremiumMultiplier: 18e17, + PermissionLessExecutionThresholdSeconds: 86400, + }, + }, +}) +``` + +--- + +## MCMS Deployment + +### DeployMCMS + +Deploys Multi-Chain Multi-Sig governance contracts (AccessController, MCM, Timelock) on one or more chains. + +**Source:** [deploy/mcms.go](../deploy/mcms.go) + +**Constructor:** +```go +func DeployMCMS(deployerReg *DeployerRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[MCMSDeploymentConfig] +``` + +**Input:** [`MCMSDeploymentConfig`](types.md#mcmsdeploymentconfig) + +**Behavior:** +1. For each chain, resolves family and looks up `Deployer` adapter +2. Executes `deployer.DeployMCMS()` sequence +3. Collects deployed MCMS contract addresses into a DataStore + +### FinalizeDeployMCMS + +Finalizes MCMS deployment. Required for chains that need a two-phase deployment (e.g., Solana timelock initialization). + +**Constructor:** +```go +func FinalizeDeployMCMS(deployerReg *DeployerRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[MCMSDeploymentConfig] +``` + +Same input as `DeployMCMS`. Executes `deployer.FinalizeDeployMCMS()` instead. + +### GrantAdminRoleToTimelock + +Grants admin role from one timelock to another. Used when setting up multi-tiered MCMS governance. + +**Constructor:** +```go +func GrantAdminRoleToTimelock(deployerReg *DeployerRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[GrantAdminRoleToTimelockConfig] +``` + +**Input:** [`GrantAdminRoleToTimelockConfig`](types.md#grantadminroletotimelockconfig) + +**Validation:** +- Both timelock refs must have type `RBACTimelock` +- Both must have non-empty qualifier and version + +--- + +## Lane Configuration + +### ConnectChains + +Configures bidirectional lanes between chains. For each lane, configures both the source-side and destination-side on each chain. + +**Source:** [lanes/connect_chains.go](../lanes/connect_chains.go) + +**Constructor:** +```go +func ConnectChains(laneRegistry *LaneAdapterRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[ConnectChainsConfig] +``` + +**Input:** [`ConnectChainsConfig`](types.md#connectchainsconfig) + +**Behavior:** +For each `LaneConfig` in the input: +1. Resolves `LaneAdapter` for both ChainA and ChainB families +2. Populates contract addresses (OnRamp, OffRamp, Router, FeeQuoter) from the DataStore via the adapter's `Get*Address` methods +3. Executes `ConfigureLaneLegAsSource()` and `ConfigureLaneLegAsDest()` for both directions: + - A as source, B as dest + - B as source, A as dest + +**Example:** +```go +changeset := lanes.ConnectChains(lanes.GetLaneAdapterRegistry(), changesets.GetRegistry()) +output, err := changeset.Apply(env, lanes.ConnectChainsConfig{ + Lanes: []lanes.LaneConfig{ + { + ChainA: lanes.ChainDefinition{Selector: evmSel, GasPrice: big.NewInt(2e12)}, + ChainB: lanes.ChainDefinition{Selector: solSel, GasPrice: big.NewInt(2e12)}, + Version: semver.MustParse("1.6.0"), + }, + }, + MCMS: mcms.Input{TimelockAction: mcms_types.TimelockActionSchedule}, +}) +``` + +--- + +## OCR3 Configuration + +### SetOCR3Config + +Sets OCR3 configuration on remote chain OffRamps. Reads the OCR3 config from CCIPHome on the home chain and applies it to the specified remote chains. + +**Source:** [deploy/set_ocr3_config.go](../deploy/set_ocr3_config.go) + +**Constructor:** +```go +func SetOCR3Config(deployerReg *DeployerRegistry, mcmsReg *MCMSReaderRegistry) cldf.ChangeSetV2[SetOCR3ConfigArgs] +``` + +**Input:** [`SetOCR3ConfigArgs`](types.md#setocr3configargs) + +**Behavior:** +1. For each remote chain selector, resolves the `Deployer` adapter (always version 1.6.0) +2. Reads OCR3 config from CCIPHome on the home chain +3. Builds `OCR3ConfigArgs` with signers, transmitters, and config digests +4. Executes `deployer.SetOCR3Config()` on each remote chain + +--- + +## Token Configuration + +### TokenExpansion + +Comprehensive changeset that deploys tokens, token pools, configures them for cross-chain transfers, and transfers ownership to the timelock. + +**Source:** [tokens/token_expansion.go](../tokens/token_expansion.go) + +**Constructor:** +```go +func TokenExpansion() cldf.ChangeSetV2[TokenExpansionInput] +``` + +**Input:** [`TokenExpansionInput`](types.md#tokenexpansioninput) + +**Behavior:** +1. **Deploy tokens** (if `DeployTokenInput` is non-nil): Executes `adapter.DeployToken()` +2. **Deploy token pools** (if `DeployTokenPoolInput` is non-nil): Executes `adapter.DeployTokenPoolForToken()` +3. **Configure for transfers** (if `TokenTransferConfig` is non-nil): Calls `processTokenConfigForChain()` which executes `adapter.ConfigureTokenForTransfersSequence()` +4. **Update authorities** (unless `SkipOwnershipTransfer` is true): Executes `adapter.UpdateAuthorities()` to transfer ownership to the timelock + +### ConfigureTokensForTransfers + +Configures already-deployed tokens and token pools for cross-chain transfers. Does not deploy new contracts. + +**Source:** [tokens/configure_tokens_for_transfers.go](../tokens/configure_tokens_for_transfers.go) + +**Constructor:** +```go +func ConfigureTokensForTransfers(tokenRegistry *TokenAdapterRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[ConfigureTokensForTransfersConfig] +``` + +**Input:** [`ConfigureTokensForTransfersConfig`](types.md#configuretokensfortransfersconfig) + +**Behavior:** +For each token configuration: +1. Resolves the `TokenAdapter` for the chain family +2. Resolves remote chain addresses and decimals +3. Derives inbound rate limiter config from counterpart's outbound config +4. Executes `adapter.ConfigureTokenForTransfersSequence()` + +### ManualRegistration + +Registers customer tokens with the token admin registry. Used when the customer has already deployed the token and no longer has mint authority. + +**Source:** [tokens/manual_registration.go](../tokens/manual_registration.go) + +**Constructor:** +```go +func ManualRegistration() cldf.ChangeSetV2[ManualRegistrationInput] +``` + +**Input:** [`ManualRegistrationInput`](types.md#manualregistrationinput) + +### SetTokenPoolRateLimits + +Sets rate limits on token pools for specific remote chains. + +**Source:** [tokens/rate_limits.go](../tokens/rate_limits.go) + +**Constructor:** +```go +func SetTokenPoolRateLimits() cldf.ChangeSetV2[TPRLInput] +``` + +**Input:** [`TPRLInput`](types.md#tprlinput) + +**Behavior:** +- Resolves token decimals on both local and remote chains +- Scales float-based user inputs by token decimals +- Derives inbound rate limiter from counterpart's outbound config +- Inbound capacity is scaled by 1.1x to avoid accidental rate limit hits + +**Validation:** +- If rate limiter is enabled, capacity and rate must be positive + +--- + +## Fee Configuration + +### SetTokenTransferFee + +Sets per-token transfer fee configurations on the FeeQuoter for each source-destination pair. + +**Source:** [fees/set_token_transfer_fee.go](../fees/set_token_transfer_fee.go) + +**Constructor:** +```go +func SetTokenTransferFee(feeRegistry *FeeAdapterRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[SetTokenTransferFeeInput] +``` + +**Input:** +```go +type SetTokenTransferFeeInput struct { + Version *semver.Version + Args []TokenTransferFeeForSrc + MCMS mcms.Input +} +``` + +**Fee Resolution:** +For each token, the changeset uses a three-tier fallback: +1. **User-specified values** (if `Valid` is true in `UnresolvedTokenTransferFeeArgs`) +2. **On-chain values** (if the token already has fee config set) +3. **Adapter defaults** (from `adapter.GetDefaultTokenTransferFeeConfig()`) + +**Validation:** +- No duplicate source chain selectors +- No duplicate destination selectors within the same source +- Source and destination selectors cannot be the same +- Token addresses cannot be empty +- Same address cannot appear in both updates and resets + +--- + +## Ownership Management + +### TransferOwnershipChangeset + +Proposes ownership transfer of contracts through MCMS governance. On chains where `ShouldAcceptOwnershipWithTransferOwnership()` returns true (e.g., Solana), also accepts ownership atomically. + +**Source:** [deploy/transfer_ownership.go](../deploy/transfer_ownership.go) + +**Constructor:** +```go +func TransferOwnershipChangeset(cr *TransferOwnershipAdapterRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[TransferOwnershipInput] +``` + +**Input:** [`TransferOwnershipInput`](types.md#transferownershipinput) + +**Behavior:** +1. For each chain, resolves the `TransferOwnershipAdapter` +2. Initializes timelock address via `adapter.InitializeTimelockAddress()` +3. Resolves partial contract refs to full refs +4. Executes `adapter.SequenceTransferOwnershipViaMCMS()` +5. If `adapter.ShouldAcceptOwnershipWithTransferOwnership()` returns true, also executes `adapter.SequenceAcceptOwnership()` + +### AcceptOwnershipChangeset + +Accepts previously proposed ownership transfers. + +**Constructor:** +```go +func AcceptOwnershipChangeset(cr *TransferOwnershipAdapterRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[TransferOwnershipInput] +``` + +Same input as `TransferOwnershipChangeset`. Only executes `adapter.SequenceAcceptOwnership()`. + +--- + +## RMN Curse Operations + +**Source:** [fastcurse/fastcurse.go](../fastcurse/fastcurse.go) + +### CurseChangeset + +Curses specified subjects on specified chains via the RMNRemote contract. + +**Constructor:** +```go +func CurseChangeset(cr *CurseRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[RMNCurseConfig] +``` + +**Input:** +```go +type RMNCurseConfig struct { + CurseActions []CurseActionInput + Force bool // Include already-cursed subjects + MCMS mcms.Input +} + +type CurseActionInput struct { + IsGlobalCurse bool + ChainSelector uint64 + SubjectChainSelector uint64 + Version *semver.Version +} +``` + +**Behavior:** +- Groups curse actions by chain selector +- Filters out already-cursed subjects (unless `Force` is true) +- Executes `adapter.Curse()` sequence for each chain + +### UncurseChangeset + +Lifts curses on specified subjects. + +**Constructor:** +```go +func UncurseChangeset(cr *CurseRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[RMNCurseConfig] +``` + +Same input as `CurseChangeset`. Executes `adapter.Uncurse()` instead. + +### GloballyCurseChainChangeset + +Globally curses chains across the entire network. Automatically discovers connected chains and creates curse actions for all of them. + +**Constructor:** +```go +func GloballyCurseChainChangeset(cr *CurseRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[GlobalCurseOnNetworkInput] +``` + +**Input:** +```go +type GlobalCurseOnNetworkInput struct { + ChainSelectors map[uint64]*semver.Version // Chains to curse -> RMN version + Force bool + MCMS mcms.Input +} +``` + +### GloballyUncurseChainChangeset + +Reverses a global curse across the network. + +**Constructor:** +```go +func GloballyUncurseChainChangeset(cr *CurseRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[GlobalCurseOnNetworkInput] +``` + +--- + +## Lane Migration + +### LaneMigrateToNewVersionChangeset + +Migrates lanes to a new contract version by updating router configurations and ramp contracts. + +**Source:** [deploy/lanemigrator.go](../deploy/lanemigrator.go) + +**Constructor:** +```go +func LaneMigrateToNewVersionChangeset(migratorReg *LaneMigratorRegistry, mcmsRegistry *MCMSReaderRegistry) cldf.ChangeSetV2[LaneMigratorConfig] +``` + +**Input:** +```go +type LaneMigratorConfig struct { + Input map[uint64]LaneMigratorConfigPerChain + MCMS mcms.Input +} + +type LaneMigratorConfigPerChain struct { + RemoteChains []uint64 // Remote chains to migrate + RouterVersion *semver.Version // Router version to use + RampVersion *semver.Version // Ramp version to upgrade to (must be >= 1.6.0) +} +``` + +**Behavior:** +1. Looks up OnRamp, OffRamp, and Router refs from the DataStore +2. Executes `routerUpdater.UpdateRouter()` to point the router to new ramps +3. Executes `rampUpdater.UpdateVersionWithRouter()` to configure ramps with the new router + +**Validation:** +- Ramp version must be >= 1.6.0 +- Both router updater and ramp updater must be registered +- All chain selectors must exist in the environment +- Existing addresses must be present in the DataStore diff --git a/deployment/docs/implementing-adapters.md b/deployment/docs/implementing-adapters.md new file mode 100644 index 0000000000..72e60e731a --- /dev/null +++ b/deployment/docs/implementing-adapters.md @@ -0,0 +1,313 @@ +--- +title: "Implementing a New Chain Family Adapter" +sidebar_label: "Implementing Adapters" +sidebar_position: 6 +--- + +# Implementing a New Chain Family Adapter + +This guide provides a step-by-step walkthrough for adding support for a new chain family to the CCIP Deployment Tooling API. + +For the complete interface definitions, see [Interfaces Reference](interfaces.md). For type definitions, see [Types Reference](types.md). + +## Prerequisites + +- Familiarity with the [Architecture](architecture.md) (adapter-registry pattern, operations-sequences-changesets hierarchy) +- The `chain-selectors` library must already define a family constant for your chain (e.g., `chain_selectors.FamilyAptos`) +- Smart contracts for your chain family are deployed or in development + +## Step 1: Choose Your Module Location + +By convention, chain-family adapters live alongside their contracts: + +``` +chainlink-ccip/chains//deployment/ +``` + +Or in an external repository: + +``` +chainlink-/deployment/ +``` + +Create a Go module with its own `go.mod` that imports `chainlink-ccip/deployment` for the shared types and interfaces. + +## Step 2: Set Up the Directory Structure + +Follow this canonical layout: + +``` +chains//deployment/ +├── go.mod +├── go.sum +├── utils/ # Shared utilities for this chain family +│ ├── common.go # Chain-specific contract type constants +│ ├── deploy.go # Deployment helpers +│ ├── mcms.go # MCMS-related utilities +│ └── datastore.go # DataStore helpers +├── v1_6_0/ # Version-specific implementation +│ ├── adapters/ # Adapters registered separately (curse, fees) +│ │ └── init.go # init() registrations for adapters +│ ├── operations/ # Low-level contract operations +│ │ ├── router/ +│ │ ├── offramp/ +│ │ ├── fee_quoter/ +│ │ ├── token_pools/ +│ │ ├── tokens/ +│ │ ├── rmn_remote/ +│ │ └── mcms/ +│ ├── sequences/ # High-level operation orchestration +│ │ ├── adapter.go # Main adapter struct + init() registration +│ │ ├── deploy_chain_contracts.go +│ │ ├── connect_chains.go +│ │ ├── ocr.go +│ │ ├── mcms.go +│ │ ├── tokens.go +│ │ ├── fee_quoter.go +│ │ └── transfer_ownership.go +│ └── testadapter/ # Test adapter implementation +└── docs/ # Chain-specific documentation +``` + +## Step 3: Create the Adapter Struct + +Define a single struct that will implement all required interfaces: + +```go +// sequences/adapter.go +package sequences + +type MyChainAdapter struct { + // Add any stateful fields your chain needs. + // For example, Solana caches timelock addresses: + // timelockAddr map[uint64]solana.PublicKey + // + // EVM uses a stateless empty struct: + // (no fields) +} +``` + +## Step 4: Implement Required Interfaces + +### Interface Checklist + +Each method returns a `*operations.Sequence` that the framework executes. Your job is to implement the sequence logic using chain-specific operations. + +#### 4.1 Deployer + +Deploy all CCIP infrastructure contracts on your chain: + +```go +func (a *MyChainAdapter) DeployChainContracts() *Sequence[ContractDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] { + return DeployChainContractsSequence // your sequence variable +} + +func (a *MyChainAdapter) DeployMCMS() *Sequence[MCMSDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] { + return DeployMCMSSequence +} + +func (a *MyChainAdapter) FinalizeDeployMCMS() *Sequence[MCMSDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] { + return FinalizeDeployMCMSSequence // can be no-op if not needed +} + +func (a *MyChainAdapter) SetOCR3Config() *Sequence[SetOCR3ConfigInput, OnChainOutput, BlockChains] { + return SetOCR3ConfigSequence +} + +func (a *MyChainAdapter) GrantAdminRoleToTimelock() *Sequence[GrantAdminRoleToTimelockConfigPerChainWithSelector, OnChainOutput, BlockChains] { + return GrantAdminRoleToTimelockSequence +} +``` + +#### 4.2 LaneAdapter + +Address retrieval methods must encode addresses in your chain's native format: + +```go +func (a *MyChainAdapter) GetOnRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { + // Look up the OnRamp address from the DataStore and return as bytes +} + +func (a *MyChainAdapter) GetOffRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { ... } +func (a *MyChainAdapter) GetRouterAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { ... } +func (a *MyChainAdapter) GetFQAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { ... } + +func (a *MyChainAdapter) ConfigureLaneLegAsSource() *Sequence[UpdateLanesInput, OnChainOutput, BlockChains] { + return ConfigureLaneLegAsSourceSequence +} + +func (a *MyChainAdapter) ConfigureLaneLegAsDest() *Sequence[UpdateLanesInput, OnChainOutput, BlockChains] { + return ConfigureLaneLegAsDestSequence +} +``` + +#### 4.3 TokenAdapter + +The token adapter requires several helper methods for address derivation: + +```go +func (a *MyChainAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error) { + // Convert the AddressRef.Address string to bytes using your chain's encoding + // EVM: hex decoding, Solana: base58 decoding +} + +func (a *MyChainAdapter) DeriveTokenAddress(e Environment, chainSelector uint64, poolRef datastore.AddressRef) ([]byte, error) { + // Read the token address from the pool contract on-chain +} + +func (a *MyChainAdapter) DeriveTokenDecimals(e Environment, chainSelector uint64, poolRef datastore.AddressRef, token []byte) (uint8, error) { + // Read the token decimals on-chain +} + +func (a *MyChainAdapter) DeriveTokenPoolCounterpart(e Environment, chainSelector uint64, tokenPool []byte, token []byte) ([]byte, error) { + // For chains where the operational pool address differs from the deployed address + // (e.g., Solana PDAs). Return tokenPool unchanged if not applicable. +} +``` + +#### 4.4 FeeAdapter, MCMSReader, TransferOwnershipAdapter, CurseAdapter, CurseSubjectAdapter + +Follow the same pattern -- see [Interfaces Reference](interfaces.md) for the full method signatures. + +## Step 5: Create Operations + +Operations are the atomic building blocks. Define them in the `operations/` directory, organized by contract. + +Each operation follows this pattern: + +```go +var Deploy = operations.NewOperation( + "my-contract:deploy", // Operation ID: contract:method + semver.MustParse("1.6.0"), // Contract version + "Deploys the MyContract program", // Description + func(b operations.Bundle, chain MyChain, input DeployInput) (DeployOutput, error) { + // Chain-specific deployment logic + }, +) +``` + +## Step 6: Compose Sequences + +Sequences orchestrate multiple operations into complete workflows. Define them in the `sequences/` directory. + +```go +var DeployChainContractsSequence = operations.NewSequence( + "deploy-chain-contracts", + semver.MustParse("1.6.0"), + "Deploys all CCIP contracts on a chain", + func(b operations.Bundle, chains BlockChains, input ContractDeploymentConfigPerChainWithAddress) (OnChainOutput, error) { + var agg sequences.OnChainOutput + + // Deploy Router + agg, err := sequences.RunAndMergeSequence(b, chains, deployRouterSeq, routerInput, agg) + if err != nil { + return agg, err + } + + // Deploy FeeQuoter + agg, err = sequences.RunAndMergeSequence(b, chains, deployFeeQuoterSeq, fqInput, agg) + if err != nil { + return agg, err + } + + // ... more contract deployments + + return agg, nil + }, +) +``` + +Key patterns: +- Use `sequences.RunAndMergeSequence` to compose sub-sequences and aggregate their outputs +- Each sequence should target a single chain for simplicity +- Return `OnChainOutput` with deployed addresses, metadata, and MCMS batch operations + +## Step 7: Register via init() + +Create `init()` functions that run automatically when your package is imported. + +**Main adapter registration** (`sequences/adapter.go`): + +```go +func init() { + v, err := semver.NewVersion("1.6.0") + if err != nil { + panic(err) + } + + // Required registrations + laneapi.GetLaneAdapterRegistry().RegisterLaneAdapter(chain_selectors.FamilyMyChain, v, &MyChainAdapter{}) + deployapi.GetRegistry().RegisterDeployer(chain_selectors.FamilyMyChain, v, &MyChainAdapter{}) + deployapi.GetTransferOwnershipRegistry().RegisterAdapter(chain_selectors.FamilyMyChain, v, &MyChainAdapter{}) + mcmsreaderapi.GetRegistry().RegisterMCMSReader(chain_selectors.FamilyMyChain, &MyChainAdapter{}) + tokensapi.GetTokenAdapterRegistry().RegisterTokenAdapter(chain_selectors.FamilyMyChain, v, &MyChainAdapter{}) +} +``` + +**Separate adapter registration** (`adapters/init.go`): + +```go +func init() { + // Curse/RMN adapter + fastcurse.GetCurseRegistry().RegisterNewCurse(fastcurse.CurseRegistryInput{ + CursingFamily: chain_selectors.FamilyMyChain, + CursingVersion: semver.MustParse("1.6.0"), + CurseAdapter: NewCurseAdapter(), + CurseSubjectAdapter: NewCurseAdapter(), + }) + + // Fee adapter + fees.GetRegistry().RegisterFeeAdapter(chain_selectors.FamilyMyChain, semver.MustParse("1.6.0"), &FeesAdapter{}) +} +``` + +## Step 8: Wire Into chainlink-deployments + +In `chainlink-deployments/domains///pipelines.go`, import your adapter package to trigger the `init()` functions: + +```go +import ( + _ "github.com/smartcontractkit/chainlink-ccip/chains/mychain/deployment/v1_6_0/sequences" + _ "github.com/smartcontractkit/chainlink-ccip/chains/mychain/deployment/v1_6_0/adapters" +) +``` + +The blank import is sufficient -- it triggers `init()` and registers all adapters into the global registries. + +## Reference Implementations + +Study these existing implementations: + +| Chain | Adapter Source | Key Patterns | +|-------|---------------|--------------| +| **EVM** | [chains/evm/deployment/v1_6_0/sequences/adapter.go](../../chains/evm/deployment/v1_6_0/sequences/adapter.go) | Stateless adapter, auto-generated operations from gethwrappers, multi-version support (v1_0_0 through v1_6_5) | +| **Solana** | [chains/solana/deployment/v1_6_0/sequences/adapter.go](../../chains/solana/deployment/v1_6_0/sequences/adapter.go) | Stateful adapter (caches timelock addresses), two-phase MCMS deployment, PDA-based address derivation | + +## Common Considerations + +### Address Encoding + +Each chain family must handle address serialization consistently: +- `AddressRefToBytes`: Convert string addresses from the DataStore to bytes +- `Get*Address` methods on `LaneAdapter`: Return addresses as bytes in your chain's native format +- Cross-chain references: When configuring a lane, the source chain receives the destination's addresses as `[]byte` + +### Two-Phase MCMS + +Some chains (like Solana) require a two-phase MCMS deployment: +1. `DeployMCMS()` -- deploy the contracts +2. `FinalizeDeployMCMS()` -- initialize the timelock and configure roles + +If your chain can do everything in one step, `FinalizeDeployMCMS()` can return a no-op sequence. + +### MCMS Batch Operations + +When a write operation cannot be executed directly by the deployer key (because the contract is owned by a timelock), the operation should produce `mcms_types.BatchOperation` entries instead. These get collected by the `OutputBuilder` and assembled into an MCMS proposal. + +### DataStore Integration + +Sequences should return all deployed contract addresses in `OnChainOutput.Addresses` so the changeset can persist them to the DataStore. Use `datastore.AddressRef` with your chain's contract types, versions, and qualifiers. + +### Contract Type Constants + +Define your chain-specific contract types in `utils/common.go`. Use the shared constants from `deployment/utils/common.go` where applicable (e.g., `RBACTimelock`, `BurnMintTokenPool`). diff --git a/deployment/docs/index.md b/deployment/docs/index.md new file mode 100644 index 0000000000..7abda1add2 --- /dev/null +++ b/deployment/docs/index.md @@ -0,0 +1,129 @@ +--- +title: "CCIP Deployment Tooling API" +sidebar_label: "Overview" +sidebar_position: 1 +--- + +# CCIP Deployment Tooling API + +The CCIP Deployment Tooling API provides a unified, strongly-typed Go-based operational layer for deploying, configuring, and managing CCIP across all chain families (EVM, Solana, Aptos, TON, Sui, etc.). + +This shared library (`chainlink-ccip/deployment`) contains all generic, chain-agnostic types, registries, and utilities. Each chain family implements its own adapter alongside its contracts, either in `chainlink-ccip/chains//deployment` or in a dedicated repository. + +## Architecture Overview + +```mermaid +flowchart LR + subgraph chainlink-deployments + dp[Durable Pipelines] + ds[DataStore] + end + + subgraph Chain Family Repo + cfmr[MCMSReader] + subgraph Sequences + subgraph v1.6.0 + clls1_6[ConfigureLaneLegAsSource] + clld1_6[ConfigureLaneLegAsDest] + cllb1_6[ConfigureLaneLegBidirectionally] + ctft1_6[ConfigureTokenForTransfers] + end + subgraph v1.7.0 + clls1_7[ConfigureChainForLanes] + ctft1_7[ConfigureTokenForTransfers] + end + subgraph v1.5.0 + ctft1_5[ConfigureTokenForTransfers] + end + end + subgraph Helpers + artb[AddressRefToBytes] + dtfp[DeriveTokenFromPool] + end + end + + subgraph chainlink-ccip/deployment + subgraph changesets + ctft[ConfigureTokensForTransfers] + cc1_6[v1_6.ConnectChains] + cc1_7[v1_7.ConnectChains] + end + subgraph interfaces + mr[MCMSReader] + ta[TokensAdapter] + ca1_6[v1_6.ChainAdapter] + ca1_7[v1_7.ChainAdapter] + end + subgraph registries + tar[TokenAdapterRegistry] + car1_6[v1_6.ChainAdapterRegistry] + car1_7[v1_7.ChainAdapterRegistry] + mrr[MCMSReaderRegistry] + end + end + + ctft --> tar + ctft --> mrr + + tar --> ta + mrr --> mr + + ta --> artb + ta --> dtfp + ta --> ctft1_5 + ta --> ctft1_6 + ta --> ctft1_7 + mr ------> cfmr + + dp ---init---> registries + dp ---run---> changesets + + cc1_6 --> mrr & car1_6 + car1_6 --> ca1_6 + ca1_6 ------> cllb1_6 + ca1_6 ------> clls1_6 + ca1_6 ------> clld1_6 +``` + +## Three-Level Hierarchy + +The API is structured in three levels of granularity: + +| Level | Description | Use When | +|-------|-------------|----------| +| **Changesets** | Environment-aware entry points that read from DataStore, invoke sequences, and produce MCMS proposals | Executing operations via Durable Pipelines or full deployment environments | +| **Sequences** | Ordered collections of operations. Accept serializable input and minimal dependencies | Completing an operational workflow without a full deployment environment | +| **Operations** | Single side-effect actions (deploy, read, write). Produce reports for stateful retries | Making a single contract call or deployment | + +## Package Layout + +| Package | Purpose | +|---------|---------| +| `deploy/` | Contract deployment, MCMS deployment, OCR3 config, ownership transfer changesets and interfaces | +| `lanes/` | Lane configuration and inter-chain connection changesets and interfaces | +| `tokens/` | Token pool configuration, expansion, manual registration, rate limits | +| `fees/` | Fee configuration and token transfer fee management | +| `fastcurse/` | RMN curse/uncurse operations | +| `utils/changesets/` | `MCMSReader` interface, `OutputBuilder`, changeset utilities | +| `utils/sequences/` | `OnChainOutput` type, sequence execution utilities | +| `utils/mcms/` | MCMS input types | +| `utils/` | Common types, version constants, contract type constants | +| `testadapters/` | Test adapter framework for cross-chain message testing | + +## Documentation + +| Document | Description | +|----------|-------------| +| [Architecture](architecture.md) | Design principles, adapter-registry pattern, dispatch flow, DataStore and MCMS integration | +| [Interfaces](interfaces.md) | Complete API reference for all adapter interfaces and their registries | +| [Types](types.md) | All input/output types, config structs, and constants | +| [Changesets](changesets.md) | Reference for all changesets (entry points) with config types and usage | +| [Implementing Adapters](implementing-adapters.md) | Step-by-step guide for adding a new chain family | +| [MCMS and Utilities](mcms-and-utilities.md) | MCMS integration, `OutputBuilder`, DataStore and sequence utilities | + +## Chain-Specific Documentation + +| Chain Family | Documentation | +|-------------|---------------| +| EVM | [EVM Deployment Docs](../../chains/evm/deployment/docs/index.md) | +| Solana | [Solana Deployment Docs](../../chains/solana/deployment/docs/index.md) | diff --git a/deployment/docs/interfaces.md b/deployment/docs/interfaces.md new file mode 100644 index 0000000000..2ded7e6c13 --- /dev/null +++ b/deployment/docs/interfaces.md @@ -0,0 +1,524 @@ +--- +title: "Adapter Interfaces Reference" +sidebar_label: "Interfaces" +sidebar_position: 3 +--- + +# Adapter Interfaces Reference + +This document provides a complete API reference for all adapter interfaces that chain-specific implementations must or can provide. Each interface is accompanied by its registry, registration pattern, and method signatures. + +For a step-by-step guide on implementing these interfaces for a new chain family, see [Implementing Adapters](implementing-adapters.md). + +## Quick Reference + +### Required Interfaces + +Every chain family **must** implement these interfaces: + +| Interface | Registry | Key Format | Source | +|-----------|----------|------------|--------| +| [Deployer](#deployer) | `DeployerRegistry` | `chainFamily-version` | [deploy/product.go](../deploy/product.go) | +| [LaneAdapter](#laneadapter) | `LaneAdapterRegistry` | `chainFamily-version` | [lanes/product.go](../lanes/product.go) | +| [TokenAdapter](#tokenadapter) | `TokenAdapterRegistry` | `chainFamily-version` | [tokens/product.go](../tokens/product.go) | +| [FeeAdapter](#feeadapter) | `FeeAdapterRegistry` | `chainFamily-version` | [fees/product.go](../fees/product.go) | +| [MCMSReader](#mcmsreader) | `MCMSReaderRegistry` | `chainFamily` | [utils/changesets/output.go](../utils/changesets/output.go) | +| [TransferOwnershipAdapter](#transferownershipadapter) | `TransferOwnershipAdapterRegistry` | `chainFamily-version` | [deploy/product.go](../deploy/product.go) | +| [CurseAdapter](#curseadapter) | `CurseRegistry` | `chainFamily-version` | [fastcurse/product.go](../fastcurse/product.go) | +| [CurseSubjectAdapter](#cursesubjectadapter) | `CurseRegistry` | `chainFamily` | [fastcurse/product.go](../fastcurse/product.go) | + +### Optional Interfaces + +These interfaces are optional depending on what the chain family supports: + +| Interface | Registry | Purpose | Source | +|-----------|----------|---------|--------| +| [TokenPriceProvider](#tokenpriceprovider) | None (embedded) | Provide default fee token prices | [lanes/product.go](../lanes/product.go) | +| [PingPongAdapter](#pingpongadapter) | `PingPongAdapterRegistry` | PingPong demo contract support | [lanes/pingpong.go](../lanes/pingpong.go) | +| [ConfigImporter](#configimporter) | None | Import config from existing deployments | [deploy/product.go](../deploy/product.go) | +| [RampUpdateInRouter](#rampupdateinrouter) | `LaneMigratorRegistry` | Lane migration: update router | [deploy/lanemigrator.go](../deploy/lanemigrator.go) | +| [RouterUpdateInRamp](#routerupdateinramp) | `LaneMigratorRegistry` | Lane migration: update ramps | [deploy/lanemigrator.go](../deploy/lanemigrator.go) | +| [TestAdapter](#testadapter) | `TestAdapterRegistry` | Cross-chain message testing | [testadapters/adapters.go](../testadapters/adapters.go) | + +--- + +## Required Interfaces + +### Deployer + +Handles deployment of CCIP core contracts and MCMS governance contracts on a chain. + +**Source:** [deploy/product.go](../deploy/product.go) +**Registry:** `DeployerRegistry` via `deploy.GetRegistry()` +**Key:** `chainFamily-version` + +```go +type Deployer interface { + // DeployChainContracts deploys all CCIP contracts required for a chain + // (Router, OnRamp, OffRamp, FeeQuoter, RMNRemote, etc.) + DeployChainContracts() *Sequence[ContractDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] + + // DeployMCMS deploys Multi-Chain Multi-Sig governance contracts + // (AccessController, MCM, Timelock) + DeployMCMS() *Sequence[MCMSDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] + + // FinalizeDeployMCMS finalizes MCMS deployment (e.g., timelock initialization on Solana). + // Not all chains require this - can be a no-op sequence. + FinalizeDeployMCMS() *Sequence[MCMSDeploymentConfigPerChainWithAddress, OnChainOutput, BlockChains] + + // SetOCR3Config sets OCR3 configuration on the chain's OffRamp + SetOCR3Config() *Sequence[SetOCR3ConfigInput, OnChainOutput, BlockChains] + + // GrantAdminRoleToTimelock grants admin role from one timelock to another + GrantAdminRoleToTimelock() *Sequence[GrantAdminRoleToTimelockConfigPerChainWithSelector, OnChainOutput, BlockChains] +} +``` + +**Registration:** +```go +deploy.GetRegistry().RegisterDeployer(chain_selectors.FamilyEVM, semver.MustParse("1.6.0"), &EVMAdapter{}) +``` + +--- + +### LaneAdapter + +Handles lane configuration between chains -- configuring a chain as a message source or destination for a given lane. + +**Source:** [lanes/product.go](../lanes/product.go) +**Registry:** `LaneAdapterRegistry` via `lanes.GetLaneAdapterRegistry()` +**Key:** `chainFamily-version` + +```go +type LaneAdapter interface { + // ConfigureLaneLegAsSource configures this chain as the source for a lane. + // Sets up OnRamp destination chain config, FeeQuoter destination config, and token prices. + ConfigureLaneLegAsSource() *Sequence[UpdateLanesInput, OnChainOutput, BlockChains] + + // ConfigureLaneLegAsDest configures this chain as the destination for a lane. + // Sets up OffRamp source chain config and Router integration. + ConfigureLaneLegAsDest() *Sequence[UpdateLanesInput, OnChainOutput, BlockChains] + + // GetOnRampAddress returns the OnRamp contract address (as bytes) for the given chain. + // On Solana, this returns the Router address since Solana has a unified contract. + GetOnRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) + + // GetOffRampAddress returns the OffRamp contract address (as bytes) for the given chain. + GetOffRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) + + // GetRouterAddress returns the Router contract address (as bytes) for the given chain. + GetRouterAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) + + // GetFQAddress returns the FeeQuoter contract address (as bytes) for the given chain. + GetFQAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) +} +``` + +**Registration:** +```go +lanes.GetLaneAdapterRegistry().RegisterLaneAdapter(chain_selectors.FamilySolana, semver.MustParse("1.6.0"), &SolanaAdapter{}) +``` + +**Note:** The `Get*Address` methods are used by the `ConnectChains` changeset to programmatically populate `ChainDefinition` fields. Address bytes must be chain-family encoded (e.g., 20-byte EVM address, 32-byte Solana public key). + +--- + +### TokenAdapter + +Handles token pool configuration, deployment, and cross-chain token transfer setup. + +**Source:** [tokens/product.go](../tokens/product.go) +**Registry:** `TokenAdapterRegistry` via `tokens.GetTokenAdapterRegistry()` +**Key:** `chainFamily-version` + +Each chain-family-version combination registers separately, because configuration differs by token pool version (e.g., 1.7.0 pools require CCV config, 1.5.0 pools require remote pool addresses). + +```go +type TokenAdapter interface { + // ConfigureTokenForTransfersSequence configures a token pool for cross-chain transfers. + // Assumes the token and pool are already deployed and registered. + ConfigureTokenForTransfersSequence() *Sequence[ConfigureTokenForTransfersInput, OnChainOutput, BlockChains] + + // AddressRefToBytes converts an AddressRef to a byte slice. + // Each chain family serializes addresses differently (hex for EVM, base58 for Solana). + AddressRefToBytes(ref datastore.AddressRef) ([]byte, error) + + // DeriveTokenAddress derives the token address from a token pool reference. + // Used when the token address is stored on the pool contract. + DeriveTokenAddress(e Environment, chainSelector uint64, poolRef datastore.AddressRef) ([]byte, error) + + // DeriveTokenDecimals derives the token's decimal count from a pool reference. + DeriveTokenDecimals(e Environment, chainSelector uint64, poolRef datastore.AddressRef, token []byte) (uint8, error) + + // DeriveTokenPoolCounterpart derives the effective pool address for chains where + // the deployed address differs from the operational address (e.g., Solana PDAs). + DeriveTokenPoolCounterpart(e Environment, chainSelector uint64, tokenPool []byte, token []byte) ([]byte, error) + + // ManualRegistration registers a customer token with the token admin registry. + // Used when the customer has already deployed and no longer has mint authority. + ManualRegistration() *Sequence[ManualRegistrationSequenceInput, OnChainOutput, BlockChains] + + // SetTokenPoolRateLimits sets rate limits on a token pool. + SetTokenPoolRateLimits() *Sequence[TPRLRemotes, OnChainOutput, BlockChains] + + // DeployToken deploys a new token on the chain. + DeployToken() *Sequence[DeployTokenInput, OnChainOutput, BlockChains] + + // DeployTokenVerify validates the DeployToken input before execution. + DeployTokenVerify(e Environment, in DeployTokenInput) error + + // DeployTokenPoolForToken deploys a token pool for an existing token. + DeployTokenPoolForToken() *Sequence[DeployTokenPoolInput, OnChainOutput, BlockChains] + + // UpdateAuthorities transfers token and pool ownership to the timelock signer. + UpdateAuthorities() *Sequence[UpdateAuthoritiesInput, OnChainOutput, *Environment] +} +``` + +**Registration:** +```go +tokens.GetTokenAdapterRegistry().RegisterTokenAdapter(chain_selectors.FamilyEVM, semver.MustParse("1.6.0"), &EVMAdapter{}) +``` + +--- + +### FeeAdapter + +Handles token transfer fee configuration and retrieval. + +**Source:** [fees/product.go](../fees/product.go) +**Registry:** `FeeAdapterRegistry` via `fees.GetRegistry()` +**Key:** `chainFamily-version` + +```go +type FeeAdapter interface { + // SetTokenTransferFee returns a sequence that sets per-token transfer fees for each destination chain. + SetTokenTransferFee(e Environment) *Sequence[SetTokenTransferFeeSequenceInput, OnChainOutput, BlockChains] + + // GetOnchainTokenTransferFeeConfig reads the current on-chain fee configuration for a token on a lane. + GetOnchainTokenTransferFeeConfig(e Environment, src uint64, dst uint64, token string) (TokenTransferFeeArgs, error) + + // GetDefaultTokenTransferFeeConfig returns default fee configuration for a token on a lane. + GetDefaultTokenTransferFeeConfig(src uint64, dst uint64) TokenTransferFeeArgs +} +``` + +**Registration:** +```go +fees.GetRegistry().RegisterFeeAdapter(chain_selectors.FamilySolana, semver.MustParse("1.6.0"), &FeesAdapter{}) +``` + +--- + +### MCMSReader + +Resolves MCMS governance metadata for a chain -- timelock addresses, MCMS contract references, and chain metadata needed to build proposals. + +**Source:** [utils/changesets/output.go](../utils/changesets/output.go) +**Registry:** `MCMSReaderRegistry` via `changesets.GetRegistry()` +**Key:** `chainFamily` (version-agnostic -- one reader per chain family) + +```go +type MCMSReader interface { + // GetChainMetadata returns MCMS chain metadata (e.g., starting op count, MCM address). + GetChainMetadata(e Environment, chainSelector uint64, input mcms.Input) (mcms_types.ChainMetadata, error) + + // GetTimelockRef returns the timelock contract AddressRef for a given MCMS input. + GetTimelockRef(e Environment, chainSelector uint64, input mcms.Input) (datastore.AddressRef, error) + + // GetMCMSRef returns the MCMS contract AddressRef for a given MCMS input. + GetMCMSRef(e Environment, chainSelector uint64, input mcms.Input) (datastore.AddressRef, error) +} +``` + +**Registration:** +```go +changesets.GetRegistry().RegisterMCMSReader(chain_selectors.FamilySolana, &SolanaAdapter{}) +``` + +**Note:** Unlike other registries, this one is keyed by chain family only (no version), since MCMS metadata resolution is typically family-wide. + +--- + +### TransferOwnershipAdapter + +Handles transferring contract ownership via MCMS governance proposals. + +**Source:** [deploy/product.go](../deploy/product.go) +**Registry:** `TransferOwnershipAdapterRegistry` via `deploy.GetTransferOwnershipRegistry()` +**Key:** `chainFamily-version` + +```go +type TransferOwnershipAdapter interface { + // InitializeTimelockAddress resolves and caches the timelock address for use in ownership sequences. + InitializeTimelockAddress(e Environment, input mcms.Input) error + + // SequenceTransferOwnershipViaMCMS proposes ownership transfer of contracts through MCMS. + SequenceTransferOwnershipViaMCMS() *Sequence[TransferOwnershipPerChainInput, OnChainOutput, BlockChains] + + // SequenceAcceptOwnership accepts previously proposed ownership transfers. + SequenceAcceptOwnership() *Sequence[TransferOwnershipPerChainInput, OnChainOutput, BlockChains] + + // ShouldAcceptOwnershipWithTransferOwnership returns true if accept-ownership should be + // called automatically as part of the transfer-ownership flow (chain-specific behavior). + ShouldAcceptOwnershipWithTransferOwnership(e Environment, in TransferOwnershipPerChainInput) (bool, error) +} +``` + +**Registration:** +```go +deploy.GetTransferOwnershipRegistry().RegisterAdapter(chain_selectors.FamilyEVM, semver.MustParse("1.6.0"), &EVMAdapter{}) +``` + +--- + +### CurseAdapter + +Handles RMN (Risk Management Network) curse and uncurse operations on a chain. + +**Source:** [fastcurse/product.go](../fastcurse/product.go) +**Registry:** `CurseRegistry` via `fastcurse.GetCurseRegistry()` +**Key:** `chainFamily-version` + +```go +type CurseAdapter interface { + // Initialize sets up the adapter state for a given chain (e.g., loads RMN contract addresses). + Initialize(e Environment, selector uint64) error + + // IsSubjectCursedOnChain returns true if the given subject is cursed on the chain. + // Does NOT follow EVM RMN behavior of returning true for global curse. + // Use GlobalCurseSubject() to check global curse state. + IsSubjectCursedOnChain(e Environment, selector uint64, subject Subject) (bool, error) + + // IsChainConnectedToTargetChain returns true if the chain is connected to the target chain. + // E.g., on EVM, checks if router.isChainSupported(targetSel) returns true. + IsChainConnectedToTargetChain(e Environment, selector uint64, targetSel uint64) (bool, error) + + // IsCurseEnabledForChain returns true if the chain supports cursing + // (e.g., RMNRemote contract is deployed). + IsCurseEnabledForChain(e Environment, selector uint64) (bool, error) + + // SubjectToSelector converts a Subject to a chain selector. + SubjectToSelector(subject Subject) (uint64, error) + + // Curse returns a sequence that curses the given subjects on a chain. + Curse() *Sequence[CurseInput, OnChainOutput, BlockChains] + + // Uncurse returns a sequence that lifts curses on the given subjects. + Uncurse() *Sequence[CurseInput, OnChainOutput, BlockChains] + + // ListConnectedChains returns all chain selectors connected to this chain. + // Used to determine which chains need to curse subjects derived from a given selector. + ListConnectedChains(e Environment, selector uint64) ([]uint64, error) +} +``` + +--- + +### CurseSubjectAdapter + +Maps between chain selectors and curse subjects, and derives the correct curse adapter version for a chain. + +**Source:** [fastcurse/product.go](../fastcurse/product.go) +**Registry:** `CurseRegistry` via `fastcurse.GetCurseRegistry()` +**Key:** `chainFamily` (version-agnostic for subject mapping) + +```go +type CurseSubjectAdapter interface { + // SelectorToSubject converts a chain selector to a curse Subject. + SelectorToSubject(selector uint64) Subject + + // DeriveCurseAdapterVersion derives which version of the curse adapter to use for a chain. + // E.g., for EVM, this could check which RMN version is deployed on the chain. + DeriveCurseAdapterVersion(e Environment, selector uint64) (*semver.Version, error) +} +``` + +**Registration (both adapters together):** +```go +fastcurse.GetCurseRegistry().RegisterNewCurse(fastcurse.CurseRegistryInput{ + CursingFamily: chain_selectors.FamilyEVM, + CursingVersion: semver.MustParse("1.6.0"), + CurseAdapter: NewCurseAdapter(), + CurseSubjectAdapter: NewCurseAdapter(), +}) +``` + +--- + +## Optional Interfaces + +### TokenPriceProvider + +An optional interface that `LaneAdapter` implementations can also satisfy to provide default fee token prices. Primarily used by EVM chains. + +**Source:** [lanes/product.go](../lanes/product.go) +**Registry:** None -- checked via Go type assertion on the `LaneAdapter` instance. + +```go +type TokenPriceProvider interface { + // GetDefaultTokenPrices returns default fee token prices for a chain. + // Returns a map of contract type (e.g., "WETH", "LINK") to USD price (18 decimals). + GetDefaultTokenPrices() map[datastore.ContractType]*big.Int +} +``` + +--- + +### PingPongAdapter + +Supports the PingPong demo contract for testing lane connectivity. Chains that do not support PingPong (e.g., Solana) should not implement this. + +**Source:** [lanes/pingpong.go](../lanes/pingpong.go) +**Registry:** `PingPongAdapterRegistry` via `lanes.GetPingPongAdapterRegistry()` +**Key:** `chainFamily-version` + +```go +type PingPongAdapter interface { + // GetPingPongDemoAddress returns the PingPongDemo contract address for the given chain. + GetPingPongDemoAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) + + // ConfigurePingPong configures PingPong for a lane between source and dest. + ConfigurePingPong() *Sequence[PingPongInput, PingPongOutput, BlockChains] +} +``` + +--- + +### ConfigImporter + +Imports configuration from existing deployments to bootstrap the DataStore. + +**Source:** [deploy/product.go](../deploy/product.go) +**Registry:** None currently. + +```go +type ConfigImporter interface { + // InitializeAdapter sets up the importer for the given chain selectors. + InitializeAdapter(e Environment, selectors []uint64) error + + // ConnectedChains returns the chain selectors connected to a given chain. + ConnectedChains(e Environment, chainsel uint64) ([]uint64, error) + + // SupportedTokensPerRemoteChain returns supported tokens per remote chain. + SupportedTokensPerRemoteChain(e Environment, chainSelector uint64) (map[uint64][]common.Address, error) + + // SequenceImportConfig returns a sequence to import lane config from on-chain state. + SequenceImportConfig() *Sequence[ImportConfigPerChainInput, OnChainOutput, BlockChains] +} +``` + +--- + +### RampUpdateInRouter + +Updates router configuration for lane migration scenarios (pointing routers to new ramps). + +**Source:** [deploy/lanemigrator.go](../deploy/lanemigrator.go) +**Registry:** `LaneMigratorRegistry` via `deploy.GetLaneMigratorRegistry()` (as RouterUpdater) +**Key:** `chainFamily-version` + +```go +type RampUpdateInRouter interface { + // UpdateRouter updates the router to point to new OnRamp/OffRamp contracts for remote chains. + UpdateRouter() *Sequence[RouterUpdaterConfig, OnChainOutput, BlockChains] +} +``` + +--- + +### RouterUpdateInRamp + +Updates ramp configuration with new router addresses for lane migration scenarios. + +**Source:** [deploy/lanemigrator.go](../deploy/lanemigrator.go) +**Registry:** `LaneMigratorRegistry` via `deploy.GetLaneMigratorRegistry()` (as RampUpdater) +**Key:** `chainFamily-version` + +```go +type RouterUpdateInRamp interface { + // UpdateVersionWithRouter updates OnRamp/OffRamp contracts with a new router address. + UpdateVersionWithRouter() *Sequence[RampUpdaterConfig, OnChainOutput, BlockChains] +} +``` + +--- + +### TestAdapter + +Interface for integration testing of cross-chain message passing. Each adapter instance represents a concrete chain. + +**Source:** [testadapters/adapters.go](../testadapters/adapters.go) +**Registry:** `TestAdapterRegistry` via `testadapters.GetTestAdapterRegistry()` +**Key:** `chainFamily-version` + +```go +type TestAdapter interface { + // ChainSelector returns the selector of the chain for this adapter. + ChainSelector() uint64 + + // Family returns the chain family string (e.g., "evm", "solana"). + Family() string + + // BuildMessage builds a chain-family-specific message from generic components. + // E.g., EVM produces router.ClientEVM2AnyMessage, Solana produces ccip_router.SVM2AnyMessage. + BuildMessage(components MessageComponents) (any, error) + + // SendMessage sends a CCIP message and returns the sequence number. + SendMessage(ctx context.Context, destChainSelector uint64, msg any) (uint64, error) + + // CCIPReceiver returns the address of a CCIP receiver contract on this chain. + CCIPReceiver() []byte + + // NativeFeeToken returns the native fee token identifier for this chain. + NativeFeeToken() string + + // GetExtraArgs returns encoded extra args for sending to this chain from a given source family. + // Extra args are source-family encoded (abi.encode for EVM, borsh for Solana). + GetExtraArgs(receiver []byte, sourceFamily string, opts ...ExtraArgOpt) ([]byte, error) + + // GetInboundNonce returns the inbound nonce for a sender from a source chain. + // Returns 0 for chains without nonce concepts. + GetInboundNonce(ctx context.Context, sender []byte, srcSel uint64) (uint64, error) + + // ValidateCommit validates that a message was committed on this chain. + ValidateCommit(t *testing.T, sourceSelector uint64, startBlock *uint64, seqNumRange ccipocr3.SeqNumRange) + + // ValidateExec validates that a message was executed on this chain and returns execution states. + ValidateExec(t *testing.T, sourceSelector uint64, startBlock *uint64, seqNrs []uint64) (execStates map[uint64]int) + + // AllowRouterToWithdrawTokens approves the router to spend tokens from the deployer. + AllowRouterToWithdrawTokens(ctx context.Context, tokenAddress string, amount *big.Int) error + + // GetTokenBalance returns the token balance for a given owner address. + GetTokenBalance(ctx context.Context, tokenAddress string, ownerAddress []byte) (*big.Int, error) + + // GetTokenExpansionConfig returns default token expansion config for testing. + GetTokenExpansionConfig() TokenExpansionInputPerChain + + // GetRegistryAddress returns the address of the token admin registry contract. + GetRegistryAddress() (string, error) +} +``` + +**Note:** `TestAdapter` is instantiated via a factory function: +```go +type TestAdapterFactory = func(env *Environment, selector uint64) TestAdapter +``` + +--- + +## Registry Accessor Summary + +| Registry | Accessor | Key Format | +|----------|----------|------------| +| `DeployerRegistry` | `deploy.GetRegistry()` | `chainFamily-version` | +| `TransferOwnershipAdapterRegistry` | `deploy.GetTransferOwnershipRegistry()` | `chainFamily-version` | +| `LaneAdapterRegistry` | `lanes.GetLaneAdapterRegistry()` | `chainFamily-version` | +| `PingPongAdapterRegistry` | `lanes.GetPingPongAdapterRegistry()` | `chainFamily-version` | +| `TokenAdapterRegistry` | `tokens.GetTokenAdapterRegistry()` | `chainFamily-version` | +| `FeeAdapterRegistry` | `fees.GetRegistry()` | `chainFamily-version` | +| `MCMSReaderRegistry` | `changesets.GetRegistry()` | `chainFamily` | +| `CurseRegistry` | `fastcurse.GetCurseRegistry()` | `chainFamily-version` / `chainFamily` | +| `LaneMigratorRegistry` | `deploy.GetLaneMigratorRegistry()` | `chainFamily-version` | +| `TestAdapterRegistry` | `testadapters.GetTestAdapterRegistry()` | `chainFamily-version` | diff --git a/deployment/docs/mcms-and-utilities.md b/deployment/docs/mcms-and-utilities.md new file mode 100644 index 0000000000..1cd2cb5826 --- /dev/null +++ b/deployment/docs/mcms-and-utilities.md @@ -0,0 +1,281 @@ +--- +title: "MCMS and Utilities Reference" +sidebar_label: "MCMS & Utilities" +sidebar_position: 7 +--- + +# MCMS and Utilities Reference + +This document covers the Multi-Chain Multi-Sig (MCMS) governance integration and shared utility functions used throughout the CCIP Deployment Tooling API. + +For overall system design, see [Architecture Guide](architecture.md). For the full list of adapter interfaces including `MCMSReader`, see [Interfaces Reference](interfaces.md). + +## MCMS Overview + +MCMS (Multi-Chain Multi-Sig) is the governance layer for contract operations across chains. It allows write operations to be: + +1. **Proposed** -- bundled into a `TimelockProposal` containing batch operations across one or more chains. +2. **Approved** -- signed by the required number of multi-sig signers. +3. **Executed** -- carried out via a timelock contract after an enforced delay. + +When a changeset produces write operations that the deployer key cannot execute directly (because the contracts are owned by the timelock), those operations are collected as `BatchOperation` entries and assembled into a proposal. The `OutputBuilder` and `MCMSReader` interface handle this assembly automatically. + +## mcms.Input + +`mcms.Input` configures how an MCMS proposal is constructed. Every changeset that may produce governance operations accepts this as part of its config. + +**Source:** [utils/mcms/mcms.go](../utils/mcms/mcms.go) + +```go +type Input struct { + OverridePreviousRoot bool + ValidUntil uint32 + TimelockDelay mcms_types.Duration + TimelockAction mcms_types.TimelockAction + Qualifier string + Description string +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `OverridePreviousRoot` | `bool` | When `true`, overrides the existing root of the MCMS contract. Set this when a previous proposal was not executed and its root should be replaced. | +| `ValidUntil` | `uint32` | Unix timestamp after which the proposal can no longer be set or executed. Acts as an expiration deadline. | +| `TimelockDelay` | `mcms_types.Duration` | Minimum wait time between scheduling an operation and executing it. Enforced on-chain by the timelock contract. | +| `TimelockAction` | `mcms_types.TimelockAction` | One of `schedule`, `bypass`, or `cancel`. Controls what the timelock does with the operations: queue them for delayed execution, execute immediately (bypasser role), or cancel previously scheduled operations. | +| `Qualifier` | `string` | Qualifies which MCMS + Timelock contract addresses to use. Allows multiple MCMS deployments to coexist (e.g., `"CLLCCIP"` for CLL-managed CCIP contracts, `"RMNMCMS"` for RMN-specific governance). | +| `Description` | `string` | Human-readable description included in the proposal for review by signers. | + +Validation enforces that `TimelockAction` is one of the three allowed values. + +## MCMSReader Interface + +The `MCMSReader` interface resolves chain-specific MCMS governance metadata. Each chain family registers one reader (keyed by `chainFamily` only, not versioned). + +**Source:** [utils/changesets/output.go](../utils/changesets/output.go) +**Registry:** `MCMSReaderRegistry` via `changesets.GetRegistry()` +**Full definition:** See [Interfaces Reference -- MCMSReader](interfaces.md#mcmsreader) + +```go +type MCMSReader interface { + GetChainMetadata(e Environment, chainSelector uint64, input mcms.Input) (mcms_types.ChainMetadata, error) + GetTimelockRef(e Environment, chainSelector uint64, input mcms.Input) (datastore.AddressRef, error) + GetMCMSRef(e Environment, chainSelector uint64, input mcms.Input) (datastore.AddressRef, error) +} +``` + +Changesets use `MCMSReader` indirectly through `OutputBuilder`. When `Build()` is called, the builder iterates over the batch operations, determines each chain's family from its selector, looks up the registered reader, and calls: + +- `GetTimelockRef` -- to resolve the timelock contract address that will execute the operations. +- `GetChainMetadata` -- to fetch the starting operation count and MCM address needed by the proposal builder. + +The `MCMSReaderRegistry` is a thread-safe singleton. Readers register in `init()`: + +```go +changesets.GetRegistry().RegisterMCMSReader(chain_selectors.FamilyEVM, &EVMMCMSReader{}) +``` + +## OutputBuilder + +`OutputBuilder` is a builder pattern that assembles a `ChangesetOutput` from sequence execution results, optionally including an MCMS `TimelockProposal` when there are batch operations to govern. + +**Source:** [utils/changesets/output.go](../utils/changesets/output.go) + +### Construction + +```go +output, err := changesets.NewOutputBuilder(env, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + WithDataStore(ds). + Build(mcmsInput) +``` + +### Methods + +| Method | Signature | Description | +|--------|-----------|-------------| +| `NewOutputBuilder` | `NewOutputBuilder(e Environment, registry *MCMSReaderRegistry) *OutputBuilder` | Creates a new builder bound to an environment and MCMS reader registry. | +| `WithReports` | `WithReports(reports []operations.Report[any, any]) *OutputBuilder` | Attaches execution reports to the output. Reports contain operation-level traces for debugging and retry. | +| `WithBatchOps` | `WithBatchOps(ops []mcms_types.BatchOperation) *OutputBuilder` | Sets the MCMS batch operations. Automatically filters out any `BatchOperation` entries with zero transactions. | +| `WithDataStore` | `WithDataStore(ds datastore.MutableDataStore) *OutputBuilder` | Attaches a `MutableDataStore` containing newly deployed addresses and metadata. | +| `Build` | `Build(input mcms.Input) (ChangesetOutput, error)` | Finalizes the output. If batch operations exist, resolves timelock addresses and chain metadata via the `MCMSReaderRegistry`, then constructs and attaches a `TimelockProposal`. If no batch operations are present, returns the output without a proposal. | + +### Build Internals + +When `Build` is called with non-empty batch operations: + +1. For each unique chain selector in the batch operations, the builder resolves the chain family and retrieves the registered `MCMSReader`. +2. `getTimelockAddresses` calls `GetTimelockRef` for each chain to build a `map[ChainSelector]string` of timelock addresses. +3. `getChainMetadata` calls `GetChainMetadata` for each chain to build a `map[ChainSelector]ChainMetadata`. +4. These maps are passed to `mcms.NewTimelockProposalBuilder` along with the `mcms.Input` fields to construct the final `TimelockProposal`. + +## OnChainOutput + +`OnChainOutput` is the standard return type for sequences that deploy contracts or perform on-chain write operations. It aggregates all artifacts produced during sequence execution. + +**Source:** [utils/sequences/sequences.go](../utils/sequences/sequences.go) + +```go +type OnChainOutput struct { + Addresses []datastore.AddressRef + Metadata Metadata + BatchOps []mcms_types.BatchOperation +} + +type Metadata struct { + Contracts []datastore.ContractMetadata + Chain *datastore.ChainMetadata + Env *datastore.EnvMetadata +} +``` + +| Field | Description | +|-------|-------------| +| `Addresses` | Contract addresses deployed or managed by the sequence. Each `AddressRef` includes chain selector, address, contract type, version, and optional qualifier. | +| `Metadata.Contracts` | Per-contract metadata entries. Keyed by address + chain selector in the datastore (upsert semantics). | +| `Metadata.Chain` | Per-chain metadata. At most one per sequence; keyed by chain selector. | +| `Metadata.Env` | Per-environment metadata. At most one per environment. | +| `BatchOps` | Ordered list of `BatchOperation` entries for MCMS proposal construction. Each batch operation is executed atomically. Order is preserved during proposal assembly. | + +## Sequence Utilities + +### RunAndMergeSequence + +Composes sub-sequences by executing them and merging their `OnChainOutput` into an aggregator. This is the primary mechanism for building complex workflows from smaller, focused sequences. + +**Source:** [utils/sequences/sequences.go](../utils/sequences/sequences.go) + +```go +func RunAndMergeSequence[IN any]( + b operations.Bundle, + chains cldf_chain.BlockChains, + seq *operations.Sequence[IN, OnChainOutput, cldf_chain.BlockChains], + input IN, + agg OnChainOutput, +) (OnChainOutput, error) +``` + +Merge behavior: + +| Field | Strategy | +|-------|----------| +| `BatchOps` | Appended to the aggregator's list. | +| `Addresses` | Appended to the aggregator's list. | +| `Metadata.Contracts` | Appended to the aggregator's list. | +| `Metadata.Chain` | Set if aggregator has none; returns an error if both the aggregator and the sub-sequence provide conflicting chain metadata. | +| `Metadata.Env` | Set if aggregator has none; returns an error on conflict. | + +### WriteMetadataToDatastore + +Persists metadata from an `OnChainOutput` into a `MutableDataStore`. + +**Source:** [utils/sequences/sequences.go](../utils/sequences/sequences.go) + +```go +func WriteMetadataToDatastore(ds datastore.MutableDataStore, metadata Metadata) error +``` + +Upsert behavior: + +- **Contract metadata**: Each entry is upserted individually. Key = address + chain selector. +- **Chain metadata**: Upserted if non-nil. Key = chain selector. +- **Env metadata**: Set if non-nil. One record per environment. + +Because upsert replaces the entire record for a given key, callers must include all required fields when writing to a key that may already exist. + +## Common Utility Functions + +**Source:** [utils/common.go](../utils/common.go) + +### NewRegistererID + +Creates a composite registry key from a chain family and semver version: + +```go +func NewRegistererID(chainFamily string, version *semver.Version) string +``` + +Returns `fmt.Sprintf("%s-%s", chainFamily, version.String())`, e.g., `"evm-1.6.0"` or `"solana-1.6.0"`. + +### NewIDFromSelector + +Resolves the chain family from a numeric chain selector and creates the registry key: + +```go +func NewIDFromSelector(chainSelector uint64, version *semver.Version) string +``` + +Uses `chain_selectors.GetSelectorFamily` to determine the family, then delegates to `NewRegistererID`. Panics if the chain selector is invalid. + +### GetSelectorHex + +Returns the 4-byte on-chain family selector for a given chain selector: + +```go +func GetSelectorHex(selector uint64) []byte +``` + +Maps chain families to their on-chain identifiers (derived from `keccak256` of the family name): + +| Family | Hex Constant | Value | +|--------|-------------|-------| +| EVM | `EVMFamilySelector` | `0x2812d52c` | +| SVM (Solana) | `SVMFamilySelector` | `0x1e10bdc4` | +| Aptos | `AptosFamilySelector` | `0xac77ffec` | +| TVM (TON) | `TVMFamilySelector` | `0x647e2ba9` | +| Sui | `SuiFamilySelector` | `0xc4e05953` | + +These selectors are defined in the CCIP Solidity library (`Internal.sol`) and must match across all chain families. + +## Version Constants + +**Source:** [utils/common.go](../utils/common.go) + +Pre-parsed `semver.Version` values used for adapter registration and contract version identification: + +| Constant | Value | +|----------|-------| +| `Version_1_0_0` | `1.0.0` | +| `Version_1_5_0` | `1.5.0` | +| `Version_1_5_1` | `1.5.1` | +| `Version_1_6_0` | `1.6.0` | +| `Version_1_6_1` | `1.6.1` | + +These are created with `semver.MustParse` and are safe to use as map keys and in comparisons. + +## Contract Type Constants + +**Source:** [utils/common.go](../utils/common.go) + +Shared `cldf.ContractType` strings used across all chain families for datastore lookups and adapter registration: + +| Constant | String Value | Description | +|----------|-------------|-------------| +| `BypasserManyChainMultisig` | `"BypasserManyChainMultiSig"` | MCMS bypasser multi-sig contract | +| `CancellerManyChainMultisig` | `"CancellerManyChainMultiSig"` | MCMS canceller multi-sig contract | +| `ProposerManyChainMultisig` | `"ProposerManyChainMultiSig"` | MCMS proposer multi-sig contract | +| `RBACTimelock` | `"RBACTimelock"` | Role-based access control timelock | +| `CallProxy` | `"CallProxy"` | Call proxy contract | +| `CapabilitiesRegistry` | `"CapabilitiesRegistry"` | DON capabilities registry | +| `CCIPHome` | `"CCIPHome"` | CCIP home contract (chain config) | +| `RMNHome` | `"RMNHome"` | RMN home contract | +| `BurnMintTokenPool` | `"BurnMintTokenPool"` | Burn-and-mint token pool | +| `LockReleaseTokenPool` | `"LockReleaseTokenPool"` | Lock-and-release token pool | +| `TokenPoolLookupTable` | `"TokenPoolLookupTable"` | Token pool lookup table | +| `BurnWithFromMintTokenPool` | `"BurnWithFromMintTokenPool"` | Burn-with-from-mint token pool | +| `BurnFromMintTokenPool` | `"BurnFromMintTokenPool"` | Burn-from-mint token pool | +| `CCTPTokenPool` | `"CCTPTokenPool"` | CCTP (Circle) token pool | + +Additional qualifier constants: + +| Constant | Value | Purpose | +|----------|-------|---------| +| `CLLQualifier` | `"CLLCCIP"` | Qualifies CLL-managed CCIP contract addresses | +| `RMNTimelockQualifier` | `"RMNMCMS"` | Qualifies RMN-specific MCMS contract addresses | + +These qualifiers are passed via `mcms.Input.Qualifier` to scope timelock and multi-sig resolution to the correct deployment set. + +--- + +Cross-reference [Architecture Guide](architecture.md) for how MCMS proposal construction fits into the changeset execution flow, and [Interfaces Reference](interfaces.md) for the full `MCMSReader` interface definition and all other adapter interfaces. diff --git a/deployment/docs/types.md b/deployment/docs/types.md new file mode 100644 index 0000000000..2ca7463b84 --- /dev/null +++ b/deployment/docs/types.md @@ -0,0 +1,838 @@ +--- +title: "Types Reference" +sidebar_label: "Types" +sidebar_position: 4 +--- + +# Types Reference + +This document provides a complete reference for all input/output types used across the CCIP Deployment Tooling API. + +For the interfaces that use these types, see [Interfaces Reference](interfaces.md). For the changesets that accept these types as input, see [Changesets Reference](changesets.md). + +--- + +## Table of Contents + +- [Deployment Types](#deployment-types) +- [MCMS Deployment Types](#mcms-deployment-types) +- [Lane Types](#lane-types) +- [OCR3 Types](#ocr3-types) +- [Token Types](#token-types) +- [Fee Types](#fee-types) +- [Ownership Types](#ownership-types) +- [MCMS Input Types](#mcms-input-types) +- [Output Types](#output-types) +- [Curse Types](#curse-types) +- [Test Adapter Types](#test-adapter-types) +- [Constants](#constants) + +--- + +## Deployment Types + +**Source:** [deploy/contracts.go](../deploy/contracts.go) + +### ContractDeploymentConfig + +Top-level input for the `DeployContracts` changeset. + +```go +type ContractDeploymentConfig struct { + Chains map[uint64]ContractDeploymentConfigPerChain + MCMS mcms.Input +} +``` + +### ContractDeploymentConfigPerChain + +Per-chain configuration for deploying CCIP contracts. + +```go +type ContractDeploymentConfigPerChain struct { + Version *semver.Version + TokenPrivKey string // Private key for LINK token deployment (Solana: base58) + TokenDecimals uint8 // LINK token decimals + MaxFeeJuelsPerMsg *big.Int // FeeQuoter: max fee per message + TokenPriceStalenessThreshold uint32 // FeeQuoter: staleness threshold + LinkPremiumMultiplier uint64 // FeeQuoter: LINK premium (Wei per ETH on EVM) + NativeTokenPremiumMultiplier uint64 // FeeQuoter: native token premium (Wei per ETH on EVM) + PermissionLessExecutionThresholdSeconds uint32 // OffRamp: threshold for manual execution + GasForCallExactCheck uint16 // OffRamp: EVM only + MessageInterceptor string // OffRamp: EVM only, validates incoming messages + LegacyRMN string // RMN Remote config + ContractVersion string // Contract version string + DeployPingPongDapp bool // Deploy PingPongDemo contract +} +``` + +### ContractDeploymentConfigPerChainWithAddress + +Extends `ContractDeploymentConfigPerChain` with chain selector and existing addresses (populated by the framework). + +```go +type ContractDeploymentConfigPerChainWithAddress struct { + ContractDeploymentConfigPerChain + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef +} +``` + +--- + +## MCMS Deployment Types + +**Source:** [deploy/mcms.go](../deploy/mcms.go) + +### MCMSDeploymentConfig + +Top-level input for `DeployMCMS` and `FinalizeDeployMCMS` changesets. + +```go +type MCMSDeploymentConfig struct { + Chains map[uint64]MCMSDeploymentConfigPerChain + AdapterVersion *semver.Version + MCMS mcms.Input +} +``` + +### MCMSDeploymentConfigPerChain + +Per-chain MCMS configuration specifying multi-sig roles and timelock settings. + +```go +type MCMSDeploymentConfigPerChain struct { + Canceller mcmstypes.Config // MCM canceller role configuration + Bypasser mcmstypes.Config // MCM bypasser role configuration + Proposer mcmstypes.Config // MCM proposer role configuration + TimelockMinDelay *big.Int // Minimum delay for timelock operations + Label *string // Optional label for the MCMS instance + Qualifier *string // Optional qualifier for the MCMS instance + TimelockAdmin common.Address // Admin address for the timelock + ContractVersion string // Contract version string +} +``` + +### MCMSDeploymentConfigPerChainWithAddress + +Extends `MCMSDeploymentConfigPerChain` with chain selector and existing addresses. + +```go +type MCMSDeploymentConfigPerChainWithAddress struct { + MCMSDeploymentConfigPerChain + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef +} +``` + +### GrantAdminRoleToTimelockConfig + +Input for the `GrantAdminRoleToTimelock` changeset. + +```go +type GrantAdminRoleToTimelockConfig struct { + Chains map[uint64]GrantAdminRoleToTimelockConfigPerChain + AdapterVersion *semver.Version +} +``` + +### GrantAdminRoleToTimelockConfigPerChain + +Per-chain config specifying which timelock transfers admin rights and which receives them. + +```go +type GrantAdminRoleToTimelockConfigPerChain struct { + TimelockToTransferRef datastore.AddressRef // Timelock that transfers its admin rights + NewAdminTimelockRef datastore.AddressRef // Timelock that will be granted admin +} +``` + +--- + +## Lane Types + +**Source:** [lanes/lane_update.go](../lanes/lane_update.go) + +### ConnectChainsConfig + +Top-level input for the `ConnectChains` changeset. Configures bidirectional lanes between chains. + +```go +type ConnectChainsConfig struct { + Lanes []LaneConfig + MCMS mcms.Input +} +``` + +### LaneConfig + +Defines a single bidirectional lane between two chains. + +```go +type LaneConfig struct { + ChainA ChainDefinition + ChainB ChainDefinition + Version *semver.Version + IsDisabled bool + TestRouter bool // Use test router instead of production + ExtraConfigs ExtraConfigs +} +``` + +### ChainDefinition + +Complete definition of a chain's role in a lane. Some fields are user-provided, others are populated programmatically. + +```go +type ChainDefinition struct { + // User-provided fields + Selector uint64 // Chain selector + GasPrice *big.Int // USD price (18 decimals) per unit gas + TokenPrices map[string]*big.Int // Token USD prices (18 decimals) + FeeQuoterDestChainConfig FeeQuoterDestChainConfig // Fee config when this chain is a destination + RMNVerificationEnabled bool // RMN blessing for messages FROM this chain + AllowListEnabled bool // Allowlist for messages TO this chain + AllowList []string // Allowed sender addresses + + // Populated programmatically (do not set) + OnRamp []byte // OnRamp contract address + OffRamp []byte // OffRamp contract address + Router []byte // Router contract address + FeeQuoter []byte // FeeQuoter contract address +} +``` + +### FeeQuoterDestChainConfig + +Fee configuration applied on a source chain when the target chain is a destination. + +```go +type FeeQuoterDestChainConfig struct { + IsEnabled bool + MaxNumberOfTokensPerMsg uint16 + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 + DestGasOverhead uint32 + DestGasPerPayloadByteBase uint8 + DestGasPerPayloadByteHigh uint8 + DestGasPerPayloadByteThreshold uint16 + DestDataAvailabilityOverheadGas uint32 + DestGasPerDataAvailabilityByte uint16 + DestDataAvailabilityMultiplierBps uint16 + ChainFamilySelector uint32 + EnforceOutOfOrder bool + DefaultTokenFeeUSDCents uint16 + DefaultTokenDestGasOverhead uint32 + DefaultTxGasLimit uint32 + GasMultiplierWeiPerEth uint64 + GasPriceStalenessThreshold uint32 + NetworkFeeUSDCents uint32 +} +``` + +A default configuration is available via `DefaultFeeQuoterDestChainConfig(configEnabled bool, selector uint64)`. + +### UpdateLanesInput + +Input passed to `LaneAdapter.ConfigureLaneLegAsSource()` and `ConfigureLaneLegAsDest()` sequences. + +```go +type UpdateLanesInput struct { + Source *ChainDefinition + Dest *ChainDefinition + IsDisabled bool + TestRouter bool + ExtraConfigs ExtraConfigs +} +``` + +### ExtraConfigs + +Additional lane configuration options. + +```go +type ExtraConfigs struct { + OnRampVersion []byte +} +``` + +--- + +## OCR3 Types + +**Source:** [deploy/set_ocr3_config.go](../deploy/set_ocr3_config.go) + +### SetOCR3ConfigArgs + +Top-level input for the `SetOCR3Config` changeset. + +```go +type SetOCR3ConfigArgs struct { + HomeChainSel uint64 // Home chain selector (where CCIPHome lives) + RemoteChainSels []uint64 // Remote chains to configure + ConfigType utils.ConfigType // "active" or "candidate" + MCMS mcms.Input +} +``` + +### SetOCR3ConfigInput + +Per-chain input passed to the `Deployer.SetOCR3Config()` sequence. + +```go +type SetOCR3ConfigInput struct { + ChainSelector uint64 + Datastore datastore.DataStore + Configs map[ccipocr3.PluginType]OCR3ConfigArgs +} +``` + +### OCR3ConfigArgs + +OCR3 configuration parameters for a single plugin. + +```go +type OCR3ConfigArgs struct { + ConfigDigest [32]byte + PluginType ccipocr3.PluginType + F uint8 // Faulty nodes tolerance + IsSignatureVerificationEnabled bool + Signers [][]byte + Transmitters [][]byte +} +``` + +--- + +## Token Types + +**Source:** [tokens/product.go](../tokens/product.go), [tokens/token_expansion.go](../tokens/token_expansion.go), [tokens/configure_tokens_for_transfers.go](../tokens/configure_tokens_for_transfers.go), [tokens/manual_registration.go](../tokens/manual_registration.go), [tokens/rate_limits.go](../tokens/rate_limits.go) + +### TokenExpansionInput + +Top-level input for the `TokenExpansion` changeset. Deploys tokens, pools, and configures them for cross-chain transfers. + +```go +type TokenExpansionInput struct { + TokenExpansionInputPerChain map[uint64]TokenExpansionInputPerChain + ChainAdapterVersion *semver.Version + MCMS mcms.Input +} +``` + +### TokenExpansionInputPerChain + +Per-chain token expansion configuration. + +```go +type TokenExpansionInputPerChain struct { + TokenPoolVersion *semver.Version + DeployTokenInput *DeployTokenInput // nil = token already deployed + DeployTokenPoolInput *DeployTokenPoolInput // nil = pool already deployed + TokenTransferConfig *TokenTransferConfig // nil = skip transfer configuration + SkipOwnershipTransfer bool // Skip timelock ownership transfer +} +``` + +### DeployTokenInput + +Input for deploying a new token. + +```go +type DeployTokenInput struct { + Name string // Token name + Symbol string // Token symbol + Decimals uint8 // Token decimals + Supply *big.Int // Total supply + PreMint *big.Int // Amount to pre-mint + ExternalAdmin string // External admin address (chain-agnostic string) + CCIPAdmin string // CCIP admin address (defaults to timelock) + Senders []string // Addresses needing special processing (e.g., Solana ATAs) + Type cldf.ContractType // SPLToken, ERC20, etc. + TokenPrivKey string // Solana: base58 private key for vanity addresses + DisableFreezeAuthority bool // Solana: revoke freeze authority permanently + TokenMetadata *TokenMetadata // Solana: token metadata to upload + // Populated programmatically + ChainSelector uint64 + ExistingDataStore datastore.DataStore +} +``` + +### TokenMetadata + +Token metadata for Solana tokens (extensible to other VMs). + +```go +type TokenMetadata struct { + TokenPubkey string // Populated programmatically + MetadataJSONPath string // Path to metadata JSON (initial upload) + UpdateAuthority string // Update authority for metadata PDA + UpdateName string // Update token name after upload + UpdateSymbol string // Update token symbol after upload + UpdateURI string // Update token URI after upload +} +``` + +### DeployTokenPoolInput + +Input for deploying a token pool. + +```go +type DeployTokenPoolInput struct { + TokenRef *datastore.AddressRef // Reference to the token + TokenPoolQualifier string // Pool qualifier in DataStore + PoolType string // BurnMintTokenPool, LockReleaseTokenPool, etc. + TokenPoolVersion *semver.Version + Allowlist []string + AcceptLiquidity *bool // LockReleaseTokenPool v1.5.1 only + BurnAddress string // BurnToAddressMintTokenPool only + TokenGovernor string // BurnMintWithExternalMinterTokenPool only + // Populated programmatically + ChainSelector uint64 + ExistingDataStore datastore.DataStore +} +``` + +### TokenTransferConfig + +Configuration for enabling a token for cross-chain transfers. + +```go +type TokenTransferConfig struct { + ChainSelector uint64 // Target chain + TokenPoolRef datastore.AddressRef // Token pool reference + TokenRef datastore.AddressRef // Token reference + ExternalAdmin string // External admin (leave empty for internal) + RegistryRef datastore.AddressRef // Token admin registry reference + RemoteChains map[uint64]RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef] +} +``` + +### ConfigureTokensForTransfersConfig + +Top-level input for the `ConfigureTokensForTransfers` changeset. + +```go +type ConfigureTokensForTransfersConfig struct { + ChainAdapterVersion *semver.Version + Tokens []TokenTransferConfig + MCMS mcms.Input +} +``` + +### ConfigureTokenForTransfersInput + +Per-chain input passed to the `TokenAdapter.ConfigureTokenForTransfersSequence()`. + +```go +type ConfigureTokenForTransfersInput struct { + ChainSelector uint64 + TokenPoolAddress string + RemoteChains map[uint64]RemoteChainConfig[[]byte, string] + ExternalAdmin string + RegistryAddress string + // Populated programmatically + ExistingDataStore datastore.DataStore + PoolType string + TokenRef datastore.AddressRef +} +``` + +### RemoteChainConfig + +Generic configuration for a remote chain on a token pool. Parameterized by address type (`R`) and cross-chain verifier type (`CCV`). + +```go +type RemoteChainConfig[R any, CCV any] struct { + RemoteToken R // Token on remote chain + RemotePool R // Token pool on remote chain + RemoteDecimals uint8 // Token decimals on remote chain + InboundRateLimiterConfig RateLimiterConfigFloatInput // Derived from counterpart outbound + OutboundRateLimiterConfig RateLimiterConfigFloatInput // User-specified + OutboundCCVs []CCV // Outbound cross-chain verifiers + InboundCCVs []CCV // Inbound cross-chain verifiers +} +``` + +### RateLimiterConfig + +On-chain rate limiter configuration (uses `*big.Int` for precision). + +```go +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int // Maximum tokens in bucket + Rate *big.Int // Refill rate (tokens per second) +} +``` + +### RateLimiterConfigFloatInput + +User-friendly rate limiter input (float values scaled by token decimals internally). + +```go +type RateLimiterConfigFloatInput struct { + IsEnabled bool + Capacity float64 + Rate float64 +} +``` + +### ManualRegistrationInput + +Top-level input for the `ManualRegistration` changeset. + +```go +type ManualRegistrationInput struct { + ChainAdapterVersion *semver.Version + Registrations []RegisterTokenConfig + MCMS mcms.Input +} +``` + +### RegisterTokenConfig + +Per-registration configuration for manual token registration. + +```go +type RegisterTokenConfig struct { + TokenPoolRef datastore.AddressRef // Token pool reference (always required on SVM) + TokenRef datastore.AddressRef // Token reference (always required on SVM) + ChainSelector uint64 // Chain selector (required) + ProposedOwner string // Proposed owner address (required) + SVMExtraArgs *SVMExtraArgs // SVM-specific extra args (optional) +} +``` + +### SVMExtraArgs + +Solana-specific arguments for manual registration. + +```go +type SVMExtraArgs struct { + CustomerMintAuthorities []solana.PublicKey + SkipTokenPoolInit bool +} +``` + +### TPRLInput + +Top-level input for the `SetTokenPoolRateLimits` changeset. + +```go +type TPRLInput struct { + Configs map[uint64]TPRLConfig + MCMS mcms.Input +} +``` + +### TPRLConfig + +Per-chain rate limit configuration. + +```go +type TPRLConfig struct { + ChainAdapterVersion *semver.Version + TokenRef datastore.AddressRef + TokenPoolRef datastore.AddressRef + RemoteOutbounds map[uint64]RateLimiterConfigFloatInput // Remote chain -> outbound limits +} +``` + +### TPRLRemotes + +Per-remote-chain input passed to the `TokenAdapter.SetTokenPoolRateLimits()` sequence. + +```go +type TPRLRemotes struct { + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + ChainSelector uint64 + RemoteChainSelector uint64 + TokenRef datastore.AddressRef + TokenPoolRef datastore.AddressRef + ExistingDataStore datastore.DataStore +} +``` + +### UpdateAuthoritiesInput + +Input for transferring token and pool ownership to the timelock. + +```go +type UpdateAuthoritiesInput struct { + ChainSelector uint64 + TokenRef datastore.AddressRef + TokenPoolRef datastore.AddressRef +} +``` + +--- + +## Fee Types + +**Source:** [fees/models.go](../fees/models.go), [fees/product.go](../fees/product.go) + +### SetTokenTransferFeeSequenceInput + +Input passed to the `FeeAdapter.SetTokenTransferFee()` sequence. + +```go +type SetTokenTransferFeeSequenceInput struct { + // Settings maps destination chain selector -> token address -> fee args + Settings map[uint64]map[string]*TokenTransferFeeArgs + Selector uint64 +} +``` + +### TokenTransferFeeArgs + +Standardized token transfer fee configuration for all chain families. + +```go +type TokenTransferFeeArgs struct { + DestBytesOverhead uint32 // Additional bytes overhead on destination + DestGasOverhead uint32 // Additional gas overhead on destination + MinFeeUSDCents uint32 // Minimum fee in USD cents + MaxFeeUSDCents uint32 // Maximum fee in USD cents + DeciBps uint16 // Fee in deci-basis points (1/10th of a basis point) + IsEnabled bool // Whether fee is enabled +} +``` + +### UnresolvedTokenTransferFeeArgs + +Allows partial specification of fee configuration. Unset fields are auto-filled from on-chain data or defaults. + +```go +type UnresolvedTokenTransferFeeArgs struct { + DestBytesOverhead TokenTransferFeeValue[uint32] + DestGasOverhead TokenTransferFeeValue[uint32] + MinFeeUSDCents TokenTransferFeeValue[uint32] + MaxFeeUSDCents TokenTransferFeeValue[uint32] + DeciBps TokenTransferFeeValue[uint16] + IsEnabled TokenTransferFeeValue[bool] +} +``` + +### TokenTransferFeeValue + +A wrapper that indicates whether a value was explicitly set or should use a fallback. + +```go +type TokenTransferFeeValue[T any] struct { + Valid bool // If false, Value is auto-filled from on-chain data or defaults + Value T // Only used when Valid is true +} +``` + +--- + +## Ownership Types + +**Source:** [deploy/transfer_ownership.go](../deploy/transfer_ownership.go) + +### TransferOwnershipInput + +Top-level input for `TransferOwnership` and `AcceptOwnership` changesets. + +```go +type TransferOwnershipInput struct { + ChainInputs []TransferOwnershipPerChainInput + AdapterVersion *semver.Version + MCMS mcms.Input +} +``` + +### TransferOwnershipPerChainInput + +Per-chain ownership transfer configuration. + +```go +type TransferOwnershipPerChainInput struct { + ChainSelector uint64 + ContractRef []datastore.AddressRef // Contracts to transfer ownership of + CurrentOwner string + ProposedOwner string +} +``` + +--- + +## MCMS Input Types + +**Source:** [utils/mcms/mcms.go](../utils/mcms/mcms.go) + +### mcms.Input + +Configuration for MCMS proposal construction. Included in most changeset inputs. + +```go +type Input struct { + OverridePreviousRoot bool // Override existing MCMS root + ValidUntil uint32 // Unix timestamp for proposal expiry + TimelockDelay mcms_types.Duration // Delay before operations can execute + TimelockAction mcms_types.TimelockAction // schedule, bypass, or cancel + Qualifier string // Qualifier for MCMS + Timelock addresses + Description string // Human-readable proposal description +} +``` + +**TimelockAction values:** +- `mcms_types.TimelockActionSchedule` -- schedule operations through the timelock +- `mcms_types.TimelockActionBypass` -- bypass the timelock (immediate execution) +- `mcms_types.TimelockActionCancel` -- cancel pending operations + +--- + +## Output Types + +**Source:** [utils/sequences/sequences.go](../utils/sequences/sequences.go) + +### OnChainOutput + +Standard output type returned by all sequences. + +```go +type OnChainOutput struct { + Addresses []datastore.AddressRef // Deployed contract addresses + Metadata Metadata // Execution metadata + BatchOps []mcms_types.BatchOperation // MCMS batch operations +} +``` + +### Metadata + +Metadata about sequence execution, persisted to the DataStore. + +```go +type Metadata struct { + Contracts []datastore.ContractMetadata // Contract-level metadata + Chain *datastore.ChainMetadata // Chain-level metadata + Env *datastore.EnvMetadata // Environment-level metadata +} +``` + +--- + +## Curse Types + +**Source:** [fastcurse/product.go](../fastcurse/product.go) + +See [Interfaces Reference](interfaces.md#curseadapter) for `CurseInput`, `Subject`, and related types used by `CurseAdapter` and `CurseSubjectAdapter`. + +--- + +## Test Adapter Types + +**Source:** [testadapters/adapters.go](../testadapters/adapters.go) + +### MessageComponents + +Generic CCIP message components, independent of chain family. + +```go +type MessageComponents struct { + DestChainSelector uint64 // Destination chain selector + Receiver []byte // Dest-chain-encoded receiver address + Data []byte // Message payload + FeeToken string // Fee token identifier (source-chain encoded) + ExtraArgs []byte // Message extra args (chain-family encoded) + TokenAmounts []TokenAmount +} +``` + +### TokenAmount + +Token and amount for cross-chain transfers. + +```go +type TokenAmount struct { + Token string // Source-chain-encoded token address + Amount *big.Int +} +``` + +### ExtraArgOpt + +Chain-agnostic representation of a message extra arg. + +```go +type ExtraArgOpt struct { + Name string + Value any +} +``` + +Constructors: `NewOutOfOrderExtraArg(bool)`, `NewGasLimitExtraArg(*big.Int)`. + +--- + +## Constants + +**Source:** [utils/common.go](../utils/common.go) + +### Contract Type Constants + +```go +const ( + BypasserManyChainMultisig = "BypasserManyChainMultiSig" + CancellerManyChainMultisig = "CancellerManyChainMultiSig" + ProposerManyChainMultisig = "ProposerManyChainMultiSig" + RBACTimelock = "RBACTimelock" + CallProxy = "CallProxy" + CapabilitiesRegistry = "CapabilitiesRegistry" + CCIPHome = "CCIPHome" + RMNHome = "RMNHome" + BurnMintTokenPool = "BurnMintTokenPool" + LockReleaseTokenPool = "LockReleaseTokenPool" + TokenPoolLookupTable = "TokenPoolLookupTable" + BurnWithFromMintTokenPool = "BurnWithFromMintTokenPool" + BurnFromMintTokenPool = "BurnFromMintTokenPool" + CCTPTokenPool = "CCTPTokenPool" +) +``` + +### Version Constants + +```go +var ( + Version_1_0_0 = semver.MustParse("1.0.0") + Version_1_5_0 = semver.MustParse("1.5.0") + Version_1_5_1 = semver.MustParse("1.5.1") + Version_1_6_0 = semver.MustParse("1.6.0") + Version_1_6_1 = semver.MustParse("1.6.1") +) +``` + +### Chain Family Selectors + +On-chain identifiers for each chain family, derived from `keccak256`: + +| Family | Selector | Constant | +|--------|----------|----------| +| EVM | `0x2812d52c` | `EVMFamilySelector` | +| SVM (Solana) | `0x1e10bdc4` | `SVMFamilySelector` | +| Aptos | `0xac77ffec` | `AptosFamilySelector` | +| TVM (TON) | `0x647e2ba9` | `TVMFamilySelector` | +| Sui | `0xc4e05953` | `SuiFamilySelector` | + +### Qualifier Constants + +```go +const ( + CLLQualifier = "CLLCCIP" // Standard CLL qualifier + RMNTimelockQualifier = "RMNMCMS" // RMN timelock qualifier +) +``` + +### Execution State Constants + +```go +const ( + EXECUTION_STATE_UNTOUCHED = 0 + EXECUTION_STATE_INPROGRESS = 1 + EXECUTION_STATE_SUCCESS = 2 + EXECUTION_STATE_FAILURE = 3 +) +``` From 36b2c9b84662236a46dfbd8b1877e1beea541c47 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:45:05 -0800 Subject: [PATCH 15/41] deploy 1.6.3 fq as part of 1.6 deployment (#1776) * 163 deploy * tests --- .../v1_6_0/sequences/deploy_chain_contracts.go | 17 +++++++++-------- integration-tests/deployment/helpers.go | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go index d0b9ec93e3..203c0a737c 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go @@ -30,6 +30,7 @@ import ( offrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/rmn_remote" + fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" deployopsTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -186,11 +187,11 @@ var DeployChainContracts = cldf_ops.NewSequence( addresses = append(addresses, nonceManagerRef) // Deploy FeeQuoter - feeQuoterRef, err := contract.MaybeDeployContract(b, fqops.Deploy, chain, contract.DeployInput[fqops.ConstructorArgs]{ - TypeAndVersion: deployment.NewTypeAndVersion(fqops.ContractType, *fqops.Version), + feeQuoterRef, err := contract.MaybeDeployContract(b, fq163ops.Deploy, chain, contract.DeployInput[fq163ops.ConstructorArgs]{ + TypeAndVersion: deployment.NewTypeAndVersion(fq163ops.ContractType, *fq163ops.Version), ChainSelector: chain.Selector, - Args: fqops.ConstructorArgs{ - StaticConfig: fqops.StaticConfig{ + Args: fq163ops.ConstructorArgs{ + StaticConfig: fq163ops.StaticConfig{ MaxFeeJuelsPerMsg: input.MaxFeeJuelsPerMsg, LinkToken: common.HexToAddress(linkRef.Address), TokenPriceStalenessThreshold: input.TokenPriceStalenessThreshold, @@ -203,9 +204,9 @@ var DeployChainContracts = cldf_ops.NewSequence( common.HexToAddress(linkRef.Address), common.HexToAddress(wethRef.Address), }, - TokenPriceFeeds: []fqops.TokenPriceFeedUpdate{}, - TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{}, - PremiumMultiplierWeiPerEthArgs: []fqops.PremiumMultiplierWeiPerEthArgs{ + TokenPriceFeeds: []fq163ops.TokenPriceFeedUpdate{}, + TokenTransferFeeConfigArgs: []fq163ops.TokenTransferFeeConfigArgs{}, + PremiumMultiplierWeiPerEthArgs: []fq163ops.PremiumMultiplierWeiPerEthArgs{ { PremiumMultiplierWeiPerEth: input.LinkPremiumMultiplier, Token: common.HexToAddress(linkRef.Address), @@ -215,7 +216,7 @@ var DeployChainContracts = cldf_ops.NewSequence( Token: common.HexToAddress(wethRef.Address), }, }, - DestChainConfigArgs: []fqops.DestChainConfigArgs{}, + DestChainConfigArgs: []fq163ops.DestChainConfigArgs{}, }, }, input.ExistingAddresses) if err != nil { diff --git a/integration-tests/deployment/helpers.go b/integration-tests/deployment/helpers.go index b4cb009ebc..ee60de95e6 100644 --- a/integration-tests/deployment/helpers.go +++ b/integration-tests/deployment/helpers.go @@ -15,9 +15,9 @@ import ( "github.com/stretchr/testify/require" evmrouterops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" - evmfqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" evmofframpops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" evmonrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" + fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/utils" fqops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/fee_quoter" offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" @@ -317,8 +317,8 @@ func EVMTransferOwnership(t *testing.T, e *cldf_deployment.Environment, selector ChainSelector: chain.Selector, ContractRef: []datastore.AddressRef{ { - Type: datastore.ContractType(evmfqops.ContractType), - Version: evmfqops.Version, + Type: datastore.ContractType(fq163ops.ContractType), + Version: fq163ops.Version, }, }, ProposedOwner: timelockAddrs[chain.Selector], From b1a0d27745bc5ee6ecb95ac4188affaf80694b39 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:11:48 -0800 Subject: [PATCH 16/41] Reapply "Implement disable lane (#1741)" (#1752) (#1764) This reverts commit f21cb2f233b4bf9d57e8d120b2673972158ce8f1. --- .gitignore | 1 + .../v1_6_0/sequences/disable_remote_chain.go | 51 ++++++ .../operations/fee_quoter/fee_quoter.go | 46 +++++ .../v1_6_0/operations/offramp/offramp.go | 46 +++++ .../v1_6_0/sequences/disable_remote_chain.go | 63 +++++++ deployment/lanes/disable_lane.go | 130 ++++++++++++++ deployment/lanes/product.go | 1 + .../deployment/connect_chains_test.go | 160 ++++++++++++++++++ 8 files changed, 498 insertions(+) create mode 100644 chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go create mode 100644 chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go create mode 100644 deployment/lanes/disable_lane.go diff --git a/.gitignore b/.gitignore index 728c19367d..07bd29f106 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ gcr_creds.env devenv/tests/e2e/blockscout devenv/env-out.toml .cursorrules +.claude diff --git a/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go new file mode 100644 index 0000000000..77e99804de --- /dev/null +++ b/chains/evm/deployment/v1_6_0/sequences/disable_remote_chain.go @@ -0,0 +1,51 @@ +package sequences + +import ( + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + + "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" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +var DisableRemoteChainSequence = operations.NewSequence( + "DisableRemoteChain", + semver.MustParse("1.6.0"), + "Disables both sending to and receiving from a remote chain on an EVM chain via router updates", + func(b operations.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { + var result sequences.OnChainOutput + b.Logger.Infof("EVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + result, err := sequences.RunAndMergeSequence(b, chains, RouterApplyRampUpdatesSequence, RouterApplyRampUpdatesSequenceInput{ + Address: common.BytesToAddress(input.Router), + ChainSelector: input.LocalChainSelector, + UpdatesByChain: router.ApplyRampsUpdatesArgs{ + OnRampUpdates: []router.OnRamp{ + { + DestChainSelector: input.RemoteChainSelector, + OnRamp: common.HexToAddress("0x0"), + }, + }, + OffRampRemoves: []router.OffRamp{ + { + SourceChainSelector: input.RemoteChainSelector, + OffRamp: common.BytesToAddress(input.OffRamp), + }, + }, + }, + }, result) + if err != nil { + return result, err + } + b.Logger.Infof("Remote chain %d disabled on EVM chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + return result, nil + }, +) + +func (a *EVMAdapter) DisableRemoteChain() *operations.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { + return DisableRemoteChainSequence +} diff --git a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go index 801c235a16..5c309f865c 100644 --- a/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go +++ b/chains/solana/deployment/v1_6_0/operations/fee_quoter/fee_quoter.go @@ -185,6 +185,52 @@ var ConnectChains = operations.NewOperation( }, ) +type DisableDestChainParams struct { + FeeQuoter solana.PublicKey + RemoteChainSelector uint64 +} + +var DisableDestChain = operations.NewOperation( + "fee-quoter:disable-dest-chain", + Version, + "Disables a destination chain on the FeeQuoter, preventing sending to that chain", + func(b operations.Bundle, chain cldf_solana.Chain, input DisableDestChainParams) (sequences.OnChainOutput, error) { + fee_quoter.SetProgramID(input.FeeQuoter) + authority := GetAuthority(chain, input.FeeQuoter) + feeQuoterConfigPDA, _, _ := state.FindFqConfigPDA(input.FeeQuoter) + fqDestChainPDA, _, _ := state.FindFqDestChainPDA(input.RemoteChainSelector, input.FeeQuoter) + + instruction, err := fee_quoter.NewDisableDestChainInstruction( + input.RemoteChainSelector, + feeQuoterConfigPDA, + fqDestChainPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable dest chain instruction: %w", err) + } + + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{instruction}, + input.FeeQuoter.String(), + ContractType.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable dest chain: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{instruction}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable dest chain: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + var TransferOwnership = operations.NewOperation( "fee-quoter:transfer-ownership", Version, diff --git a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go index 26bf4138c5..42942422f0 100644 --- a/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go +++ b/chains/solana/deployment/v1_6_0/operations/offramp/offramp.go @@ -242,6 +242,52 @@ var ConnectChains = operations.NewOperation( }, ) +type DisableSourceChainParams struct { + OffRamp solana.PublicKey + RemoteChainSelector uint64 +} + +var DisableSourceChain = operations.NewOperation( + "off-ramp:disable-source-chain", + Version, + "Disables a source chain on the OffRamp, preventing receiving from that chain", + func(b operations.Bundle, chain cldf_solana.Chain, input DisableSourceChainParams) (sequences.OnChainOutput, error) { + ccip_offramp.SetProgramID(input.OffRamp) + authority := GetAuthority(chain, input.OffRamp) + offRampConfigPDA, _, _ := state.FindOfframpConfigPDA(input.OffRamp) + offRampSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(input.RemoteChainSelector, input.OffRamp) + + instruction, err := ccip_offramp.NewDisableSourceChainSelectorInstruction( + input.RemoteChainSelector, + offRampSourceChainPDA, + offRampConfigPDA, + authority, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build disable source chain instruction: %w", err) + } + + if authority != chain.DeployerKey.PublicKey() { + batches, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{instruction}, + input.OffRamp.String(), + ContractType.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create MCMS batch for disable source chain: %w", err) + } + return sequences.OnChainOutput{BatchOps: []types.BatchOperation{batches}}, nil + } + + err = chain.Confirm([]solana.Instruction{instruction}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm disable source chain: %w", err) + } + return sequences.OnChainOutput{}, nil + }, +) + var SetOcr3 = operations.NewOperation( "off-ramp:set-ocr3", Version, diff --git a/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go b/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go new file mode 100644 index 0000000000..87ab822010 --- /dev/null +++ b/chains/solana/deployment/v1_6_0/sequences/disable_remote_chain.go @@ -0,0 +1,63 @@ +package sequences + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/gagliardetto/solana-go" + + fqops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/fee_quoter" + offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" + "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +var DisableRemoteChainSequence = cldf_ops.NewSequence( + "DisableRemoteChain", + semver.MustParse("1.6.0"), + "Disables both sending to and receiving from a remote chain on a Solana chain", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input lanes.DisableRemoteChainInput) (sequences.OnChainOutput, error) { + var result sequences.OnChainOutput + b.Logger.Infof("SVM Disabling remote chain %d on chain %d", input.RemoteChainSelector, input.LocalChainSelector) + + feeQuoterAddress := solana.PublicKeyFromBytes(input.FeeQuoter) + offRampAddress := solana.PublicKeyFromBytes(input.OffRamp) + + fqOut, err := cldf_ops.ExecuteOperation( + b, + fqops.DisableDestChain, + chains.SolanaChains()[input.LocalChainSelector], + fqops.DisableDestChainParams{ + FeeQuoter: feeQuoterAddress, + RemoteChainSelector: input.RemoteChainSelector, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to disable dest chain on FeeQuoter: %w", err) + } + result.BatchOps = append(result.BatchOps, fqOut.Output.BatchOps...) + + offrampOut, err := cldf_ops.ExecuteOperation( + b, + offrampops.DisableSourceChain, + chains.SolanaChains()[input.LocalChainSelector], + offrampops.DisableSourceChainParams{ + OffRamp: offRampAddress, + RemoteChainSelector: input.RemoteChainSelector, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to disable source chain on OffRamp: %w", err) + } + result.BatchOps = append(result.BatchOps, offrampOut.Output.BatchOps...) + + b.Logger.Infof("Remote chain %d disabled on Solana chain %d", input.RemoteChainSelector, input.LocalChainSelector) + return result, nil + }, +) + +func (a *SolanaAdapter) DisableRemoteChain() *cldf_ops.Sequence[lanes.DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { + return DisableRemoteChainSequence +} diff --git a/deployment/lanes/disable_lane.go b/deployment/lanes/disable_lane.go new file mode 100644 index 0000000000..1e6ebb3029 --- /dev/null +++ b/deployment/lanes/disable_lane.go @@ -0,0 +1,130 @@ +package lanes + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" +) + +// DisableRemoteChainInput provides the local and remote chain info +// needed to disable a lane on the local chain. +type DisableRemoteChainInput struct { + LocalChainSelector uint64 + RemoteChainSelector uint64 + OnRamp []byte + OffRamp []byte + Router []byte + FeeQuoter []byte +} + +// DisableLanePair identifies two chains whose bidirectional lane should be disabled. +type DisableLanePair struct { + ChainA uint64 + ChainB uint64 + Version *semver.Version +} + +// DisableLaneConfig is the input for the DisableLane changeset. +type DisableLaneConfig struct { + Lanes []DisableLanePair + MCMS mcms.Input +} + +// DisableLane returns a changeset that disables bidirectional CCIP lanes. +func DisableLane( + laneRegistry *LaneAdapterRegistry, + mcmsRegistry *changesets.MCMSReaderRegistry, +) cldf.ChangeSetV2[DisableLaneConfig] { + return cldf.CreateChangeSet( + makeDisableApply(laneRegistry, mcmsRegistry), + makeDisableVerify(), + ) +} + +func makeDisableVerify() func(cldf.Environment, DisableLaneConfig) error { + return func(_ cldf.Environment, _ DisableLaneConfig) error { + return nil + } +} + +func makeDisableApply( + laneRegistry *LaneAdapterRegistry, + mcmsRegistry *changesets.MCMSReaderRegistry, +) func(cldf.Environment, DisableLaneConfig) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, cfg DisableLaneConfig) (cldf.ChangesetOutput, error) { + batchOps := make([]mcms_types.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + + for _, lane := range cfg.Lanes { + chainAFamily, err := chain_selectors.GetSelectorFamily(lane.ChainA) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainA, err) + } + chainBFamily, err := chain_selectors.GetSelectorFamily(lane.ChainB) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", lane.ChainB, err) + } + + chainAAdapter, exists := laneRegistry.GetLaneAdapter(chainAFamily, lane.Version) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainAFamily, lane.Version) + } + chainBAdapter, exists := laneRegistry.GetLaneAdapter(chainBFamily, lane.Version) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no LaneAdapter registered for chain family '%s' version %s", chainBFamily, lane.Version) + } + + chainADef := &ChainDefinition{Selector: lane.ChainA} + chainBDef := &ChainDefinition{Selector: lane.ChainB} + + err = populateAddresses(e.DataStore, chainADef, chainAAdapter) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainA, err) + } + err = populateAddresses(e.DataStore, chainBDef, chainBAdapter) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("error fetching addresses for chain %d: %w", lane.ChainB, err) + } + + type disablePair struct { + local *ChainDefinition + remote *ChainDefinition + adapter LaneAdapter + } + for _, pair := range []disablePair{ + {local: chainADef, remote: chainBDef, adapter: chainAAdapter}, + {local: chainBDef, remote: chainADef, adapter: chainBAdapter}, + } { + report, err := cldf_ops.ExecuteSequence( + e.OperationsBundle, + pair.adapter.DisableRemoteChain(), + e.BlockChains, + DisableRemoteChainInput{ + LocalChainSelector: pair.local.Selector, + RemoteChainSelector: pair.remote.Selector, + OnRamp: pair.local.OnRamp, + OffRamp: pair.local.OffRamp, + Router: pair.local.Router, + FeeQuoter: pair.local.FeeQuoter, + }, + ) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to disable remote chain %d on chain %d: %w", pair.remote.Selector, pair.local.Selector, err) + } + batchOps = append(batchOps, report.Output.BatchOps...) + reports = append(reports, report.ExecutionReports...) + } + } + + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + Build(cfg.MCMS) + } +} diff --git a/deployment/lanes/product.go b/deployment/lanes/product.go index f2a51bcde2..5508a51d0f 100644 --- a/deployment/lanes/product.go +++ b/deployment/lanes/product.go @@ -16,6 +16,7 @@ type LaneAdapter interface { // high level API ConfigureLaneLegAsSource() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] ConfigureLaneLegAsDest() *cldf_ops.Sequence[UpdateLanesInput, sequences.OnChainOutput, cldf_chain.BlockChains] + DisableRemoteChain() *cldf_ops.Sequence[DisableRemoteChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] // helpers to expose lower level functionality if needed // needed for populating values in chain specific configs diff --git a/integration-tests/deployment/connect_chains_test.go b/integration-tests/deployment/connect_chains_test.go index ccaffcc230..1829f315e0 100644 --- a/integration-tests/deployment/connect_chains_test.go +++ b/integration-tests/deployment/connect_chains_test.go @@ -163,6 +163,52 @@ func checkBidirectionalLaneConnectivity( require.Equal(t, solanaChain.GasPrice, price.Value, "price must equal expected") } +func checkLaneDisabled( + t *testing.T, + e *fdeployment.Environment, + solanaChain lanesapi.ChainDefinition, + evmChain lanesapi.ChainDefinition, + solanaAdapter lanesapi.LaneAdapter, + evmAdapter lanesapi.LaneAdapter, +) { + t.Helper() + + // EVM Router: OnRamp must be zeroed for the remote chain + routerOnDestAddr, err := evmAdapter.GetRouterAddress(e.DataStore, evmChain.Selector) + require.NoError(t, err, "must get router from evmAdapter") + routerOnDest, err := router.NewRouter(common.BytesToAddress(routerOnDestAddr), e.BlockChains.EVMChains()[evmChain.Selector].Client) + require.NoError(t, err, "must instantiate router") + + onRampOnRouter, err := routerOnDest.GetOnRamp(nil, solanaChain.Selector) + require.NoError(t, err, "must get onRamp from router") + require.Equal(t, common.Address{}, onRampOnRouter, "onRamp must be zeroed after disable") + + // EVM Router: OffRamp must be removed for the remote chain + offRampDestAddr, err := evmAdapter.GetOffRampAddress(e.DataStore, evmChain.Selector) + require.NoError(t, err, "must get offRamp from evmAdapter") + isOffRamp, err := routerOnDest.IsOffRamp(nil, solanaChain.Selector, common.Address(offRampDestAddr)) + require.NoError(t, err, "must check if router has offRamp") + require.False(t, isOffRamp, "offRamp must be removed from router after disable") + + // Solana FeeQuoter: DestChain must be disabled for the remote chain + feeQuoterOnSrcAddr, err := solanaAdapter.GetFQAddress(e.DataStore, solanaChain.Selector) + require.NoError(t, err, "must get feeQuoter from solanaAdapter") + var destChainFqAccount fee_quoter.DestChain + fqEvmDestChainPDA, _, _ := state.FindFqDestChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(feeQuoterOnSrcAddr)) + err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), fqEvmDestChainPDA, &destChainFqAccount) + require.NoError(t, err, "must get FeeQuoter dest chain account") + require.False(t, destChainFqAccount.Config.IsEnabled, "Solana FeeQuoter dest chain must be disabled") + + // Solana OffRamp: SourceChain must be disabled for the remote chain + offRampOnSrcAddr, err := solanaAdapter.GetOffRampAddress(e.DataStore, solanaChain.Selector) + require.NoError(t, err, "must get offRamp from solanaAdapter") + var offRampSourceChain ccip_offramp.SourceChain + offRampEvmSourceChainPDA, _, _ := state.FindOfframpSourceChainPDA(evmChain.Selector, solana.PublicKeyFromBytes(offRampOnSrcAddr)) + err = e.BlockChains.SolanaChains()[solanaChain.Selector].GetAccountDataBorshInto(e.GetContext(), offRampEvmSourceChainPDA, &offRampSourceChain) + require.NoError(t, err, "must get OffRamp source chain account") + require.False(t, offRampSourceChain.Config.IsEnabled, "Solana OffRamp source chain must be disabled") +} + func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { t.Parallel() programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) @@ -262,3 +308,117 @@ func TestConnectChains_EVM2SVM_NoMCMS(t *testing.T) { // should add a new entry for remote source and remote dest in solana require.Equal(t, 2, len(connectOut.DataStore.Addresses().Filter())) } + +func TestDisableLane_EVM2SVM(t *testing.T) { + t.Parallel() + programsPath, ds, err := PreloadSolanaEnvironment(t, chain_selectors.SOLANA_MAINNET.Selector) + require.NoError(t, err, "Failed to set up Solana environment") + require.NotNil(t, ds, "Datastore should be created") + + evmChains := []uint64{ + chain_selectors.ETHEREUM_MAINNET.Selector, + } + solanaChains := []uint64{ + chain_selectors.SOLANA_MAINNET.Selector, + } + allChains := append(evmChains, solanaChains...) + e, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, evmChains), + environment.WithSolanaContainer(t, solanaChains, programsPath, solanaProgramIDs), + ) + require.NoError(t, err, "Failed to create test environment") + require.NotNil(t, e, "Environment should be created") + e.DataStore = ds.Seal() + + mcmsRegistry := cs_core.GetRegistry() + dReg := deployops.GetRegistry() + version := semver.MustParse("1.6.0") + for _, chainSel := range allChains { + mint, _ := solana.NewRandomPrivateKey() + out, err := deployops.DeployContracts(dReg).Apply(*e, deployops.ContractDeploymentConfig{ + MCMS: mcms.Input{}, + Chains: map[uint64]deployops.ContractDeploymentConfigPerChain{ + chainSel: { + Version: version, + TokenPrivKey: mint.String(), + TokenDecimals: 9, + MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1e18)), + TokenPriceStalenessThreshold: uint32(24 * 60 * 60), + LinkPremiumMultiplier: 9e17, + NativeTokenPremiumMultiplier: 1e18, + PermissionLessExecutionThresholdSeconds: uint32((20 * time.Minute).Seconds()), + GasForCallExactCheck: uint16(5000), + }, + }, + }) + require.NoError(t, err, "Failed to apply DeployChainContracts changeset") + out.DataStore.Merge(e.DataStore) + e.DataStore = out.DataStore.Seal() + } + DeployMCMS(t, e, chain_selectors.SOLANA_MAINNET.Selector, []string{cciputils.CLLQualifier}) + SolanaTransferOwnership(t, e, chain_selectors.SOLANA_MAINNET.Selector) + + chain1 := lanesapi.ChainDefinition{ + Selector: chain_selectors.SOLANA_MAINNET.Selector, + GasPrice: big.NewInt(1e17), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.SOLANA_MAINNET.Selector), + } + chain2 := lanesapi.ChainDefinition{ + Selector: chain_selectors.ETHEREUM_MAINNET.Selector, + GasPrice: big.NewInt(1e9), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.ETHEREUM_MAINNET.Selector), + } + + connectOut, err := lanesapi.ConnectChains(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.ConnectChainsConfig{ + Lanes: []lanesapi.LaneConfig{ + { + Version: version, + ChainA: chain1, + ChainB: chain2, + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: false, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("1s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: cciputils.CLLQualifier, + Description: "Connect Chains", + }, + }) + require.NoError(t, err, "Failed to apply ConnectChains changeset") + testhelpers.ProcessTimelockProposals(t, *e, connectOut.MCMSTimelockProposals, false) + + laneRegistry := lanesapi.GetLaneAdapterRegistry() + srcFamily, err := chain_selectors.GetSelectorFamily(chain1.Selector) + require.NoError(t, err, "must get selector family for src") + srcAdapter, exists := laneRegistry.GetLaneAdapter(srcFamily, version) + require.True(t, exists, "must have ChainAdapter registered for src chain family") + destFamily, err := chain_selectors.GetSelectorFamily(chain2.Selector) + require.NoError(t, err, "must get selector family for dest") + destAdapter, exists := laneRegistry.GetLaneAdapter(destFamily, version) + require.True(t, exists, "must have ChainAdapter registered for dest chain family") + checkBidirectionalLaneConnectivity(t, e, chain1, chain2, srcAdapter, destAdapter, false, false) + + disableOut, err := lanesapi.DisableLane(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.DisableLaneConfig{ + Lanes: []lanesapi.DisableLanePair{ + { + ChainA: chain_selectors.SOLANA_MAINNET.Selector, + ChainB: chain_selectors.ETHEREUM_MAINNET.Selector, + Version: version, + }, + }, + MCMS: mcms.Input{ + OverridePreviousRoot: true, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("1s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: cciputils.CLLQualifier, + Description: "Disable Lane", + }, + }) + require.NoError(t, err, "Failed to apply DisableLane changeset") + testhelpers.ProcessTimelockProposals(t, *e, disableOut.MCMSTimelockProposals, false) + + checkLaneDisabled(t, e, chain1, chain2, srcAdapter, destAdapter) +} From 47af98c8ae82a18ef3b7e12695364c88215e2942 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:34:37 -0800 Subject: [PATCH 17/41] Revert "add interface (#1760)" (#1763) This reverts commit 96c2394678f9164f175cf85b0a6a4a4f9e49d525. --- .../deployment/v1_0_0/adapters/deployer.go | 5 +- .../v1_0_0/adapters/deployer_test.go | 10 +- .../sequences/deploy_chain_contracts.go | 3 +- .../deployment/v1_6_0/sequences/mcms.go | 12 +- deployment/deploy/mcms.go | 114 +++++++++++++++ deployment/deploy/product.go | 1 + deployment/deployTmp/README.md | 1 - deployment/deployTmp/mcms.go | 134 ------------------ deployment/deployTmp/product.go | 79 ----------- integration-tests/deployment/mcms_test.go | 12 +- 10 files changed, 133 insertions(+), 238 deletions(-) delete mode 100644 deployment/deployTmp/README.md delete mode 100644 deployment/deployTmp/mcms.go delete mode 100644 deployment/deployTmp/product.go diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer.go b/chains/evm/deployment/v1_0_0/adapters/deployer.go index de6f085d53..81cd75c723 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer.go @@ -10,7 +10,6 @@ import ( cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" ccipapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - ccipapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" sequtil "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -33,12 +32,12 @@ func (a *EVMDeployer) SetOCR3Config() *cldf_ops.Sequence[ccipapi.SetOCR3ConfigIn return nil } -func (a *EVMDeployer) UpdateMCMSConfig() *cldf_ops.Sequence[ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { +func (a *EVMDeployer) UpdateMCMSConfig() *cldf_ops.Sequence[ccipapi.UpdateMCMSConfigInputPerChainWithSelector, sequtil.OnChainOutput, cldf_chain.BlockChains] { return cldf_ops.NewSequence( "update-mcms-config", semver.MustParse("1.0.0"), "Updates MCMS Configs of the specified contracts with the specified configs", - func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, in ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector) (output sequtil.OnChainOutput, err error) { + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequtil.OnChainOutput, err error) { evmChain, ok := chains.EVMChains()[in.ChainSelector] if !ok { return sequtil.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go index 6759166fdc..d2f7c617e5 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - deployopsTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" deploymentutils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -143,9 +142,6 @@ func TestUpdateMCMSConfig(t *testing.T) { dReg := deployops.GetRegistry() dReg.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) - dRegTmp := deployopsTmp.GetRegistry() - dRegTmp.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) - // deploy one set of timelock and MCMS contracts on each chain deployMCMS := deployops.DeployMCMS(dReg, nil) output, err := deployMCMS.Apply(*env, deployops.MCMSDeploymentConfig{ @@ -219,10 +215,10 @@ func TestUpdateMCMSConfig(t *testing.T) { } // update the config for each MCMS contract - updateMcmsConfigMCMS := deployopsTmp.UpdateMCMSConfig(dRegTmp, nil) - output, err = updateMcmsConfigMCMS.Apply(*env, deployopsTmp.UpdateMCMSConfigInput{ + updateMcmsConfigMCMS := deployops.UpdateMCMSConfig(dReg, nil) + output, err = updateMcmsConfigMCMS.Apply(*env, deployops.UpdateMCMSConfigInput{ AdapterVersion: semver.MustParse("1.0.0"), - Chains: map[uint64]deployopsTmp.UpdateMCMSConfigInputPerChain{ + Chains: map[uint64]deployops.UpdateMCMSConfigInputPerChain{ selector1: { MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), MCMContracts: mcmsRefs[selector1], diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go index 203c0a737c..acd6ad70c1 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go @@ -32,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/rmn_remote" fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - deployopsTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" ) @@ -59,7 +58,7 @@ func (a *EVMAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.G } // Updates MCMs Config on specified MCMS contracts -func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployopsTmp.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { evmDeployer := &evm1_0_0.EVMDeployer{} return evmDeployer.UpdateMCMSConfig() } diff --git a/chains/solana/deployment/v1_6_0/sequences/mcms.go b/chains/solana/deployment/v1_6_0/sequences/mcms.go index 3872e01e68..6cf97e7a94 100644 --- a/chains/solana/deployment/v1_6_0/sequences/mcms.go +++ b/chains/solana/deployment/v1_6_0/sequences/mcms.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/timelock" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" ccipapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - ccipapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" common_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -308,7 +308,7 @@ func setupRoles(b operations.Bundle, deps mcmsops.Deps, mcmProgram solana.Public func transferAllMCMS( b operations.Bundle, chain cldf_solana.Chain, - in ccipapi.TransferOwnershipPerChainInput, + in deployops.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { var output sequences.OnChainOutput deps := mcmsops.Deps{ @@ -333,7 +333,7 @@ func transferAllMCMS( } // assume refs are in the order returned by GetAllMCMS -func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in ccipapi.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { +func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in deployops.TransferOwnershipPerChainInput, transferAccessController bool) (sequences.OnChainOutput, error) { var output sequences.OnChainOutput deps := mcmsops.Deps{ Chain: chain, @@ -355,17 +355,17 @@ func acceptAllMCMS(b operations.Bundle, chain cldf_solana.Chain, in ccipapi.Tran return output, nil } -func (a *SolanaAdapter) GrantAdminRoleToTimelock() *operations.Sequence[ccipapi.GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *SolanaAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { // Not implemented for Solana return nil } -func (a *SolanaAdapter) UpdateMCMSConfig() *operations.Sequence[ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { +func (a *SolanaAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { return operations.NewSequence( "update-mcms-config", semver.MustParse("1.0.0"), "Updates Config of specified MCMS Contracts", - func(b operations.Bundle, chains cldf_chain.BlockChains, in ccipapiTmp.UpdateMCMSConfigInputPerChainWithSelector) (output sequences.OnChainOutput, err error) { + func(b operations.Bundle, chains cldf_chain.BlockChains, in ccipapi.UpdateMCMSConfigInputPerChainWithSelector) (output sequences.OnChainOutput, err error) { chain, ok := chains.SolanaChains()[in.ChainSelector] if !ok { return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", in.ChainSelector) diff --git a/deployment/deploy/mcms.go b/deployment/deploy/mcms.go index a87c8eca73..a8606eeddd 100644 --- a/deployment/deploy/mcms.go +++ b/deployment/deploy/mcms.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math/big" + "slices" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" @@ -61,6 +62,119 @@ type GrantAdminRoleToTimelockConfig struct { AdapterVersion *semver.Version `json:"adapterVersion"` } +type UpdateMCMSConfigInputPerChainWithSelector struct { + UpdateMCMSConfigInputPerChain + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef // needed for Solana +} + +type UpdateMCMSConfigInputPerChain struct { + MCMConfig mcmstypes.Config + MCMContracts []datastore.AddressRef +} + +type UpdateMCMSConfigInput struct { + Chains map[uint64]UpdateMCMSConfigInputPerChain `json:"chains"` + AdapterVersion *semver.Version `json:"adapterVersion"` + MCMS mcms.Input `json:"mcms"` +} + +func UpdateMCMSConfig(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateMCMSConfigInput] { + return cldf.CreateChangeSet( + updateMCMSConfigApply(deployerReg, mcmsRegistry), + updateMCMSConfigVerify(deployerReg, mcmsRegistry), + ) +} + +func updateMCMSConfigVerify(_ *DeployerRegistry, _ *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) error { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) error { + if cfg.AdapterVersion == nil { + return errors.New("adapter version is required") + } + + // validate mcms input + if err := cfg.MCMS.Validate(); err != nil { + return err + } + + validTypes := []string{utils.BypasserManyChainMultisig.String(), utils.ProposerManyChainMultisig.String(), + utils.CancellerManyChainMultisig.String()} + + // validate each contract + for _, chainCfg := range cfg.Chains { + for _, contract := range chainCfg.MCMContracts { + if !slices.Contains(validTypes, contract.Type.String()) { + return errors.New("type of contract needs to be mcms") + } + if len(contract.Qualifier) == 0 { + return errors.New("mcms contract qualifier cannot be empty") + } + if len(contract.Version.String()) == 0 { + return errors.New("mcms contract version cannot be empty") + } + } + } + + return nil + } +} + +func updateMCMSConfigApply(d *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, cfg UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { + batchOps := make([]mcmstypes.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + for selector, chainCfg := range cfg.Chains { + family, err := chain_selectors.GetSelectorFamily(selector) + if err != nil { + return cldf.ChangesetOutput{}, err + } + deployer, exists := d.GetDeployer(family, cfg.AdapterVersion) + if !exists { + return cldf.ChangesetOutput{}, fmt.Errorf("no deployer registered for chain family %s and version %s", family, cfg.AdapterVersion.String()) + } + + // If partial refs are provided, resolve to full refs + mcmsContracts := []datastore.AddressRef{} + for _, contract := range chainCfg.MCMContracts { + mcmsQualifier := contract.Qualifier + mcmsRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: selector, + Type: contract.Type, + Version: contract.Version, + Qualifier: mcmsQualifier, + }, selector, datastore_utils.FullRef) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to find mcms ref with qualifier %s on chain with selector %d", mcmsQualifier, selector) + } + + mcmsContracts = append(mcmsContracts, mcmsRef) + } + + // find existing addresses for this chain from the env + existingAddrs := d.ExistingAddressesForChain(e, selector) + + // Call the set mcms config sequence + seqCfg := UpdateMCMSConfigInputPerChainWithSelector{ + UpdateMCMSConfigInputPerChain: chainCfg, + ChainSelector: selector, + ExistingAddresses: existingAddrs, + } + + report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, deployer.UpdateMCMSConfig(), e.BlockChains, seqCfg) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to Update MCMS Config on chain with selector %d: %w", selector, err) + } + batchOps = append(batchOps, report.Output.BatchOps...) + reports = append(reports, report.ExecutionReports...) + } + + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithBatchOps(batchOps). + Build(cfg.MCMS) + } +} + func GrantAdminRoleToTimelock(deployerReg *DeployerRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[GrantAdminRoleToTimelockConfig] { return cldf.CreateChangeSet( grantAdminRoleToTimelockApply(deployerReg, mcmsRegistry), diff --git a/deployment/deploy/product.go b/deployment/deploy/product.go index d42a9c84d8..64adf7f31a 100644 --- a/deployment/deploy/product.go +++ b/deployment/deploy/product.go @@ -33,6 +33,7 @@ type Deployer interface { FinalizeDeployMCMS() *cldf_ops.Sequence[MCMSDeploymentConfigPerChainWithAddress, sequences.OnChainOutput, cldf_chain.BlockChains] SetOCR3Config() *cldf_ops.Sequence[SetOCR3ConfigInput, sequences.OnChainOutput, cldf_chain.BlockChains] GrantAdminRoleToTimelock() *cldf_ops.Sequence[GrantAdminRoleToTimelockConfigPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] + UpdateMCMSConfig() *cldf_ops.Sequence[UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] } type DeployerRegistry struct { diff --git a/deployment/deployTmp/README.md b/deployment/deployTmp/README.md deleted file mode 100644 index 6167701062..0000000000 --- a/deployment/deployTmp/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a temporary extension of the deploy registry. This should be removed once TON stops importing the existing deploy registry. diff --git a/deployment/deployTmp/mcms.go b/deployment/deployTmp/mcms.go deleted file mode 100644 index e2ad5e0c3b..0000000000 --- a/deployment/deployTmp/mcms.go +++ /dev/null @@ -1,134 +0,0 @@ -package deploytmp - -import ( - "errors" - "fmt" - "slices" - - "github.com/Masterminds/semver/v3" - chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" - - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" - - mcmstypes "github.com/smartcontractkit/mcms/types" - - datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" -) - -type UpdateMCMSConfigInputPerChainWithSelector struct { - UpdateMCMSConfigInputPerChain - ChainSelector uint64 - ExistingAddresses []datastore.AddressRef // needed for Solana -} - -type UpdateMCMSConfigInputPerChain struct { - MCMConfig mcmstypes.Config - MCMContracts []datastore.AddressRef -} - -type UpdateMCMSConfigInput struct { - Chains map[uint64]UpdateMCMSConfigInputPerChain `json:"chains"` - AdapterVersion *semver.Version `json:"adapterVersion"` - MCMS mcms.Input `json:"mcms"` -} - -func UpdateMCMSConfig(deployerReg *DeployerTmpRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateMCMSConfigInput] { - return cldf.CreateChangeSet( - updateMCMSConfigApply(deployerReg, mcmsRegistry), - updateMCMSConfigVerify(deployerReg, mcmsRegistry), - ) -} - -func updateMCMSConfigVerify(_ *DeployerTmpRegistry, _ *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) error { - return func(e cldf.Environment, cfg UpdateMCMSConfigInput) error { - if cfg.AdapterVersion == nil { - return errors.New("adapter version is required") - } - - // validate mcms input - if err := cfg.MCMS.Validate(); err != nil { - return err - } - - validTypes := []string{utils.BypasserManyChainMultisig.String(), utils.ProposerManyChainMultisig.String(), - utils.CancellerManyChainMultisig.String()} - - // validate each contract - for _, chainCfg := range cfg.Chains { - for _, contract := range chainCfg.MCMContracts { - if !slices.Contains(validTypes, contract.Type.String()) { - return errors.New("type of contract needs to be mcms") - } - if len(contract.Qualifier) == 0 { - return errors.New("mcms contract qualifier cannot be empty") - } - if len(contract.Version.String()) == 0 { - return errors.New("mcms contract version cannot be empty") - } - } - } - - return nil - } -} - -func updateMCMSConfigApply(d *DeployerTmpRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { - return func(e cldf.Environment, cfg UpdateMCMSConfigInput) (cldf.ChangesetOutput, error) { - batchOps := make([]mcmstypes.BatchOperation, 0) - reports := make([]cldf_ops.Report[any, any], 0) - for selector, chainCfg := range cfg.Chains { - family, err := chain_selectors.GetSelectorFamily(selector) - if err != nil { - return cldf.ChangesetOutput{}, err - } - deployer, exists := d.GetDeployer(family, cfg.AdapterVersion) - if !exists { - return cldf.ChangesetOutput{}, fmt.Errorf("no deployer registered for chain family %s and version %s", family, cfg.AdapterVersion.String()) - } - - // If partial refs are provided, resolve to full refs - mcmsContracts := []datastore.AddressRef{} - for _, contract := range chainCfg.MCMContracts { - mcmsQualifier := contract.Qualifier - mcmsRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - ChainSelector: selector, - Type: contract.Type, - Version: contract.Version, - Qualifier: mcmsQualifier, - }, selector, datastore_utils.FullRef) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to find mcms ref with qualifier %s on chain with selector %d", mcmsQualifier, selector) - } - - mcmsContracts = append(mcmsContracts, mcmsRef) - } - - // find existing addresses for this chain from the env - existingAddrs := d.ExistingAddressesForChain(e, selector) - - // Call the set mcms config sequence - seqCfg := UpdateMCMSConfigInputPerChainWithSelector{ - UpdateMCMSConfigInputPerChain: chainCfg, - ChainSelector: selector, - ExistingAddresses: existingAddrs, - } - - report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, deployer.UpdateMCMSConfig(), e.BlockChains, seqCfg) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to Update MCMS Config on chain with selector %d: %w", selector, err) - } - batchOps = append(batchOps, report.Output.BatchOps...) - reports = append(reports, report.ExecutionReports...) - } - - return changesets.NewOutputBuilder(e, mcmsRegistry). - WithReports(reports). - WithBatchOps(batchOps). - Build(cfg.MCMS) - } -} diff --git a/deployment/deployTmp/product.go b/deployment/deployTmp/product.go deleted file mode 100644 index ff7e764935..0000000000 --- a/deployment/deployTmp/product.go +++ /dev/null @@ -1,79 +0,0 @@ -package deploytmp - -import ( - "fmt" - "sync" - - "github.com/Masterminds/semver/v3" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" - - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" -) - -var ( - MCMSVersion = semver.MustParse("1.0.0") - singletonRegistry *DeployerTmpRegistry - once sync.Once - chainAdapterOnce sync.Once -) - -type DeployerTmp interface { - UpdateMCMSConfig() *cldf_ops.Sequence[UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, cldf_chain.BlockChains] -} - -type DeployerTmpRegistry struct { - mu sync.Mutex - deployers map[string]DeployerTmp -} - -func (r *DeployerTmpRegistry) RegisterDeployer(chainFamily string, version *semver.Version, deployer DeployerTmp) { - r.mu.Lock() - defer r.mu.Unlock() - id := utils.NewRegistererID(chainFamily, version) - if _, exists := r.deployers[id]; !exists { - r.deployers[id] = deployer - } -} - -func newDeployerTmpRegistry() *DeployerTmpRegistry { - return &DeployerTmpRegistry{ - mu: sync.Mutex{}, - deployers: make(map[string]DeployerTmp), - } -} - -// GetRegistry returns the global singleton instance. -// The first call creates the registry; subsequent calls return the same pointer. -func GetRegistry() *DeployerTmpRegistry { - once.Do(func() { - singletonRegistry = newDeployerTmpRegistry() - }) - return singletonRegistry -} - -func (r *DeployerTmpRegistry) GetDeployer(chainFamily string, version *semver.Version) (DeployerTmp, bool) { - r.mu.Lock() - defer r.mu.Unlock() - id := utils.NewRegistererID(chainFamily, version) - deployer, ok := r.deployers[id] - return deployer, ok -} - -func (r *DeployerTmpRegistry) Blockchain(e cldf.Environment, chainSelector uint64) (cldf_chain.BlockChain, error) { - allChains := e.BlockChains.All() - for sel, chain := range allChains { - if sel == chainSelector { - return chain, nil - } - } - return nil, fmt.Errorf("no blockchain found in environment for selector %d", chainSelector) -} - -func (r *DeployerTmpRegistry) ExistingAddressesForChain(e cldf.Environment, chainSelector uint64) []datastore.AddressRef { - // filter addresses for the given chain selector - return e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSelector)) -} diff --git a/integration-tests/deployment/mcms_test.go b/integration-tests/deployment/mcms_test.go index f735e340fe..e06cd73dd7 100644 --- a/integration-tests/deployment/mcms_test.go +++ b/integration-tests/deployment/mcms_test.go @@ -14,8 +14,8 @@ import ( solseqV1_6_0 "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/mcm" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" mcmsapi "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" - mcmsapiTmp "github.com/smartcontractkit/chainlink-ccip/deployment/deployTmp" "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" _ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" @@ -41,9 +41,9 @@ func TestUpdateMCMSConfigSolana(t *testing.T) { require.NotNil(t, env, "Environment should be created") env.DataStore = dstr.Seal() // Add preloaded contracts to env datastore chain := env.BlockChains.SolanaChains()[chainsel.SOLANA_MAINNET.Selector] - dRegTmp := mcmsapiTmp.GetRegistry() + dReg := mcmsapi.GetRegistry() solAdapter := solseqV1_6_0.SolanaAdapter{} - dRegTmp.RegisterDeployer(chainsel.FamilySolana, mcmsapi.MCMSVersion, &solAdapter) + dReg.RegisterDeployer(chainsel.FamilySolana, deployops.MCMSVersion, &solAdapter) err = utils.FundSolanaAccounts( t.Context(), []solana.PublicKey{chain.DeployerKey.PublicKey()}, @@ -92,10 +92,10 @@ func TestUpdateMCMSConfigSolana(t *testing.T) { } // update the config for each MCMS contract - updateMcmsConfigMCMS := mcmsapiTmp.UpdateMCMSConfig(dRegTmp, nil) - output, err := updateMcmsConfigMCMS.Apply(*env, mcmsapiTmp.UpdateMCMSConfigInput{ + updateMcmsConfigMCMS := mcmsapi.UpdateMCMSConfig(dReg, nil) + output, err := updateMcmsConfigMCMS.Apply(*env, mcmsapi.UpdateMCMSConfigInput{ AdapterVersion: semver.MustParse("1.0.0"), - Chains: map[uint64]mcmsapiTmp.UpdateMCMSConfigInputPerChain{ + Chains: map[uint64]mcmsapi.UpdateMCMSConfigInputPerChain{ solanaChains[0]: { MCMConfig: testhelpers.SingleGroupMCMSTwoSigners(), MCMContracts: mcmsRefs, From beb7b2b4d423b35257e83d592dc71e9979fbf657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 4 Mar 2026 10:03:14 -0500 Subject: [PATCH 18/41] TON testadapter (#1615) * Re-enable TON, support evm->ton extraArgs * go mod tidy * chore(deps): bump ctf * chore: testing timeout * fix: skip token setup when not supported * chore: temp trick * Revert "chore: temp trick" This reverts commit 7f481cdc9777c7465cd71232029c54fadc960c46. * fix: override bytecode * Revert "fix: override bytecode" This reverts commit e66b0435471e5e319919f6fd6e10e7c7c0aad350. * fix: devenv deploy override with fq 163 * fix: register ton * chore: bump * Bump CTF * Bump chainlink-ton version to one in main * Bump chainlink-ton * Add constants for extra args for easier matching * Allow configuring extra args * Reorder * Remove extract-bytecode-abi * Correctly skip destination chains with no token pool support * Refactor tests and add a couple more test cases * Add test receiver interface * Support custom extra args * Dep bump * Split message and token transfer+message tests * fix lint * Fix t.Skip log * Use uint max rather than int max * Skip TON on this test case * go mod tidy * Add more test cases, restructure so it's callable with existing env * go mod tidy * make generate * Revert moved code block to fix failure * Bump chainlink-ton * Move smoke tests into a lib * fix: invalid receiver not supported by Solana * fix: inverted bound check * fix: invalid chain selector * fix: skip OOO Solana test temporarily * doc: issues * fix: wrong skip condition * tmp: skip gas limit test for Solana * tmp: skip extra OOO test on evm->sol * fix: revert reverted reverts * revert fq bindings to main * remove fq override --------- Co-authored-by: Jade Park Co-authored-by: Terry Tata Co-authored-by: Patricio Tourne Passarino Co-authored-by: tt-cll <141346969+tt-cll@users.noreply.github.com> --- .gitignore | 2 + chains/evm/deployment/go.mod | 4 +- .../v1_6_0/testadapter/test_adapter.go | 43 ++- .../v1_6_0/testadapter/test_adapter.go | 52 +++- deployment/testadapters/adapters.go | 11 +- devenv/cldf.go | 124 ++++---- devenv/common/home_chain.go | 48 ++- devenv/common/implcommon.go | 19 +- devenv/environment.go | 15 +- devenv/go.mod | 58 ++-- devenv/go.sum | 140 +++++---- devenv/tests/e2e/load_test.go | 8 +- devenv/tests/e2e/smoke_test.go | 160 +--------- devenv/tests/smoke.go | 286 ++++++++++++++++++ go.md | 23 +- 15 files changed, 638 insertions(+), 355 deletions(-) create mode 100644 devenv/tests/smoke.go diff --git a/.gitignore b/.gitignore index 07bd29f106..8a4b6b6131 100644 --- a/.gitignore +++ b/.gitignore @@ -62,5 +62,7 @@ credentials.env gcr_creds.env devenv/tests/e2e/blockscout devenv/env-out.toml +# devenv contract build artifacts +contracts/build .cursorrules .claude diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index 5aea04a58d..ca3aa297c6 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -25,8 +25,10 @@ require ( github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd + github.com/smartcontractkit/chainlink-ton v0.0.0-20260115170733-b16e9683d4d5 github.com/smartcontractkit/mcms v0.34.0 github.com/stretchr/testify v1.11.1 + github.com/xssnick/tonutils-go v1.14.1 github.com/zksync-sdk/zksync2-go v1.1.1-0.20250620124214-2c742ee399c6 golang.org/x/sync v0.19.0 ) @@ -220,7 +222,6 @@ require ( github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect - github.com/smartcontractkit/chainlink-ton v0.0.0-20260115170733-b16e9683d4d5 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -244,7 +245,6 @@ require ( github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect - github.com/xssnick/tonutils-go v1.14.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect diff --git a/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go b/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go index 8698c6f815..e67b5bc792 100644 --- a/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go +++ b/chains/evm/deployment/v1_6_0/testadapter/test_adapter.go @@ -16,6 +16,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" "github.com/stretchr/testify/require" + "github.com/xssnick/tonutils-go/tlb" chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" @@ -24,6 +25,8 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + ton_onramp "github.com/smartcontractkit/chainlink-ton/pkg/ccip/bindings/onramp" + bnmERC20ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/burn_mint_erc20" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/nonce_manager" @@ -222,6 +225,10 @@ func (a *EVMAdapter) CCIPReceiver() []byte { return common.LeftPadBytes(common.HexToAddress("0xdead").Bytes(), 32) } +func (a *EVMAdapter) SetReceiverRejectAll(ctx context.Context, rejectAll bool) error { + return errors.ErrUnsupported +} + func (a *EVMAdapter) NativeFeeToken() string { return "0x0" } @@ -229,13 +236,45 @@ func (a *EVMAdapter) NativeFeeToken() string { func (a *EVMAdapter) GetExtraArgs(receiver []byte, sourceFamily string, opts ...testadapters.ExtraArgOpt) ([]byte, error) { switch sourceFamily { case chain_selectors.FamilyEVM: - return ccipcommon.SerializeClientGenericExtraArgsV2(msg_hasher163.ClientGenericExtraArgsV2{ + extraArgs := msg_hasher163.ClientGenericExtraArgsV2{ GasLimit: new(big.Int).SetUint64(100_000), AllowOutOfOrderExecution: true, - }) + } + for _, opt := range opts { + switch opt.Name { + case testadapters.ExtraArgGasLimit: + extraArgs.GasLimit = opt.Value.(*big.Int) + case testadapters.ExtraArgOOO: + extraArgs.AllowOutOfOrderExecution = opt.Value.(bool) + default: + // unsupported arg + } + } + return ccipcommon.SerializeClientGenericExtraArgsV2(extraArgs) case chain_selectors.FamilySolana: // EVM allows empty extraArgs return nil, nil + case chain_selectors.FamilyTon: + // TODO: maybe for 1.6 we should look up the source adapter and use a 1.6 method to encode? would be good to avoid other chain SDKs + extraArgs := ton_onramp.GenericExtraArgsV2{ + GasLimit: big.NewInt(1000000), + AllowOutOfOrderExecution: true, + } + for _, opt := range opts { + switch opt.Name { + case testadapters.ExtraArgGasLimit: + extraArgs.GasLimit = opt.Value.(*big.Int) + case testadapters.ExtraArgOOO: + extraArgs.AllowOutOfOrderExecution = opt.Value.(bool) + default: + // unsupported arg + } + } + extraArgsCell, err := tlb.ToCell(extraArgs) + if err != nil { + return nil, err + } + return extraArgsCell.ToBOC(), nil default: // TODO: add support for other families return nil, fmt.Errorf("unsupported source family: %s", sourceFamily) diff --git a/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go b/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go index 9cdd6752f6..dae6f11b35 100644 --- a/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go +++ b/chains/solana/deployment/v1_6_0/testadapter/test_adapter.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "maps" + "math" "math/big" "slices" "strconv" @@ -27,6 +28,7 @@ import ( solutils "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/ccip_common" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/ccip_offramp" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/test_ccip_receiver" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_0/ccip_router" solccip "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/ccip" solcommon "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" @@ -333,6 +335,33 @@ func (a *SVMAdapter) CCIPReceiver() []byte { return receiver.Bytes() } +func (a *SVMAdapter) SetReceiverRejectAll(ctx context.Context, rejectAll bool) error { + receiverProgram, err := a.getAddress("TestReceiver") + if err != nil { + return err + } + receiverTargetAccountPDA, _, _ := solana.FindProgramAddress([][]byte{[]byte("counter")}, receiverProgram) + // Set reject all flag in receiver to force reverts + deployer := a.Chain.DeployerKey + ix, err := test_ccip_receiver.NewSetRejectAllInstruction(true, receiverTargetAccountPDA, deployer.PublicKey()).ValidateAndBuild() + if err != nil { + return err + } + ixData, err := ix.Data() + if err != nil { + return err + } + rejectAllIx := solana.NewInstruction(receiverProgram, ix.Accounts(), ixData) + result, err := solcommon.SendAndConfirm(ctx, a.Client, []solana.Instruction{rejectAllIx}, *deployer, solconfig.DefaultCommitment) + if err != nil { + return fmt.Errorf("failed to send and confirm transaction: %w", err) + } + if result.Meta.Err != nil { + return fmt.Errorf("failed to send and confirm transaction: %v", result.Meta.Err) + } + return nil +} + func (a *SVMAdapter) NativeFeeToken() string { return solana.SolMint.String() } @@ -349,13 +378,32 @@ func (a *SVMAdapter) GetExtraArgs(receiver []byte, sourceFamily string, opts ... switch sourceFamily { case chain_selectors.FamilyEVM: - return ccipcommon.SerializeClientSVMExtraArgsV1(msg_hasher163.ClientSVMExtraArgsV1{ + extraArgs := msg_hasher163.ClientSVMExtraArgsV1{ AccountIsWritableBitmap: solccip.GenerateBitMapForIndexes([]int{0, 1}), Accounts: accounts, TokenReceiver: receiverProgram, ComputeUnits: 100_000, AllowOutOfOrderExecution: true, - }) + } + for _, opt := range opts { + switch opt.Name { + case testadapters.ExtraArgGasLimit: + unitsBig := opt.Value.(*big.Int) + if !unitsBig.IsUint64() { + return nil, fmt.Errorf("ComputeUnits is larger than uint32: %d", unitsBig) + } + units := unitsBig.Uint64() + if units > math.MaxUint32 { + return nil, fmt.Errorf("ComputeUnits is larger than uint32: %d", units) + } + extraArgs.ComputeUnits = uint32(units) + case testadapters.ExtraArgOOO: + extraArgs.AllowOutOfOrderExecution = opt.Value.(bool) + default: + // unsupported arg + } + } + return ccipcommon.SerializeClientSVMExtraArgsV1(extraArgs) case chain_selectors.FamilySolana: panic("unimplemented GetExtraArgs(solana->solana)") default: diff --git a/deployment/testadapters/adapters.go b/deployment/testadapters/adapters.go index 0414448e68..9ea5e7b961 100644 --- a/deployment/testadapters/adapters.go +++ b/deployment/testadapters/adapters.go @@ -47,6 +47,9 @@ type MessageComponents struct { TokenAmounts []TokenAmount } +const ExtraArgGasLimit = "gasLimit|computeUnits" +const ExtraArgOOO = "outOfOrderExecutionEnabled" + // ExtraArgOpt is a generic representation of an extra arg that can be applied // to any kind of ccip message. // We use this to make it possible to specify extra args in a chain-agnostic way. @@ -57,14 +60,14 @@ type ExtraArgOpt struct { func NewOutOfOrderExtraArg(outOfOrder bool) ExtraArgOpt { return ExtraArgOpt{ - Name: "outOfOrderExecutionEnabled", + Name: ExtraArgOOO, Value: outOfOrder, } } func NewGasLimitExtraArg(gasLimit *big.Int) ExtraArgOpt { return ExtraArgOpt{ - Name: "gasLimit|computeUnits", + Name: ExtraArgGasLimit, Value: gasLimit, } } @@ -95,6 +98,10 @@ type TestAdapter interface { // // CCIPReceiver returns a CCIP receiver for the given chain family. CCIPReceiver() []byte + // SetReceiverRejectAll configures the receiver to reject all incoming messages. + // This is used for test cases with a a failing receiver. + SetReceiverRejectAll(ctx context.Context, rejectAll bool) error + // NativeFeeToken returns the native fee token for the given chain family. NativeFeeToken() string diff --git a/devenv/cldf.go b/devenv/cldf.go index 2a1f8d0098..f1815754fa 100644 --- a/devenv/cldf.go +++ b/devenv/cldf.go @@ -2,7 +2,7 @@ package ccip import ( "context" - // "encoding/hex" + "encoding/hex" "errors" "fmt" "os" @@ -19,26 +19,26 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain" - // "github.com/xssnick/tonutils-go/address" - // "github.com/xssnick/tonutils-go/tlb" - // "github.com/xssnick/tonutils-go/ton/wallet" + "github.com/xssnick/tonutils-go/address" + "github.com/xssnick/tonutils-go/tlb" + "github.com/xssnick/tonutils-go/ton/wallet" chainsel "github.com/smartcontractkit/chain-selectors" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_evm_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/provider" cldf_solana_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana/provider" - // cldf_ton_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/ton/provider" - // testutils "github.com/smartcontractkit/chainlink-ton/deployment/utils" - - // ccipTon "github.com/smartcontractkit/chainlink-ton/devenv" + cldf_ton_provider "github.com/smartcontractkit/chainlink-deployments-framework/chain/ton/provider" + testutils "github.com/smartcontractkit/chainlink-ton/deployment/utils" ccipEVM "github.com/smartcontractkit/chainlink-ccip/devenv/chainimpl/ccip-evm" ccipSolana "github.com/smartcontractkit/chainlink-ccip/devenv/chainimpl/ccip-solana" + ccipTon "github.com/smartcontractkit/chainlink-ton/devenv" // Register test adapters _ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/testadapter" _ "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/testadapter" + _ "github.com/smartcontractkit/chainlink-ton/deployment/testadapter" ) type initOptions struct { @@ -165,49 +165,48 @@ func NewCLDFOperationsEnvironment(bc []*blockchain.Input, dataStore datastore.Da } providers = append(providers, p) } else if b.Type == "ton" { - panic("TON support temporarily disabled") - // chainID := b.ChainID - // rpcHTTPURL := b.Out.Nodes[0].ExternalHTTPUrl + chainID := b.ChainID + rpcHTTPURL := b.Out.Nodes[0].ExternalHTTPUrl - // d, err := chainsel.GetChainDetailsByChainIDAndFamily(chainID, chainsel.FamilyTon) - // if err != nil { - // return nil, nil, err - // } - // client, err := testutils.CreateClient(context.Background(), rpcHTTPURL) - // if err != nil { - // return nil, nil, fmt.Errorf("failed to create TON client: %w", err) - // } + d, err := chainsel.GetChainDetailsByChainIDAndFamily(chainID, chainsel.FamilyTon) + if err != nil { + return nil, nil, err + } + client, err := testutils.CreateClient(context.Background(), rpcHTTPURL) + if err != nil { + return nil, nil, fmt.Errorf("failed to create TON client: %w", err) + } - // seed := wallet.NewSeed() - // w, err := wallet.FromSeed(client, seed, wallet.ConfigV5R1Final{NetworkGlobalID: wallet.MainnetGlobalID, Workchain: 0}) - // if err != nil { - // return nil, nil, fmt.Errorf("failed to create TON wallet: %w", err) - // } - // privateKey, err := wallet.SeedToPrivateKey(seed /*password=*/, "" /*isBIP39=*/, false) - // if err != nil { - // return nil, nil, fmt.Errorf("failed to get private key from seed: %w", err) - // } - // walletVersion := "V5R1" - // deployerSignerGen := cldf_ton_provider.PrivateKeyFromRaw(hex.EncodeToString(privateKey)) + seed := wallet.NewSeed() + w, err := wallet.FromSeed(client, seed, wallet.ConfigV5R1Final{NetworkGlobalID: wallet.MainnetGlobalID, Workchain: 0}) + if err != nil { + return nil, nil, fmt.Errorf("failed to create TON wallet: %w", err) + } + privateKey, err := wallet.SeedToPrivateKey(seed /*password=*/, "" /*isBIP39=*/, false) + if err != nil { + return nil, nil, fmt.Errorf("failed to get private key from seed: %w", err) + } + walletVersion := "V5R1" + deployerSignerGen := cldf_ton_provider.PrivateKeyFromRaw(hex.EncodeToString(privateKey)) - // selectors = append(selectors, d.ChainSelector) - // p, err := cldf_ton_provider.NewRPCChainProvider( - // d.ChainSelector, - // cldf_ton_provider.RPCChainProviderConfig{ - // HTTPURL: rpcHTTPURL, - // WalletVersion: cldf_ton_provider.WalletVersion(walletVersion), - // DeployerSignerGen: deployerSignerGen, - // }, - // ).Initialize(context.Background()) - // if err != nil { - // return nil, nil, err - // } + selectors = append(selectors, d.ChainSelector) + p, err := cldf_ton_provider.NewRPCChainProvider( + d.ChainSelector, + cldf_ton_provider.RPCChainProviderConfig{ + HTTPURL: rpcHTTPURL, + WalletVersion: cldf_ton_provider.WalletVersion(walletVersion), + DeployerSignerGen: deployerSignerGen, + }, + ).Initialize(context.Background()) + if err != nil { + return nil, nil, err + } - // err = testutils.FundWalletsNoT(client, []*address.Address{w.Address()}, []tlb.Coins{tlb.MustFromTON("1000")}) - // if err != nil { - // return nil, nil, fmt.Errorf("failed to fund TON wallet: %w", err) - // } - // providers = append(providers, p) + err = testutils.FundWalletsNoT(client, []*address.Address{w.Address()}, []tlb.Coins{tlb.MustFromTON("1000")}) + if err != nil { + return nil, nil, fmt.Errorf("failed to fund TON wallet: %w", err) + } + providers = append(providers, p) } } @@ -244,37 +243,24 @@ func NewDefaultCLDFBundle(e *deployment.Environment) operations.Bundle { ) } -func NewCCIPImplFromNetwork(typ string, chainID string) (CCIP16ProductConfiguration, error) { - // TODO: extract to method - var family string - switch typ { - case "anvil", "geth": - family = chainsel.FamilyEVM - case "solana": - family = chainsel.FamilySolana - case "ton": - family = chainsel.FamilyTon - default: - return nil, fmt.Errorf("unsupported blockchain type: %s", typ) - } +func NewCCIPImplFromNetwork(family string, chainID string) (CCIP16ProductConfiguration, error) { networkInfo, err := chainsel.GetChainDetailsByChainIDAndFamily(chainID, family) if err != nil { return nil, err } - switch typ { - case "anvil", "geth": + switch family { + case chainsel.FamilyEVM: return ccipEVM.NewEmptyCCIP16EVM(networkInfo), nil - case "solana": + case chainsel.FamilySolana: return ccipSolana.NewEmptyCCIP16Solana(networkInfo), nil - case "sui": + case chainsel.FamilySui: panic("implement Sui") - case "aptos": + case chainsel.FamilyAptos: panic("implement Aptos") - case "ton": - panic("TON temporarily disabled") - // return ccipTon.NewEmptyCCIP16TON(networkInfo), nil + case chainsel.FamilyTon: + return ccipTon.NewEmptyCCIP16TON(networkInfo), nil default: - return nil, errors.New("unknown devenv network type " + typ) + return nil, errors.New("unsupported devenv chain family " + family) } } diff --git a/devenv/common/home_chain.go b/devenv/common/home_chain.go index d5666218da..f1f1b698ad 100644 --- a/devenv/common/home_chain.go +++ b/devenv/common/home_chain.go @@ -23,8 +23,9 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-testing-framework/framework/clclient" - // tonSeqs "github.com/smartcontractkit/chainlink-ton/deployment/ccip/1_6_0/sequences" - // ccip_ton "github.com/smartcontractkit/chainlink-ton/devenv" + + tonSeqs "github.com/smartcontractkit/chainlink-ton/deployment/ccip/1_6_0/sequences" + ccip_ton "github.com/smartcontractkit/chainlink-ton/devenv" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -405,12 +406,11 @@ func applyAddDonAndSetCandidateChangesetConfig(e deployment.Environment, cfg Add return deployment.ChangesetOutput{}, err } case chain_selectors.FamilyTon: - // a := &tonSeqs.TonLaneAdapter{} - // offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) - // if err != nil { - // return deployment.ChangesetOutput{}, err - // } - panic("TON support temporarily disabled") + a := &tonSeqs.TonLaneAdapter{} + offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) + if err != nil { + return deployment.ChangesetOutput{}, err + } default: return deployment.ChangesetOutput{}, fmt.Errorf("unsupported chain family %s for selector %d", family, chainSelector) } @@ -731,17 +731,16 @@ func getOracleIdentities(clClients []*clclient.ChainlinkClient, nodeKeyBundles m onPrefix = "ocr2on_solana_" cfgPrefix = "ocr2cfg_solana_" case chain_selectors.FamilyTon: - panic("TON support temporarily disabled") - // bundle := nodeKeyBundles[family][id.Raw()] - // addr, err = ccip_ton.GetNodeAddressFromBundle(&bundle) - // if err != nil { - // return err - // } - // ocrKey := bundle.OCR2Key - // ocr2Config = ocrKey.Data.Attributes - // offPrefix = "ocr2off_ton_" - // onPrefix = "ocr2on_ton_" - // cfgPrefix = "ocr2cfg_ton_" + bundle := nodeKeyBundles[family][id.Raw()] + addr, err = ccip_ton.GetNodeAddressFromBundle(&bundle) + if err != nil { + return err + } + ocrKey := bundle.OCR2Key + ocr2Config = ocrKey.Data.Attributes + offPrefix = "ocr2off_ton_" + onPrefix = "ocr2on_ton_" + cfgPrefix = "ocr2cfg_ton_" default: return fmt.Errorf("unsupported chain family %s for selector %d", family, destSelector) } @@ -902,12 +901,11 @@ func applySetCandidateChangesetConfig(e deployment.Environment, cfg SetCandidate return deployment.ChangesetOutput{}, err } case chain_selectors.FamilyTon: - panic("TON support temporarily disabled") - // a := &tonSeqs.TonLaneAdapter{} - // offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) - // if err != nil { - // return deployment.ChangesetOutput{}, err - // } + a := &tonSeqs.TonLaneAdapter{} + offRampAddress, err = a.GetOffRampAddress(e.DataStore, chainSelector) + if err != nil { + return deployment.ChangesetOutput{}, err + } default: return deployment.ChangesetOutput{}, fmt.Errorf("unsupported chain family %s for selector %d", family, chainSelector) } diff --git a/devenv/common/implcommon.go b/devenv/common/implcommon.go index 198f4590b2..8590977c1a 100644 --- a/devenv/common/implcommon.go +++ b/devenv/common/implcommon.go @@ -82,7 +82,7 @@ func DeployContractsForSelector(ctx context.Context, env *deployment.Environment // Directory needs to exist at ../contracts/build relative to chainlink-ccip/devenv for TON contractVersion := os.Getenv("DEPLOY_CONTRACT_VERSION") if contractVersion == "" { - contractVersion = "a60d19e33dc8" // Jan 5, 2026 commit hash + contractVersion = "4f7b7be09c30" // https://github.com/smartcontractkit/chainlink-ton/releases/tag/ton-contracts-build-4f7b7be09c30 } out, err := deployops.DeployContracts(dReg).Apply(*env, deployops.ContractDeploymentConfig{ MCMS: mcms.Input{}, @@ -695,10 +695,19 @@ func SetupTokensAndTokenPools(env *deployment.Environment, adp []testadapters.Te return nil } + // Filter out adapters that don't support token transfers (e.g. TON message-passing only). + var tokenAdapters []testadapters.TestAdapter + for _, a := range adp { + if _, err := a.GetRegistryAddress(); errors.Is(err, errors.ErrUnsupported) { + continue + } + tokenAdapters = append(tokenAdapters, a) + } + // The deployment map defines the tokens and token pools to deploy // and the configurations for their cross-chain interactions. We deploy one token and token pool per chain, and configure them to be transferable to each other. dply := map[uint64]tokensapi.TokenExpansionInputPerChain{} - for _, srcAdapter := range adp { + for _, srcAdapter := range tokenAdapters { srcCfg := srcAdapter.GetTokenExpansionConfig() srcSel := srcAdapter.ChainSelector() srcFamily := srcAdapter.Family() @@ -706,7 +715,7 @@ func SetupTokensAndTokenPools(env *deployment.Environment, adp []testadapters.Te continue // only EVM and Solana are supported for token transfers in 1.6 } - for _, dstAdapter := range adp { + for _, dstAdapter := range tokenAdapters { // dstCfg := dstAdapter.GetTokenExpansionConfig() dstSel := dstAdapter.ChainSelector() @@ -735,7 +744,7 @@ func SetupTokensAndTokenPools(env *deployment.Environment, adp []testadapters.Te } // Allow the router to withdraw a sensible amount of tokens from the account that will be transferring tokens. - for _, adapter := range adp { + for _, adapter := range tokenAdapters { teConfig := adapter.GetTokenExpansionConfig() selector := adapter.ChainSelector() @@ -761,7 +770,7 @@ func SetupTokensAndTokenPools(env *deployment.Environment, adp []testadapters.Te if err != nil { return nil, fmt.Errorf("failed to allow router to withdraw tokens for selector %d: %w", selector, err) } - for _, dst := range adp { + for _, dst := range tokenAdapters { if dst.ChainSelector() == selector { continue } diff --git a/devenv/environment.go b/devenv/environment.go index 93bea7a515..466426f324 100644 --- a/devenv/environment.go +++ b/devenv/environment.go @@ -154,7 +154,7 @@ func checkForkedEnvIsSet(in *Cfg) error { // NewEnvironment creates a new CCIP environment either locally in Docker or remotely in K8s. func NewEnvironment() (*Cfg, error) { - ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Minute) + ctx, cancelFunc := context.WithTimeout(context.Background(), 15*time.Minute) defer cancelFunc() tr := NewTimeTracker(Plog) ctx = L.WithContext(ctx) @@ -178,7 +178,18 @@ func NewEnvironment() (*Cfg, error) { impls := make([]CCIP16ProductConfiguration, 0) for _, bc := range in.Blockchains { - impl, err := NewCCIPImplFromNetwork(bc.Type, bc.ChainID) + var family string + switch bc.Type { + case "anvil", "geth": + family = chainsel.FamilyEVM + case "solana": + family = chainsel.FamilySolana + case "ton": + family = chainsel.FamilyTon + default: + return nil, fmt.Errorf("unsupported blockchain type: %s", bc.Type) + } + impl, err := NewCCIPImplFromNetwork(family, bc.ChainID) if err != nil { return nil, err } diff --git a/devenv/go.mod b/devenv/go.mod index 57b8fab4d6..61eb2f7ce9 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -33,20 +33,20 @@ require ( github.com/prometheus/client_golang v1.23.0 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d + github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 - github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260107192940-0be702ef3ff5 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 - github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 + github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 + github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd - github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6 - github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1 + github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 + github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d - github.com/smartcontractkit/mcms v0.34.0 + github.com/smartcontractkit/mcms v0.35.1-0.20260209175626-b68b54b6e8d0 github.com/spf13/cobra v1.10.1 github.com/stretchr/testify v1.11.1 github.com/xssnick/tonutils-go v1.14.1 @@ -57,8 +57,8 @@ require ( require ( github.com/aws/smithy-go v1.24.0 -// github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260127214148-d1bc1a4821a9 -// github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260127214148-d1bc1a4821a9 + github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494 + github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494 ) require ( @@ -76,6 +76,7 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect + github.com/TyphonHill/go-mermaid v1.0.0 // indirect github.com/VictoriaMetrics/fastcache v1.13.0 // indirect github.com/XSAM/otelsql v0.37.0 // indirect github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect @@ -92,7 +93,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.24.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect - github.com/block-vision/sui-go-sdk v1.1.2 // indirect + github.com/block-vision/sui-go-sdk v1.1.4 // indirect github.com/btcsuite/btcd v0.24.2 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/btcsuite/btcd/btcutil v1.1.6 // indirect @@ -185,7 +186,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v1.0.0 // indirect github.com/google/btree v1.1.3 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.9 // indirect @@ -218,6 +219,7 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.7 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/memberlist v0.5.2 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/yamux v0.1.2 // indirect @@ -275,6 +277,7 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/go-archive v0.1.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect + github.com/moby/spdystream v0.5.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect @@ -287,6 +290,7 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/oklog/run v1.2.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.116.0 // indirect @@ -336,13 +340,15 @@ require ( github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect - github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect + github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect - github.com/smartcontractkit/chainlink-ton v0.0.0-20260127214148-d1bc1a4821a9 // indirect + github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -399,10 +405,10 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect go.opentelemetry.io/otel/metric v1.39.0 // indirect go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect go.opentelemetry.io/otel/trace v1.39.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect @@ -412,19 +418,19 @@ require ( go.uber.org/ratelimit v0.3.1 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.21.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/mod v0.31.0 // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect + golang.org/x/mod v0.32.0 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sys v0.40.0 // indirect golang.org/x/term v0.39.0 // indirect golang.org/x/text v0.33.0 // indirect - golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/time v0.14.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/api v0.221.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect @@ -432,11 +438,11 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.32.2 // indirect - k8s.io/apimachinery v0.32.2 // indirect - k8s.io/client-go v0.32.2 // indirect + k8s.io/api v0.32.3 // indirect + k8s.io/apimachinery v0.32.3 // indirect + k8s.io/client-go v0.32.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect + k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 // indirect sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect diff --git a/devenv/go.sum b/devenv/go.sum index fe96324492..d07be31723 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -85,6 +85,8 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= +github.com/TyphonHill/go-mermaid v1.0.0 h1:VtmgQwgZA+KNHJvG/O591ibBVuDkGhg2+F/olVXnXAs= +github.com/TyphonHill/go-mermaid v1.0.0/go.mod h1:BqMEbKnr2HHpZ4lJJvGjL47v6rZAUpJcOaE/db1Ppwc= github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0= github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU= github.com/Workiva/go-datastructures v1.1.5 h1:5YfhQ4ry7bZc2Mc7R0YZyYwpf5c6t1cEFvdAhd6Mkf4= @@ -117,6 +119,8 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= @@ -181,8 +185,8 @@ github.com/bits-and-blooms/bitset v1.24.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6 github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= -github.com/block-vision/sui-go-sdk v1.1.2 h1:p9DPfb51mEcTmF0Lx9ORpH+Nh9Rzg4Sv3Pu5gsJZ2AA= -github.com/block-vision/sui-go-sdk v1.1.2/go.mod h1:KlibJnwEpWt8qhQkIPxc/2ZE4kwh0Md6LvMHmW5kemA= +github.com/block-vision/sui-go-sdk v1.1.4 h1:1PPgYxQjo1P9UCgFOPTvDCuGEglRL32NwjKPulR4FQk= +github.com/block-vision/sui-go-sdk v1.1.4/go.mod h1:t8mWASwfyv+EyqHGO9ZrcDiCJWGOFEXqq50TMJ8GQco= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= @@ -308,8 +312,8 @@ github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= +github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0= github.com/cucumber/godog v0.15.1 h1:rb/6oHDdvVZKS66hrhpjFQFHjthFSrQBCOI1LwshNTI= @@ -424,6 +428,10 @@ github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ= github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= +github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= +github.com/gkampitakis/go-snaps v0.5.19 h1:hUJlCQOpTt1M+kSisMwioDWZDWpDtdAvUhvWCx1YGW0= +github.com/gkampitakis/go-snaps v0.5.19/go.mod h1:gC3YqxQTPyIXvQrw/Vpt3a8VqR1MO8sVpZFWN4DGwNs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -497,8 +505,8 @@ github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/goccy/go-yaml v1.12.0 h1:/1WHjnMsI1dlIBQutrvSMGZRQufVO3asrHfTwfACoPM= -github.com/goccy/go-yaml v1.12.0/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= +github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= +github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= @@ -553,8 +561,8 @@ github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -692,6 +700,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -880,6 +890,8 @@ github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4 github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/marcboeker/go-duckdb v1.8.5 h1:tkYp+TANippy0DaIOP5OEfBEwbUINqiFqgwMQ44jME0= github.com/marcboeker/go-duckdb v1.8.5/go.mod h1:6mK7+WQE4P4u5AFLvVBmhFxY5fvhymFptghgJX6B+/8= +github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= +github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -951,6 +963,8 @@ github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= +github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= @@ -980,6 +994,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -996,8 +1012,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= -github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM= +github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1151,6 +1167,8 @@ github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aeprPTHb6yY= github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYMWZJ294T3BtmVCpQ= +github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= +github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v4 v4.25.9 h1:JImNpf6gCVhKgZhtaAHJ0serfFGtlfIlSC08eaKdTrU= @@ -1173,40 +1191,48 @@ github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0ku github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= -github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d h1:ytcMsJM0zlw5PnaZ1D8JmyGT1m6Fxtb8ycqWYMGheYs= -github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d/go.mod h1:ZtZ+wtqU9JsJEmbiCsavVVEbhywpgMF7q/IpD9Eaq48= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 h1:OeZ/wkrH9pRogFTUE9TrSncYA/xLTj2ui5VmkX0/6ss= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139/go.mod h1:ZtZ+wtqU9JsJEmbiCsavVVEbhywpgMF7q/IpD9Eaq48= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= -github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 h1:8R5BstwQlzucsa/wfHXsIG5lOD6B1fYPHHC/yFYossw= -github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827/go.mod h1:YpOudvJ+dCK7JbW+NgYE/48dDRFWd+YCVYBsplksf0Q= +github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= +github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.3 h1:JqwyJEtnNEUaoQQPoOBTT4sn2lpdIZHtf0Hr0M60YDw= github.com/smartcontractkit/chainlink-evm v0.3.3/go.mod h1:q0ZBvaoisNaqC8NcMYWNPTjee88nQktDEeJMQHq3hVI= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd h1:sK+pK4epQp20yQ7XztwrVgkTkRAr4FY+TvEegW8RuQk= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 h1:IXF7+k8I1YY/yvXC1wnS3FAAggtCy6ByEQ9hv/F2FvQ= +github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= -github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 h1:EaLuGs7jZ6Vm2iv6rNK3bQ3XN5CRbFd4knjjvaD1zFc= -github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471/go.mod h1:VlyZhVw+a93Sk8rVHOIH6tpiXrMzuWLZrjs1eTIExW8= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6 h1:+Pjg5HsFo+AG6Id/iN/VHHHuU1HRfXNLBc/HHu30yjg= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6/go.mod h1:2p+lXQtkaJmD5dXw+HaAf+lFoQtNJy3NwkRfprU3VlY= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= +github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9/go.mod h1:KpEWZJMLwbdMHeHQz9rbkES0vRrx4nk6OQXyhlHb9/8= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 h1:w1KRBigXgoBYQBi4IU0gKbA2mBF6vq5vW/zbtan+mPo= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1/go.mod h1:43xdIQuqw/gzfazsqJkBrGdF25TIJDiY/Ak/YrWFTmU= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0/go.mod h1:lyAu+oMXdNUzEDScj2DXB2IueY+SDXPPfyl/kb63tMM= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 h1:ZJ/8Jx6Be5//TyjPi1pS1uotnmcYq5vVkSyISIymSj8= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1 h1:azdJaWIyZJlHFEQQExHklfGfb30zzAx3WsxaCaMm4IM= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1/go.mod h1:vB5W8mngbHvDFlpujHY8jIotHr0a8J/8TIsexP/yANo= -github.com/smartcontractkit/chainlink-ton v0.0.0-20260127214148-d1bc1a4821a9 h1:kTyV7r7efaxgK8UPhZsTA5aN7+MDZ5wRRWjepOF1GjE= -github.com/smartcontractkit/chainlink-ton v0.0.0-20260127214148-d1bc1a4821a9/go.mod h1:jeuUzo8fWXrqnMniJrtfmbbtE8FJr6why+Maj/Xz1ZU= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 h1:QFO9Ar1zY9SHj//7LXWq5caVrfyTFrkRcfkMQeSOAaQ= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2/go.mod h1:OLczwaAvyObFG+eq4tQHkWqkbPBB0cHkZj0JzY3inik= +github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 h1:+5wW8HbwNhHEBOanhSiT7sxyFAAeDP9TvQ6GwJ4STps= +github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0/go.mod h1:IZvH2r16xcQvVLB7AtjU112wnHfEku+29OlI1vCQHCQ= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494 h1:LXfOVzQ9u66bBXt7+zYJ4tmJ7Reei2i89yZIhGY7TN8= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494/go.mod h1:Gki75dC/U4umgpv6+A14h0BWyJYiJ/UbQ2hjncDHYXU= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494 h1:DLDpJksqtO8Ecww8py3TtbZqGjmqUfubk0qeHaruHGw= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494/go.mod h1:WlNwZdjxlos4/RhT51azuypplpThTI9rvCJLRZS8WR8= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 h1:XRNxgcNqagXu6e4smJuS1crRK5cUAcCVd7u+iLduHDM= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513/go.mod h1:ccjEgNeqOO+bjPddnL4lUrNLzyCvGCxgBjJdhFX3wa8= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20250528121202-292529af39df h1:36e3ROIZyV/qE8SvFOACXtXfMOMd9vG4+zY2v2ScXkI= @@ -1217,8 +1243,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d h1:LokA9PoCNb8mm8mDT52c3RECPMRsGz1eCQORq+J3n74= github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d/go.mod h1:Acy3BTBxou83ooMESLO90s8PKSu7RvLCzwSTbxxfOK0= -github.com/smartcontractkit/mcms v0.34.0 h1:3RQtoSuoeAWnGXculRHsGkUhylYW1cHZdsQFccRs4Z0= -github.com/smartcontractkit/mcms v0.34.0/go.mod h1:CCQEpYC/QIsNZ5lp+KgxjtWUIA17cmxtaRZs5QH1Z6Y= +github.com/smartcontractkit/mcms v0.35.1-0.20260209175626-b68b54b6e8d0 h1:H6GXXs71EGZBk3Vr6Ren3PzkY5l3F6RUFaAJ5Gn7Gj8= +github.com/smartcontractkit/mcms v0.35.1-0.20260209175626-b68b54b6e8d0/go.mod h1:GVgE0Friw/XKcgua03ZRPeo23lxaMCkwuIIjk6qbKW0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1292,6 +1318,8 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tjhop/slog-gokit v0.1.3 h1:6SdexP3UIeg93KLFeiM1Wp1caRwdTLgsD/THxBUy1+o= github.com/tjhop/slog-gokit v0.1.3/go.mod h1:Bbu5v2748qpAWH7k6gse/kw3076IJf6owJmh7yArmJs= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= @@ -1422,14 +1450,14 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= @@ -1510,8 +1538,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1539,8 +1567,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1589,8 +1617,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1703,8 +1731,8 @@ golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523 h1:H52Mhyrc44wBgLTGzq6+0cmuVuF3LURCSXsLMOqfFos= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523/go.mod h1:ArQvPJS723nJQietgilmZA+shuB3CZxH1n2iXq9VSfs= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1743,8 +1771,8 @@ golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1795,8 +1823,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1806,8 +1834,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1868,8 +1896,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1932,16 +1960,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= -k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= -k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= -k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= -k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= +k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= +k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= +k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= +k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= +k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= +k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 h1:jGnCPejIetjiy2gqaJ5V0NLwTpF4wbQ6cZIItJCSHno= k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/devenv/tests/e2e/load_test.go b/devenv/tests/e2e/load_test.go index a705334546..b1faad375d 100644 --- a/devenv/tests/e2e/load_test.go +++ b/devenv/tests/e2e/load_test.go @@ -164,8 +164,12 @@ func TestE2ELoad(t *testing.T) { } impls := make([]ccip.CCIP16ProductConfiguration, 0) - for _, bc := range in.Blockchains { - i, err := ccip.NewCCIPImplFromNetwork(bc.Type, bc.ChainID) + for _, selector := range selectors { + family, err := chainsel.GetSelectorFamily(selector) + require.NoError(t, err) + chainID, err := chainsel.GetChainIDFromSelector(selector) + require.NoError(t, err) + i, err := ccip.NewCCIPImplFromNetwork(family, chainID) require.NoError(t, err) i.SetCLDF(e) impls = append(impls, i) diff --git a/devenv/tests/e2e/smoke_test.go b/devenv/tests/e2e/smoke_test.go index 77bb89cda4..7296dde4ef 100644 --- a/devenv/tests/e2e/smoke_test.go +++ b/devenv/tests/e2e/smoke_test.go @@ -2,22 +2,14 @@ package e2e import ( "fmt" - "math/big" - "os" "testing" - "time" "github.com/stretchr/testify/require" - datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" - "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-testing-framework/framework" - chainsel "github.com/smartcontractkit/chain-selectors" - - "github.com/smartcontractkit/chainlink-ccip/deployment/testadapters" ccip "github.com/smartcontractkit/chainlink-ccip/devenv" + "github.com/smartcontractkit/chainlink-ccip/devenv/tests" ) func TestE2ESmoke(t *testing.T) { @@ -26,162 +18,14 @@ func TestE2ESmoke(t *testing.T) { if in.ForkedEnvConfig != nil { t.Skip("Skipping E2E tests on forked environments, not supported yet") } - chainIDs, wsURLs := make([]string, 0), make([]string, 0) - for _, bc := range in.Blockchains { - chainIDs = append(chainIDs, bc.ChainID) - wsURLs = append(wsURLs, bc.Out.Nodes[0].ExternalWSUrl) - } selectors, e, err := ccip.NewCLDFOperationsEnvironment(in.Blockchains, in.CLDF.DataStore) require.NoError(t, err) - selectorsToImpl := make(map[uint64]ccip.CCIP16ProductConfiguration) - - for _, bc := range in.Blockchains { - i, err := ccip.NewCCIPImplFromNetwork(bc.Type, bc.ChainID) - require.NoError(t, err) - i.SetCLDF(e) - family, err := chainsel.GetSelectorFamily(i.ChainSelector()) - require.NoError(t, err) - networkInfo, err := chainsel.GetChainDetailsByChainIDAndFamily(bc.ChainID, family) - require.NoError(t, err) - selectorsToImpl[networkInfo.ChainSelector] = i - } t.Cleanup(func() { _, err := framework.SaveContainerLogs(fmt.Sprintf("%s-%s", framework.DefaultCTFLogsDir, t.Name())) require.NoError(t, err) }) - type testcase struct { - name string - fromSelector uint64 - toSelector uint64 - } - tcs := []testcase{} - for i := range selectors { - for j := range selectors { - if i == j { - continue - } - fromFamily, _ := chainsel.GetSelectorFamily(selectors[i]) - toFamily, _ := chainsel.GetSelectorFamily(selectors[j]) - tcs = append(tcs, testcase{ - name: fmt.Sprintf("msg execution eoa receiver from %s to %s", fromFamily, toFamily), - fromSelector: selectors[i], - toSelector: selectors[j], - }) - } - } - - for _, tc := range tcs { - fromImpl := selectorsToImpl[tc.fromSelector] - toImpl := selectorsToImpl[tc.toSelector] - supportedTokenFamilies := map[string]bool{ - chainsel.FamilyEVM: true, - chainsel.FamilySolana: true, - } - _, fromSupported := supportedTokenFamilies[fromImpl.Family()] - _, toSupported := supportedTokenFamilies[toImpl.Family()] - if fromSupported && toSupported { - tc.name += " with token transfer" - } else { - tc.name += " without token transfer" - } - // Capture the loop variable so each goroutine gets its own copy. - t.Run(tc.name, func(t *testing.T) { - if os.Getenv("PARALLEL_E2E_TESTS") == "true" { - t.Parallel() - } - - t.Logf("Testing CCIP message from chain %d to chain %d", tc.fromSelector, tc.toSelector) - - receiver := toImpl.CCIPReceiver() - extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family()) - require.NoError(t, err) - - // TODO: once non-EVM tooling supports token transfers, we'll be able - // to remove the EVM <-> EVM filter and directly set these variables. - var tokenAmounts []testadapters.TokenAmount = nil - var balanceCheck func() bool = nil - // technically something like solana <> solana isn't valid, but this - // check is just to ensure we only run token transfer tests on supported - // chain families for now. - if fromSupported && toSupported { - srcChainSel, srcTokenCfg := fromImpl.ChainSelector(), fromImpl.GetTokenExpansionConfig().DeployTokenInput - dstChainSel, dstTokenCfg := toImpl.ChainSelector(), toImpl.GetTokenExpansionConfig().DeployTokenInput - - srcTokenFilterDS := datastore.AddressRef{ChainSelector: srcChainSel, Qualifier: srcTokenCfg.Symbol, Type: datastore.ContractType(srcTokenCfg.Type)} - srcTokenRef, err := datastore_utils.FindAndFormatRef(e.DataStore, srcTokenFilterDS, srcChainSel, datastore_utils.FullRef) - require.NoError(t, err) - - dstTokenFilterDS := datastore.AddressRef{ChainSelector: dstChainSel, Qualifier: dstTokenCfg.Symbol, Type: datastore.ContractType(dstTokenCfg.Type)} - dstTokenRef, err := datastore_utils.FindAndFormatRef(e.DataStore, dstTokenFilterDS, dstChainSel, datastore_utils.FullRef) - require.NoError(t, err) - - // Here, we avoid using a fractional token amount to simplify the test logic. In - // this case, we transfer 10^src_decimals units on the *src* chain, which is the - // the equivalent of one whole token on the source. This results in the receiver - // getting the equivalent of 10^dst_decimals units which is also one whole token - // on the *destination* chain. If we want to test fractional amounts later, then - // we'd need to scale the amounts according to both the src/dst token decimals. - sendAmnt := new(big.Int).Exp(big.NewInt(10), new(big.Int).SetUint64(uint64(srcTokenCfg.Decimals)), nil) - - // We expect the receiver to get 1 whole token on the destination chain. - recvAmnt := new(big.Int).Exp(big.NewInt(10), new(big.Int).SetUint64(uint64(dstTokenCfg.Decimals)), nil) - - // Query the initial balance of the receiver account on the destination chain - initAmnt, err := toImpl.GetTokenBalance(t.Context(), dstTokenRef.Address, receiver) - require.NoError(t, err) - - // Calculate the total balance that the receiver should have after execution - trgtAmnt := new(big.Int).Add(initAmnt, recvAmnt) - - // This balance check function will be polled at regular intervals. It returns - // true when the receiver's current balance matches the expected target amount - balanceCheck = func() bool { - t.Helper() - - balance, err := toImpl.GetTokenBalance(t.Context(), dstTokenRef.Address, receiver) - require.NoError(t, err) - - t.Log(fmt.Sprintf("Fetched receiver token balance on chain %d (%s)", tc.toSelector, toImpl.Family()), - "token.qualifier="+dstTokenRef.Qualifier, - "token.address="+dstTokenRef.Address, - "token.type="+dstTokenRef.Type, - "balance.target="+trgtAmnt.String(), - "balance.actual="+balance.String(), - ) - - return balance.Cmp(trgtAmnt) == 0 - } - - tokenAmounts = []testadapters.TokenAmount{ - {Amount: sendAmnt, Token: srcTokenRef.Address}, - } - } - - msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ - DestChainSelector: tc.toSelector, - Receiver: receiver, - Data: []byte("hello eoa"), - FeeToken: "", - ExtraArgs: extraArgs, - TokenAmounts: tokenAmounts, - }) - require.NoError(t, err) - - seq, err := fromImpl.SendMessage(t.Context(), tc.toSelector, msg) - require.NoError(t, err) - seqNr := ccipocr3.SeqNum(seq) - seqNumRange := ccipocr3.NewSeqNumRange(seqNr, seqNr) - toImpl.ValidateCommit(t, tc.fromSelector, nil, seqNumRange) - toImpl.ValidateExec(t, tc.fromSelector, nil, []uint64{seq}) - - // TODO: once non-EVM tooling supports token transfers we can - // remove this if statement and always run the balance check. - if balanceCheck != nil { - require.Eventually(t, balanceCheck, 5*time.Second, time.Second) - } - }) - } + tests.RunSmokeTests(t, e, selectors) } diff --git a/devenv/tests/smoke.go b/devenv/tests/smoke.go new file mode 100644 index 0000000000..84be5aa895 --- /dev/null +++ b/devenv/tests/smoke.go @@ -0,0 +1,286 @@ +package tests + +import ( + "fmt" + "math" + "math/big" + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" + + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-ccip/deployment/testadapters" + ccip "github.com/smartcontractkit/chainlink-ccip/devenv" +) + +var supportedTokenFamilies = map[string]bool{ + chainsel.FamilyEVM: true, + chainsel.FamilySolana: true, +} + +func RunSmokeTests(t *testing.T, e *deployment.Environment, selectors []uint64) { + selectorsToImpl := make(map[uint64]ccip.CCIP16ProductConfiguration) + for _, selector := range selectors { + family, err := chainsel.GetSelectorFamily(selector) + require.NoError(t, err) + chainID, err := chainsel.GetChainIDFromSelector(selector) + require.NoError(t, err) + i, err := ccip.NewCCIPImplFromNetwork(family, chainID) + require.NoError(t, err) + i.SetCLDF(e) + selectorsToImpl[selector] = i + } + + if os.Getenv("PARALLEL_E2E_TESTS") == "true" { + t.Parallel() + } + + type testpair struct { + fromChain ccip.CCIP16ProductConfiguration + toChain ccip.CCIP16ProductConfiguration + } + matrix := []testpair{} + for _, i := range selectors { + for _, j := range selectors { + if i == j { + continue + } + matrix = append(matrix, testpair{ + fromChain: selectorsToImpl[i], + toChain: selectorsToImpl[j], + }) + } + } + + for _, tc := range matrix { + fromImpl := tc.fromChain + toImpl := tc.toChain + laneTag := fmt.Sprintf("%s->%s", fromImpl.Family(), toImpl.Family()) + + t.Run(fmt.Sprintf("%s message", laneTag), func(t *testing.T) { + receiver := toImpl.CCIPReceiver() + extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family()) + require.NoError(t, err) + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: receiver, + Data: []byte("hello eoa"), + FeeToken: "", + ExtraArgs: extraArgs, + TokenAmounts: nil, + }) + require.NoError(t, err) + + seq, err := fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.NoError(t, err) + seqNr := ccipocr3.SeqNum(seq) + seqNumRange := ccipocr3.NewSeqNumRange(seqNr, seqNr) + toImpl.ValidateCommit(t, fromImpl.ChainSelector(), nil, seqNumRange) + toImpl.ValidateExec(t, fromImpl.ChainSelector(), nil, []uint64{seq}) + }) + + t.Run(fmt.Sprintf("%s token transfer", laneTag), func(t *testing.T) { + receiver := toImpl.CCIPReceiver() + extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family()) + require.NoError(t, err) + + _, fromSupported := supportedTokenFamilies[fromImpl.Family()] + _, toSupported := supportedTokenFamilies[toImpl.Family()] + if !fromSupported || !toSupported { + t.Skip("Token transfers not supported on " + laneTag) + } + + srcChainSel, srcTokenCfg := fromImpl.ChainSelector(), fromImpl.GetTokenExpansionConfig().DeployTokenInput + dstChainSel, dstTokenCfg := toImpl.ChainSelector(), toImpl.GetTokenExpansionConfig().DeployTokenInput + + srcTokenFilterDS := datastore.AddressRef{ChainSelector: srcChainSel, Qualifier: srcTokenCfg.Symbol, Type: datastore.ContractType(srcTokenCfg.Type)} + srcTokenRef, err := datastore_utils.FindAndFormatRef(e.DataStore, srcTokenFilterDS, srcChainSel, datastore_utils.FullRef) + require.NoError(t, err) + + dstTokenFilterDS := datastore.AddressRef{ChainSelector: dstChainSel, Qualifier: dstTokenCfg.Symbol, Type: datastore.ContractType(dstTokenCfg.Type)} + dstTokenRef, err := datastore_utils.FindAndFormatRef(e.DataStore, dstTokenFilterDS, dstChainSel, datastore_utils.FullRef) + require.NoError(t, err) + + // Here, we avoid using a fractional token amount to simplify the test logic. In + // this case, we transfer 10^src_decimals units on the *src* chain, which is the + // the equivalent of one whole token on the source. This results in the receiver + // getting the equivalent of 10^dst_decimals units which is also one whole token + // on the *destination* chain. If we want to test fractional amounts later, then + // we'd need to scale the amounts according to both the src/dst token decimals. + sendAmnt := new(big.Int).Exp(big.NewInt(10), new(big.Int).SetUint64(uint64(srcTokenCfg.Decimals)), nil) + + // We expect the receiver to get 1 whole token on the destination chain. + recvAmnt := new(big.Int).Exp(big.NewInt(10), new(big.Int).SetUint64(uint64(dstTokenCfg.Decimals)), nil) + + // Query the initial balance of the receiver account on the destination chain + initAmnt, err := toImpl.GetTokenBalance(t.Context(), dstTokenRef.Address, receiver) + require.NoError(t, err) + + // Calculate the total balance that the receiver should have after execution + trgtAmnt := new(big.Int).Add(initAmnt, recvAmnt) + + // This balance check function will be polled at regular intervals. It returns + // true when the receiver's current balance matches the expected target amount + balanceCheck := func() bool { + t.Helper() + + balance, err := toImpl.GetTokenBalance(t.Context(), dstTokenRef.Address, receiver) + require.NoError(t, err) + + t.Log(fmt.Sprintf("Fetched receiver token balance on chain %d (%s)", toImpl.ChainSelector(), toImpl.Family()), + "token.qualifier="+dstTokenRef.Qualifier, + "token.address="+dstTokenRef.Address, + "token.type="+dstTokenRef.Type, + "balance.target="+trgtAmnt.String(), + "balance.actual="+balance.String(), + ) + return balance.Cmp(trgtAmnt) == 0 + } + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: receiver, + Data: []byte("hello eoa"), + FeeToken: "", + ExtraArgs: extraArgs, + TokenAmounts: []testadapters.TokenAmount{ + {Amount: sendAmnt, Token: srcTokenRef.Address}, + }, + }) + require.NoError(t, err) + + seq, err := fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.NoError(t, err) + seqNr := ccipocr3.SeqNum(seq) + seqNumRange := ccipocr3.NewSeqNumRange(seqNr, seqNr) + toImpl.ValidateCommit(t, fromImpl.ChainSelector(), nil, seqNumRange) + toImpl.ValidateExec(t, fromImpl.ChainSelector(), nil, []uint64{seq}) + require.Eventually(t, balanceCheck, 5*time.Second, time.Second) + }) + + t.Run(fmt.Sprintf("%s gas limit too high", laneTag), func(t *testing.T) { + if fromImpl.Family() == chainsel.FamilySolana { + t.Skip("TODO: evm adapter GetExtraArgs returns nil adapter") + } + receiver := toImpl.CCIPReceiver() + + extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family(), testadapters.NewGasLimitExtraArg(big.NewInt(math.MaxUint32))) + require.NoError(t, err) + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: receiver, + Data: []byte("hello world"), + ExtraArgs: extraArgs, + }) + require.NoError(t, err) + + _, err = fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.Error(t, err) + }) + + // TODO: send data payload larger than limit + + t.Run(fmt.Sprintf("%s invalid extra args tag", laneTag), func(t *testing.T) { + if fromImpl.Family() == chainsel.FamilyTon { + t.Skip("TON expects a well-formatted BOC or BuildMessage will fail") + } + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: toImpl.CCIPReceiver(), + Data: []byte("hello world"), + ExtraArgs: []byte{1, 2, 3, 4, 99, 99}, // invalid extraArgs prefix + }) + require.NoError(t, err) + + _, err = fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.Error(t, err) + }) + + t.Run(fmt.Sprintf("%s invalid/unconfigured chain selector", laneTag), func(t *testing.T) { + receiver := toImpl.CCIPReceiver() + extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family()) + require.NoError(t, err) + + const invalidUnconfiguredChainSelector = 1 + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: invalidUnconfiguredChainSelector, + Receiver: toImpl.CCIPReceiver(), + Data: []byte("hello world"), + ExtraArgs: extraArgs, + }) + require.NoError(t, err) + + _, err = fromImpl.SendMessage(t.Context(), invalidUnconfiguredChainSelector, msg) + require.Error(t, err) + }) + + t.Run(fmt.Sprintf("%s invalid receiver", laneTag), func(t *testing.T) { + switch { + + case fromImpl.Family() == chainsel.FamilySolana: + t.Skip("GetExtraArgs fails with invalid pubkey receivers, we'd need to construct a raw payload to test against the contract") + case toImpl.Family() == chainsel.FamilySolana: + // TODO call skip in a getInvalidReceivers interface maybe + t.Skip("GetExtraArgs fails with invalid pubkey receivers, we'd need to construct a raw payload to test against the contract") + } + invalidReceiver := []byte{99} + + extraArgs, err := toImpl.GetExtraArgs(invalidReceiver, fromImpl.Family(), testadapters.NewGasLimitExtraArg(big.NewInt(math.MaxInt64))) + require.NoError(t, err) + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: invalidReceiver, + Data: []byte("hello world"), + ExtraArgs: extraArgs, + }) + require.NoError(t, err) + + _, err = fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.Error(t, err) + }) + + // TODO: message with not enough gas + // then manual re-exec with higher limit + + // TODO: test whitelisting + + t.Run(fmt.Sprintf("%s OOO flag is required on non-EVMs", laneTag), func(t *testing.T) { + if fromImpl.Family() == chainsel.FamilyEVM && toImpl.Family() == chainsel.FamilyEVM { + t.Skip("EVM->EVM still supports OOO, depending on config") + } + if (fromImpl.Family() == chainsel.FamilySolana && toImpl.Family() == chainsel.FamilyEVM) || + (fromImpl.Family() == chainsel.FamilyEVM && toImpl.Family() == chainsel.FamilySolana) { + t.Skip("TODO: Setup lane block OOO on Solana->EVM") + // 1. evm adapter returns nil adapter + // 2. solana setup lane seems not to be setting enforeceOOO on the contract side + } + + receiver := toImpl.CCIPReceiver() + extraArgs, err := toImpl.GetExtraArgs(receiver, fromImpl.Family(), testadapters.NewOutOfOrderExtraArg(false)) + require.NoError(t, err) + + msg, err := fromImpl.BuildMessage(testadapters.MessageComponents{ + DestChainSelector: toImpl.ChainSelector(), + Receiver: receiver, + Data: []byte("hello world"), + ExtraArgs: extraArgs, + }) + require.NoError(t, err) + + _, err = fromImpl.SendMessage(t.Context(), toImpl.ChainSelector(), msg) + require.Error(t, err) + }) + } +} diff --git a/go.md b/go.md index 9c93806412..e06ce1db00 100644 --- a/go.md +++ b/go.md @@ -95,15 +95,16 @@ flowchart LR click chainlink-ccip/deployment href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-ccip/devenv --> chainlink-ccip/chains/evm/deployment chainlink-ccip/devenv --> chainlink-ccip/chains/solana/deployment + chainlink-ccip/devenv --> chainlink-ton/devenv click chainlink-ccip/devenv href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-ccip/integration-tests --> chainlink-ccip/chains/evm/deployment chainlink-ccip/integration-tests --> chainlink-ccip/chains/solana/deployment click chainlink-ccip/integration-tests href "https://github.com/smartcontractkit/chainlink-ccip" - chainlink-common --> chain-selectors chainlink-common --> chainlink-common/pkg/chipingress chainlink-common --> chainlink-protos/billing/go chainlink-common --> chainlink-protos/cre/go chainlink-common --> chainlink-protos/linking-service/go + chainlink-common --> chainlink-protos/node-platform chainlink-common --> chainlink-protos/storage-service chainlink-common --> chainlink-protos/workflows/go chainlink-common --> freeport @@ -139,18 +140,20 @@ flowchart LR chainlink-framework/chains --> chainlink-common chainlink-framework/chains --> chainlink-framework/multinode click chainlink-framework/chains href "https://github.com/smartcontractkit/chainlink-framework" - chainlink-framework/metrics + chainlink-framework/metrics --> chainlink-common click chainlink-framework/metrics href "https://github.com/smartcontractkit/chainlink-framework" chainlink-framework/multinode click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework" chainlink-protos/billing/go click chainlink-protos/billing/go href "https://github.com/smartcontractkit/chainlink-protos" - chainlink-protos/cre/go + chainlink-protos/cre/go --> chain-selectors click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/job-distributor click chainlink-protos/job-distributor href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/linking-service/go click chainlink-protos/linking-service/go href "https://github.com/smartcontractkit/chainlink-protos" + chainlink-protos/node-platform + click chainlink-protos/node-platform href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/op-catalog click chainlink-protos/op-catalog href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/rmn/v1.6/go @@ -180,6 +183,10 @@ flowchart LR chainlink-ton --> chainlink-common/pkg/monitoring chainlink-ton --> chainlink-framework/metrics click chainlink-ton href "https://github.com/smartcontractkit/chainlink-ton" + chainlink-ton/deployment --> chainlink-ccip/deployment + click chainlink-ton/deployment href "https://github.com/smartcontractkit/chainlink-ton" + chainlink-ton/devenv --> chainlink-ton/deployment + click chainlink-ton/devenv href "https://github.com/smartcontractkit/chainlink-ton" chainlink-tron/relayer --> chainlink-common chainlink-tron/relayer --> chainlink-common/pkg/values click chainlink-tron/relayer href "https://github.com/smartcontractkit/chainlink-tron" @@ -236,6 +243,7 @@ flowchart LR chainlink-protos/cre/go chainlink-protos/job-distributor chainlink-protos/linking-service/go + chainlink-protos/node-platform chainlink-protos/op-catalog chainlink-protos/rmn/v1.6/go chainlink-protos/storage-service @@ -253,6 +261,13 @@ flowchart LR end click chainlink-testing-framework-repo href "https://github.com/smartcontractkit/chainlink-testing-framework" + subgraph chainlink-ton-repo[chainlink-ton] + chainlink-ton + chainlink-ton/deployment + chainlink-ton/devenv + end + click chainlink-ton-repo href "https://github.com/smartcontractkit/chainlink-ton" + classDef outline stroke-dasharray:6,fill:none; - class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo outline + class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo,chainlink-ton-repo outline ``` From 41ad0df0d5ae5fb206f21c9eb0505c8665b67d88 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 4 Mar 2026 12:36:55 -0500 Subject: [PATCH 19/41] Add missing check to fChain lookup. (#1692) --- execute/plugin_functions.go | 6 +++++- execute/plugin_functions_test.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/execute/plugin_functions.go b/execute/plugin_functions.go index 5acf1caff5..950eb1811b 100644 --- a/execute/plugin_functions.go +++ b/execute/plugin_functions.go @@ -9,6 +9,7 @@ import ( "time" mapset "github.com/deckarep/golang-set/v2" + "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -540,7 +541,10 @@ func computeCommitObservationsConsensus( validRoots := make([]merkleRootData, 0, len(merkleRootsVotes)) for mr, votes := range merkleRootsVotes { - if consensus.GteFPlusOne(fChain[mr.SourceChain], votes) { + f, ok := fChain[mr.SourceChain] + if !ok { + lggr.Warnw("no fChain defined for chain", "chain", mr.SourceChain, "fChain", fChain) + } else if consensus.GteFPlusOne(f, votes) { validRoots = append(validRoots, mr) } else { lggr.Debugw("merkle root with less than f+1 votes was found, skipping it", "mr", mr, "votes", votes) diff --git a/execute/plugin_functions_test.go b/execute/plugin_functions_test.go index 27685db9f6..9dacf4ed20 100644 --- a/execute/plugin_functions_test.go +++ b/execute/plugin_functions_test.go @@ -1851,6 +1851,11 @@ func Test_computeCommitObservationsConsensus(t *testing.T) { }, } + baseObservationDupeRoot := map[cciptypes.ChainSelector][]exectypes.CommitData{ + 1: baseObservation[1], + 9999: baseObservation[1], + } + baseObservationDifferentOnRamp := map[cciptypes.ChainSelector][]exectypes.CommitData{ 1: { { @@ -1961,6 +1966,16 @@ func Test_computeCommitObservationsConsensus(t *testing.T) { }, fChain: map[cciptypes.ChainSelector]int{}, }, + { + name: "ignore observation from unknown source chain", + observations: []exectypes.CommitObservations{ + baseObservation, + baseObservation, + baseObservationDupeRoot, // <-- different data but same merkle root, should be ignored + }, + fChain: map[cciptypes.ChainSelector]int{1: 2}, // need 3 observations for src 1 + exp: baseObservation, + }, } for _, tc := range testCases { From 5d24cbbb151e65151f9e29a1f9ad848ced825e94 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:25:26 -0800 Subject: [PATCH 20/41] bump ton in devenv (#1789) --- devenv/go.mod | 8 ++++---- devenv/go.sum | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/devenv/go.mod b/devenv/go.mod index 61eb2f7ce9..ee9701eadb 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -33,12 +33,12 @@ require ( github.com/prometheus/client_golang v1.23.0 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 + github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 - github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 + github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect @@ -57,8 +57,8 @@ require ( require ( github.com/aws/smithy-go v1.24.0 - github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494 - github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494 + github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122 + github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122 ) require ( diff --git a/devenv/go.sum b/devenv/go.sum index d07be31723..c6454625ec 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -1191,8 +1191,8 @@ github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0ku github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= -github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 h1:OeZ/wkrH9pRogFTUE9TrSncYA/xLTj2ui5VmkX0/6ss= -github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139/go.mod h1:ZtZ+wtqU9JsJEmbiCsavVVEbhywpgMF7q/IpD9Eaq48= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 h1:XTZ3crmZ5BsK2pUblJMDUb0nE3gap5mKTr4tFXnwilI= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82/go.mod h1:KsZAvGHRP0+mHRwrMQY5nNJYaIXu222n0FQoaMeSkeo= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= @@ -1229,10 +1229,10 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 h1:QFO9Ar1z github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2/go.mod h1:OLczwaAvyObFG+eq4tQHkWqkbPBB0cHkZj0JzY3inik= github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 h1:+5wW8HbwNhHEBOanhSiT7sxyFAAeDP9TvQ6GwJ4STps= github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0/go.mod h1:IZvH2r16xcQvVLB7AtjU112wnHfEku+29OlI1vCQHCQ= -github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494 h1:LXfOVzQ9u66bBXt7+zYJ4tmJ7Reei2i89yZIhGY7TN8= -github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260226155259-fada112b6494/go.mod h1:Gki75dC/U4umgpv6+A14h0BWyJYiJ/UbQ2hjncDHYXU= -github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494 h1:DLDpJksqtO8Ecww8py3TtbZqGjmqUfubk0qeHaruHGw= -github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260226155259-fada112b6494/go.mod h1:WlNwZdjxlos4/RhT51azuypplpThTI9rvCJLRZS8WR8= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122 h1:ZTyy8Pf4mhOHoKEm1UfnYYiqgaCIeg1TGp3SD5w3m2Y= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122/go.mod h1:w83O9EU6BEtAJ1FifeVAqp1mQNISnH3BY+MLbYX5PBg= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122 h1:3hOkTsTpsdTnJUB1vi6By7abpHvUrf4yHqdiGFCJs1Q= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122/go.mod h1:W4sihns3zi0UJF956bPdBI/DbP+fF9wQ5ON0RB0U2jY= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 h1:XRNxgcNqagXu6e4smJuS1crRK5cUAcCVd7u+iLduHDM= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513/go.mod h1:ccjEgNeqOO+bjPddnL4lUrNLzyCvGCxgBjJdhFX3wa8= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20250528121202-292529af39df h1:36e3ROIZyV/qE8SvFOACXtXfMOMd9vG4+zY2v2ScXkI= From 7a28a8641246f4a81369ae7f254f0aa421c215e2 Mon Sep 17 00:00:00 2001 From: Austin <107539019+0xAustinWang@users.noreply.github.com> Date: Wed, 4 Mar 2026 13:32:36 -0500 Subject: [PATCH 21/41] support malformed protobuf messages (#1784) * support malformed protobuf messages * lint * replace recover with granular error handling * lint --- pkg/ocrtypecodec/v1/commit.go | 92 ++++++++++++++--------- pkg/ocrtypecodec/v1/compatability_test.go | 30 ++++++++ pkg/ocrtypecodec/v1/exec.go | 32 ++++---- pkg/ocrtypecodec/v1/translate.go | 26 +++++-- 4 files changed, 124 insertions(+), 56 deletions(-) diff --git a/pkg/ocrtypecodec/v1/commit.go b/pkg/ocrtypecodec/v1/commit.go index 2991c9a1eb..1095813008 100644 --- a/pkg/ocrtypecodec/v1/commit.go +++ b/pkg/ocrtypecodec/v1/commit.go @@ -120,44 +120,52 @@ func (c *CommitCodecProto) EncodeObservation(observation committypes.Observation return proto.Marshal(pbObs) } -func (c *CommitCodecProto) DecodeObservation(data []byte) (committypes.Observation, error) { +func (c *CommitCodecProto) DecodeObservation(data []byte) (obs committypes.Observation, err error) { if len(data) == 0 { - return committypes.Observation{}, nil + return obs, nil } pbObs := &ocrtypecodecpb.CommitObservation{} if err := proto.Unmarshal(data, pbObs); err != nil { - return committypes.Observation{}, fmt.Errorf("proto unmarshal observation: %w", err) + return obs, fmt.Errorf("proto unmarshal observation: %w", err) } + merkleRoots, err := c.tr.merkleRootsFromProto(pbObs.GetMerkleRootObs().GetMerkleRoots()) + if err != nil { + return obs, fmt.Errorf("merkle roots from proto: %w", err) + } + rmnRemoteCfg, err := c.tr.rmnRemoteConfigFromProto(pbObs.GetMerkleRootObs().GetRmnRemoteConfig()) + if err != nil { + return obs, fmt.Errorf("rmn remote config from proto: %w", err) + } return committypes.Observation{ MerkleRootObs: merkleroot.Observation{ - MerkleRoots: c.tr.merkleRootsFromProto(pbObs.MerkleRootObs.MerkleRoots), - RMNEnabledChains: c.tr.rmnEnabledChainsFromProto(pbObs.MerkleRootObs.RmnEnabledChains), - OnRampMaxSeqNums: c.tr.seqNumChainFromProto(pbObs.MerkleRootObs.OnRampMaxSeqNums), - OffRampNextSeqNums: c.tr.seqNumChainFromProto(pbObs.MerkleRootObs.OffRampNextSeqNums), - RMNRemoteConfig: c.tr.rmnRemoteConfigFromProto(pbObs.MerkleRootObs.RmnRemoteConfig), - FChain: c.tr.fChainFromProto(pbObs.MerkleRootObs.FChain), + MerkleRoots: merkleRoots, + RMNEnabledChains: c.tr.rmnEnabledChainsFromProto(pbObs.GetMerkleRootObs().GetRmnEnabledChains()), + OnRampMaxSeqNums: c.tr.seqNumChainFromProto(pbObs.GetMerkleRootObs().GetOnRampMaxSeqNums()), + OffRampNextSeqNums: c.tr.seqNumChainFromProto(pbObs.GetMerkleRootObs().GetOffRampNextSeqNums()), + RMNRemoteConfig: rmnRemoteCfg, + FChain: c.tr.fChainFromProto(pbObs.GetMerkleRootObs().GetFChain()), }, TokenPriceObs: tokenprice.Observation{ - FeedTokenPrices: c.tr.feedTokenPricesFromProto(pbObs.TokenPriceObs.FeedTokenPrices), - FeeQuoterTokenUpdates: c.tr.feeQuoterTokenUpdatesFromProto(pbObs.TokenPriceObs.FeeQuoterTokenUpdates), - FChain: c.tr.fChainFromProto(pbObs.TokenPriceObs.FChain), - Timestamp: pbObs.TokenPriceObs.Timestamp.AsTime(), + FeedTokenPrices: c.tr.feedTokenPricesFromProto(pbObs.GetTokenPriceObs().GetFeedTokenPrices()), + FeeQuoterTokenUpdates: c.tr.feeQuoterTokenUpdatesFromProto(pbObs.GetTokenPriceObs().GetFeeQuoterTokenUpdates()), + FChain: c.tr.fChainFromProto(pbObs.GetTokenPriceObs().GetFChain()), + Timestamp: pbObs.GetTokenPriceObs().GetTimestamp().AsTime(), }, ChainFeeObs: chainfee.Observation{ - FeeComponents: c.tr.feeComponentsFromProto(pbObs.ChainFeeObs.FeeComponents), - NativeTokenPrices: c.tr.nativeTokenPricesFromProto(pbObs.ChainFeeObs.NativeTokenPrices), - ChainFeeUpdates: c.tr.chainFeeUpdatesFromProto(pbObs.ChainFeeObs.ChainFeeUpdates), - FChain: c.tr.fChainFromProto(pbObs.ChainFeeObs.FChain), - TimestampNow: pbObs.ChainFeeObs.TimestampNow.AsTime(), + FeeComponents: c.tr.feeComponentsFromProto(pbObs.GetChainFeeObs().GetFeeComponents()), + NativeTokenPrices: c.tr.nativeTokenPricesFromProto(pbObs.GetChainFeeObs().GetNativeTokenPrices()), + ChainFeeUpdates: c.tr.chainFeeUpdatesFromProto(pbObs.GetChainFeeObs().GetChainFeeUpdates()), + FChain: c.tr.fChainFromProto(pbObs.GetChainFeeObs().GetFChain()), + TimestampNow: pbObs.GetChainFeeObs().GetTimestampNow().AsTime(), }, DiscoveryObs: discoverytypes.Observation{ - FChain: c.tr.fChainFromProto(pbObs.DiscoveryObs.FChain), - Addresses: c.tr.discoveryAddressesFromProto(pbObs.DiscoveryObs.ContractNames.Addresses), + FChain: c.tr.fChainFromProto(pbObs.GetDiscoveryObs().GetFChain()), + Addresses: c.tr.discoveryAddressesFromProto(pbObs.GetDiscoveryObs().GetContractNames().GetAddresses()), }, - FChain: c.tr.fChainFromProto(pbObs.FChain), - OnChainPriceOcrSeqNum: pbObs.OnchainPriceOcrSeqNum, + FChain: c.tr.fChainFromProto(pbObs.GetFChain()), + OnChainPriceOcrSeqNum: pbObs.GetOnchainPriceOcrSeqNum(), }, nil } @@ -198,26 +206,42 @@ func (c *CommitCodecProto) DecodeOutcome(data []byte) (committypes.Outcome, erro return committypes.Outcome{}, fmt.Errorf("proto unmarshal outcome: %w", err) } + rootsToReport, err := c.tr.merkleRootsFromProto(pbOutcome.GetMerkleRootOutcome().GetRootsToReport()) + if err != nil { + return committypes.Outcome{}, fmt.Errorf("merkle roots from proto: %w", err) + } + sigs, err := c.tr.ccipRmnSignaturesFromProto(pbOutcome.GetMerkleRootOutcome().GetRmnReportSignatures()) + if err != nil { + return committypes.Outcome{}, fmt.Errorf("rmn report signatures from proto: %w", err) + } + rmnRemoteCfg, err := c.tr.rmnRemoteConfigFromProto(pbOutcome.GetMerkleRootOutcome().GetRmnRemoteCfg()) + if err != nil { + return committypes.Outcome{}, fmt.Errorf("rmn remote config from proto: %w", err) + } return committypes.Outcome{ MerkleRootOutcome: merkleroot.Outcome{ - OutcomeType: merkleroot.OutcomeType(pbOutcome.MerkleRootOutcome.OutcomeType), - RangesSelectedForReport: c.tr.chainRangeFromProto(pbOutcome.MerkleRootOutcome.RangesSelectedForReport), - RootsToReport: c.tr.merkleRootsFromProto(pbOutcome.MerkleRootOutcome.RootsToReport), - RMNEnabledChains: c.tr.rmnEnabledChainsFromProto(pbOutcome.MerkleRootOutcome.RmnEnabledChains), - OffRampNextSeqNums: c.tr.seqNumChainFromProto(pbOutcome.MerkleRootOutcome.OffRampNextSeqNums), - ReportTransmissionCheckAttempts: uint(pbOutcome.MerkleRootOutcome.ReportTransmissionCheckAttempts), - RMNReportSignatures: c.tr.ccipRmnSignaturesFromProto(pbOutcome.MerkleRootOutcome.RmnReportSignatures), - RMNRemoteCfg: c.tr.rmnRemoteConfigFromProto(pbOutcome.MerkleRootOutcome.RmnRemoteCfg), + OutcomeType: merkleroot.OutcomeType(pbOutcome.GetMerkleRootOutcome().GetOutcomeType()), + RangesSelectedForReport: c.tr.chainRangeFromProto( + pbOutcome.GetMerkleRootOutcome().GetRangesSelectedForReport(), + ), + RootsToReport: rootsToReport, + RMNEnabledChains: c.tr.rmnEnabledChainsFromProto( + pbOutcome.GetMerkleRootOutcome().GetRmnEnabledChains(), + ), + OffRampNextSeqNums: c.tr.seqNumChainFromProto(pbOutcome.GetMerkleRootOutcome().GetOffRampNextSeqNums()), + ReportTransmissionCheckAttempts: uint(pbOutcome.GetMerkleRootOutcome().GetReportTransmissionCheckAttempts()), + RMNReportSignatures: sigs, + RMNRemoteCfg: rmnRemoteCfg, }, TokenPriceOutcome: tokenprice.Outcome{ - TokenPrices: c.tr.feedTokenPricesFromProto(pbOutcome.TokenPriceOutcome.TokenPrices), + TokenPrices: c.tr.feedTokenPricesFromProto(pbOutcome.GetTokenPriceOutcome().GetTokenPrices()), }, ChainFeeOutcome: chainfee.Outcome{ - GasPrices: c.tr.gasPriceChainFromProto(pbOutcome.ChainFeeOutcome.GasPrices), + GasPrices: c.tr.gasPriceChainFromProto(pbOutcome.GetChainFeeOutcome().GetGasPrices()), }, MainOutcome: committypes.MainOutcome{ - InflightPriceOcrSequenceNumber: cciptypes.SeqNum(pbOutcome.MainOutcome.InflightPriceOcrSequenceNumber), - RemainingPriceChecks: int(pbOutcome.MainOutcome.RemainingPriceChecks), + InflightPriceOcrSequenceNumber: cciptypes.SeqNum(pbOutcome.GetMainOutcome().GetInflightPriceOcrSequenceNumber()), + RemainingPriceChecks: int(pbOutcome.GetMainOutcome().GetRemainingPriceChecks()), }, }, nil } diff --git a/pkg/ocrtypecodec/v1/compatability_test.go b/pkg/ocrtypecodec/v1/compatability_test.go index b2f888dfc9..4c971ac9cc 100644 --- a/pkg/ocrtypecodec/v1/compatability_test.go +++ b/pkg/ocrtypecodec/v1/compatability_test.go @@ -7,6 +7,7 @@ import ( "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-ccip/commit/committypes" "github.com/smartcontractkit/chainlink-ccip/pkg/ocrtypecodec/v1/ocrtypecodecpb" "github.com/stretchr/testify/require" @@ -225,3 +226,32 @@ func TestEdgeCases(t *testing.T) { require.Nil(t, decoded.Report.ChainReports) }) } + +func TestDecodeObservationHandlesMalformedProto(t *testing.T) { + commitCodec := v1.NewCommitCodecProto() + t.Run("ShortMerkleRoot", func(t *testing.T) { + + pb := &ocrtypecodecpb.CommitObservation{ + MerkleRootObs: &ocrtypecodecpb.MerkleRootObservation{ + MerkleRoots: []*ocrtypecodecpb.MerkleRootChain{ + { + ChainSel: 1, + SeqNumsRange: &ocrtypecodecpb.SeqNumRange{ + MinMsgNr: 1, + MaxMsgNr: 10, + }, + MerkleRoot: []byte{0x01}, + }, + }, + }, + } + + data, err := proto.Marshal(pb) + require.NoError(t, err) + + res, err := commitCodec.DecodeObservation(data) + require.Error(t, err) + require.ErrorContains(t, err, "merkle root must be 32 bytes") + require.Equal(t, committypes.Observation{}, res) + }) +} diff --git a/pkg/ocrtypecodec/v1/exec.go b/pkg/ocrtypecodec/v1/exec.go index 93f5b5f6b5..1d1b7e7bce 100644 --- a/pkg/ocrtypecodec/v1/exec.go +++ b/pkg/ocrtypecodec/v1/exec.go @@ -55,27 +55,27 @@ func (e *ExecCodecProto) EncodeObservation(observation exectypes.Observation) ([ return proto.Marshal(pbObs) } -func (e *ExecCodecProto) DecodeObservation(data []byte) (exectypes.Observation, error) { +func (e *ExecCodecProto) DecodeObservation(data []byte) (obs exectypes.Observation, err error) { if len(data) == 0 { - return exectypes.Observation{}, nil + return obs, nil } pbObs := &ocrtypecodecpb.ExecObservation{} - if err := proto.Unmarshal(data, pbObs); err != nil { - return exectypes.Observation{}, fmt.Errorf("proto unmarshal ExecObservation: %w", err) + if err = proto.Unmarshal(data, pbObs); err != nil { + return obs, fmt.Errorf("proto unmarshal ExecObservation: %w", err) } return exectypes.Observation{ - CommitReports: e.tr.commitReportsFromProto(pbObs.CommitReports), - Messages: e.tr.messageObservationsFromProto(pbObs.SeqNumsToMsgs), - Hashes: e.tr.messageHashesFromProto(pbObs.MsgHashes), - TokenData: e.tr.tokenDataObservationsFromProto(pbObs.TokenDataObservations.TokenData), - Nonces: e.tr.nonceObservationsFromProto(pbObs.Nonces), + CommitReports: e.tr.commitReportsFromProto(pbObs.GetCommitReports()), + Messages: e.tr.messageObservationsFromProto(pbObs.GetSeqNumsToMsgs()), + Hashes: e.tr.messageHashesFromProto(pbObs.GetMsgHashes()), + TokenData: e.tr.tokenDataObservationsFromProto(pbObs.GetTokenDataObservations().GetTokenData()), + Nonces: e.tr.nonceObservationsFromProto(pbObs.GetNonces()), Contracts: discoverytypes.Observation{ - FChain: e.tr.fChainFromProto(pbObs.Contracts.FChain), - Addresses: e.tr.discoveryAddressesFromProto(pbObs.Contracts.ContractNames.Addresses), + FChain: e.tr.fChainFromProto(pbObs.GetContracts().GetFChain()), + Addresses: e.tr.discoveryAddressesFromProto(pbObs.GetContracts().GetContractNames().GetAddresses()), }, - FChain: e.tr.fChainFromProto(pbObs.FChain), + FChain: e.tr.fChainFromProto(pbObs.GetFChain()), }, nil } @@ -117,16 +117,16 @@ func (e *ExecCodecProto) DecodeOutcome(data []byte) (exectypes.Outcome, error) { } otcm := exectypes.Outcome{ - State: exectypes.PluginState(pbOtcm.PluginState), - CommitReports: e.tr.commitDataSliceFromProto(pbOtcm.CommitReports), - Reports: e.tr.execPluginReportsFromProto(pbOtcm.ExecutePluginReports), + State: exectypes.PluginState(pbOtcm.GetPluginState()), + CommitReports: e.tr.commitDataSliceFromProto(pbOtcm.GetCommitReports()), + Reports: e.tr.execPluginReportsFromProto(pbOtcm.GetExecutePluginReports()), } // Decode the legacy Report field into the new Reports field. This way the plugin layer doesn't // need to worry about type migration. // TODO: Remove temporary migration code after a few releases. if pbOtcm.ExecutePluginReport != nil { - otcm.Reports = e.tr.execPluginReportsFromProto([]*ocrtypecodecpb.ExecutePluginReport{pbOtcm.ExecutePluginReport}) + otcm.Reports = e.tr.execPluginReportsFromProto([]*ocrtypecodecpb.ExecutePluginReport{pbOtcm.GetExecutePluginReport()}) } // Decode the new report format into the legacy field as an intermediate step for implementing this feature. diff --git a/pkg/ocrtypecodec/v1/translate.go b/pkg/ocrtypecodec/v1/translate.go index 53412d6d4b..211e54ef32 100644 --- a/pkg/ocrtypecodec/v1/translate.go +++ b/pkg/ocrtypecodec/v1/translate.go @@ -1,6 +1,7 @@ package v1 import ( + "fmt" "maps" "math/big" @@ -65,19 +66,22 @@ func (t *protoTranslator) ccipRmnSignaturesToProto( func (t *protoTranslator) ccipRmnSignaturesFromProto( pbSigs []*ocrtypecodecpb.SignatureEcdsa, -) []cciptypes.RMNECDSASignature { +) ([]cciptypes.RMNECDSASignature, error) { var sigs []cciptypes.RMNECDSASignature if len(pbSigs) > 0 { sigs = make([]cciptypes.RMNECDSASignature, len(pbSigs)) } for i := range pbSigs { + if len(pbSigs[i].R) != 32 || len(pbSigs[i].S) != 32 { + return nil, fmt.Errorf("signature must be 32 bytes: %v", pbSigs[i]) + } sigs[i] = cciptypes.RMNECDSASignature{ R: cciptypes.Bytes32(pbSigs[i].R), S: cciptypes.Bytes32(pbSigs[i].S), } } - return sigs + return sigs, nil } func (t *protoTranslator) laneUpdatesToProto( @@ -145,13 +149,16 @@ func (t *protoTranslator) merkleRootsToProto( func (t *protoTranslator) merkleRootsFromProto( pbMerkleRoots []*ocrtypecodecpb.MerkleRootChain, -) []cciptypes.MerkleRootChain { +) ([]cciptypes.MerkleRootChain, error) { var merkleRoots []cciptypes.MerkleRootChain if len(pbMerkleRoots) > 0 { merkleRoots = make([]cciptypes.MerkleRootChain, len(pbMerkleRoots)) } for i, mr := range pbMerkleRoots { + if len(mr.MerkleRoot) != 32 { + return nil, fmt.Errorf("merkle root must be 32 bytes: %v", mr.MerkleRoot) + } merkleRoots[i] = cciptypes.MerkleRootChain{ ChainSel: cciptypes.ChainSelector(mr.ChainSel), OnRampAddress: mr.OnRampAddress, @@ -163,7 +170,7 @@ func (t *protoTranslator) merkleRootsFromProto( } } - return merkleRoots + return merkleRoots, nil } func (t *protoTranslator) rmnEnabledChainsToProto(rmnEnabled map[cciptypes.ChainSelector]bool) map[uint64]bool { @@ -241,7 +248,7 @@ func (t *protoTranslator) rmnRemoteConfigToProto(rmnRemoteCfg cciptypes.RemoteCo func (t *protoTranslator) rmnRemoteConfigFromProto( pbRmnRemoteCfg *ocrtypecodecpb.RmnRemoteConfig, -) cciptypes.RemoteConfig { +) (cciptypes.RemoteConfig, error) { var rmnSigners []cciptypes.RemoteSignerInfo if len(pbRmnRemoteCfg.Signers) > 0 { rmnSigners = make([]cciptypes.RemoteSignerInfo, len(pbRmnRemoteCfg.Signers)) @@ -252,6 +259,13 @@ func (t *protoTranslator) rmnRemoteConfigFromProto( NodeIndex: s.NodeIndex, } } + if len(pbRmnRemoteCfg.ConfigDigest) != 32 { + return cciptypes.RemoteConfig{}, fmt.Errorf("config digest must be 32 bytes: %v", pbRmnRemoteCfg.ConfigDigest) + } + if len(pbRmnRemoteCfg.RmnReportVersion) != 32 { + return cciptypes.RemoteConfig{}, fmt.Errorf( + "rmn report version must be 32 bytes: %v", pbRmnRemoteCfg.RmnReportVersion) + } return cciptypes.RemoteConfig{ ContractAddress: pbRmnRemoteCfg.ContractAddress, @@ -260,7 +274,7 @@ func (t *protoTranslator) rmnRemoteConfigFromProto( FSign: pbRmnRemoteCfg.FSign, ConfigVersion: pbRmnRemoteCfg.ConfigVersion, RmnReportVersion: cciptypes.Bytes32(pbRmnRemoteCfg.RmnReportVersion), - } + }, nil } func (t *protoTranslator) fChainToProto(fChain map[cciptypes.ChainSelector]int) map[uint64]int32 { From c436547ae48f3d5a08e4cfe1979661d687b99ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tob=C3=ADas=20Lichtig?= Date: Wed, 4 Mar 2026 18:36:38 -0500 Subject: [PATCH 22/41] Create 1.6.1 changesets for solana (#1761) * Create deploymnet/v1_6_1 * Add new op * Port other 1.6.0 changes to 1.6.1 * Change other 1.6.0 to 1.6.1 * Add new sequence * Remove code from 1.6.0 that is still under development from 1.6.1 * Fix go mods * Add changeset * Fix comment * Add validator * Fix changeset input and factory * Bump devenv chainlink-ton * Go mod tidy * Add timelock support to changeset * Remove version filter * Apply PR feedback * Move everything back into 1.6.0 * Remove TODO * Only use 1.6.1 bindings for that new op * Run go mod tidy --------- Co-authored-by: Agustina Aldasoro --- chains/solana/deployment/go.mod | 4 +- chains/solana/deployment/go.sum | 4 +- .../v1_6_0/changesets/rmn_changesets.go | 69 +++++++++++++++++++ .../operations/rmn_remote/rmn_remote.go | 56 ++++++++++++++- .../sequences/set_rmn_event_authorities.go | 66 ++++++++++++++++++ devenv/go.mod | 6 +- devenv/go.sum | 4 +- integration-tests/go.mod | 4 +- integration-tests/go.sum | 4 +- 9 files changed, 201 insertions(+), 16 deletions(-) create mode 100644 chains/solana/deployment/v1_6_0/changesets/rmn_changesets.go create mode 100644 chains/solana/deployment/v1_6_0/sequences/set_rmn_event_authorities.go diff --git a/chains/solana/deployment/go.mod b/chains/solana/deployment/go.mod index 165adcaf2c..f550071649 100644 --- a/chains/solana/deployment/go.mod +++ b/chains/solana/deployment/go.mod @@ -24,8 +24,8 @@ require ( github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260304183236-7a28a8641246 + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 diff --git a/chains/solana/deployment/go.sum b/chains/solana/deployment/go.sum index 2ad095de78..42bfa5e534 100644 --- a/chains/solana/deployment/go.sum +++ b/chains/solana/deployment/go.sum @@ -800,8 +800,8 @@ github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0ku github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 h1:cMzoreLtepEiB5pfYrvreXNoZideVRzQQKNr5Io5J7M= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/chains/solana/deployment/v1_6_0/changesets/rmn_changesets.go b/chains/solana/deployment/v1_6_0/changesets/rmn_changesets.go new file mode 100644 index 0000000000..7738294f9e --- /dev/null +++ b/chains/solana/deployment/v1_6_0/changesets/rmn_changesets.go @@ -0,0 +1,69 @@ +package changesets + +import ( + "fmt" + + "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" + _ "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/sequences" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +type RMNRemoteSetEventAuthoritiesChangesetInput struct { + ChainSelector uint64 `json:"chainSelector"` + MCMS mcms.Input `json:"mcms"` +} + +func RMNRemoteSetEventAuthoritiesChangeset() cldf.ChangeSetV2[RMNRemoteSetEventAuthoritiesChangesetInput] { + return cldf.CreateChangeSet(rmnSetEventAuthoritiesApply, rmnSetEventAuthoritiesVerify) +} + +func rmnSetEventAuthoritiesVerify(env cldf.Environment, input RMNRemoteSetEventAuthoritiesChangesetInput) error { + if err := cldf.IsValidChainSelector(input.ChainSelector); err != nil { + return fmt.Errorf("invalid chain selector: %d - %w", input.ChainSelector, err) + } + if !env.BlockChains.Exists(input.ChainSelector) { + return fmt.Errorf("chain with selector %d does not exist", input.ChainSelector) + } + + if err := input.MCMS.Validate(); err != nil { + return fmt.Errorf("invalid MCMS configuration: %w", err) + } + + return nil +} + +func rmnSetEventAuthoritiesApply(e cldf.Environment, input RMNRemoteSetEventAuthoritiesChangesetInput) (cldf.ChangesetOutput, error) { + reports := make([]cldf_ops.Report[any, any], 0) + + // Prepare sequence input + seqInput := sequences.RMNRemoteSetEventAuthoritiesSequenceInput{ + DataStore: e.DataStore, + Selector: input.ChainSelector, + } + + report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, sequences.SetRMNRemoteEventAuthorities, e.BlockChains, seqInput) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to set rmn event authorities: %w", err) + } + + reports = append(reports, report.ExecutionReports...) + + // Create the datastore with the addresses from the report + ds := datastore.NewMemoryDataStore() + for _, addr := range report.Output.Addresses { + if err := ds.Addresses().Add(addr); err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to add address to datastore: %w", err) + } + } + + return changesets. + NewOutputBuilder(e, changesets.GetRegistry()). + WithReports(reports). + WithDataStore(ds). + WithBatchOps(report.Output.BatchOps). + Build(input.MCMS) +} diff --git a/chains/solana/deployment/v1_6_0/operations/rmn_remote/rmn_remote.go b/chains/solana/deployment/v1_6_0/operations/rmn_remote/rmn_remote.go index 5bfe5ab44f..fa3fd59902 100644 --- a/chains/solana/deployment/v1_6_0/operations/rmn_remote/rmn_remote.go +++ b/chains/solana/deployment/v1_6_0/operations/rmn_remote/rmn_remote.go @@ -15,14 +15,17 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/rmn_remote" + rmn161 "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v1_6_1/rmn_remote" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" api "github.com/smartcontractkit/chainlink-ccip/deployment/fastcurse" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" ) -var ContractType cldf_deployment.ContractType = "RMNRemote" -var ProgramName = "rmn_remote" -var Version *semver.Version = semver.MustParse("1.6.0") +var ( + ContractType cldf_deployment.ContractType = "RMNRemote" + ProgramName = "rmn_remote" + Version *semver.Version = semver.MustParse("1.6.0") +) type CurseInput struct { Subjects []api.Subject @@ -256,6 +259,53 @@ var Uncurse = operations.NewOperation( }, ) +type EventAuthoritiesInput struct { + EventAuthorities []solana.PublicKey + RMNRemote solana.PublicKey + RMNRemoteConfigPDA solana.PublicKey +} + +var SetEventAuthorities = operations.NewOperation( + "rmn-remote:set-event-authorities", + Version, + "Sets the event authorities list on the RMNRemote contract", + func(b operations.Bundle, chain cldf_solana.Chain, input EventAuthoritiesInput) (sequences.OnChainOutput, error) { + rmn161.SetProgramID(input.RMNRemote) + + authority := GetAuthority(chain, input.RMNRemote) + + ixn, err := rmn161.NewSetEventAuthoritiesInstruction( + input.EventAuthorities, + input.RMNRemoteConfigPDA, + authority, + solana.SystemProgramID, + ).ValidateAndBuild() + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to build set event authorities instruction: %w", err) + } + + batches := make([]types.BatchOperation, 0) + if authority != chain.DeployerKey.PublicKey() { + b, err := utils.BuildMCMSBatchOperation( + chain.Selector, + []solana.Instruction{ixn}, + input.RMNRemote.String(), + ContractType.String(), + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to execute or create batch: %w", err) + } + batches = append(batches, b) + } else { + err := chain.Confirm([]solana.Instruction{ixn}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to confirm set-event-authorities instruction: %w", err) + } + } + return sequences.OnChainOutput{BatchOps: batches}, nil + }, +) + func GetAuthority(chain cldf_solana.Chain, program solana.PublicKey) solana.PublicKey { programData := rmn_remote.Config{} rmnRemoteConfigPDA, _, _ := state.FindRMNRemoteConfigPDA(program) diff --git a/chains/solana/deployment/v1_6_0/sequences/set_rmn_event_authorities.go b/chains/solana/deployment/v1_6_0/sequences/set_rmn_event_authorities.go new file mode 100644 index 0000000000..b52b881e95 --- /dev/null +++ b/chains/solana/deployment/v1_6_0/sequences/set_rmn_event_authorities.go @@ -0,0 +1,66 @@ +package sequences + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/gagliardetto/solana-go" + rmnops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/rmn_remote" + "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" +) + +type RMNRemoteSetEventAuthoritiesSequenceInput struct { + DataStore datastore.DataStore + Selector uint64 +} + +var SetRMNRemoteEventAuthorities = cldf_ops.NewSequence( + "rmn-remote:set-event-authorities", + semver.MustParse("1.6.1"), + "Sets event authorities on the RMNRemote 1.6.1 contract", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input RMNRemoteSetEventAuthoritiesSequenceInput) (sequences.OnChainOutput, error) { + chain, ok := chains.SolanaChains()[input.Selector] + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("solana chain with selector %d not found", input.Selector) + } + + rmnAddrBytes, err := (&SolanaAdapter{}).GetRMNRemoteAddress(input.DataStore, input.Selector) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get RMNRemote address: %w", err) + } + rmnPubkey := solana.PublicKeyFromBytes(rmnAddrBytes) + + routerAddrBytes, err := (&SolanaAdapter{}).GetRouterAddress(input.DataStore, input.Selector) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get Router address: %w", err) + } + routerPubkey := solana.PublicKeyFromBytes(routerAddrBytes) + + rmnConfigPDA, _, err := state.FindRMNRemoteConfigPDA(rmnPubkey) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to find RMNRemote config PDA: %w", err) + } + routerSignerPDA, _, err := state.FindFeeBillingSignerPDA(routerPubkey) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to find Router Signer PDA: %w", err) + } + + out, err := cldf_ops.ExecuteOperation(b, + rmnops.SetEventAuthorities, + chain, + rmnops.EventAuthoritiesInput{ + EventAuthorities: []solana.PublicKey{routerSignerPDA}, + RMNRemote: rmnPubkey, + RMNRemoteConfigPDA: rmnConfigPDA, + }, + ) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to set event authorities: %w", err) + } + return out.Output, nil + }, +) diff --git a/devenv/go.mod b/devenv/go.mod index ee9701eadb..d8dae5b582 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -35,9 +35,9 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 @@ -348,7 +348,7 @@ require ( github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect - github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 // indirect + github.com/smartcontractkit/chainlink-ton v0.0.0-20260304145142-d4cf6759e50b // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/devenv/go.sum b/devenv/go.sum index c6454625ec..ac225534d9 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -1227,8 +1227,8 @@ github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 h1:ZJ/8Jx6B github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 h1:QFO9Ar1zY9SHj//7LXWq5caVrfyTFrkRcfkMQeSOAaQ= github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2/go.mod h1:OLczwaAvyObFG+eq4tQHkWqkbPBB0cHkZj0JzY3inik= -github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 h1:+5wW8HbwNhHEBOanhSiT7sxyFAAeDP9TvQ6GwJ4STps= -github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0/go.mod h1:IZvH2r16xcQvVLB7AtjU112wnHfEku+29OlI1vCQHCQ= +github.com/smartcontractkit/chainlink-ton v0.0.0-20260304145142-d4cf6759e50b h1:GsN7iAbxmNxm6cgJiNCJKdhoksYCEB19w5yW5bDD37o= +github.com/smartcontractkit/chainlink-ton v0.0.0-20260304145142-d4cf6759e50b/go.mod h1:FDDjLuc4vrfclu3JHkMaREg0XZz7Lw1MK47Z4jJ4U5Q= github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122 h1:ZTyy8Pf4mhOHoKEm1UfnYYiqgaCIeg1TGp3SD5w3m2Y= github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122/go.mod h1:w83O9EU6BEtAJ1FifeVAqp1mQNISnH3BY+MLbYX5PBg= github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122 h1:3hOkTsTpsdTnJUB1vi6By7abpHvUrf4yHqdiGFCJs1Q= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 235757b299..90efa4ed17 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -27,9 +27,9 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d + github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 github.com/smartcontractkit/chainlink-evm v0.3.3 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index fba177ce43..4c96321dbc 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -856,8 +856,8 @@ github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0ku github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a h1:jrP1CEWevxo5Ls7C/leXfO24LUZ53uqPMVvX+D7DDV0= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a/go.mod h1:1WcontO9PeuKdUf5HXfs3nuICtzUvFNnyCmrHkTCF9Y= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= From 4b3d3bef04800fa4152561c9839cb204c22d6533 Mon Sep 17 00:00:00 2001 From: Rens Rooimans <5789419+RensR@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:22:37 +0100 Subject: [PATCH 23/41] Add fq v2 ops to main (#1790) * add fq v2 ops * fix selector return type, inefficient encoding & nil return * fix nits --- chains/evm/deployment/go.mod | 2 +- .../deployment/utils/datastore/datastore.go | 28 +- .../deployment/v1_6_0/sequences/adapter.go | 75 +- .../deployment/v1_6_0/sequences/fee_quoter.go | 39 +- .../v2_0_0/adapters/feequoterupdater.go | 81 ++ .../operations/fee_quoter/fee_quoter.go | 359 +++++++ .../deployment/v2_0_0/sequences/fee_quoter.go | 562 +++++++++++ .../v2_0_0/sequences/fee_quoter_test.go | 414 ++++++++ ...sequence_fee_quoter_input_creation_test.go | 948 ++++++++++++++++++ deployment/deploy/feequoterupdater.go | 11 + deployment/utils/common.go | 23 +- deployment/utils/datastore/datastore.go | 135 ++- 12 files changed, 2612 insertions(+), 65 deletions(-) create mode 100644 chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go create mode 100644 chains/evm/deployment/v2_0_0/operations/fee_quoter/fee_quoter.go create mode 100644 chains/evm/deployment/v2_0_0/sequences/fee_quoter.go create mode 100644 chains/evm/deployment/v2_0_0/sequences/fee_quoter_test.go create mode 100644 chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go create mode 100644 deployment/deploy/feequoterupdater.go diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index ca3aa297c6..f643fc0276 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -30,6 +30,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/xssnick/tonutils-go v1.14.1 github.com/zksync-sdk/zksync2-go v1.1.1-0.20250620124214-2c742ee399c6 + golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc golang.org/x/sync v0.19.0 ) @@ -272,7 +273,6 @@ require ( go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect golang.org/x/crypto v0.47.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/sys v0.40.0 // indirect golang.org/x/term v0.39.0 // indirect diff --git a/chains/evm/deployment/utils/datastore/datastore.go b/chains/evm/deployment/utils/datastore/datastore.go index f0f867efda..e38e7936d4 100644 --- a/chains/evm/deployment/utils/datastore/datastore.go +++ b/chains/evm/deployment/utils/datastore/datastore.go @@ -9,21 +9,6 @@ import ( datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" ) -// ToByteArray formats a datastore.AddressRef into a byte slice. -func ToByteArray(ref datastore.AddressRef) (bytes []byte, err error) { - if ref.Address == "" { - return nil, fmt.Errorf("address is empty in ref: %s", datastore_utils.SprintRef(ref)) - } - if !common.IsHexAddress(ref.Address) { - return nil, fmt.Errorf("address is not a valid hex address in ref: %s", datastore_utils.SprintRef(ref)) - } - addr, err := ToEVMAddress(ref) - if err != nil { - return nil, err - } - return addr.Bytes(), nil -} - // ToEVMAddress formats a datastore.AddressRef into an ethereum common.Address. func ToEVMAddress(ref datastore.AddressRef) (commonAddress common.Address, err error) { if ref.Address == "" { @@ -35,11 +20,20 @@ func ToEVMAddress(ref datastore.AddressRef) (commonAddress common.Address, err e return common.HexToAddress(ref.Address), nil } +// ToEVMAddressBytes formats a datastore.AddressRef into a 20-byte ethereum address. +func ToEVMAddressBytes(ref datastore.AddressRef) (paddedAddress []byte, err error) { + addr, err := ToEVMAddress(ref) + if err != nil { + return nil, err + } + return addr.Bytes(), nil +} + // ToPaddedEVMAddress formats a datastore.AddressRef into a 32-byte padded ethereum address. func ToPaddedEVMAddress(ref datastore.AddressRef) (paddedAddress []byte, err error) { - addr, err := ToEVMAddress(ref) + addr, err := ToEVMAddressBytes(ref) if err != nil { return nil, err } - return common.LeftPadBytes(addr.Bytes(), 32), nil + return common.LeftPadBytes(addr, 32), nil } diff --git a/chains/evm/deployment/v1_6_0/sequences/adapter.go b/chains/evm/deployment/v1_6_0/sequences/adapter.go index 640eb75f60..d9ee170999 100644 --- a/chains/evm/deployment/v1_6_0/sequences/adapter.go +++ b/chains/evm/deployment/v1_6_0/sequences/adapter.go @@ -1,29 +1,30 @@ package sequences import ( + "fmt" "math/big" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + chain_selectors "github.com/smartcontractkit/chain-selectors" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + "github.com/smartcontractkit/chainlink-deployments-framework/operations" evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - link "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/link" - weth "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/weth" + "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" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" pingpongdapp "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/ping_pong_dapp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" - tokensapi "github.com/smartcontractkit/chainlink-ccip/deployment/tokens" - datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" - cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" - "github.com/smartcontractkit/chainlink-deployments-framework/operations" - deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" ccipapi "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" + tokensapi "github.com/smartcontractkit/chainlink-ccip/deployment/tokens" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" ) func init() { @@ -45,7 +46,7 @@ func (a *EVMAdapter) GetOnRampAddress(ds datastore.DataStore, chainSelector uint ChainSelector: chainSelector, Type: datastore.ContractType(onramp.ContractType), Version: onramp.Version, - }, chainSelector, evm_datastore_utils.ToByteArray) + }, chainSelector, evm_datastore_utils.ToEVMAddressBytes) if err != nil { return nil, err } @@ -57,7 +58,7 @@ func (a *EVMAdapter) GetOffRampAddress(ds datastore.DataStore, chainSelector uin ChainSelector: chainSelector, Type: datastore.ContractType(offramp.ContractType), Version: offramp.Version, - }, chainSelector, evm_datastore_utils.ToByteArray) + }, chainSelector, evm_datastore_utils.ToEVMAddressBytes) if err != nil { return nil, err } @@ -70,24 +71,11 @@ func (a *EVMAdapter) GetFQAddress(ds datastore.DataStore, chainSelector uint64) datastore.AddressRefByType(datastore.ContractType(fee_quoter.ContractType)), datastore.AddressRefByChainSelector(chainSelector), ) - latestVersion := semver.MustParse("1.6.0") - tooHighVersion := semver.MustParse("1.7.0") - var addr []byte - var err error - for _, ref := range refs { - v := ref.Version - // we want the latest version below 1.7.0 - if v.GreaterThanEqual(latestVersion) && - v.LessThan(tooHighVersion) { - latestVersion = v - addr, err = evm_datastore_utils.ToByteArray(ref) - if err != nil { - return nil, err - } - } - + ref, err := GetFeeQuoterAddress(refs, chainSelector) + if err != nil { + return nil, err } - return addr, nil + return evm_datastore_utils.ToEVMAddressBytes(ref) } func (a *EVMAdapter) GetRouterAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error) { @@ -95,7 +83,7 @@ func (a *EVMAdapter) GetRouterAddress(ds datastore.DataStore, chainSelector uint ChainSelector: chainSelector, Type: datastore.ContractType(router.ContractType), Version: router.Version, - }, chainSelector, evm_datastore_utils.ToByteArray) + }, chainSelector, evm_datastore_utils.ToEVMAddressBytes) if err != nil { return nil, err } @@ -122,7 +110,7 @@ func (a *EVMAdapter) GetPingPongDemoAddress(ds datastore.DataStore, chainSelecto ChainSelector: chainSelector, Type: datastore.ContractType(pingpongdapp.ContractType), Version: pingpongdapp.Version, - }, chainSelector, evm_datastore_utils.ToByteArray) + }, chainSelector, evm_datastore_utils.ToEVMAddressBytes) if err != nil { return nil, err } @@ -163,3 +151,32 @@ var ConfigurePingPongSequence = operations.NewSequence( return ccipapi.PingPongOutput{}, nil }, ) + +// GetFeeQuoterAddress returns the address of the fee quoter contract for a given chain selector. +// there may be multiple fee quoter addresses for a chain selector, so we return the one with the latest version below 1.7.0 +// (the next major version on or after 1.6.0). +func GetFeeQuoterAddress(addresses []datastore.AddressRef, chainSelector uint64) (datastore.AddressRef, error) { + var refs []datastore.AddressRef + for _, ref := range addresses { + if ref.ChainSelector == chainSelector && + ref.Type == datastore.ContractType(fee_quoter.ContractType) { + refs = append(refs, ref) + } + } + latestVersion := semver.MustParse("1.6.0") + tooHighVersion := semver.MustParse("1.7.0") + feeQRef := datastore.AddressRef{} + for _, ref := range refs { + v := ref.Version + // we want the latest version below 1.7.0 + if v.GreaterThanEqual(latestVersion) && + v.LessThan(tooHighVersion) { + latestVersion = v + feeQRef = ref + } + } + if feeQRef.Address == "" { + return datastore.AddressRef{}, fmt.Errorf("no fee quoter address found for chain selector %d", chainSelector) + } + return feeQRef, nil +} diff --git a/chains/evm/deployment/v1_6_0/sequences/fee_quoter.go b/chains/evm/deployment/v1_6_0/sequences/fee_quoter.go index 78fe65a5b6..b29ae705f6 100644 --- a/chains/evm/deployment/v1_6_0/sequences/fee_quoter.go +++ b/chains/evm/deployment/v1_6_0/sequences/fee_quoter.go @@ -42,6 +42,12 @@ type FeeQuoterImportConfigSequenceInput struct { } type FeeQuoterImportConfigSequenceOutput struct { + RemoteChainCfgs map[uint64]FeeQuoterImportConfigSequenceOutputPerRemoteChain + PriceUpdaters []common.Address + StaticCfg fqops.StaticConfig +} + +type FeeQuoterImportConfigSequenceOutputPerRemoteChain struct { DestChainCfg fqops.DestChainConfig TokenTransferFeeCfgs map[common.Address]fqops.TokenTransferFeeConfig } @@ -144,7 +150,7 @@ var ( fqAddress := in.Address chainSelector := in.ChainSelector b.Logger.Infof("Importing configuration for FeeQuoter %s on chain %d (%s)", fqAddress.Hex(), chainSelector, evmChain.Name()) - fqOutput := make(map[uint64]FeeQuoterImportConfigSequenceOutput) + fqOutput := make(map[uint64]FeeQuoterImportConfigSequenceOutputPerRemoteChain) destChainConfigs := make(map[uint64]fqops.DestChainConfig) for _, remoteChain := range in.RemoteChains { opsOutput, err := operations.ExecuteOperation(b, fqops.GetDestChainConfig, evmChain, contract.FunctionInput[uint64]{ @@ -157,12 +163,19 @@ var ( "remote chain %d from feequoter %s on chain %d: %w", remoteChain, fqAddress.Hex(), chainSelector, err) } + if !opsOutput.Output.IsEnabled { + continue // skip disabled dest chain configs + } + destChainConfigs[remoteChain] = opsOutput.Output } tokenTransferFeeCfgsPerChain := make(map[uint64]map[common.Address]fqops.TokenTransferFeeConfig) for remoteChain, tokens := range in.TokensPerRemoteChain { + if _, ok := destChainConfigs[remoteChain]; !ok { + continue // skip token transfer fee config fetching if dest chain config is not enabled + } tokenTransferFeeCfgs := make(map[common.Address]fqops.TokenTransferFeeConfig) for _, token := range tokens { opsOutput, err := operations.ExecuteOperation(b, fqops.GetTokenTransferFeeConfig, evmChain, @@ -186,16 +199,36 @@ var ( tokenTransferFeeCfgsPerChain[remoteChain] = tokenTransferFeeCfgs } for remoteChain, destCfg := range destChainConfigs { - fqOutput[remoteChain] = FeeQuoterImportConfigSequenceOutput{ + fqOutput[remoteChain] = FeeQuoterImportConfigSequenceOutputPerRemoteChain{ DestChainCfg: destCfg, TokenTransferFeeCfgs: tokenTransferFeeCfgsPerChain[remoteChain], } } + staticCfgOutput, err := operations.ExecuteOperation(b, fqops.GetStaticConfig, evmChain, contract.FunctionInput[struct{}]{ + Address: fqAddress, + ChainSelector: chainSelector, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get static config from feequoter %s on chain %d: %w", + fqAddress.Hex(), chainSelector, err) + } + priceUpdaters, err := operations.ExecuteOperation(b, fqops.GetAllAuthorizedCallers, evmChain, contract.FunctionInput[struct{}]{ + Address: fqAddress, + ChainSelector: chainSelector, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get all authorized callers from feequoter %s on chain %d: %w", + fqAddress.Hex(), chainSelector, err) + } contractMetadata = []datastore.ContractMetadata{ { Address: fqAddress.Hex(), ChainSelector: chainSelector, - Metadata: fqOutput, + Metadata: FeeQuoterImportConfigSequenceOutput{ + RemoteChainCfgs: fqOutput, + StaticCfg: staticCfgOutput.Output, + PriceUpdaters: priceUpdaters.Output, + }, }, } return sequences.OnChainOutput{ diff --git a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go new file mode 100644 index 0000000000..8bfb23146d --- /dev/null +++ b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go @@ -0,0 +1,81 @@ +package adapters + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + + "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + + fqseq "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" +) + +// FeeQuoterUpdater uses FeeQUpdateArgs any so it implements deploy.FeeQuoterUpdater[any] and can be registered directly. +// The implementation is for v2.0.0 and uses fqseq.FeeQuoterUpdate internally. +type FeeQuoterUpdater[FeeQUpdateArgs any] struct{} + +func (fqu FeeQuoterUpdater[FeeQUpdateArgs]) SequenceFeeQuoterInputCreation() *cldf_ops.Sequence[deploy.FeeQuoterUpdateInput, FeeQUpdateArgs, cldf_chain.BlockChains] { + return cldf_ops.NewSequence( + "fee-quoter-updater:input-creation", + semver.MustParse("2.0.0"), + "Creates FeeQuoterUpdateInput for FeeQuoter update sequence", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input deploy.FeeQuoterUpdateInput) (output FeeQUpdateArgs, err error) { + var zero FeeQUpdateArgs + chain, ok := chains.EVMChains()[input.ChainSelector] + if !ok { + return zero, fmt.Errorf("chain with selector %d not found in environment", input.ChainSelector) + } + // get the FeeQuoterUpdateOutput from both v1.6.0 and v1.5.0 sequences and combine them to create the input for the fee quoter update sequence + report, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV16x, chain, input) + if err != nil { + return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.6.0: %w", err) + } + output16 := report.Output + + report15, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV150, chain, input) + if err != nil { + return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.5.0: %w", err) + } + output15 := report15.Output + // combine the outputs from both sequences to create the input for the fee quoter update sequence + out, err := fqseq.MergeFeeQuoterUpdateOutputs(output16, output15) + if err != nil { + return zero, fmt.Errorf("failed to merge FeeQuoterUpdateInput from v1.6.0 and v1.5.0: %w", err) + } + // check if output is empty, if so, return an error + empty, err := out.IsEmpty() + if err != nil { + return zero, fmt.Errorf("could not create input for fee quoter 2.0.0 update sequence: %w", err) + } + if empty { + return zero, fmt.Errorf("could not create input for fee quoter 2.0.0 update sequence: output is empty") + } + + out.ChainSelector = input.ChainSelector + out.ExistingAddresses = input.ExistingAddresses + return any(out).(FeeQUpdateArgs), nil + }, + ) +} + +func (fqu FeeQuoterUpdater[FeeQUpdateArgs]) SequenceDeployOrUpdateFeeQuoter() *cldf_ops.Sequence[FeeQUpdateArgs, sequences.OnChainOutput, cldf_chain.BlockChains] { + return cldf_ops.NewSequence( + "fee-quoter-v2.0.0:update-sequence", + semver.MustParse("2.0.0"), + "Deploys or fetches existing FeeQuoter contract and applies config updates", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input FeeQUpdateArgs) (output sequences.OnChainOutput, err error) { + fqInput, ok := any(input).(fqseq.FeeQuoterUpdate) + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("expected fqseq.FeeQuoterUpdate, got %T", input) + } + report, err := cldf_ops.ExecuteSequence(b, fqseq.SequenceFeeQuoterUpdate, chains, fqInput) + if err != nil { + return sequences.OnChainOutput{}, err + } + return report.Output, nil + }, + ) +} diff --git a/chains/evm/deployment/v2_0_0/operations/fee_quoter/fee_quoter.go b/chains/evm/deployment/v2_0_0/operations/fee_quoter/fee_quoter.go new file mode 100644 index 0000000000..a0857a1097 --- /dev/null +++ b/chains/evm/deployment/v2_0_0/operations/fee_quoter/fee_quoter.go @@ -0,0 +1,359 @@ +// Code generated by operations-gen. DO NOT EDIT. + +package fee_quoter + +import ( + "math/big" + + "strings" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" +) + +var ContractType cldf_deployment.ContractType = "FeeQuoter" +var Version = semver.MustParse("2.0.0") +var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) + +const FeeQuoterABI = `[{"type":"constructor","inputs":[{"name":"staticConfig","type":"tuple","internalType":"struct FeeQuoter.StaticConfig","components":[{"name":"maxFeeJuelsPerMsg","type":"uint96","internalType":"uint96"},{"name":"linkToken","type":"address","internalType":"address"}]},{"name":"priceUpdaters","type":"address[]","internalType":"address[]"},{"name":"tokenTransferFeeConfigArgs","type":"tuple[]","internalType":"struct FeeQuoter.TokenTransferFeeConfigArgs[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"tokenTransferFeeConfigs","type":"tuple[]","internalType":"struct FeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]","components":[{"name":"token","type":"address","internalType":"address"},{"name":"tokenTransferFeeConfig","type":"tuple","internalType":"struct FeeQuoter.TokenTransferFeeConfig","components":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"},{"name":"isEnabled","type":"bool","internalType":"bool"}]}]}]},{"name":"destChainConfigArgs","type":"tuple[]","internalType":"struct FeeQuoter.DestChainConfigArgs[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"destChainConfig","type":"tuple","internalType":"struct FeeQuoter.DestChainConfig","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}]}],"stateMutability":"nonpayable"},{"type":"function","name":"acceptOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"applyAuthorizedCallerUpdates","inputs":[{"name":"authorizedCallerArgs","type":"tuple","internalType":"struct AuthorizedCallers.AuthorizedCallerArgs","components":[{"name":"addedCallers","type":"address[]","internalType":"address[]"},{"name":"removedCallers","type":"address[]","internalType":"address[]"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"applyDestChainConfigUpdates","inputs":[{"name":"destChainConfigArgs","type":"tuple[]","internalType":"struct FeeQuoter.DestChainConfigArgs[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"destChainConfig","type":"tuple","internalType":"struct FeeQuoter.DestChainConfig","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"applyTokenTransferFeeConfigUpdates","inputs":[{"name":"tokenTransferFeeConfigArgs","type":"tuple[]","internalType":"struct FeeQuoter.TokenTransferFeeConfigArgs[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"tokenTransferFeeConfigs","type":"tuple[]","internalType":"struct FeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]","components":[{"name":"token","type":"address","internalType":"address"},{"name":"tokenTransferFeeConfig","type":"tuple","internalType":"struct FeeQuoter.TokenTransferFeeConfig","components":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"},{"name":"isEnabled","type":"bool","internalType":"bool"}]}]}]},{"name":"tokensToUseDefaultFeeConfigs","type":"tuple[]","internalType":"struct FeeQuoter.TokenTransferFeeConfigRemoveArgs[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"token","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"convertTokenAmount","inputs":[{"name":"fromToken","type":"address","internalType":"address"},{"name":"fromTokenAmount","type":"uint256","internalType":"uint256"},{"name":"toToken","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getAllAuthorizedCallers","inputs":[],"outputs":[{"name":"","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"getAllDestChainConfigs","inputs":[],"outputs":[{"name":"","type":"uint64[]","internalType":"uint64[]"},{"name":"","type":"tuple[]","internalType":"struct FeeQuoter.DestChainConfig[]","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}],"stateMutability":"view"},{"type":"function","name":"getAllTokenTransferFeeConfigs","inputs":[],"outputs":[{"name":"destChainSelectors","type":"uint64[]","internalType":"uint64[]"},{"name":"transferTokens","type":"address[][]","internalType":"address[][]"},{"name":"tokenTransferFeeConfigs","type":"tuple[][]","internalType":"struct FeeQuoter.TokenTransferFeeConfig[][]","components":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"},{"name":"isEnabled","type":"bool","internalType":"bool"}]}],"stateMutability":"view"},{"type":"function","name":"getDestChainConfig","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"}],"outputs":[{"name":"","type":"tuple","internalType":"struct FeeQuoter.DestChainConfig","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}],"stateMutability":"view"},{"type":"function","name":"getDestinationChainGasPrice","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"}],"outputs":[{"name":"","type":"tuple","internalType":"struct Internal.TimestampedPackedUint224","components":[{"name":"value","type":"uint224","internalType":"uint224"},{"name":"timestamp","type":"uint32","internalType":"uint32"}]}],"stateMutability":"view"},{"type":"function","name":"getFeeTokens","inputs":[],"outputs":[{"name":"","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"function","name":"getStaticConfig","inputs":[],"outputs":[{"name":"","type":"tuple","internalType":"struct FeeQuoter.StaticConfig","components":[{"name":"maxFeeJuelsPerMsg","type":"uint96","internalType":"uint96"},{"name":"linkToken","type":"address","internalType":"address"}]}],"stateMutability":"view"},{"type":"function","name":"getTokenAndGasPrices","inputs":[{"name":"token","type":"address","internalType":"address"},{"name":"destChainSelector","type":"uint64","internalType":"uint64"}],"outputs":[{"name":"tokenPrice","type":"uint224","internalType":"uint224"},{"name":"gasPriceValue","type":"uint224","internalType":"uint224"}],"stateMutability":"view"},{"type":"function","name":"getTokenPrice","inputs":[{"name":"token","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"tuple","internalType":"struct Internal.TimestampedPackedUint224","components":[{"name":"value","type":"uint224","internalType":"uint224"},{"name":"timestamp","type":"uint32","internalType":"uint32"}]}],"stateMutability":"view"},{"type":"function","name":"getTokenPrices","inputs":[{"name":"tokens","type":"address[]","internalType":"address[]"}],"outputs":[{"name":"","type":"tuple[]","internalType":"struct Internal.TimestampedPackedUint224[]","components":[{"name":"value","type":"uint224","internalType":"uint224"},{"name":"timestamp","type":"uint32","internalType":"uint32"}]}],"stateMutability":"view"},{"type":"function","name":"getTokenTransferFee","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"token","type":"address","internalType":"address"}],"outputs":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"getTokenTransferFeeConfig","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"token","type":"address","internalType":"address"}],"outputs":[{"name":"tokenTransferFeeConfig","type":"tuple","internalType":"struct FeeQuoter.TokenTransferFeeConfig","components":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"},{"name":"isEnabled","type":"bool","internalType":"bool"}]}],"stateMutability":"view"},{"type":"function","name":"getValidatedFee","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"message","type":"tuple","internalType":"struct Client.EVM2AnyMessage","components":[{"name":"receiver","type":"bytes","internalType":"bytes"},{"name":"data","type":"bytes","internalType":"bytes"},{"name":"tokenAmounts","type":"tuple[]","internalType":"struct Client.EVMTokenAmount[]","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"}]},{"name":"feeToken","type":"address","internalType":"address"},{"name":"extraArgs","type":"bytes","internalType":"bytes"}]}],"outputs":[{"name":"feeTokenAmount","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getValidatedTokenPrice","inputs":[{"name":"token","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint224","internalType":"uint224"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"processMessageArgs","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"feeToken","type":"address","internalType":"address"},{"name":"feeTokenAmount","type":"uint256","internalType":"uint256"},{"name":"extraArgs","type":"bytes","internalType":"bytes"},{"name":"messageReceiver","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"msgFeeJuels","type":"uint256","internalType":"uint256"},{"name":"isOutOfOrderExecution","type":"bool","internalType":"bool"},{"name":"convertedExtraArgs","type":"bytes","internalType":"bytes"},{"name":"tokenReceiver","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"processPoolReturnData","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"onRampTokenTransfers","type":"tuple[]","internalType":"struct Internal.EVM2AnyTokenTransfer[]","components":[{"name":"sourcePoolAddress","type":"address","internalType":"address"},{"name":"destTokenAddress","type":"bytes","internalType":"bytes"},{"name":"extraData","type":"bytes","internalType":"bytes"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"destExecData","type":"bytes","internalType":"bytes"}]},{"name":"sourceTokenAmounts","type":"tuple[]","internalType":"struct Client.EVMTokenAmount[]","components":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"}]}],"outputs":[{"name":"destExecDataPerToken","type":"bytes[]","internalType":"bytes[]"}],"stateMutability":"view"},{"type":"function","name":"quoteGasForExec","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"nonCalldataGas","type":"uint32","internalType":"uint32"},{"name":"calldataSize","type":"uint32","internalType":"uint32"},{"name":"feeToken","type":"address","internalType":"address"}],"outputs":[{"name":"totalGas","type":"uint32","internalType":"uint32"},{"name":"gasCostInUsdCents","type":"uint256","internalType":"uint256"},{"name":"feeTokenPrice","type":"uint256","internalType":"uint256"},{"name":"premiumPercentMultiplier","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"removeFeeTokens","inputs":[{"name":"feeTokensToRemove","type":"address[]","internalType":"address[]"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"resolveLegacyArgs","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"extraArgs","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"tokenReceiver","type":"bytes","internalType":"bytes"},{"name":"gasLimit","type":"uint32","internalType":"uint32"},{"name":"executorArgs","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"transferOwnership","inputs":[{"name":"to","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"typeAndVersion","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"function","name":"updatePrices","inputs":[{"name":"priceUpdates","type":"tuple","internalType":"struct Internal.PriceUpdates","components":[{"name":"tokenPriceUpdates","type":"tuple[]","internalType":"struct Internal.TokenPriceUpdate[]","components":[{"name":"sourceToken","type":"address","internalType":"address"},{"name":"usdPerToken","type":"uint224","internalType":"uint224"}]},{"name":"gasPriceUpdates","type":"tuple[]","internalType":"struct Internal.GasPriceUpdate[]","components":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"usdPerUnitGas","type":"uint224","internalType":"uint224"}]}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"AuthorizedCallerAdded","inputs":[{"name":"caller","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"AuthorizedCallerRemoved","inputs":[{"name":"caller","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"DestChainAdded","inputs":[{"name":"destChainSelector","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"destChainConfig","type":"tuple","indexed":false,"internalType":"struct FeeQuoter.DestChainConfig","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}],"anonymous":false},{"type":"event","name":"DestChainConfigUpdated","inputs":[{"name":"destChainSelector","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"destChainConfig","type":"tuple","indexed":false,"internalType":"struct FeeQuoter.DestChainConfig","components":[{"name":"isEnabled","type":"bool","internalType":"bool"},{"name":"maxDataBytes","type":"uint32","internalType":"uint32"},{"name":"maxPerMsgGasLimit","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destGasPerPayloadByteBase","type":"uint8","internalType":"uint8"},{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"},{"name":"defaultTokenFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"defaultTokenDestGasOverhead","type":"uint32","internalType":"uint32"},{"name":"defaultTxGasLimit","type":"uint32","internalType":"uint32"},{"name":"networkFeeUSDCents","type":"uint16","internalType":"uint16"},{"name":"linkFeeMultiplierPercent","type":"uint8","internalType":"uint8"}]}],"anonymous":false},{"type":"event","name":"FeeTokenAdded","inputs":[{"name":"feeToken","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"FeeTokenRemoved","inputs":[{"name":"feeToken","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferRequested","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"TokenTransferFeeConfigDeleted","inputs":[{"name":"destChainSelector","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"token","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"TokenTransferFeeConfigUpdated","inputs":[{"name":"destChainSelector","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"token","type":"address","indexed":true,"internalType":"address"},{"name":"tokenTransferFeeConfig","type":"tuple","indexed":false,"internalType":"struct FeeQuoter.TokenTransferFeeConfig","components":[{"name":"feeUSDCents","type":"uint32","internalType":"uint32"},{"name":"destGasOverhead","type":"uint32","internalType":"uint32"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"},{"name":"isEnabled","type":"bool","internalType":"bool"}]}],"anonymous":false},{"type":"event","name":"UsdPerTokenUpdated","inputs":[{"name":"token","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"UsdPerUnitGasUpdated","inputs":[{"name":"destChain","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"CannotTransferToSelf","inputs":[]},{"type":"error","name":"DestinationChainNotEnabled","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"}]},{"type":"error","name":"FeeTokenNotSupported","inputs":[{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"Invalid32ByteAddress","inputs":[{"name":"encodedAddress","type":"bytes","internalType":"bytes"}]},{"type":"error","name":"InvalidChainFamilySelector","inputs":[{"name":"chainFamilySelector","type":"bytes4","internalType":"bytes4"}]},{"type":"error","name":"InvalidDataLength","inputs":[{"name":"location","type":"uint8","internalType":"enum ExtraArgsCodec.EncodingErrorLocation"},{"name":"offset","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidDestBytesOverhead","inputs":[{"name":"token","type":"address","internalType":"address"},{"name":"destBytesOverhead","type":"uint32","internalType":"uint32"}]},{"type":"error","name":"InvalidDestChainConfig","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"}]},{"type":"error","name":"InvalidEVMAddress","inputs":[{"name":"encodedAddress","type":"bytes","internalType":"bytes"}]},{"type":"error","name":"InvalidExtraArgsData","inputs":[]},{"type":"error","name":"InvalidExtraArgsTag","inputs":[]},{"type":"error","name":"InvalidSVMExtraArgsWritableBitmap","inputs":[{"name":"accountIsWritableBitmap","type":"uint64","internalType":"uint64"},{"name":"numAccounts","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"InvalidStaticConfig","inputs":[]},{"type":"error","name":"InvalidTVMAddress","inputs":[{"name":"encodedAddress","type":"bytes","internalType":"bytes"}]},{"type":"error","name":"InvalidTokenReceiver","inputs":[]},{"type":"error","name":"MessageComputeUnitLimitTooHigh","inputs":[]},{"type":"error","name":"MessageFeeTooHigh","inputs":[{"name":"msgFeeJuels","type":"uint256","internalType":"uint256"},{"name":"maxFeeJuelsPerMsg","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"MessageGasLimitTooHigh","inputs":[]},{"type":"error","name":"MessageTooLarge","inputs":[{"name":"maxSize","type":"uint256","internalType":"uint256"},{"name":"actualSize","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"MustBeProposedOwner","inputs":[]},{"type":"error","name":"NoGasPriceAvailable","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"}]},{"type":"error","name":"OnlyCallableByOwner","inputs":[]},{"type":"error","name":"OwnerCannotBeZero","inputs":[]},{"type":"error","name":"SourceTokenDataTooLarge","inputs":[{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"TokenNotSupported","inputs":[{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"TokenTransferConfigMustBeEnabled","inputs":[{"name":"destChainSelector","type":"uint64","internalType":"uint64"},{"name":"token","type":"address","internalType":"address"}]},{"type":"error","name":"TooManySVMExtraArgsAccounts","inputs":[{"name":"numAccounts","type":"uint256","internalType":"uint256"},{"name":"maxAccounts","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"TooManySuiExtraArgsReceiverObjectIds","inputs":[{"name":"numReceiverObjectIds","type":"uint256","internalType":"uint256"},{"name":"maxReceiverObjectIds","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"UnauthorizedCaller","inputs":[{"name":"caller","type":"address","internalType":"address"}]},{"type":"error","name":"UnsupportedNumberOfTokens","inputs":[{"name":"numberOfTokens","type":"uint256","internalType":"uint256"},{"name":"maxNumberOfTokensPerMsg","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"ZeroAddressNotAllowed","inputs":[]}]` +const FeeQuoterBin = "0x60c060405234610aca57616e508038038061001981610c5c565b92833981019080820360a08112610aca57604013610aca57610039610c3d565b81516001600160601b0381168103610aca57815261005960208301610c81565b6020820190815260408301519093906001600160401b038111610aca5783019381601f86011215610aca5784519461009861009387610c95565b610c5c565b9560208088838152019160051b83010191848311610aca57602001905b828210610c255750505060608401516001600160401b038111610aca5784019382601f86011215610aca578451946100ef61009387610c95565b9560208088838152019160051b83010191858311610aca5760208101915b838310610ae557505050506080810151906001600160401b038211610aca570182601f82011215610aca5780519061014761009383610c95565b936020610180818786815201940283010191818311610aca57602001925b8284106109a05750505050331561098f57600180546001600160a01b0319163317905560209261019484610c5c565b926000845260003681376101a6610c3d565b968752838588015260005b8451811015610218576001906001600160a01b036101cf8288610cfb565b5116876101db82610f2a565b6101e8575b5050016101b1565b7fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758091604051908152a138876101e0565b508493508587519260005b8451811015610294576001600160a01b0361023e8287610cfb565b5116908115610283577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8883610275600195610d7f565b50604051908152a101610223565b6342bcdf7f60e11b60005260046000fd5b50845186919086906001600160a01b031615801561097d575b61096c57516001600160a01b031660a052516001600160601b031660805260005b83518110156106ae576102e18185610cfb565b51826001600160401b036102f58488610cfb565b5151169101518115801561069b575b801561067d575b801561066d575b8015610657575b610642578161055c9160019493600052600a865263ffffffff60e01b60406000205460701b161560001461056357817f4efe320c85221c7c3684c54561bea5a9c4dcfad794c6ef9ff9e6b43fb307c0f86040518061041e858291909161014060ff8161016084019580511515855263ffffffff602082015116602086015263ffffffff604082015116604086015263ffffffff606082015116606086015282608082015116608086015263ffffffff60e01b60a08201511660a086015261ffff60c08201511660c086015263ffffffff60e08201511660e086015263ffffffff6101008201511661010086015261ffff61012082015116610120860152015116910152565b0390a25b6000828152600a875260409081902082518154848a0151938501516060860151608087015160a08089015160c0808b015160e0808d01516101008e01516101208f0151610140909f01517fff00000000000000000000000000000000000000000000000000000000000000909b1660ff9c15159c909c169b909b1760089d909d1b64ffffffff00169c909c1760289890981b68ffffffff0000000000169790971760489690961b6cffffffff000000000000000000169590951760689490941b6dff00000000000000000000000000169390931760709190911c63ffffffff60701b161760909390931b61ffff60901b16929092179690911b63ffffffff60a01b16959095179290941b63ffffffff60c01b16919091179390921b61ffff60e01b169290921760f09190911b60ff60f01b16179055610dbe565b50016102ce565b817f0c6380a4766d45f5d53ca170bf865bebfab44958dec379d5a90177264e6645b76040518061063a858291909161014060ff8161016084019580511515855263ffffffff602082015116602086015263ffffffff604082015116604086015263ffffffff606082015116606086015282608082015116608086015263ffffffff60e01b60a08201511660a086015261ffff60c08201511660c086015263ffffffff60e08201511660e086015263ffffffff6101008201511661010086015261ffff61012082015116610120860152015116910152565b0390a2610422565b5063c35aa79d60e01b60005260045260246000fd5b5060a08101516001600160e01b03191615610319565b5060ff6101408201511615610312565b5063ffffffff6101008201511663ffffffff6040830151161061030b565b5063ffffffff6101008201511615610304565b5060016106ba82610c5c565b9260008452600091610967575b81925b8151841015610892576106dd8483610cfb565b5180516001600160401b031692831561087e578285979201965b8751805182101561086e5761070d828692610cfb565b51015188516001600160a01b0390610726908490610cfb565b5151169060608101805115610857576040820163ffffffff8151168881106108405750608084938a9363ffffffff7f5c55501634b3b87e45686082d77f017b6639b436c21cb423ba6313d843f66ed194818f61081a8f9b60408360019f9e600c908e8067ffffffff000000009852600b825284842060018060a01b038716855282528484208d8d8c8c835116926cff0000000000000000000000006bffffffff000000000000000088875493019e8f518a1b1693518c1b169351151560601b16936cff000000000000000000000000199160018060601b0319161716171717905561081081610dbe565b5083525220610df7565b5081604051965116865251168d850152511660408301525115156060820152a3016106f7565b6312766e0160e11b8b52600485905260245260448afd5b604489848a632ce1527960e21b8352600452602452fd5b50509250945092600101926106ca565b63c35aa79d60e01b85526004849052602485fd5b849150825b825181101561092a576001906001600160401b036108b58286610cfb565b515116828060a01b03846108c98488610cfb565b5101511690808752600b855260408720848060a01b03831688528552866040812055808752600c85526108ff8260408920610e74565b507f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b8780a301610897565b604051615e919081610fbf823960805181818161045c01526110a0015260a0518181816104840152818161103701528181611dd001526124bb0152f35b6106c7565b63d794ef9560e01b60005260046000fd5b5081516001600160601b0316156102ad565b639b15e16f60e01b60005260046000fd5b8382036101808112610aca576101606109b7610c3d565b916109c187610cac565b8352601f190112610aca576040519161016083016001600160401b03811184821017610acf576040526109f660208701610cd1565b8352610a0460408701610cc0565b6020840152610a1560608701610cc0565b6040840152610a2660808701610cc0565b6060840152610a3760a08701610cde565b608084015260c0860151916001600160e01b031983168303610aca578360209360a0610180960152610a6b60e08901610cec565b60c0820152610a7d6101008901610cc0565b60e0820152610a8f6101208901610cc0565b610100820152610aa26101408901610cec565b610120820152610ab56101608901610cde565b61014082015283820152815201930192610165565b600080fd5b634e487b7160e01b600052604160045260246000fd5b82516001600160401b038111610aca5782016040818903601f190112610aca57610b0d610c3d565b90610b1a60208201610cac565b825260408101516001600160401b038111610aca57602091010188601f82011215610aca578051610b4d61009382610c95565b91602060a08185858152019302820101908b8211610aca57602001915b818310610b89575050509181602093848094015281520192019161010d565b828c0360a08112610aca576080610b9e610c3d565b91610ba886610c81565b8352601f190112610aca576040519160808301916001600160401b03831184841017610acf5760a093602093604052610be2848801610cc0565b8152610bf060408801610cc0565b84820152610c0060608801610cc0565b6040820152610c1160808801610cd1565b606082015283820152815201920191610b6a565b60208091610c3284610c81565b8152019101906100b5565b60408051919082016001600160401b03811183821017610acf57604052565b6040519190601f01601f191682016001600160401b03811183821017610acf57604052565b51906001600160a01b0382168203610aca57565b6001600160401b038111610acf5760051b60200190565b51906001600160401b0382168203610aca57565b519063ffffffff82168203610aca57565b51908115158203610aca57565b519060ff82168203610aca57565b519061ffff82168203610aca57565b8051821015610d0f5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b8054821015610d0f5760005260206000200190600090565b80549068010000000000000000821015610acf5781610d64916001610d7b94018155610d25565b819391549060031b91821b91600019901b19161790565b9055565b80600052600360205260406000205415600014610db857610da1816002610d3d565b600254906000526003602052604060002055600190565b50600090565b80600052600960205260406000205415600014610db857610de0816008610d3d565b600854906000526009602052604060002055600190565b6000828152600182016020526040902054610e2e5780610e1983600193610d3d565b80549260005201602052604060002055600190565b5050600090565b80548015610e5e576000190190610e4c8282610d25565b8154906000199060031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b906001820191816000528260205260406000205490811515600014610f2157600019820191808311610f0b5781546000198101908111610f0b578381610ec29503610ed4575b505050610e35565b60005260205260006040812055600190565b610ef4610ee4610d649386610d25565b90549060031b1c92839286610d25565b905560005284602052604060002055388080610eba565b634e487b7160e01b600052601160045260246000fd5b50505050600090565b6000818152600360205260409020548015610e2e576000198101818111610f0b57600254600019810191908211610f0b57808203610f84575b505050610f706002610e35565b600052600360205260006040812055600190565b610fa6610f95610d64936002610d25565b90549060031b1c9283926002610d25565b90556000526003602052604060002055388080610f6356fe6080604052600436101561001257600080fd5b60003560e01c806241e5be146101d657806301447eaa146101d157806306285c69146101cc578063080d711a146101c757806315c34d5b146101c2578063181f5a77146101bd5780632451a627146101b85780633937306f146101b35780633a49bb49146101ae5780633f37a52c146101a957806345ac924d146101a45780634ab35b0b1461019f578063514e8cff1461019a5780636def4ce71461019557806379ba50971461019057806382b49eb01461018b57806389933a51146101865780638da5cb5b14610181578063910d8f591461017c57806391a2749a1461017757806391b2f60714610172578063947f82171461016d5780639cc1999614610168578063cdc73d5114610163578063d02641a01461015e578063d8694ccd14610159578063f2fde38b146101545763ffdb4b371461014f57600080fd5b6127dd565b612707565b61236e565b612312565b61229b565b612221565b6121d2565b61204e565b611f70565b611c27565b611bf3565b611b06565b6119f3565b6118e5565b6117c0565b611638565b6115eb565b611522565b6112a8565b610fc5565b610b9a565b610b17565b610a5a565b61082c565b61063a565b61040f565b610370565b6101fe565b73ffffffffffffffffffffffffffffffffffffffff8116036101f957565b600080fd5b346101f95760606003193601126101f9576020610235600435610220816101db565b60243560443591610230836101db565b6129a4565b604051908152f35b6004359067ffffffffffffffff821682036101f957565b6024359067ffffffffffffffff821682036101f957565b359067ffffffffffffffff821682036101f957565b9181601f840112156101f95782359167ffffffffffffffff83116101f9576020808501948460051b0101116101f957565b919082519283825260005b8481106102dd575050601f19601f8460006020809697860101520116010190565b806020809284010151828286010152016102bc565b602081016020825282518091526040820191602060408360051b8301019401926000915b83831061032557505050505090565b9091929394602080610361837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0866001960301875289516102b1565b97019301930191939290610316565b346101f95760606003193601126101f95761038961023d565b60243567ffffffffffffffff81116101f9576103a9903690600401610280565b6044929192359167ffffffffffffffff83116101f957366023840112156101f95782600401359167ffffffffffffffff83116101f9573660248460061b860101116101f95761040b9460246103ff950192612ba2565b604051918291826102f2565b0390f35b346101f95760006003193601126101f957610428612de6565b5060408051610436816104e3565b73ffffffffffffffffffffffffffffffffffffffff60206bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169283815201817f0000000000000000000000000000000000000000000000000000000000000000168152835192835251166020820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176104ff57604052565b6104b4565b6080810190811067ffffffffffffffff8211176104ff57604052565b610160810190811067ffffffffffffffff8211176104ff57604052565b60a0810190811067ffffffffffffffff8211176104ff57604052565b90601f601f19910116810190811067ffffffffffffffff8211176104ff57604052565b6040519061058b604083610559565b565b6040519061058b61016083610559565b6040519061058b606083610559565b6040519061058b602083610559565b67ffffffffffffffff81116104ff5760051b60200190565b9080601f830112156101f95781356105ea816105bb565b926105f86040519485610559565b81845260208085019260051b8201019283116101f957602001905b8282106106205750505090565b60208091833561062f816101db565b815201910190610613565b346101f95760206003193601126101f95760043567ffffffffffffffff81116101f95761066b9036906004016105d3565b610673614108565b60005b815181101561074e57806106ab73ffffffffffffffffffffffffffffffffffffffff6106a460019486612b8e565b5116615920565b610703575b60006106fc73ffffffffffffffffffffffffffffffffffffffff6106d48487612b8e565b511673ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b5501610676565b73ffffffffffffffffffffffffffffffffffffffff6107228285612b8e565b51167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91600080a26106b0565b005b6024359063ffffffff821682036101f957565b6044359063ffffffff821682036101f957565b359063ffffffff821682036101f957565b801515036101f957565b359061058b82610787565b81601f820112156101f9578035906107b3826105bb565b926107c16040519485610559565b82845260208085019360061b830101918183116101f957602001925b8284106107eb575050505090565b6040848303126101f95760206040918251610805816104e3565b61080e8761026b565b81528287013561081d816101db565b838201528152019301926107dd565b346101f95760406003193601126101f95760043567ffffffffffffffff81116101f957366023820112156101f9578060040135610868816105bb565b916108766040519384610559565b8183526024602084019260051b820101903682116101f95760248101925b8284106108c5576024358567ffffffffffffffff82116101f9576108bf61074e92369060040161079c565b90612dff565b833567ffffffffffffffff81116101f957820160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82360301126101f95760405190610911826104e3565b61091d6024820161026b565b8252604481013567ffffffffffffffff81116101f957602491010136601f820112156101f957803561094e816105bb565b9161095c6040519384610559565b818352602060a08185019302820101903682116101f957602001915b8183106109975750505091816020938480940152815201930192610894565b82360360a081126101f9576080601f19604051926109b4846104e3565b86356109bf816101db565b845201126101f95760a0916020916040516109d981610504565b6109e4848801610776565b81526109f260408801610776565b84820152610a0260608801610776565b60408201526080870135610a1581610787565b606082015283820152815201920191610978565b67ffffffffffffffff81116104ff57601f01601f191660200190565b60405190610a54602083610559565b60008252565b346101f95760006003193601126101f95761040b6040805190610a7d8183610559565b600f82527f46656551756f74657220322e302e3000000000000000000000000000000000006020830152519182916020835260208301906102b1565b906020808351928381520192019060005b818110610ad75750505090565b825173ffffffffffffffffffffffffffffffffffffffff16845260209384019390920191600101610aca565b906020610b14928181520190610ab9565b90565b346101f95760006003193601126101f95760405180602060025491828152019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9060005b818110610b845761040b85610b7881870382610559565b60405191829182610b03565b8254845260209093019260019283019201610b61565b346101f95760206003193601126101f95760043567ffffffffffffffff81116101f9578060040190604060031982360301126101f957610bd8614173565b610be282806131c0565b4263ffffffff1692915060005b818110610dbc57505060240190610c0682846131c0565b92905060005b838110610c1557005b80610c34610c2f600193610c29868a6131c0565b90612a62565b613274565b7fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e67ffffffffffffffff610d83610d606020850194610d52610c9287517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b610cc1610c9d61057c565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252565b63ffffffff8c166020820152610cfc610ce2845167ffffffffffffffff1690565b67ffffffffffffffff166000526004602052604060002090565b815160209092015160e01b7fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5167ffffffffffffffff1690565b93517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610c0c565b80610dd5610dd0600193610c2989806131c0565b61323d565b7f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a73ffffffffffffffffffffffffffffffffffffffff610ee2610d606020850194610e9d610e3f87517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b610e4a610c9d61057c565b63ffffffff8d166020820152610cfc610e77845173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b610ec3610ebe825173ffffffffffffffffffffffffffffffffffffffff1690565b6141b7565b610f1b575b5173ffffffffffffffffffffffffffffffffffffffff1690565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9290921682524260208301529190931692a201610bef565b83610f3a825173ffffffffffffffffffffffffffffffffffffffff1690565b167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23600080a2610ec8565b9181601f840112156101f95782359167ffffffffffffffff83116101f957602083818601950101116101f957565b92610b149492610fb7928552151560208501526080604085015260808401906102b1565b9160608184039101526102b1565b346101f95760a06003193601126101f957610fde61023d565b60243590610feb826101db565b6044359160643567ffffffffffffffff81116101f95761100f903690600401610f65565b93909160843567ffffffffffffffff81116101f957611032903690600401610f65565b9290917f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff821673ffffffffffffffffffffffffffffffffffffffff82161460001461111c575050935b6bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168086116110eb5750926110da926001969261040b956141f8565b919390509260405194859485610f93565b857f6a92a4830000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b91611126926129a4565b93611091565b906020808351928381520192019060005b81811061114a5750505090565b825167ffffffffffffffff1684526020938401939092019160010161113d565b9061117d9060608352606083019061112c565b8181036020830152825180825260208201916020808360051b8301019501926000915b8383106112755750505050506040818303910152815180825260208201906020808260051b8501019401916000905b8282106111de57505050505090565b909192939594601f19878203018252845190602080835192838152019201906000905b80821061122357505050602080600192960192019201909291959394956111cf565b909192602060808261126a60019488516060809163ffffffff815116845263ffffffff602082015116602085015263ffffffff604082015116604085015201511515910152565b019401920190611201565b9091929397969560208061129583601f1986600196030187528c51610ab9565b9a019301930191939290979596976111a0565b346101f95760006003193601126101f9576008546112c581613299565b6112ce826129ea565b916112d8816129ea565b906000905b8082106112f657505061040b906040519384938461116a565b61132b61131261130584615d88565b67ffffffffffffffff1690565b61131c8487612b8e565b9067ffffffffffffffff169052565b61135e61135861133e610d528588612b8e565b67ffffffffffffffff16600052600c602052604060002090565b54613299565b6113688387612b8e565b526113738286612b8e565b5061138d61138761133e610d528588612b8e565b546132ef565b6113978385612b8e565b526113a28284612b8e565b5060005b85856113b861133e610d528784612b8e565b548310156114a3578261147883611454610ec88461140e8b61144e611434610d52838c60019f9e61142f9061149c9f8a61140e866114088361140361133e610d528561141499612b8e565b6144ca565b94612b8e565b51612b8e565b9073ffffffffffffffffffffffffffffffffffffffff169052565b612b8e565b67ffffffffffffffff16600052600b602052604060002090565b95612b8e565b73ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b61148c611485888a612b8e565b5191612b49565b6114968383612b8e565b52612b8e565b50016113a6565b50505090600101906112dd565b602060408183019282815284518094520192019060005b8181106114d45750505090565b9091926020604082611517600194885163ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b0194019291016114c7565b346101f95760206003193601126101f95760043567ffffffffffffffff81116101f957611553903690600401610280565b61155c816105bb565b9161156a6040519384610559565b818352601f19611579836105bb565b0160005b8181106115d457505060005b828110156115c6576001906115aa6115a58260051b8501612a77565b613db9565b6115b48287612b8e565b526115bf8186612b8e565b5001611589565b6040518061040b86826114b0565b6020906115df612de6565b8282880101520161157d565b346101f95760206003193601126101f957602061161260043561160d816101db565b613378565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff60405191168152f35b346101f95760206003193601126101f95767ffffffffffffffff61165a61023d565b611662612de6565b5016600052600460205260406000206040519061167e826104e3565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260e01c6020820152604051809161040b82604081019263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b906101408061058b936116fe84825115159052565b60208181015163ffffffff169085015260408181015163ffffffff169085015260608181015163ffffffff169085015260808181015160ff169085015260a0818101517fffffffff00000000000000000000000000000000000000000000000000000000169085015260c08181015161ffff169085015260e08181015163ffffffff16908501526101008181015163ffffffff16908501526101208181015161ffff1690850152015160ff16910152565b6101608101929161058b91906116e9565b346101f95760206003193601126101f95767ffffffffffffffff6117e261023d565b6117ea613476565b5016600052600a60205261040b60406000206118d96118ce6040519261180f84610520565b5461181e60ff82165b15158552565b63ffffffff600882901c16602085015263ffffffff602882901c16604085015263ffffffff604882901c16606085015260ff606882901c1660808501527fffffffff00000000000000000000000000000000000000000000000000000000607082901b1660a085015261ffff609082901c1660c085015263ffffffff60a082901c1660e085015263ffffffff60c082901c1661010085015261ffff60e082901c1661012085015260f01c60ff1690565b60ff16610140830152565b604051918291826117af565b346101f95760006003193601126101f95760005473ffffffffffffffffffffffffffffffffffffffff81163303611986577fffffffffffffffffffffffff00000000000000000000000000000000000000006001549133828416176001551660005573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f02b543c60000000000000000000000000000000000000000000000000000000060005260046000fd5b61058b9092919260808101936060809163ffffffff815116845263ffffffff602082015116602085015263ffffffff604082015116604085015201511515910152565b346101f95760406003193601126101f9576080611a6b611a66611a1461023d565b67ffffffffffffffff60243591611a2a836101db565b611a326132ca565b5016600052600b60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b612b49565b611aaa60405180926060809163ffffffff815116845263ffffffff602082015116602085015263ffffffff604082015116604085015201511515910152565bf35b90611abf9060408352604083019061112c565b9060208183039101526020808351928381520192019060005b818110611ae55750505090565b909192602061016082611afb60019488516116e9565b019401929101611ad8565b346101f95760006003193601126101f957600854611b23816105bb565b90611b316040519283610559565b808252601f19611b40826105bb565b0160005b818110611bdc575050611b5681613299565b9060005b818110611b7257505061040b60405192839283611aac565b80611b8e611b84611305600194615d88565b61131c8387612b8e565b611bc0611bbb611ba1610d528488612b8e565b67ffffffffffffffff16600052600a602052604060002090565b6134c8565b611bca8287612b8e565b52611bd58186612b8e565b5001611b5a565b602090611be7613476565b82828701015201611b44565b346101f95760006003193601126101f957602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346101f95760806003193601126101f957611c4061023d565b611c48610750565b611c50610763565b9060643591611c5e836101db565b611c7f611bbb8567ffffffffffffffff16600052600a602052604060002090565b91611c91611c8d8451151590565b1590565b611f3857611cbf90611cb9611cb3611cad608087015160ff1690565b60ff1690565b846134f6565b90613513565b93611cdd611cd4604085015163ffffffff1690565b63ffffffff1690565b9163ffffffff8616928311611f0e57602084015163ffffffff1663ffffffff811663ffffffff831611611ed5575050611d32611d2d8267ffffffffffffffff166000526004602052604060002090565b61333e565b9063ffffffff611d49602084015163ffffffff1690565b1615611e9a575091611db8611dab611da660ff9794611da0611d8d611d8d61040b99517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6dffffffffffffffffffffffffffff1690565b90612958565b61352d565b662386f26fc10000900490565b9073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861614600014611e7157611e44611e3e6101407bffffffffffffffffffffffffffffffffffffffffffffffffffffffff93015160ff1690565b95613378565b16906040519586951692859094939260609263ffffffff6080840197168352602083015260408201520152565b507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff611e44606495613378565b7fa96740690000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045260246000fd5b6000fd5b7f869337890000000000000000000000000000000000000000000000000000000060005263ffffffff9081166004521660245260446000fd5b7f4c4fc93a0000000000000000000000000000000000000000000000000000000060005260046000fd5b7f99ac52f20000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff851660045260246000fd5b346101f95760206003193601126101f95760043567ffffffffffffffff81116101f957604060031982360301126101f957604051611fad816104e3565b816004013567ffffffffffffffff81116101f957611fd190600436918501016105d3565b8152602482013567ffffffffffffffff81116101f95761074e926004611ffa92369201016105d3565b6020820152613578565b359060ff821682036101f957565b35907fffffffff00000000000000000000000000000000000000000000000000000000821682036101f957565b359061ffff821682036101f957565b346101f95760206003193601126101f95760043567ffffffffffffffff81116101f957366023820112156101f95780600401359061208b826105bb565b906120996040519283610559565b8282526024610180602084019402820101903682116101f957602401925b8184106120c75761074e83613718565b83360361018081126101f957610160601f19604051926120e6846104e3565b6120ef8861026b565b845201126101f9576101809160209161210661058d565b612111848901610791565b815261211f60408901610776565b8482015261212f60608901610776565b604082015261214060808901610776565b606082015261215160a08901612004565b608082015261216260c08901612012565b60a082015261217360e0890161203f565b60c08201526121856101008901610776565b60e08201526121976101208901610776565b6101008201526121aa610140890161203f565b6101208201526121bd6101608901612004565b610140820152838201528152019301926120b7565b346101f95760406003193601126101f957606063ffffffff806122086121f661023d565b60243590612203826101db565b613943565b9193908160405195168552166020840152166040820152f35b346101f95760406003193601126101f95761223a61023d565b6024359067ffffffffffffffff82116101f95761226b61040b91612265612287943690600401610f65565b916139f2565b63ffffffff6040949394519586956060875260608701906102b1565b9216602085015283820360408501526102b1565b346101f95760006003193601126101f95760405180602060065491828152019060066000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9060005b8181106122fc5761040b85610b7881870382610559565b82548452602090930192600192830192016122e5565b346101f95760206003193601126101f95760406123346004356115a5816101db565b611aaa8251809263ffffffff602080927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8151168552015116910152565b346101f95760406003193601126101f95761238761023d565b60243567ffffffffffffffff81116101f957806004019160a060031983360301126101f9576123cd611bbb8267ffffffffffffffff16600052600a602052604060002090565b906123db611c8d8351151590565b6126d057606483019161241f611c8d6123f385612a77565b73ffffffffffffffffffffffffffffffffffffffff166000526001600601602052604060002054151590565b6126825761242e858284614ed1565b909161243c61160d86612a77565b96604487019660008061244f8a856131c0565b15905061265257505061249961ffff8798996124a39861247460c088015161ffff1690565b9161249061248960e08a015163ffffffff1690565b91886131c0565b949093166155e2565b9099909790612a77565b73ffffffffffffffffffffffffffffffffffffffff807f00000000000000000000000000000000000000000000000000000000000000001691161460001461261b576101408401516124f79060ff166128c9565b61250091612958565b9761255d60606125516125406125679a63ffffffff6125386125629b6125316125629b6024611cd49c5b0190612ac1565b905061356b565b91169061356b565b611da0611cad60808a015160ff1690565b95015163ffffffff1690565b613513565b61356b565b90612589611d2d8267ffffffffffffffff166000526004602052604060002090565b9061259e611cd4602084015163ffffffff1690565b15611e9a5761040b61260b867bffffffffffffffffffffffffffffffffffffffffffffffffffffffff612603886125626125fe8a611da0611d8d611d8d8d517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6128f0565b91169061296b565b6040519081529081906020820190565b612624906128f0565b9761255d60606125516125406125679a63ffffffff6125386125629b6125316125629b6024611cd49c61252a565b96979098506124a361267c61267761267061012088015161ffff1690565b61ffff1690565b6128c9565b91612a77565b611ed161268e84612a77565b7f2502348c0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff16600452602490565b7f99ac52f20000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045260246000fd5b346101f95760206003193601126101f95773ffffffffffffffffffffffffffffffffffffffff600435612739816101db565b612741614108565b163381146127b357807fffffffffffffffffffffffff0000000000000000000000000000000000000000600054161760005573ffffffffffffffffffffffffffffffffffffffff600154167fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278600080a3005b7fdad89dca0000000000000000000000000000000000000000000000000000000060005260046000fd5b346101f95760406003193601126101f9576004356127fa816101db565b67ffffffffffffffff61280b610254565b169081600052600a60205260ff604060002054161561286c5761282d90613378565b6000918252600460209081526040928390205483517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384168152921690820152f35b507f99ac52f20000000000000000000000000000000000000000000000000000000060005260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90662386f26fc10000820291808304662386f26fc1000014901517156128eb57565b61289a565b90670de0b6b3a7640000820291808304670de0b6b3a764000014901517156128eb57565b908160051b91808304602014901517156128eb57565b9061012c82029180830461012c14901517156128eb57565b90606c820291808304606c14901517156128eb57565b818102929181159184041417156128eb57565b8115612975570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6129e36129dd610b1494937bffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129d68195613378565b1690612958565b92613378565b169061296b565b906129f4826105bb565b612a016040519182610559565b8281526020601f19612a1383956105bb565b01910160005b828110612a2557505050565b606082820152602001612a19565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015612a725760061b0190565b612a33565b35610b14816101db565b9190811015612a725760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61813603018212156101f9570190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101f9570180359067ffffffffffffffff82116101f9576020019181360383136101f957565b929192612b1e82610a29565b91612b2c6040519384610559565b8294818452818301116101f9578281602093846000960137010152565b90604051612b5681610504565b606060ff82945463ffffffff8116845263ffffffff8160201c16602085015263ffffffff8160401c166040850152821c161515910152565b8051821015612a725760209160051b010190565b909291612bef612bc68367ffffffffffffffff16600052600a602052604060002090565b5460701b7fffffffff000000000000000000000000000000000000000000000000000000001690565b90612bf9816129ea565b9560005b828110612c0e575050505050505090565b612c21612c1c828489612a62565b612a77565b8388612c3b612c31858484612a81565b6040810190612ac1565b905060208111612d5e575b508392612c7c612c76612c6f612c65600198612cbf97611a6697612a81565b6020810190612ac1565b3691612b12565b89613e20565b612c9a8967ffffffffffffffff16600052600b602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b606081015115612d2457612d08612ce06020612cfa93015163ffffffff1690565b6040805163ffffffff909216602083015290928391820190565b03601f198101835282610559565b612d12828b612b8e565b52612d1d818a612b8e565b5001612bfd565b50612cfa612d08612d59612d4c8967ffffffffffffffff16600052600a602052604060002090565b5460a01c63ffffffff1690565b612ce0565b915050612d96611cd4612d8984612c9a8b67ffffffffffffffff16600052600b602052604060002090565b5460401c63ffffffff1690565b10612da357838838612c46565b7f36f536ca0000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff1660045260246000fd5b60405190612df3826104e3565b60006020838281520152565b612e07614108565b6000915b81518310156130ca57612e1e8383612b8e565b51805167ffffffffffffffff1694859283156130925760206000959301945b8551805182101561307e57612e5482602092612b8e565b510151612e80612e65838951612b8e565b515173ffffffffffffffffffffffffffffffffffffffff1690565b612e90611c8d6060840151151590565b61302d57604082015163ffffffff1660208110612fdf575090867f5c55501634b3b87e45686082d77f017b6639b436c21cb423ba6313d843f66ed173ffffffffffffffffffffffffffffffffffffffff84612fc4818f80612f9b89612f1360019d9c612c9a612fbf9667ffffffffffffffff16600052600b602052604060002090565b815181546020808501516040808701516060978801517fffffffffffffffffffffffffffffffffffffff0000000000000000000000000090951663ffffffff96909616959095179190921b67ffffffff00000000161792901b6bffffffff0000000000000000169190911790151590921b6cff00000000000000000000000016919091179055565b612fa488615b41565b5067ffffffffffffffff16600052600c602052604060002090565b6141d8565b50612fd66040519283921695826119b0565b0390a301612e3d565b7f24ecdc020000000000000000000000000000000000000000000000000000000060005273ffffffffffffffffffffffffffffffffffffffff90911660045263ffffffff1660245260446000fd5b7fb38549e40000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff8a1660045273ffffffffffffffffffffffffffffffffffffffff1660245260446000fd5b505095509250926001915001919092612e0b565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff871660045260246000fd5b91505060005b81518110156131bc57806130f86130e960019385612b8e565b515167ffffffffffffffff1690565b67ffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff61314160206131258689612b8e565b51015173ffffffffffffffffffffffffffffffffffffffff1690565b600061316582612c9a8767ffffffffffffffff16600052600b602052604060002090565b5561318d816131888667ffffffffffffffff16600052600c602052604060002090565b614153565b501691167f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b600080a3016130d0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101f9570180359067ffffffffffffffff82116101f957602001918160061b360383136101f957565b35907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff821682036101f957565b6040813603126101f95761326c602060405192613259846104e3565b8035613264816101db565b845201613214565b602082015290565b6040813603126101f95761326c602060405192613290846104e3565b6132648161026b565b906132a3826105bb565b6132b06040519182610559565b828152601f196132c082946105bb565b0190602036910137565b604051906132d782610504565b60006060838281528260208201528260408201520152565b906132f9826105bb565b6133066040519182610559565b828152601f1961331682946105bb565b019060005b82811061332757505050565b6020906133326132ca565b8282850101520161331b565b9060405161334b816104e3565b91547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116835260e01c6020830152565b73ffffffffffffffffffffffffffffffffffffffff81166000526005602052604060002090604051916133aa836104e3565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811680845260e09190911c602084018190521590811561344f575b5061340b5750517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff907f06439c6b000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16159050386133e3565b6040519061348382610520565b6000610140838281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e082015282610100820152826101208201520152565b9061058b6040516134d881610520565b6101406134ee82955461181e6118188260ff1690565b60ff16910152565b9063ffffffff8091169116029063ffffffff82169182036128eb57565b9063ffffffff8091169116019063ffffffff82116128eb57565b90662386f26fc0ffff82018092116128eb57565b90600282018092116128eb57565b90602082018092116128eb57565b90600182018092116128eb57565b919082018092116128eb57565b613580614108565b60208101519160005b835181101561363457806135a2610ec860019387612b8e565b6135de6135d973ffffffffffffffffffffffffffffffffffffffff83165b73ffffffffffffffffffffffffffffffffffffffff1690565b615dbd565b6135ea575b5001613589565b60405173ffffffffffffffffffffffffffffffffffffffff9190911681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda7758090602090a1386135e3565b5091505160005b81518110156131bc57613651610ec88284612b8e565b9073ffffffffffffffffffffffffffffffffffffffff8216156136ee577feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef6136e5836136bd6136b86135c060019773ffffffffffffffffffffffffffffffffffffffff1690565b615b7c565b5060405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390a10161363b565b7f8579befe0000000000000000000000000000000000000000000000000000000060005260046000fd5b90613721614108565b60005b825181101561393e576137378184612b8e565b5160206137476130e98487612b8e565b91015167ffffffffffffffff8216918215801561391f575b80156138f1575b80156138d8575b80156138a1575b61386a579161382661382b92613821856137d06137ab612bc660019a9967ffffffffffffffff16600052600a602052604060002090565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61383257847f4efe320c85221c7c3684c54561bea5a9c4dcfad794c6ef9ff9e6b43fb307c0f86040518061380487826117af565b0390a267ffffffffffffffff16600052600a602052604060002090565b6144f4565b615b41565b5001613724565b847f0c6380a4766d45f5d53ca170bf865bebfab44958dec379d5a90177264e6645b76040518061386287826117af565b0390a2611ba1565b7fc35aa79d0000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045260246000fd5b506138d26137ab60a08401517fffffffff000000000000000000000000000000000000000000000000000000001690565b15613774565b5060ff6138ea61014084015160ff1690565b161561376d565b5061010082015163ffffffff1663ffffffff613917611cd4604086015163ffffffff1690565b911611613766565b5063ffffffff61393761010084015163ffffffff1690565b161561375f565b509050565b9190611a666139899167ffffffffffffffff8516600052600b60205260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b9160608301516139d0576139b391925067ffffffffffffffff16600052600a602052604060002090565b54609081901c61ffff169160a09190911c63ffffffff1690602090565b5063ffffffff8251169063ffffffff6040816020860151169401511691929190565b611bbb613a169194929467ffffffffffffffff16600052600a602052604060002090565b9260a08401927fffffffff00000000000000000000000000000000000000000000000000000000613a6785517fffffffff000000000000000000000000000000000000000000000000000000001690565b167f2812d52c000000000000000000000000000000000000000000000000000000008114908115613d8f575b8115613d65575b50613d11577f1e10bdc4000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613b0b86517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614613c78577fc4e05953000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000613b7d86517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614613bfe57611ed1613bb085517fffffffff000000000000000000000000000000000000000000000000000000001690565b7f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff0000000000000000000000000000000000000000000000000000000016600452602490565b613c3e9350613c1b611cd46040613c219597015163ffffffff1690565b91614d83565b91613c4c6040840151604051938491602083019190602083019252565b03601f198101845283610559565b613c726060613c5f855163ffffffff1690565b940151613c6a6105ac565b908152614e19565b91929190565b613c3e9350613c95611cd46040613c9b9597015163ffffffff1690565b91614a5e565b91613cb86060840151604051938491602083019190602083019252565b613c72613cc9845163ffffffff1690565b93613ce46020608083015192015167ffffffffffffffff1690565b90613d07613cf061059d565b6000815267ffffffffffffffff9093166020840152565b6040820152614c5c565b613d52935093613d489294613d42611cd46040613d3661010086015163ffffffff1690565b94015163ffffffff1690565b926148b8565b5163ffffffff1690565b90613d5b610a45565b9190610b14610a45565b7f647e2ba90000000000000000000000000000000000000000000000000000000091501438613a9a565b7fac77ffec0000000000000000000000000000000000000000000000000000000081149150613a93565b73ffffffffffffffffffffffffffffffffffffffff90613dd7612de6565b50166000526005602052604060002060405190613df3826104e3565b547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260e01c602082015290565b7fffffffff000000000000000000000000000000000000000000000000000000001691907f2812d52c000000000000000000000000000000000000000000000000000000008314613f68577f1e10bdc4000000000000000000000000000000000000000000000000000000008314613f5a577fac77ffec000000000000000000000000000000000000000000000000000000008314613f4f577f647e2ba9000000000000000000000000000000000000000000000000000000008314613f44577fc4e05953000000000000000000000000000000000000000000000000000000008314613f3557827f2ee820750000000000000000000000000000000000000000000000000000000060005260045260246000fd5b61058b91925061dee990615785565b61058b9192506157e6565b61058b919250615722565b61058b919250600190615785565b61058b919250615692565b917fffffffff0000000000000000000000000000000000000000000000000000000083167f2812d52c0000000000000000000000000000000000000000000000000000000081146140fc577f1e10bdc40000000000000000000000000000000000000000000000000000000081146140dc577fac77ffec0000000000000000000000000000000000000000000000000000000081146140d0577f647e2ba90000000000000000000000000000000000000000000000000000000081146140c4577fc4e0595300000000000000000000000000000000000000000000000000000000146140a9577f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff00000000000000000000000000000000000000000000000000000000831660045260246000fd5b61058b9250156140bc5761dee990615785565b600090615785565b505061058b91506157e6565b505061058b9150615722565b5061058b9250156140f35760ff60015b1690615785565b60ff60006140ec565b505061058b9150615692565b73ffffffffffffffffffffffffffffffffffffffff60015416330361412957565b7f2b5c74de0000000000000000000000000000000000000000000000000000000060005260046000fd5b73ffffffffffffffffffffffffffffffffffffffff610b14921690615a04565b3360005260036020526040600020541561418957565b7fd86ad9cf000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff610b1491166006615bb1565b73ffffffffffffffffffffffffffffffffffffffff610b14921690615bb1565b611bbb61421f9196949395929667ffffffffffffffff16600052600a602052604060002090565b9460a08601947fffffffff0000000000000000000000000000000000000000000000000000000061427087517fffffffff000000000000000000000000000000000000000000000000000000001690565b167f2812d52c0000000000000000000000000000000000000000000000000000000081149081156144a0575b8115614476575b5061443d5750507fc4e05953000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000061431686517fffffffff000000000000000000000000000000000000000000000000000000001690565b1614614412577f1e10bdc4000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000061438886517fffffffff000000000000000000000000000000000000000000000000000000001690565b16146143bb57611ed1613bb085517fffffffff000000000000000000000000000000000000000000000000000000001690565b6143fd9350612c6f60606143e76143e0611cd4604061440b989a015163ffffffff1690565b8486614a5e565b0151604051958691602083019190602083019252565b03601f198101865285610559565b9160019190565b6143fd9350612c6f60406143e7614436611cd48361440b989a015163ffffffff1690565b8486614d83565b945094610b149261446b92614460611cd461010061446695015163ffffffff1690565b91615c11565b615d3e565b936001933691612b12565b7f647e2ba900000000000000000000000000000000000000000000000000000000915014386142a3565b7fac77ffec000000000000000000000000000000000000000000000000000000008114915061429c565b73ffffffffffffffffffffffffffffffffffffffff916144e991615839565b90549060031b1c1690565b61486961014061058b9361453c61450b8251151590565b859060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b614586614550602083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff1660089190911b64ffffffff0016178555565b6145d461459a604083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffff1660289190911b68ffffffff000000000016178555565b6146266145e8606083015163ffffffff1690565b85547fffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffff1660489190911b6cffffffff00000000000000000016178555565b614676614637608083015160ff1690565b85547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1660689190911b6dff0000000000000000000000000016178555565b6146e96146a660a08301517fffffffff000000000000000000000000000000000000000000000000000000001690565b85547fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff1660709190911c71ffffffff000000000000000000000000000016178555565b6147406146fb60c083015161ffff1690565b85547fffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffff1660909190911b73ffff00000000000000000000000000000000000016178555565b61479d61475460e083015163ffffffff1690565b85547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1660a09190911b77ffffffff000000000000000000000000000000000000000016178555565b6147ff6147b261010083015163ffffffff1690565b85547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b7bffffffff00000000000000000000000000000000000000000000000016178555565b61486161481261012083015161ffff1690565b85547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09190911b7dffff0000000000000000000000000000000000000000000000000000000016178555565b015160ff1690565b7fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7eff00000000000000000000000000000000000000000000000000000000000083549260f01b169116179055565b9063ffffffff6148d2936148ca612de6565b501691615c11565b90815111611f0e5790565b906004116101f95790600490565b90929192836004116101f95783116101f957600401916003190190565b919091357fffffffff000000000000000000000000000000000000000000000000000000008116926004811061493c575050565b7fffffffff00000000000000000000000000000000000000000000000000000000929350829060040360031b1b161690565b9080601f830112156101f9578135614985816105bb565b926149936040519485610559565b81845260208085019260051b8201019283116101f957602001905b8282106149bb5750505090565b81358152602091820191016149ae565b6020818303126101f95780359067ffffffffffffffff82116101f9570160a0818303126101f957604051916149ff8361053d565b614a0882610776565b8352614a166020830161026b565b60208401526040820135614a2981610787565b604084015260608201356060840152608082013567ffffffffffffffff81116101f957614a56920161496e565b608082015290565b60606080604051614a6e8161053d565b600081526000602082015260006040820152600083820152015260048210614b72577f1f3b3aba000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000614ae5614adf85856148dd565b90614908565b1603614b485781614b0192614af9926148eb565b8101906149cb565b9063ffffffff614b15835163ffffffff1690565b1611614b1e5790565b7f2e2b0c290000000000000000000000000000000000000000000000000000000060005260046000fd5b7f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b7fb00b53dc0000000000000000000000000000000000000000000000000000000060005260046000fd5b805160209091019060005b818110614bb45750505090565b8251845260209384019390920191600101614ba7565b90610b1494937fffffffffffffffff000000000000000000000000000000000000000000000000600e947fff0000000000000000000000000000000000000000000000000000000000000080947f1a2b3c4d00000000000000000000000000000000000000000000000000000000875260f81b16600486015260c01b16600584015260f81b16600d8201520190614b9c565b604081019081515160ff8111614cd4578151916003831015614ca5576020015160ff93610b1493612cfa9267ffffffffffffffff16915191604051968795169160208601614bca565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7fd9437f9d00000000000000000000000000000000000000000000000000000000600052600d600452600060245260446000fd5b6020818303126101f95780359067ffffffffffffffff82116101f957016080818303126101f95760405191614d3c83610504565b813583526020820135614d4e81610787565b602084015260408201356040840152606082013567ffffffffffffffff81116101f957614d7b920161496e565b606082015290565b606080604051614d9281610504565b600081526000602082015260006040820152015260048210614b72577f21ea4ca9000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000614dfd614adf85856148dd565b1603614b4857816148d292614e11926148eb565b810190614d08565b8051519060ff8211614e8e577fff0000000000000000000000000000000000000000000000000000000000000091612cfa610b1492516040519485937f5e6f7a8b00000000000000000000000000000000000000000000000000000000602086015260f81b1660248401526025830190614b9c565b7fd9437f9d00000000000000000000000000000000000000000000000000000000600052600e600452600060245260446000fd5b908160209103126101f9573590565b909291600093614ee46020830183612ac1565b90506040830193614ef585856131c0565b90506020840190614f0d611cd4835163ffffffff1690565b8085116155b057506001811161557e5760a0850196614f4c88517fffffffff000000000000000000000000000000000000000000000000000000001690565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f2812d52c0000000000000000000000000000000000000000000000000000000081148015615555575b801561552c575b1561502257505050505050509181615018612c6f614fe761501196614fcb608061501e980186612ac1565b613d42611cd46040613d36610100879697015163ffffffff1690565b51958694517fffffffff000000000000000000000000000000000000000000000000000000001690565b9280612ac1565b90613f73565b9190565b7fc4e0595300000000000000000000000000000000000000000000000000000000819c94979b9a9395989c999699146000146152b15750506150c26150896150b5999a9b6040613c1b611cd461507b60808b018b612ac1565b939094015163ffffffff1690565b918251998a91517fffffffff000000000000000000000000000000000000000000000000000000001690565b615018612c6f8880612ac1565b606081015151908a6150df6150d78780612ac1565b810190614ec2565b61528c575081615256575b8515159081615249575b5061521f57604081116151ed57506151239061511d6151168695949896612942565b809261356b565b9961356b565b946000935b838510615182575050505050611cd4615145915163ffffffff1690565b8082116151525750509190565b7f869337890000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b90919293956001906151c2611cd4612d896151b18667ffffffffffffffff16600052600b602052604060002090565b611454612c1c8d610c298b8d6131c0565b80156151dd576151d19161356b565b965b0193929190615128565b506151e79061354f565b966151d3565b7fc327a56c00000000000000000000000000000000000000000000000000000000600052600452604060245260446000fd5b7f5bed51920000000000000000000000000000000000000000000000000000000060005260046000fd5b60409150015115386150f4565b611ed1827fc327a56c00000000000000000000000000000000000000000000000000000000600052906044916004526000602452565b925099506152ab6152a461529f8361355d565b612914565b809361356b565b996150ea565b7f1e10bdc400000000000000000000000000000000000000000000000000000000036154dd57506153346152f96150b5999a9b6040613c95611cd461507b60808b018b612ac1565b9161530b611cd4845163ffffffff1690565b998a91517fffffffff000000000000000000000000000000000000000000000000000000001690565b608081015151908a6153496150d78780612ac1565b6154c457508161548e575b85151580615482575b61521f576040821161544e576020015167ffffffffffffffff9081169081831c166154145750506153989061511d615116869594989661292a565b946000935b8385106153ba575050505050611cd4615145915163ffffffff1690565b90919293956001906153e9611cd4612d896151b18667ffffffffffffffff16600052600b602052604060002090565b8015615404576153f89161356b565b965b019392919061539d565b5061540e9061354f565b966153fa565b7fafa933080000000000000000000000000000000000000000000000000000000060005267ffffffffffffffff1660045260245260446000fd5b7f8a0d71f7000000000000000000000000000000000000000000000000000000006000526004829052604060245260446000fd5b5060608101511561535d565b611ed1827f8a0d71f700000000000000000000000000000000000000000000000000000000600052906044916004526000602452565b925099506154d76152a461529f83613541565b99615354565b7f2ee82075000000000000000000000000000000000000000000000000000000006000527fffffffff000000000000000000000000000000000000000000000000000000001660045260246000fd5b507f647e2ba9000000000000000000000000000000000000000000000000000000008114614fa0565b507fac77ffec000000000000000000000000000000000000000000000000000000008114614f99565b7fd88dddd600000000000000000000000000000000000000000000000000000000600052600452600160245260446000fd5b7f8693378900000000000000000000000000000000000000000000000000000000600052600452602484905260446000fd5b94939192909282156156725767ffffffffffffffff16600052600b60205260406000209115612a725761561e91611a66913590612c9a826101db565b9261562f611c8d6060860151151590565b615660575050615649612677611cd4845163ffffffff1690565b90613c726040613d36602086015163ffffffff1690565b61566b9193506128c9565b9190602090565b505050509050600090600090600090565b908160209103126101f9575190565b60208151036156d5576156ae6020825183010160208301615683565b73ffffffffffffffffffffffffffffffffffffffff8111908115615716575b506156d55750565b615712906040519182917f8d666f6000000000000000000000000000000000000000000000000000000000835260206004840181815201906102b1565b0390fd5b610400915010386156cd565b602081510361574857600b6157406020835184010160208401615683565b106157485750565b615712906040519182917fe0d7fb0200000000000000000000000000000000000000000000000000000000835260206004840181815201906102b1565b9060208251036157ab5780615798575050565b6157406020835184010160208401615683565b6040517fe0d7fb02000000000000000000000000000000000000000000000000000000008152602060048201528061571260248201856102b1565b60248151036157fc576022810151156157fc5750565b615712906040519182917f373b0e4400000000000000000000000000000000000000000000000000000000835260206004840181815201906102b1565b8054821015612a725760005260206000200190600090565b91615889918354907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055565b805480156158f1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906158c28282615839565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000818152600760205260409020549081156159fd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8201908282116128eb57600654927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84019384116128eb5783836000956159bc95036159c2575b5050506159ab600661588d565b600790600052602052604060002090565b55600190565b6159ab6159ee916159e46159da6159f4956006615839565b90549060031b1c90565b9283916006615839565b90615851565b5538808061599e565b5050600090565b6001810191806000528260205260406000205492831515600014615adc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84018481116128eb578354937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85019485116128eb5760009585836159bc97615a949503615aa3575b50505061588d565b90600052602052604060002090565b615ac36159ee91615aba6159da615ad39588615839565b92839187615839565b8590600052602052604060002090565b55388080615a8c565b50505050600090565b805490680100000000000000008210156104ff5781615b0c91600161588994018155615839565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b600081815260096020526040902054615b7657615b5f816008615ae5565b600854906000526009602052604060002055600190565b50600090565b600081815260036020526040902054615b7657615b9a816002615ae5565b600254906000526003602052604060002055600190565b60008281526001820160205260409020546159fd5780615bd383600193615ae5565b80549260005201602052604060002055600190565b908160409103126101f957602060405191615c02836104e3565b80518352015161326c81610787565b91615c1a612de6565b5060048210615d1c5750615c5d612c6f8280615c577fffffffff000000000000000000000000000000000000000000000000000000009587614908565b956148eb565b91167f181dcf10000000000000000000000000000000000000000000000000000000008103615ca4575080602080615c9a93518301019101615be8565b6001602082015290565b7f97a657c90000000000000000000000000000000000000000000000000000000014615cf4577f5247fdce0000000000000000000000000000000000000000000000000000000060005260046000fd5b80602080615d0793518301019101615683565b615d0f61057c565b9081526001602082015290565b91505067ffffffffffffffff615d3061057c565b911681526001602082015290565b6020604051917f181dcf1000000000000000000000000000000000000000000000000000000000828401528051602484015201511515604482015260448152610b14606482610559565b600854811015612a725760086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3015490565b6000818152600360205260409020549081156159fd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8201908282116128eb57600254927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84019384116128eb5783836159bc9460009603615e59575b505050615e48600261588d565b600390600052602052604060002090565b615e486159ee91615e716159da615e7b956002615839565b9283916002615839565b55388080615e3b56fea164736f6c634300081a000a" + +type FeeQuoterContract struct { + address common.Address + abi abi.ABI + backend bind.ContractBackend + contract *bind.BoundContract +} + +func NewFeeQuoterContract( + address common.Address, + backend bind.ContractBackend, +) (*FeeQuoterContract, error) { + parsed, err := abi.JSON(strings.NewReader(FeeQuoterABI)) + if err != nil { + return nil, err + } + return &FeeQuoterContract{ + address: address, + abi: parsed, + backend: backend, + contract: bind.NewBoundContract(address, parsed, backend, backend, backend), + }, nil +} + +func (c *FeeQuoterContract) Address() common.Address { + return c.address +} + +func (c *FeeQuoterContract) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []any + err := c.contract.Call(opts, &out, "owner") + if err != nil { + return common.Address{}, err + } + return *abi.ConvertType(out[0], new(common.Address)).(*common.Address), nil +} + +func (c *FeeQuoterContract) ApplyDestChainConfigUpdates(opts *bind.TransactOpts, args []DestChainConfigArgs) (*types.Transaction, error) { + return c.contract.Transact(opts, "applyDestChainConfigUpdates", args) +} + +func (c *FeeQuoterContract) UpdatePrices(opts *bind.TransactOpts, args PriceUpdates) (*types.Transaction, error) { + return c.contract.Transact(opts, "updatePrices", args) +} + +func (c *FeeQuoterContract) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, args AuthorizedCallerArgs) (*types.Transaction, error) { + return c.contract.Transact(opts, "applyAuthorizedCallerUpdates", args) +} + +func (c *FeeQuoterContract) ApplyTokenTransferFeeConfigUpdates(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []TokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []TokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) { + return c.contract.Transact(opts, "applyTokenTransferFeeConfigUpdates", tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (c *FeeQuoterContract) GetDestChainConfig(opts *bind.CallOpts, args uint64) (DestChainConfig, error) { + var out []any + err := c.contract.Call(opts, &out, "getDestChainConfig", args) + if err != nil { + var zero DestChainConfig + return zero, err + } + return *abi.ConvertType(out[0], new(DestChainConfig)).(*DestChainConfig), nil +} + +func (c *FeeQuoterContract) GetDestinationChainGasPrice(opts *bind.CallOpts, args uint64) (TimestampedPackedUint224, error) { + var out []any + err := c.contract.Call(opts, &out, "getDestinationChainGasPrice", args) + if err != nil { + var zero TimestampedPackedUint224 + return zero, err + } + return *abi.ConvertType(out[0], new(TimestampedPackedUint224)).(*TimestampedPackedUint224), nil +} + +func (c *FeeQuoterContract) GetTokenTransferFeeConfig(opts *bind.CallOpts, destChainSelector uint64, token common.Address) (TokenTransferFeeConfig, error) { + var out []any + err := c.contract.Call(opts, &out, "getTokenTransferFeeConfig", destChainSelector, token) + if err != nil { + var zero TokenTransferFeeConfig + return zero, err + } + return *abi.ConvertType(out[0], new(TokenTransferFeeConfig)).(*TokenTransferFeeConfig), nil +} + +func (c *FeeQuoterContract) GetStaticConfig(opts *bind.CallOpts) (StaticConfig, error) { + var out []any + err := c.contract.Call(opts, &out, "getStaticConfig") + if err != nil { + var zero StaticConfig + return zero, err + } + return *abi.ConvertType(out[0], new(StaticConfig)).(*StaticConfig), nil +} + +func (c *FeeQuoterContract) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + var out []any + err := c.contract.Call(opts, &out, "getAllAuthorizedCallers") + if err != nil { + var zero []common.Address + return zero, err + } + return *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address), nil +} + +type AuthorizedCallerArgs struct { + AddedCallers []common.Address + RemovedCallers []common.Address +} + +type DestChainConfig struct { + IsEnabled bool + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 + DestGasOverhead uint32 + DestGasPerPayloadByteBase uint8 + ChainFamilySelector [4]byte + DefaultTokenFeeUSDCents uint16 + DefaultTokenDestGasOverhead uint32 + DefaultTxGasLimit uint32 + NetworkFeeUSDCents uint16 + LinkFeeMultiplierPercent uint8 +} + +type DestChainConfigArgs struct { + DestChainSelector uint64 + DestChainConfig DestChainConfig +} + +type GasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type PriceUpdates struct { + TokenPriceUpdates []TokenPriceUpdate + GasPriceUpdates []GasPriceUpdate +} + +type StaticConfig struct { + MaxFeeJuelsPerMsg *big.Int + LinkToken common.Address +} + +type TimestampedPackedUint224 struct { + Value *big.Int + Timestamp uint32 +} + +type TokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type TokenTransferFeeConfig struct { + FeeUSDCents uint32 + DestGasOverhead uint32 + DestBytesOverhead uint32 + IsEnabled bool +} + +type TokenTransferFeeConfigArgs struct { + DestChainSelector uint64 + TokenTransferFeeConfigs []TokenTransferFeeConfigSingleTokenArgs +} + +type TokenTransferFeeConfigRemoveArgs struct { + DestChainSelector uint64 + Token common.Address +} + +type TokenTransferFeeConfigSingleTokenArgs struct { + Token common.Address + TokenTransferFeeConfig TokenTransferFeeConfig +} + +type ApplyTokenTransferFeeConfigUpdatesArgs struct { + TokenTransferFeeConfigArgs []TokenTransferFeeConfigArgs + TokensToUseDefaultFeeConfigs []TokenTransferFeeConfigRemoveArgs +} + +type GetTokenTransferFeeConfigArgs struct { + DestChainSelector uint64 + Token common.Address +} + +type ConstructorArgs struct { + StaticConfig StaticConfig + PriceUpdaters []common.Address + TokenTransferFeeConfigArgs []TokenTransferFeeConfigArgs + DestChainConfigArgs []DestChainConfigArgs +} + +var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ + Name: "fee-quoter:deploy", + Version: Version, + Description: "Deploys the FeeQuoter contract", + ContractMetadata: &bind.MetaData{ + ABI: FeeQuoterABI, + Bin: FeeQuoterBin, + }, + BytecodeByTypeAndVersion: map[string]contract.Bytecode{ + cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { + EVM: common.FromHex(FeeQuoterBin), + }, + }, + Validate: func(ConstructorArgs) error { return nil }, +}) + +var ApplyDestChainConfigUpdates = contract.NewWrite(contract.WriteParams[[]DestChainConfigArgs, *FeeQuoterContract]{ + Name: "fee-quoter:apply-dest-chain-config-updates", + Version: Version, + Description: "Calls applyDestChainConfigUpdates on the contract", + ContractType: ContractType, + ContractABI: FeeQuoterABI, + NewContract: NewFeeQuoterContract, + IsAllowedCaller: contract.OnlyOwner[*FeeQuoterContract, []DestChainConfigArgs], + Validate: func([]DestChainConfigArgs) error { return nil }, + CallContract: func( + c *FeeQuoterContract, + opts *bind.TransactOpts, + args []DestChainConfigArgs, + ) (*types.Transaction, error) { + return c.ApplyDestChainConfigUpdates(opts, args) + }, +}) + +var UpdatePrices = contract.NewWrite(contract.WriteParams[PriceUpdates, *FeeQuoterContract]{ + Name: "fee-quoter:update-prices", + Version: Version, + Description: "Calls updatePrices on the contract", + ContractType: ContractType, + ContractABI: FeeQuoterABI, + NewContract: NewFeeQuoterContract, + IsAllowedCaller: contract.OnlyOwner[*FeeQuoterContract, PriceUpdates], + Validate: func(PriceUpdates) error { return nil }, + CallContract: func( + c *FeeQuoterContract, + opts *bind.TransactOpts, + args PriceUpdates, + ) (*types.Transaction, error) { + return c.UpdatePrices(opts, args) + }, +}) + +var ApplyAuthorizedCallerUpdates = contract.NewWrite(contract.WriteParams[AuthorizedCallerArgs, *FeeQuoterContract]{ + Name: "fee-quoter:apply-authorized-caller-updates", + Version: Version, + Description: "Calls applyAuthorizedCallerUpdates on the contract", + ContractType: ContractType, + ContractABI: FeeQuoterABI, + NewContract: NewFeeQuoterContract, + IsAllowedCaller: contract.OnlyOwner[*FeeQuoterContract, AuthorizedCallerArgs], + Validate: func(AuthorizedCallerArgs) error { return nil }, + CallContract: func( + c *FeeQuoterContract, + opts *bind.TransactOpts, + args AuthorizedCallerArgs, + ) (*types.Transaction, error) { + return c.ApplyAuthorizedCallerUpdates(opts, args) + }, +}) + +var ApplyTokenTransferFeeConfigUpdates = contract.NewWrite(contract.WriteParams[ApplyTokenTransferFeeConfigUpdatesArgs, *FeeQuoterContract]{ + Name: "fee-quoter:apply-token-transfer-fee-config-updates", + Version: Version, + Description: "Calls applyTokenTransferFeeConfigUpdates on the contract", + ContractType: ContractType, + ContractABI: FeeQuoterABI, + NewContract: NewFeeQuoterContract, + IsAllowedCaller: contract.OnlyOwner[*FeeQuoterContract, ApplyTokenTransferFeeConfigUpdatesArgs], + Validate: func(ApplyTokenTransferFeeConfigUpdatesArgs) error { return nil }, + CallContract: func( + c *FeeQuoterContract, + opts *bind.TransactOpts, + args ApplyTokenTransferFeeConfigUpdatesArgs, + ) (*types.Transaction, error) { + return c.ApplyTokenTransferFeeConfigUpdates(opts, args.TokenTransferFeeConfigArgs, args.TokensToUseDefaultFeeConfigs) + }, +}) + +var GetDestChainConfig = contract.NewRead(contract.ReadParams[uint64, DestChainConfig, *FeeQuoterContract]{ + Name: "fee-quoter:get-dest-chain-config", + Version: Version, + Description: "Calls getDestChainConfig on the contract", + ContractType: ContractType, + NewContract: NewFeeQuoterContract, + CallContract: func(c *FeeQuoterContract, opts *bind.CallOpts, args uint64) (DestChainConfig, error) { + return c.GetDestChainConfig(opts, args) + }, +}) + +var GetDestinationChainGasPrice = contract.NewRead(contract.ReadParams[uint64, TimestampedPackedUint224, *FeeQuoterContract]{ + Name: "fee-quoter:get-destination-chain-gas-price", + Version: Version, + Description: "Calls getDestinationChainGasPrice on the contract", + ContractType: ContractType, + NewContract: NewFeeQuoterContract, + CallContract: func(c *FeeQuoterContract, opts *bind.CallOpts, args uint64) (TimestampedPackedUint224, error) { + return c.GetDestinationChainGasPrice(opts, args) + }, +}) + +var GetTokenTransferFeeConfig = contract.NewRead(contract.ReadParams[GetTokenTransferFeeConfigArgs, TokenTransferFeeConfig, *FeeQuoterContract]{ + Name: "fee-quoter:get-token-transfer-fee-config", + Version: Version, + Description: "Calls getTokenTransferFeeConfig on the contract", + ContractType: ContractType, + NewContract: NewFeeQuoterContract, + CallContract: func(c *FeeQuoterContract, opts *bind.CallOpts, args GetTokenTransferFeeConfigArgs) (TokenTransferFeeConfig, error) { + return c.GetTokenTransferFeeConfig(opts, args.DestChainSelector, args.Token) + }, +}) + +var GetStaticConfig = contract.NewRead(contract.ReadParams[struct{}, StaticConfig, *FeeQuoterContract]{ + Name: "fee-quoter:get-static-config", + Version: Version, + Description: "Calls getStaticConfig on the contract", + ContractType: ContractType, + NewContract: NewFeeQuoterContract, + CallContract: func(c *FeeQuoterContract, opts *bind.CallOpts, args struct{}) (StaticConfig, error) { + return c.GetStaticConfig(opts) + }, +}) + +var GetAllAuthorizedCallers = contract.NewRead(contract.ReadParams[struct{}, []common.Address, *FeeQuoterContract]{ + Name: "fee-quoter:get-all-authorized-callers", + Version: Version, + Description: "Calls getAllAuthorizedCallers on the contract", + ContractType: ContractType, + NewContract: NewFeeQuoterContract, + CallContract: func(c *FeeQuoterContract, opts *bind.CallOpts, args struct{}) ([]common.Address, error) { + return c.GetAllAuthorizedCallers(opts) + }, +}) diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go new file mode 100644 index 0000000000..263638bd77 --- /dev/null +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go @@ -0,0 +1,562 @@ +package sequences + +import ( + "encoding/json" + "fmt" + "strings" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" + "golang.org/x/exp/maps" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/onramp" + seq1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" + fq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + seq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/sequences" + "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + + fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" +) + +const ( + LinkFeeMultiplierPercent uint8 = 90 + NetworkFeeUSDCents uint16 = 10 +) + +type FeeQuoterUpdate struct { + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef + ConstructorArgs fqops.ConstructorArgs + PriceUpdates fqops.PriceUpdates + DestChainConfigs []fqops.DestChainConfigArgs + TokenTransferFeeConfigUpdates fqops.ApplyTokenTransferFeeConfigUpdatesArgs + AuthorizedCallerUpdates fqops.AuthorizedCallerArgs +} + +func (fqu FeeQuoterUpdate) IsEmpty() (bool, error) { + empty := FeeQuoterUpdate{} + // marshal into JSON + emptyBytes, err := json.Marshal(empty) + if err != nil { + return false, fmt.Errorf("failed to marshal empty FeeQuoterUpdate: %w", err) + } + inputBytes, err := json.Marshal(fqu) + if err != nil { + return false, fmt.Errorf("failed to marshal FeeQuoterUpdate: %w", err) + } + return string(emptyBytes) == string(inputBytes), nil +} + +var ( + // SequenceFeeQuoterUpdate is a sequence that deploys or fetches existing FeeQuoter contract + // and does the following if the corresponding input is provided - + // 1. applies destination chain config updates + // 2. price updates + // 3. token transfer fee config updates + // 4. authorized caller updates + SequenceFeeQuoterUpdate = cldf_ops.NewSequence( + "fee-quoter-v2.0.0:update-sequence", + semver.MustParse("2.0.0"), + "Deploys or fetches existing FeeQuoter contract and applies destination chain config updates and price updates", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input FeeQuoterUpdate) (output sequences.OnChainOutput, err error) { + chain, ok := chains.EVMChains()[input.ChainSelector] + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", input.ChainSelector) + } + + // deploy fee quoter or fetch existing fee quoter address + feeQuoterRef, err := contract.MaybeDeployContract( + b, fqops.Deploy, chain, contract.DeployInput[fqops.ConstructorArgs]{ + TypeAndVersion: deployment.NewTypeAndVersion(fqops.ContractType, *fqops.Version), + ChainSelector: chain.Selector, + Args: input.ConstructorArgs, + }, input.ExistingAddresses) + if err != nil { + return sequences.OnChainOutput{}, err + } + if feeQuoterRef.Address == "" { + return sequences.OnChainOutput{}, fmt.Errorf("failed to deploy or "+ + "fetch FeeQuoter on chain %s", chain.String()) + } + writes := make([]contract.WriteOutput, 0) + output.Addresses = append(output.Addresses, feeQuoterRef) + fqAddr := common.HexToAddress(feeQuoterRef.Address) + // ApplyDestChainConfigUpdates on FeeQuoter + if len(input.DestChainConfigs) > 0 { + feeQuoterReport, err := cldf_ops.ExecuteOperation( + b, fqops.ApplyDestChainConfigUpdates, chain, + contract.FunctionInput[[]fqops.DestChainConfigArgs]{ + ChainSelector: chain.Selector, + Address: fqAddr, + Args: input.DestChainConfigs, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to apply dest chain "+ + "config updates to FeeQuoter(%s) on chain %s: %w", fqAddr.Hex(), chain, err) + } + writes = append(writes, feeQuoterReport.Output) + } + // update price + if len(input.PriceUpdates.GasPriceUpdates) > 0 || len(input.PriceUpdates.TokenPriceUpdates) > 0 { + feeQuoterUpdatePricesReport, err := cldf_ops.ExecuteOperation( + b, fqops.UpdatePrices, chain, contract.FunctionInput[fqops.PriceUpdates]{ + ChainSelector: chain.Selector, + Address: fqAddr, + Args: fqops.PriceUpdates{ + GasPriceUpdates: input.PriceUpdates.GasPriceUpdates, + TokenPriceUpdates: input.PriceUpdates.TokenPriceUpdates, + }, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to update gas prices on "+ + "FeeQuoter(%s) on chain %s: %w", fqAddr.Hex(), chain, err) + } + writes = append(writes, feeQuoterUpdatePricesReport.Output) + } + // TokenTransferFeeConfigUpdates on FeeQuoter + if len(input.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs) > 0 || + len(input.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs) > 0 { + feeQuoterTokenTransferFeeConfigReport, err := cldf_ops.ExecuteOperation( + b, fqops.ApplyTokenTransferFeeConfigUpdates, chain, + contract.FunctionInput[fqops.ApplyTokenTransferFeeConfigUpdatesArgs]{ + ChainSelector: chain.Selector, + Address: fqAddr, + Args: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: input.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs, + TokensToUseDefaultFeeConfigs: input.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, + }, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to apply token transfer fee "+ + "config updates to FeeQuoter(%s) on chain %s: %w", fqAddr.Hex(), chain, err) + } + writes = append(writes, feeQuoterTokenTransferFeeConfigReport.Output) + } + // ApplyAuthorizedCallerUpdates on FeeQuoter + if len(input.AuthorizedCallerUpdates.AddedCallers) > 0 || + len(input.AuthorizedCallerUpdates.RemovedCallers) > 0 { + feeQuoterAuthorizedCallerReport, err := cldf_ops.ExecuteOperation( + b, fqops.ApplyAuthorizedCallerUpdates, chain, + contract.FunctionInput[fqops.AuthorizedCallerArgs]{ + ChainSelector: chain.Selector, + Address: fqAddr, + Args: input.AuthorizedCallerUpdates, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to apply authorized caller "+ + "updates to FeeQuoter(%s) on chain %s: %w", fqAddr.Hex(), chain, err) + } + writes = append(writes, feeQuoterAuthorizedCallerReport.Output) + } + batch, err := contract.NewBatchOperationFromWrites(writes) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation from writes: %w", err) + } + output.BatchOps = []mcms_types.BatchOperation{batch} + return output, nil + }, + ) + + // CreateFeeQuoterUpdateInputFromV16x creates FeeQuoterUpdate input by importing configuration from FeeQuoter v1.6.x + CreateFeeQuoterUpdateInputFromV16x = cldf_ops.NewSequence( + "fetches-feequoter-config-values-from-v1.6.x", + semver.MustParse("2.0.0"), + "Creates FeeQuoterUpdate input by importing configuration from FeeQuoter v1.6.x", + func(b cldf_ops.Bundle, chain evm.Chain, input deploy.FeeQuoterUpdateInput) (output FeeQuoterUpdate, err error) { + // check if FeeQuoter v1.6.x is present in existing addresses, if not, we return empty output + // it means there is no existing fee quoter deployed from v1.6.x deployment, and we can skip the config import from v1.6.x + fq16AddressRef, err := seq1_6.GetFeeQuoterAddress(input.ExistingAddresses, input.ChainSelector) + if err != nil { + if strings.Contains(err.Error(), "no fee quoter address found") { + return FeeQuoterUpdate{}, nil + } + return FeeQuoterUpdate{}, fmt.Errorf("failed to get FeeQuoter 1.6.x address: %w", err) + } + output.ChainSelector = input.ChainSelector + output.ExistingAddresses = input.ExistingAddresses + + // get feeQuoter 1.6 address meta + metadataForFq16, err := datastore_utils.FilterContractMetaByContractTypeAndVersion( + input.ExistingAddresses, + input.ContractMeta, + fq1_6.ContractType, + fq16AddressRef.Version, + "", + input.ChainSelector, + ) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to get FeeQuoter 1.6.x address: %w", err) + } + if len(metadataForFq16) == 0 { + return FeeQuoterUpdate{}, fmt.Errorf("no metadata found for FeeQuoter v1.6.x on chain selector %d", input.ChainSelector) + } + if len(metadataForFq16) > 1 { + return FeeQuoterUpdate{}, fmt.Errorf("multiple metadata entries found for FeeQuoter v1.6.x on chain selector %d", input.ChainSelector) + } + // Convert metadata to typed struct if needed + fqOutput, err := datastore_utils.ConvertMetadataToType[seq1_6.FeeQuoterImportConfigSequenceOutput](metadataForFq16[0].Metadata) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to convert metadata to "+ + "FeeQuoterImportConfigSequenceOutput for chain selector %d: %w", input.ChainSelector, err) + } + // is feeQuoter going to be deployed or fetched from existing addresses? + feeQuoterRef := datastore_utils.GetAddressRef( + input.ExistingAddresses, + input.ChainSelector, + fqops.ContractType, + fqops.Version, + "", + ) + isNewFQV2Deployment := datastore_utils.IsAddressRefEmpty(feeQuoterRef) + tokenTransferFeeConfigArgs := make([]fqops.TokenTransferFeeConfigArgs, 0) + allDestChainConfigs := make([]fqops.DestChainConfigArgs, 0) + for remoteChain, cfg := range fqOutput.RemoteChainCfgs { + if !cfg.DestChainCfg.IsEnabled { + continue + } + destChainConfig := cfg.DestChainCfg + outDestchainCfg := fqops.DestChainConfigArgs{ + DestChainSelector: remoteChain, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: destChainConfig.IsEnabled, + MaxDataBytes: destChainConfig.MaxDataBytes, + MaxPerMsgGasLimit: destChainConfig.MaxPerMsgGasLimit, + DestGasOverhead: destChainConfig.DestGasOverhead, + DestGasPerPayloadByteBase: destChainConfig.DestGasPerPayloadByteBase, + ChainFamilySelector: destChainConfig.ChainFamilySelector, + DefaultTokenFeeUSDCents: destChainConfig.DefaultTokenFeeUSDCents, + DefaultTokenDestGasOverhead: destChainConfig.DefaultTokenDestGasOverhead, + DefaultTxGasLimit: destChainConfig.DefaultTxGasLimit, + NetworkFeeUSDCents: uint16(destChainConfig.NetworkFeeUSDCents), + LinkFeeMultiplierPercent: LinkFeeMultiplierPercent, + }, + } + tokenTransferFeeCfgs := make([]fqops.TokenTransferFeeConfigSingleTokenArgs, 0) + for token, transferCfg := range cfg.TokenTransferFeeCfgs { + if !transferCfg.IsEnabled { + continue + } + tokenTransferFeeCfgs = append(tokenTransferFeeCfgs, fqops.TokenTransferFeeConfigSingleTokenArgs{ + Token: token, + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: transferCfg.MinFeeUSDCents, + DestGasOverhead: transferCfg.DestGasOverhead, + DestBytesOverhead: transferCfg.DestBytesOverhead, + IsEnabled: transferCfg.IsEnabled, + }, + }) + } + tokenTransferFeeConfigArgs = append(tokenTransferFeeConfigArgs, fqops.TokenTransferFeeConfigArgs{ + DestChainSelector: remoteChain, + TokenTransferFeeConfigs: tokenTransferFeeCfgs, + }) + allDestChainConfigs = append(allDestChainConfigs, outDestchainCfg) + } + if isNewFQV2Deployment { + output.ConstructorArgs = fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: fqOutput.StaticCfg.LinkToken, + MaxFeeJuelsPerMsg: fqOutput.StaticCfg.MaxFeeJuelsPerMsg, + }, + PriceUpdaters: fqOutput.PriceUpdaters, + TokenTransferFeeConfigArgs: tokenTransferFeeConfigArgs, + DestChainConfigArgs: allDestChainConfigs, + } + } else { + output.AuthorizedCallerUpdates = fqops.AuthorizedCallerArgs{ + AddedCallers: fqOutput.PriceUpdaters, + } + output.TokenTransferFeeConfigUpdates = fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: tokenTransferFeeConfigArgs, + } + output.DestChainConfigs = allDestChainConfigs + } + return output, nil + }) + + // CreateFeeQuoterUpdateInputFromV150 creates FeeQuoterUpdate input by importing configuration from PriceRegistry v1.5.0 and EVM2EVMOnRamp v1.5.0 + CreateFeeQuoterUpdateInputFromV150 = cldf_ops.NewSequence( + "fetches-feequoter-config-values-from-v1.5.0", + semver.MustParse("2.0.0"), + "Creates FeeQuoterUpdate input by importing configuration from PriceRegistry v1.5.0 and EVM2EVMOnRamp v1.5.0", + func(b cldf_ops.Bundle, chain evm.Chain, input deploy.FeeQuoterUpdateInput) (output FeeQuoterUpdate, err error) { + // get address ref for onramp 1.5.0 + onRampRef := datastore_utils.GetAddressRef( + input.ExistingAddresses, + input.ChainSelector, + onrampops.ContractType, + onrampops.Version, + "", + ) + // if there is no address ref for onRamp 1.5.0, it means onRamp 1.5.0 is not deployed and we can skip the config import from onRamp 1.5.0 + if datastore_utils.IsAddressRefEmpty(onRampRef) { + return FeeQuoterUpdate{}, nil + } + // get address meta for onRamp 1.5.0 to read the config values from onRamp 1.5.0 + onRampMetadata, err := datastore_utils.FilterContractMetaByContractTypeAndVersion( + input.ExistingAddresses, + input.ContractMeta, + onrampops.ContractType, + onrampops.Version, + "", + input.ChainSelector, + ) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to get EVM2EVMOnRamp v1.5.0 address: %w", err) + } + if len(onRampMetadata) == 0 { + return FeeQuoterUpdate{}, fmt.Errorf("no metadata found for EVM2EVMOnRamp v1.5.0 on chain selector %d", input.ChainSelector) + } + // get the commit stores and that will act like price updaters for fee quoter + var commitStoreRefs []datastore.AddressRef + for _, addressRef := range input.ExistingAddresses { + if addressRef.Type == "CommitStore" && + addressRef.Version.Equal(semver.MustParse("1.5.0")) && + addressRef.ChainSelector == input.ChainSelector { + commitStoreRefs = append(commitStoreRefs, addressRef) + } + } + + if len(commitStoreRefs) == 0 { + return FeeQuoterUpdate{}, fmt.Errorf("failed to get commit store ref for chain %d", input.ChainSelector) + } + var priceUpdaters []common.Address + for _, ref := range commitStoreRefs { + priceUpdaters = append(priceUpdaters, common.HexToAddress(ref.Address)) + } + output.ChainSelector = input.ChainSelector + output.ExistingAddresses = input.ExistingAddresses + // is feeQuoter going to be deployed or fetched from existing addresses? + feeQuoterV2Ref := datastore_utils.GetAddressRef( + input.ExistingAddresses, + input.ChainSelector, + fqops.ContractType, + fqops.Version, + "", + ) + isNewFQv2Deployment := datastore_utils.IsAddressRefEmpty(feeQuoterV2Ref) + + var staticCfg fqops.StaticConfig + var destChainCfgs []fqops.DestChainConfigArgs + var tokenTransferFeeConfigArgsForAll []fqops.TokenTransferFeeConfigArgs + + for _, meta := range onRampMetadata { + var tokenTransferFeeConfigArgs []fqops.TokenTransferFeeConfigSingleTokenArgs + + // Convert metadata to typed struct if needed + onRampCfg, err := datastore_utils.ConvertMetadataToType[seq1_5.OnRampImportConfigSequenceOutput](meta.Metadata) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to convert metadata to "+ + "OnRampImportConfigSequenceOutput for chain selector %d: %w", input.ChainSelector, err) + } + if staticCfg.LinkToken == (common.Address{}) { + staticCfg = fqops.StaticConfig{ + LinkToken: onRampCfg.StaticConfig.LinkToken, + MaxFeeJuelsPerMsg: onRampCfg.StaticConfig.MaxNopFeesJuels, + } + } + chainFamilySelector := utils.GetSelectorHex(onRampCfg.RemoteChainSelector) + + destChainCfgs = append(destChainCfgs, fqops.DestChainConfigArgs{ + DestChainSelector: onRampCfg.RemoteChainSelector, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: onRampCfg.DynamicConfig.MaxDataBytes, + MaxPerMsgGasLimit: onRampCfg.DynamicConfig.MaxPerMsgGasLimit, + DestGasOverhead: onRampCfg.DynamicConfig.DestGasOverhead, + DestGasPerPayloadByteBase: uint8(onRampCfg.DynamicConfig.DestGasPerPayloadByte), + ChainFamilySelector: chainFamilySelector, + DefaultTokenFeeUSDCents: onRampCfg.DynamicConfig.DefaultTokenFeeUSDCents, + DefaultTokenDestGasOverhead: onRampCfg.DynamicConfig.DefaultTokenDestGasOverhead, + DefaultTxGasLimit: uint32(onRampCfg.StaticConfig.DefaultTxGasLimit), + NetworkFeeUSDCents: NetworkFeeUSDCents, + LinkFeeMultiplierPercent: LinkFeeMultiplierPercent, + }, + }) + for token, tokenCfg := range onRampCfg.TokenTransferFeeConfig { + tokenTransferFeeConfigArgs = append(tokenTransferFeeConfigArgs, fqops.TokenTransferFeeConfigSingleTokenArgs{ + Token: token, + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: tokenCfg.MinFeeUSDCents, + DestGasOverhead: tokenCfg.DestGasOverhead, + DestBytesOverhead: tokenCfg.DestBytesOverhead, + IsEnabled: tokenCfg.IsEnabled, + }, + }) + } + tokenTransferFeeConfigArgsForAll = append(tokenTransferFeeConfigArgsForAll, fqops.TokenTransferFeeConfigArgs{ + DestChainSelector: onRampCfg.RemoteChainSelector, + TokenTransferFeeConfigs: tokenTransferFeeConfigArgs, + }) + } + if isNewFQv2Deployment { + output.ConstructorArgs = fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: staticCfg.LinkToken, + MaxFeeJuelsPerMsg: staticCfg.MaxFeeJuelsPerMsg, + }, + DestChainConfigArgs: destChainCfgs, + TokenTransferFeeConfigArgs: tokenTransferFeeConfigArgsForAll, + PriceUpdaters: priceUpdaters, + } + } else { + output.DestChainConfigs = destChainCfgs + output.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs = tokenTransferFeeConfigArgsForAll + output.AuthorizedCallerUpdates = fqops.AuthorizedCallerArgs{ + AddedCallers: priceUpdaters, + } + } + return output, nil + }) +) + +// MergeFeeQuoterUpdateOutputs merges FeeQuoterUpdate outputs from the v1.6.x and v1.5.0 import +// sequences into a single update. output16 is the base; output15 supplements it. Where both +// provide values (e.g. ConstructorArgs, dest chain configs, token transfer fee configs), +// output16 takes precedence and output15 fills in only missing entries. +func MergeFeeQuoterUpdateOutputs(output16, output15 FeeQuoterUpdate) (FeeQuoterUpdate, error) { + result := output16 + + // ConstructorArgs: use output15 if output16 is empty + if IsConstructorArgsEmpty(result.ConstructorArgs) { + result.ConstructorArgs = output15.ConstructorArgs + } else { + // merge the dest chainConfig args + result.ConstructorArgs.DestChainConfigArgs = mergeDestChainConfigs( + result.ConstructorArgs.DestChainConfigArgs, + output15.ConstructorArgs.DestChainConfigArgs) + + resultPriceUpdatersMap := make(map[common.Address]bool) + for _, updater := range output15.ConstructorArgs.PriceUpdaters { + resultPriceUpdatersMap[updater] = true + } + for _, updater := range output16.ConstructorArgs.PriceUpdaters { + resultPriceUpdatersMap[updater] = true + } + + result.ConstructorArgs.PriceUpdaters = maps.Keys(resultPriceUpdatersMap) + + result.ConstructorArgs.TokenTransferFeeConfigArgs = mergeTokenTransferFeeConfigArgs( + result.ConstructorArgs.TokenTransferFeeConfigArgs, + output15.ConstructorArgs.TokenTransferFeeConfigArgs) + } + + result.DestChainConfigs = mergeDestChainConfigs(result.DestChainConfigs, output15.DestChainConfigs) + + // TokenTransferFeeConfigUpdates: merge by DestChainSelector, output16 takes precedence for duplicates + result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs = mergeTokenTransferFeeConfigArgs( + result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs, + output15.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs) + + // TokensToUseDefaultFeeConfigs: merge by DestChainSelector and Token + if len(result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs) == 0 { + result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs = output15.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs + } else { + // Create a map of (DestChainSelector, Token) pairs from output16 + tokenRemoveMap := make(map[string]bool) + for _, cfg := range result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs { + key := fmt.Sprintf("%d:%s", cfg.DestChainSelector, cfg.Token.Hex()) + tokenRemoveMap[key] = true + } + // Add configs from output15 that don't exist in output16 + for _, cfg := range output15.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs { + key := fmt.Sprintf("%d:%s", cfg.DestChainSelector, cfg.Token.Hex()) + if !tokenRemoveMap[key] { + result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs = append(result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, cfg) + } + // If it exists in both, output16's value is already used (takes precedence) + } + } + + // AuthorizedCallerUpdates: merge unique entries from both outputs + result.AuthorizedCallerUpdates = mergePriceUpdaters(result.AuthorizedCallerUpdates, output15.AuthorizedCallerUpdates) + + return result, nil +} + +func mergeTokenTransferFeeConfigArgs(args1, args2 []fqops.TokenTransferFeeConfigArgs) []fqops.TokenTransferFeeConfigArgs { + result := args1 + // TokenTransferFeeConfigArgs: merge by DestChainSelector + if len(result) == 0 { + result = args2 + } else { + // Create a map of dest chain selectors from output16 + tokenConfigMap := make(map[uint64]int) + for i, cfg := range result { + tokenConfigMap[cfg.DestChainSelector] = i + } + // Add configs from output15 that don't exist in output16 + for _, cfg := range args2 { + if _, exists := tokenConfigMap[cfg.DestChainSelector]; !exists && len(cfg.TokenTransferFeeConfigs) > 0 { + result = append(result, cfg) + } + // If it exists in both, output16's value is already used (takes precedence) + } + } + return result +} + +func mergePriceUpdaters(updaters1, updaters2 fqops.AuthorizedCallerArgs) fqops.AuthorizedCallerArgs { + result := updaters1 + // AddedCallers: merge unique addresses from both outputs + addedCallersMap := make(map[common.Address]bool) + for _, addr := range result.AddedCallers { + addedCallersMap[addr] = true + } + for _, addr := range updaters2.AddedCallers { + if !addedCallersMap[addr] { + result.AddedCallers = append(result.AddedCallers, addr) + addedCallersMap[addr] = true + } + } + // RemovedCallers: merge unique addresses from both outputs + removedCallersMap := make(map[common.Address]bool) + for _, addr := range result.RemovedCallers { + removedCallersMap[addr] = true + } + for _, addr := range updaters2.RemovedCallers { + if !removedCallersMap[addr] { + result.RemovedCallers = append(result.RemovedCallers, addr) + removedCallersMap[addr] = true + } + } + return result +} + +// mergeDestChainConfigs merges two slices of DestChainConfigArgs, giving precedence to the first slice in case of duplicate DestChainSelectors. +func mergeDestChainConfigs(cfgs1, cfgs2 []fqops.DestChainConfigArgs) []fqops.DestChainConfigArgs { + result := cfgs1 + + // Create a map of dest chain selectors from cfgs1 which will be skipped when adding from cfgs2 + destChainMap := make(map[uint64]fqops.DestChainConfigArgs) + for _, cfg := range cfgs1 { + destChainMap[cfg.DestChainSelector] = cfg + } + + // Add configs from cfgs2 that don't exist in cfgs1 + for _, cfg := range cfgs2 { + if _, exists := destChainMap[cfg.DestChainSelector]; !exists { + result = append(result, cfg) + } + // If it exists in both, cfgs1's value is already used (takes precedence) + } + + return result +} + +func IsConstructorArgsEmpty(a fqops.ConstructorArgs) bool { + return (a.StaticConfig == fqops.StaticConfig{}) && + len(a.PriceUpdaters) == 0 && + len(a.TokenTransferFeeConfigArgs) == 0 && + len(a.DestChainConfigArgs) == 0 +} diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter_test.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter_test.go new file mode 100644 index 0000000000..41b047c210 --- /dev/null +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter_test.go @@ -0,0 +1,414 @@ +package sequences_test + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" +) + +func TestFeeQuoterUpdate_IsEmpty(t *testing.T) { + empty := sequences.FeeQuoterUpdate{} + isEmpty, err := empty.IsEmpty() + require.NoError(t, err) + require.True(t, isEmpty, "Empty FeeQuoterUpdate should return true") + + nonEmpty := sequences.FeeQuoterUpdate{ + ChainSelector: 1, + } + isEmpty, err = nonEmpty.IsEmpty() + require.NoError(t, err) + require.False(t, isEmpty, "Non-empty FeeQuoterUpdate should return false") +} + +func TestMergeFeeQuoterUpdateOutputs(t *testing.T) { + addr1 := common.HexToAddress("0x1111111111111111111111111111111111111111") + addr2 := common.HexToAddress("0x2222222222222222222222222222222222222222") + addr3 := common.HexToAddress("0x3333333333333333333333333333333333333333") + addr4 := common.HexToAddress("0x4444444444444444444444444444444444444444") + addr5 := common.HexToAddress("0x5555555555555555555555555555555555555555") + + t.Run("empty outputs", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{} + output15 := sequences.FeeQuoterUpdate{} + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Equal(t, sequences.FeeQuoterUpdate{}, result) + }) + + t.Run("ConstructorArgs - output15 used when output16 is empty", func(t *testing.T) { + linkToken := common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") + maxFeeJuelsPerMsg := big.NewInt(1000000000000000000) // 1 LINK + output16 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{}, // empty + } + output15 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken, + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg, + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Equal(t, linkToken, result.ConstructorArgs.StaticConfig.LinkToken) + require.Equal(t, maxFeeJuelsPerMsg, result.ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg) + }) + + t.Run("ConstructorArgs - output16 takes precedence when not empty", func(t *testing.T) { + linkToken16 := common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") + linkToken15 := common.HexToAddress("0x326C977E6efc84E512bB9C30f76E30c160eD06FB") + maxFeeJuelsPerMsg16 := big.NewInt(2000000000000000000) // 2 LINK + maxFeeJuelsPerMsg15 := big.NewInt(1000000000000000000) // 1 LINK + output16 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken16, + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg16, + }, + }, + } + output15 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken15, + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg15, + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + // output16's StaticConfig should be used (takes precedence) + require.Equal(t, linkToken16, result.ConstructorArgs.StaticConfig.LinkToken) + require.Equal(t, maxFeeJuelsPerMsg16, result.ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg) + }) + + t.Run("ConstructorArgs - merge DestChainConfig,PriceUpdaters TokenTransferFeeConfigArgs", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + MaxFeeJuelsPerMsg: big.NewInt(2000000000000000000), // 2 LINK + }, + PriceUpdaters: []common.Address{addr1, addr2}, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 100, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr1}, + }, + }, + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 100, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 1000, + }, + }, + }, + }, + } + output15 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: common.HexToAddress("0x326C977E6efc84E512bB9C30f76E30c160eD06FB"), + MaxFeeJuelsPerMsg: big.NewInt(1000000000000000000), // 1 LINK + }, + PriceUpdaters: []common.Address{addr2, addr3}, // addr2 is duplicate + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 100, // duplicate selector + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr2}, + }, + }, + { + DestChainSelector: 200, // unique selector + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr3}, + }, + }, + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 100, // duplicate selector + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: false, + MaxDataBytes: 2000, + }, + }, + { + DestChainSelector: 200, // unique selector + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 3000, + }, + }, + }, + }, + } + expected := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + MaxFeeJuelsPerMsg: big.NewInt(2000000000000000000), // from output16 + }, + PriceUpdaters: []common.Address{addr1, addr2, addr3}, // merged with duplicates removed + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 100, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr1}, // from output16 (takes precedence) + }, + }, + { + DestChainSelector: 200, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr3}, // from output15 + }, + }, + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 100, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 1000, + }, + }, + { + DestChainSelector: 200, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 3000, + }, + }, + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Equal(t, expected.ConstructorArgs.StaticConfig, result.ConstructorArgs.StaticConfig) + require.ElementsMatch(t, expected.ConstructorArgs.PriceUpdaters, result.ConstructorArgs.PriceUpdaters) + require.Len(t, result.ConstructorArgs.TokenTransferFeeConfigArgs, 2) + require.Equal(t, uint64(100), result.ConstructorArgs.TokenTransferFeeConfigArgs[0].DestChainSelector) + require.Equal(t, addr1, result.ConstructorArgs.TokenTransferFeeConfigArgs[0].TokenTransferFeeConfigs[0].Token) // from output16 + require.Equal(t, uint64(200), result.ConstructorArgs.TokenTransferFeeConfigArgs[1].DestChainSelector) + require.Equal(t, addr3, result.ConstructorArgs.TokenTransferFeeConfigArgs[1].TokenTransferFeeConfigs[0].Token) // from output15 + require.Len(t, result.ConstructorArgs.DestChainConfigArgs, 2) + require.Equal(t, uint64(100), result.ConstructorArgs.DestChainConfigArgs[0].DestChainSelector) + require.True(t, result.ConstructorArgs.DestChainConfigArgs[0].DestChainConfig.IsEnabled) // from output16 + require.Equal(t, uint32(1000), result.ConstructorArgs.DestChainConfigArgs[0].DestChainConfig.MaxDataBytes) // from output16 + require.Equal(t, uint64(200), result.ConstructorArgs.DestChainConfigArgs[1].DestChainSelector) + require.True(t, result.ConstructorArgs.DestChainConfigArgs[1].DestChainConfig.IsEnabled) // from output15 + require.Equal(t, uint32(3000), result.ConstructorArgs.DestChainConfigArgs[1].DestChainConfig.MaxDataBytes) // from output15 + }) + + t.Run("DestChainConfigs - output16 takes precedence for duplicates", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{ + DestChainConfigs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 100, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 1000, + }, + }, + }, + } + output15 := sequences.FeeQuoterUpdate{ + DestChainConfigs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 100, // duplicate selector + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: false, + MaxDataBytes: 2000, + }, + }, + { + DestChainSelector: 200, // unique selector + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 3000, + }, + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Len(t, result.DestChainConfigs, 2) + // output16's config for selector 100 should be used + require.Equal(t, uint64(100), result.DestChainConfigs[0].DestChainSelector) + require.True(t, result.DestChainConfigs[0].DestChainConfig.IsEnabled) + require.Equal(t, uint32(1000), result.DestChainConfigs[0].DestChainConfig.MaxDataBytes) + // output15's config for selector 200 should be added + require.Equal(t, uint64(200), result.DestChainConfigs[1].DestChainSelector) + require.Equal(t, uint32(3000), result.DestChainConfigs[1].DestChainConfig.MaxDataBytes) + }) + + t.Run("TokenTransferFeeConfigArgs - output16 takes precedence for duplicates", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{ + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 100, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr1}, + }, + }, + }, + }, + } + output15 := sequences.FeeQuoterUpdate{ + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 100, // duplicate + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr2}, + }, + }, + { + DestChainSelector: 200, // unique + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + {Token: addr3}, + }, + }, + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Len(t, result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs, 2) + // output16's config for selector 100 should be used + require.Equal(t, uint64(100), result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[0].DestChainSelector) + require.Equal(t, addr1, result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[0].TokenTransferFeeConfigs[0].Token) + // output15's config for selector 200 should be added + require.Equal(t, uint64(200), result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[1].DestChainSelector) + require.Equal(t, addr3, result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[1].TokenTransferFeeConfigs[0].Token) + }) + + t.Run("TokensToUseDefaultFeeConfigs - merge by DestChainSelector and Token", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{ + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokensToUseDefaultFeeConfigs: []fqops.TokenTransferFeeConfigRemoveArgs{ + {DestChainSelector: 100, Token: addr1}, + {DestChainSelector: 100, Token: addr2}, + }, + }, + } + output15 := sequences.FeeQuoterUpdate{ + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokensToUseDefaultFeeConfigs: []fqops.TokenTransferFeeConfigRemoveArgs{ + {DestChainSelector: 100, Token: addr2}, // duplicate + {DestChainSelector: 200, Token: addr3}, // unique + }, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Len(t, result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, 3) + // Verify all expected entries are present + require.Contains(t, result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, + fqops.TokenTransferFeeConfigRemoveArgs{DestChainSelector: 100, Token: addr1}) + require.Contains(t, result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, + fqops.TokenTransferFeeConfigRemoveArgs{DestChainSelector: 100, Token: addr2}) + require.Contains(t, result.TokenTransferFeeConfigUpdates.TokensToUseDefaultFeeConfigs, + fqops.TokenTransferFeeConfigRemoveArgs{DestChainSelector: 200, Token: addr3}) + }) + + t.Run("AuthorizedCallerUpdates - merge unique entries", func(t *testing.T) { + output16 := sequences.FeeQuoterUpdate{ + AuthorizedCallerUpdates: fqops.AuthorizedCallerArgs{ + AddedCallers: []common.Address{addr1, addr2}, + RemovedCallers: []common.Address{addr3}, + }, + } + output15 := sequences.FeeQuoterUpdate{ + AuthorizedCallerUpdates: fqops.AuthorizedCallerArgs{ + AddedCallers: []common.Address{addr2, addr4}, // addr2 is duplicate + RemovedCallers: []common.Address{addr3, addr5}, // addr3 is duplicate + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + require.Len(t, result.AuthorizedCallerUpdates.AddedCallers, 3) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr1) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr2) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr4) + require.Len(t, result.AuthorizedCallerUpdates.RemovedCallers, 2) + require.Contains(t, result.AuthorizedCallerUpdates.RemovedCallers, addr3) + require.Contains(t, result.AuthorizedCallerUpdates.RemovedCallers, addr5) + }) + + t.Run("comprehensive merge", func(t *testing.T) { + linkToken16 := common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") + linkToken15 := common.HexToAddress("0x326C977E6efc84E512bB9C30f76E30c160eD06FB") + maxFeeJuelsPerMsg16 := big.NewInt(2000000000000000000) // 2 LINK + maxFeeJuelsPerMsg15 := big.NewInt(1000000000000000000) // 1 LINK + output16 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken16, + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg16, + }, + }, + DestChainConfigs: []fqops.DestChainConfigArgs{ + {DestChainSelector: 200, DestChainConfig: fqops.DestChainConfig{IsEnabled: true}}, + }, + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + {DestChainSelector: 400, TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{{Token: addr1}}}, + }, + }, + AuthorizedCallerUpdates: fqops.AuthorizedCallerArgs{ + AddedCallers: []common.Address{addr1}, + }, + } + output15 := sequences.FeeQuoterUpdate{ + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken15, + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg15, + }, + }, + DestChainConfigs: []fqops.DestChainConfigArgs{ + {DestChainSelector: 200, DestChainConfig: fqops.DestChainConfig{IsEnabled: false}}, // duplicate + {DestChainSelector: 300, DestChainConfig: fqops.DestChainConfig{IsEnabled: true}}, // unique + }, + TokenTransferFeeConfigUpdates: fqops.ApplyTokenTransferFeeConfigUpdatesArgs{ + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + {DestChainSelector: 400, TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{{Token: addr2}}}, // duplicate + {DestChainSelector: 500, TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{{Token: addr3}}}, // unique + }, + }, + AuthorizedCallerUpdates: fqops.AuthorizedCallerArgs{ + AddedCallers: []common.Address{addr2, addr3}, + }, + } + result, err := sequences.MergeFeeQuoterUpdateOutputs(output16, output15) + require.NoError(t, err) + // ConstructorArgs from output16 (not empty) - StaticConfig takes precedence + require.Equal(t, linkToken16, result.ConstructorArgs.StaticConfig.LinkToken) + require.Equal(t, maxFeeJuelsPerMsg16, result.ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg) + // DestChainConfigs: output16's config for 200, plus output15's config for 300 + require.Len(t, result.DestChainConfigs, 2) + require.True(t, result.DestChainConfigs[0].DestChainConfig.IsEnabled) // from output16 + // TokenTransferFeeConfigArgs: output16's config for 400, plus output15's config for 500 + require.Len(t, result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs, 2) + require.Equal(t, uint64(400), result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[0].DestChainSelector) + require.Equal(t, addr1, result.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs[0].TokenTransferFeeConfigs[0].Token) // from output16 + // AuthorizedCallerUpdates: merged unique entries + require.Len(t, result.AuthorizedCallerUpdates.AddedCallers, 3) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr1) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr2) + require.Contains(t, result.AuthorizedCallerUpdates.AddedCallers, addr3) + }) +} diff --git a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go new file mode 100644 index 0000000000..a73621211c --- /dev/null +++ b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go @@ -0,0 +1,948 @@ +package sequences_test + +import ( + "math/big" + "sort" + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + + seq1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" + fee_quoter_v1_6_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + seq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/sequences" + evm_2_evm_onramp_v1_5_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + dseq "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" + + evmadapter "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/adapters" + fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" +) + +// dummyAddressRefs is hardcoded address refs (previously from address_refs.json). +// Chain selectors must match dummyContractMetadata so metadata lookup succeeds. +var dummyAddressRefs = []datastore.AddressRef{ + {Address: "0x1111111111111111111111111111111111111111", ChainSelector: 5009297550715157269, Type: datastore.ContractType("FeeQuoter"), Version: semver.MustParse("1.6.3")}, + {Address: "0x6666666666666666666666666666666666666666", ChainSelector: 5009297550715157269, Type: datastore.ContractType("EVM2EVMOnRamp"), Version: semver.MustParse("1.5.0")}, + {Address: "0x2222222222222222222222222222222222222221", ChainSelector: 5009297550715157269, Type: datastore.ContractType("CommitStore"), Version: semver.MustParse("1.5.0")}, + {Address: "0x9999999999999999999999999999999999999999", ChainSelector: 4949039107694359620, Type: datastore.ContractType("CommitStore"), Version: semver.MustParse("1.5.0"), Qualifier: "commitstore1"}, + {Address: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", ChainSelector: 4949039107694359620, Type: datastore.ContractType("FeeQuoter"), Version: semver.MustParse("1.6.0")}, + {Address: "0x1010101010101010101010101010101010101010", ChainSelector: 4949039107694359620, Type: datastore.ContractType("EVM2EVMOnRamp"), Version: semver.MustParse("1.5.0")}, + {Address: "0x3333333333333333333333333333333333333333", ChainSelector: 4949039107694359620, Type: datastore.ContractType("CommitStore"), Version: semver.MustParse("1.5.0"), Qualifier: "commitstore2"}, + {Address: "0x5050505050505050505050505050505050505050", ChainSelector: 15971525489660198786, Type: datastore.ContractType("EVM2EVMOnRamp"), Version: semver.MustParse("1.5.0")}, + {Address: "0x4444444444444444444444444444444444444444", ChainSelector: 15971525489660198786, Type: datastore.ContractType("CommitStore"), Version: semver.MustParse("1.5.0")}, + {Address: "0x6060606060606060606060606060606060606060", ChainSelector: 5936861837188149645, Type: datastore.ContractType("FeeQuoter"), Version: semver.MustParse("1.6.3")}, + {Address: "0x7070707070707070707070707070707070707070", ChainSelector: 5936861837188149645, Type: datastore.ContractType("EVM2EVMOnRamp"), Version: semver.MustParse("1.5.0")}, + {Address: "0x5555555555555555555555555555555555555551", ChainSelector: 5936861837188149645, Type: datastore.ContractType("CommitStore"), Version: semver.MustParse("1.5.0")}, +} + +var dummyContractMetadata = []datastore.ContractMetadata{ + { + Address: "0x1111111111111111111111111111111111111111", + ChainSelector: 5009297550715157269, + Metadata: seq1_6.FeeQuoterImportConfigSequenceOutput{ + RemoteChainCfgs: map[uint64]seq1_6.FeeQuoterImportConfigSequenceOutputPerRemoteChain{ + 15971525489660198786: { + DestChainCfg: fee_quoter_v1_6_0.DestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 3, + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DestGasOverhead: 80000, + DestGasPerPayloadByteBase: 14, + DestGasPerPayloadByteHigh: 28, + DestGasPerPayloadByteThreshold: 800, + DestDataAvailabilityOverheadGas: 40000, + DestGasPerDataAvailabilityByte: 8, + DestDataAvailabilityMultiplierBps: 900, + ChainFamilySelector: utils.GetSelectorHex(15971525489660198786), + EnforceOutOfOrder: false, + DefaultTokenFeeUSDCents: 8, + DefaultTokenDestGasOverhead: 40000, + DefaultTxGasLimit: 180000, + GasMultiplierWeiPerEth: 0, + GasPriceStalenessThreshold: 0, + NetworkFeeUSDCents: 10, + }, + TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{ + common.HexToAddress("0x2222222222222222222222222222222222222222"): { + MinFeeUSDCents: 4, + MaxFeeUSDCents: 40, + DeciBps: 90, + DestGasOverhead: 25000, + DestBytesOverhead: 80, + IsEnabled: true, + }, + }, + }, + }, + StaticCfg: fee_quoter_v1_6_0.StaticConfig{ + MaxFeeJuelsPerMsg: big.NewInt(1000000000000000000), + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + TokenPriceStalenessThreshold: 3600, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + }, + }, + }, + { + Address: "0x6666666666666666666666666666666666666666", + ChainSelector: 5009297550715157269, + Metadata: seq1_5.OnRampImportConfigSequenceOutput{ + RemoteChainSelector: 4949039107694359620, + StaticConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampStaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + ChainSelector: 5009297550715157269, + DestChainSelector: 4949039107694359620, + DefaultTxGasLimit: 200000, + MaxNopFeesJuels: big.NewInt(1000000000000000000), + PrevOnRamp: common.HexToAddress("0x0000000000000000000000000000000000000000"), + RmnProxy: common.HexToAddress("0x7777777777777777777777777777777777777777"), + TokenAdminRegistry: common.HexToAddress("0x8888888888888888888888888888888888888888"), + }, + DynamicConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x9999999999999999999999999999999999999999"), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 100000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 50000, + DestGasPerDataAvailabilityByte: 10, + DestDataAvailabilityMultiplierBps: 1000, + PriceRegistry: common.HexToAddress("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + EnforceOutOfOrder: false, + }, + TokenTransferFeeConfig: map[common.Address]evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampTokenTransferFeeConfig{ + common.HexToAddress("0x2222222222222222222222222222222222222222"): { + MinFeeUSDCents: 5, + MaxFeeUSDCents: 50, + DeciBps: 100, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + AggregateRateLimitEnabled: false, + IsEnabled: true, + }, + common.HexToAddress("0x3333333333333333333333333333333333333333"): { + MinFeeUSDCents: 10, + MaxFeeUSDCents: 100, + DeciBps: 200, + DestGasOverhead: 40000, + DestBytesOverhead: 200, + AggregateRateLimitEnabled: false, + IsEnabled: true, + }, + }, + }, + }, + { + Address: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + ChainSelector: 4949039107694359620, + Metadata: seq1_6.FeeQuoterImportConfigSequenceOutput{ + RemoteChainCfgs: map[uint64]seq1_6.FeeQuoterImportConfigSequenceOutputPerRemoteChain{ + 15971525489660198786: { + DestChainCfg: fee_quoter_v1_6_0.DestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 3, + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DestGasOverhead: 80000, + DestGasPerPayloadByteBase: 14, + DestGasPerPayloadByteHigh: 28, + DestGasPerPayloadByteThreshold: 800, + DestDataAvailabilityOverheadGas: 40000, + DestGasPerDataAvailabilityByte: 8, + DestDataAvailabilityMultiplierBps: 900, + ChainFamilySelector: utils.GetSelectorHex(15971525489660198786), + EnforceOutOfOrder: false, + DefaultTokenFeeUSDCents: 8, + DefaultTokenDestGasOverhead: 40000, + DefaultTxGasLimit: 180000, + GasMultiplierWeiPerEth: 0, + GasPriceStalenessThreshold: 0, + NetworkFeeUSDCents: 10, + }, + TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{ + common.HexToAddress("0x2222222222222222222222222222222222222222"): { + MinFeeUSDCents: 4, + MaxFeeUSDCents: 40, + DeciBps: 90, + DestGasOverhead: 25000, + DestBytesOverhead: 80, + IsEnabled: true, + }, + }, + }, + }, + StaticCfg: fee_quoter_v1_6_0.StaticConfig{ + MaxFeeJuelsPerMsg: big.NewInt(1000000000000000000), + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + TokenPriceStalenessThreshold: 3600, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + }, + }, + }, + { + Address: "0x1010101010101010101010101010101010101010", + ChainSelector: 4949039107694359620, + Metadata: seq1_5.OnRampImportConfigSequenceOutput{ + RemoteChainSelector: 5009297550715157269, + StaticConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampStaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + ChainSelector: 4949039107694359620, + DestChainSelector: 5009297550715157269, + DefaultTxGasLimit: 200000, + MaxNopFeesJuels: big.NewInt(1000000000000000000), + PrevOnRamp: common.HexToAddress("0x0000000000000000000000000000000000000000"), + RmnProxy: common.HexToAddress("0x7777777777777777777777777777777777777777"), + TokenAdminRegistry: common.HexToAddress("0x8888888888888888888888888888888888888888"), + }, + DynamicConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x9999999999999999999999999999999999999999"), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 100000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 50000, + DestGasPerDataAvailabilityByte: 10, + DestDataAvailabilityMultiplierBps: 1000, + PriceRegistry: common.HexToAddress("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + EnforceOutOfOrder: false, + }, + TokenTransferFeeConfig: map[common.Address]evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampTokenTransferFeeConfig{ + common.HexToAddress("0x2222222222222222222222222222222222222222"): { + MinFeeUSDCents: 5, + MaxFeeUSDCents: 50, + DeciBps: 100, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + AggregateRateLimitEnabled: false, + IsEnabled: true, + }, + }, + }, + }, + { + Address: "0x5050505050505050505050505050505050505050", + ChainSelector: 15971525489660198786, + Metadata: seq1_5.OnRampImportConfigSequenceOutput{ + RemoteChainSelector: 5009297550715157269, + StaticConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampStaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + ChainSelector: 15971525489660198786, + DestChainSelector: 5009297550715157269, + DefaultTxGasLimit: 200000, + MaxNopFeesJuels: big.NewInt(1000000000000000000), + PrevOnRamp: common.HexToAddress("0x0000000000000000000000000000000000000000"), + RmnProxy: common.HexToAddress("0x7777777777777777777777777777777777777777"), + TokenAdminRegistry: common.HexToAddress("0x8888888888888888888888888888888888888888"), + }, + DynamicConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x9999999999999999999999999999999999999999"), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 100000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 50000, + DestGasPerDataAvailabilityByte: 10, + DestDataAvailabilityMultiplierBps: 1000, + PriceRegistry: common.HexToAddress("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + EnforceOutOfOrder: false, + }, + TokenTransferFeeConfig: map[common.Address]evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampTokenTransferFeeConfig{ + common.HexToAddress("0x2222222222222222222222222222222222222222"): { + MinFeeUSDCents: 5, + MaxFeeUSDCents: 50, + DeciBps: 100, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + AggregateRateLimitEnabled: false, + IsEnabled: true, + }, + common.HexToAddress("0x3333333333333333333333333333333333333333"): { + MinFeeUSDCents: 10, + MaxFeeUSDCents: 100, + DeciBps: 200, + DestGasOverhead: 40000, + DestBytesOverhead: 200, + AggregateRateLimitEnabled: false, + IsEnabled: true, + }, + }, + }, + }, + { + Address: "0x6060606060606060606060606060606060606060", + ChainSelector: 5936861837188149645, + Metadata: seq1_6.FeeQuoterImportConfigSequenceOutput{ + RemoteChainCfgs: map[uint64]seq1_6.FeeQuoterImportConfigSequenceOutputPerRemoteChain{ + 5009297550715157269: { + DestChainCfg: fee_quoter_v1_6_0.DestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 5, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DestGasOverhead: 100000, + DestGasPerPayloadByteBase: 16, + DestGasPerPayloadByteHigh: 32, + DestGasPerPayloadByteThreshold: 1000, + DestDataAvailabilityOverheadGas: 50000, + DestGasPerDataAvailabilityByte: 10, + DestDataAvailabilityMultiplierBps: 1000, + ChainFamilySelector: utils.GetSelectorHex(5009297550715157269), + EnforceOutOfOrder: false, + DefaultTokenFeeUSDCents: 10, + DefaultTokenDestGasOverhead: 50000, + DefaultTxGasLimit: 200000, + GasMultiplierWeiPerEth: 0, + GasPriceStalenessThreshold: 0, + NetworkFeeUSDCents: 10, + }, + TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{}, + }, + 4949039107694359620: { + DestChainCfg: fee_quoter_v1_6_0.DestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 4, + MaxDataBytes: 9000, + MaxPerMsgGasLimit: 4500000, + DestGasOverhead: 90000, + DestGasPerPayloadByteBase: 15, + DestGasPerPayloadByteHigh: 30, + DestGasPerPayloadByteThreshold: 900, + DestDataAvailabilityOverheadGas: 45000, + DestGasPerDataAvailabilityByte: 9, + DestDataAvailabilityMultiplierBps: 950, + ChainFamilySelector: utils.GetSelectorHex(4949039107694359620), + EnforceOutOfOrder: false, + DefaultTokenFeeUSDCents: 9, + DefaultTokenDestGasOverhead: 45000, + DefaultTxGasLimit: 190000, + GasMultiplierWeiPerEth: 0, + GasPriceStalenessThreshold: 0, + NetworkFeeUSDCents: 10, + }, + TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{}, + }, + }, + StaticCfg: fee_quoter_v1_6_0.StaticConfig{ + MaxFeeJuelsPerMsg: big.NewInt(1000000000000000000), + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + TokenPriceStalenessThreshold: 3600, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + }, + }, + }, + { + Address: "0x7070707070707070707070707070707070707070", + ChainSelector: 5936861837188149645, + Metadata: seq1_5.OnRampImportConfigSequenceOutput{ + RemoteChainSelector: 15971525489660198786, + StaticConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampStaticConfig{ + LinkToken: common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA"), + ChainSelector: 5936861837188149645, + DestChainSelector: 15971525489660198786, + DefaultTxGasLimit: 180000, + MaxNopFeesJuels: big.NewInt(900000000000000000), + PrevOnRamp: common.HexToAddress("0x0000000000000000000000000000000000000000"), + RmnProxy: common.HexToAddress("0x7777777777777777777777777777777777777777"), + TokenAdminRegistry: common.HexToAddress("0x8888888888888888888888888888888888888888"), + }, + DynamicConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x9999999999999999999999999999999999999999"), + MaxNumberOfTokensPerMsg: 3, + DestGasOverhead: 80000, + DestGasPerPayloadByte: 14, + DestDataAvailabilityOverheadGas: 40000, + DestGasPerDataAvailabilityByte: 8, + DestDataAvailabilityMultiplierBps: 900, + PriceRegistry: common.HexToAddress("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + EnforceOutOfOrder: false, + }, + TokenTransferFeeConfig: map[common.Address]evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampTokenTransferFeeConfig{}, + }, + }, +} + +// validMaxFeeJuelsPerMsgFromMetadata returns the set of valid MaxFeeJuelsPerMsg for a chain +// by collecting values from contract metadata. The sequence merges v1.6 (FeeQuoter) and v1.5 (OnRamp) +// outputs; when the v1.6 path finds a FeeQuoter ref it uses FeeQuoter's StaticCfg.MaxFeeJuelsPerMsg, +// otherwise it may use only v1.5's ConstructorArgs which take MaxFeeJuelsPerMsg from OnRamp's +// MaxNopFeesJuels. So for chains that have both FeeQuoter and OnRamp metadata, either value is valid +// depending on ref version matching the sequence's dependency. Keys are big.Int.String() for set lookup. +func validMaxFeeJuelsPerMsgFromMetadata(chainSelector uint64, contractMetadata []datastore.ContractMetadata) map[string]bool { + valid := make(map[string]bool) + for _, meta := range contractMetadata { + if meta.ChainSelector != chainSelector { + continue + } + if fq, ok := meta.Metadata.(seq1_6.FeeQuoterImportConfigSequenceOutput); ok { + if fq.StaticCfg.MaxFeeJuelsPerMsg != nil { + valid[fq.StaticCfg.MaxFeeJuelsPerMsg.String()] = true + } + } + if onr, ok := meta.Metadata.(seq1_5.OnRampImportConfigSequenceOutput); ok { + if onr.StaticConfig.MaxNopFeesJuels != nil { + valid[onr.StaticConfig.MaxNopFeesJuels.String()] = true + } + } + } + return valid +} + +// getExpectedOutput returns hardcoded expected FeeQuoterUpdate values based on contract_metadata.json +func getExpectedOutput() map[uint64]sequences.FeeQuoterUpdate { + linkToken := common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") + maxFeeJuels, _ := new(big.Int).SetString("1000000000000000000", 10) + + expected := make(map[uint64]sequences.FeeQuoterUpdate) + + // Chain 5009297550715157269: Has FeeQuoter v1.6.3 + OnRamp v1.5.0 + // Since no FeeQuoter v2.0.0 exists, it's a new deployment (ConstructorArgs populated) + expected[5009297550715157269] = sequences.FeeQuoterUpdate{ + ChainSelector: 5009297550715157269, + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken, + MaxFeeJuelsPerMsg: maxFeeJuels, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + common.HexToAddress("0x2222222222222222222222222222222222222221"), + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 15971525489660198786, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DestGasOverhead: 80000, + DestGasPerPayloadByteBase: 14, + ChainFamilySelector: utils.GetSelectorHex(15971525489660198786), + DefaultTokenFeeUSDCents: 8, + DefaultTokenDestGasOverhead: 40000, + DefaultTxGasLimit: 180000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + { + DestChainSelector: 4949039107694359620, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DestGasOverhead: 100000, + DestGasPerPayloadByteBase: 16, + ChainFamilySelector: utils.GetSelectorHex(4949039107694359620), + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + DefaultTxGasLimit: 200000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + }, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 15971525489660198786, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + { + Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 4, + DestGasOverhead: 25000, + DestBytesOverhead: 80, + IsEnabled: true, + }, + }, + }, + }, + { + DestChainSelector: 4949039107694359620, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + { + Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 5, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + IsEnabled: true, + }, + }, + { + Token: common.HexToAddress("0x3333333333333333333333333333333333333333"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 10, + DestGasOverhead: 40000, + DestBytesOverhead: 200, + IsEnabled: true, + }, + }, + }, + }, + }, + }, + } + + // Chain 4949039107694359620: Has FeeQuoter v1.6.3 + OnRamp v1.5.0 + expected[4949039107694359620] = sequences.FeeQuoterUpdate{ + ChainSelector: 4949039107694359620, + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken, + MaxFeeJuelsPerMsg: maxFeeJuels, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + common.HexToAddress("0x3333333333333333333333333333333333333333"), + common.HexToAddress("0x9999999999999999999999999999999999999999"), + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 15971525489660198786, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DestGasOverhead: 80000, + DestGasPerPayloadByteBase: 14, + ChainFamilySelector: utils.GetSelectorHex(15971525489660198786), + DefaultTokenFeeUSDCents: 8, + DefaultTokenDestGasOverhead: 40000, + DefaultTxGasLimit: 180000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + { + DestChainSelector: 5009297550715157269, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DestGasOverhead: 100000, + DestGasPerPayloadByteBase: 16, + ChainFamilySelector: utils.GetSelectorHex(5009297550715157269), + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + DefaultTxGasLimit: 200000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + }, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 15971525489660198786, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + { + Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 4, + DestGasOverhead: 25000, + DestBytesOverhead: 80, + IsEnabled: true, + }, + }, + }, + }, + { + DestChainSelector: 5009297550715157269, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + { + Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 5, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + IsEnabled: true, + }, + }, + }, + }, + }, + }, + } + + // Chain 15971525489660198786: Only has OnRamp v1.5.0 + maxFeeJuels159, _ := new(big.Int).SetString("1000000000000000000", 10) + expected[15971525489660198786] = sequences.FeeQuoterUpdate{ + ChainSelector: 15971525489660198786, + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken, + MaxFeeJuelsPerMsg: maxFeeJuels159, + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 5009297550715157269, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DestGasOverhead: 100000, + DestGasPerPayloadByteBase: 16, + ChainFamilySelector: utils.GetSelectorHex(5009297550715157269), + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + DefaultTxGasLimit: 200000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + }, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 5009297550715157269, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ + { + Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 5, + DestGasOverhead: 30000, + DestBytesOverhead: 100, + IsEnabled: true, + }, + }, + { + Token: common.HexToAddress("0x3333333333333333333333333333333333333333"), + TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ + FeeUSDCents: 10, + DestGasOverhead: 40000, + DestBytesOverhead: 200, + IsEnabled: true, + }, + }, + }, + }, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + }, + }, + } + + // Chain 5936861837188149645: Has FeeQuoter v1.6.3 + OnRamp v1.5.0 + expected[5936861837188149645] = sequences.FeeQuoterUpdate{ + ChainSelector: 5936861837188149645, + ConstructorArgs: fqops.ConstructorArgs{ + StaticConfig: fqops.StaticConfig{ + LinkToken: linkToken, + MaxFeeJuelsPerMsg: maxFeeJuels, + }, + PriceUpdaters: []common.Address{ + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x5555555555555555555555555555555555555555"), + common.HexToAddress("0x5555555555555555555555555555555555555551"), + }, + DestChainConfigArgs: []fqops.DestChainConfigArgs{ + { + DestChainSelector: 5009297550715157269, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DestGasOverhead: 100000, + DestGasPerPayloadByteBase: 16, + ChainFamilySelector: utils.GetSelectorHex(5009297550715157269), + DefaultTokenFeeUSDCents: 10, + DefaultTokenDestGasOverhead: 50000, + DefaultTxGasLimit: 200000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + { + DestChainSelector: 4949039107694359620, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 9000, + MaxPerMsgGasLimit: 4500000, + DestGasOverhead: 90000, + DestGasPerPayloadByteBase: 15, + ChainFamilySelector: utils.GetSelectorHex(4949039107694359620), + DefaultTokenFeeUSDCents: 9, + DefaultTokenDestGasOverhead: 45000, + DefaultTxGasLimit: 190000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + { + DestChainSelector: 15971525489660198786, + DestChainConfig: fqops.DestChainConfig{ + IsEnabled: true, + MaxDataBytes: 8000, + MaxPerMsgGasLimit: 4000000, + DestGasOverhead: 80000, + DestGasPerPayloadByteBase: 14, + ChainFamilySelector: utils.GetSelectorHex(15971525489660198786), + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + DefaultTxGasLimit: 180000, + NetworkFeeUSDCents: 10, + LinkFeeMultiplierPercent: 90, + }, + }, + }, + TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ + { + DestChainSelector: 5009297550715157269, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{}, + }, + { + DestChainSelector: 4949039107694359620, + TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{}, + }, + }, + }, + } + + return expected +} + +func TestSequenceFeeQuoterInputCreation(t *testing.T) { + contractMetadata := dummyContractMetadata + addressRefs := dummyAddressRefs + + // Collect unique chain selectors from address refs + chainSelectors := make(map[uint64]bool) + for _, ref := range addressRefs { + chainSelectors[ref.ChainSelector] = true + } + + // Convert map keys to slice and sort for deterministic test order (avoids flakiness from map iteration) + chainSelectorList := make([]uint64, 0, len(chainSelectors)) + for selector := range chainSelectors { + chainSelectorList = append(chainSelectorList, selector) + } + sort.Slice(chainSelectorList, func(i, j int) bool { return chainSelectorList[i] < chainSelectorList[j] }) + + // Create environment with simulated EVM chains + e, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, chainSelectorList), + ) + require.NoError(t, err, "Failed to create environment") + require.NotNil(t, e, "Environment should be created") + + // Load address refs into a new datastore + // Note: The environment's datastore is sealed, so we'll use our own datastore + // and pass the data directly in the input to the sequence + ds := datastore.NewMemoryDataStore() + for _, ref := range addressRefs { + err := ds.Addresses().Add(ref) + require.NoError(t, err, "Failed to add address ref %+v to datastore", ref) + } + + // Load contract metadata into the datastore + err = dseq.WriteMetadataToDatastore(ds, dseq.Metadata{ + Contracts: contractMetadata, + }) + require.NoError(t, err, "Failed to write contract metadata to datastore") + + // Seal the datastore for use in the test + e.DataStore = ds.Seal() + + // Get the FeeQuoterUpdater adapter (use concrete type so report.Output is sequences.FeeQuoterUpdate) + fquUpdater := evmadapter.FeeQuoterUpdater[sequences.FeeQuoterUpdate]{} + + // Test the sequence for each chain selector that has a FeeQuoter + for _, chainSelector := range chainSelectorList { + _, ok := e.BlockChains.EVMChains()[chainSelector] + require.True(t, ok, "Chain with selector %d should exist", chainSelector) + + // Build input from original slices so Version/Type match exactly (sealed datastore + // can alter refs and break GetAddressRef lookup for FeeQuoter 1.6.0). + existingAddresses := make([]datastore.AddressRef, 0) + for _, ref := range addressRefs { + if ref.ChainSelector == chainSelector { + existingAddresses = append(existingAddresses, ref) + } + } + contractMeta := make([]datastore.ContractMetadata, 0) + for _, meta := range contractMetadata { + if meta.ChainSelector == chainSelector { + contractMeta = append(contractMeta, meta) + } + } + sort.Slice(existingAddresses, func(i, j int) bool { + if existingAddresses[i].Type != existingAddresses[j].Type { + return string(existingAddresses[i].Type) < string(existingAddresses[j].Type) + } + return existingAddresses[i].Address < existingAddresses[j].Address + }) + sort.Slice(contractMeta, func(i, j int) bool { + return contractMeta[i].Address < contractMeta[j].Address + }) + + // Create input for SequenceFeeQuoterInputCreation + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: chainSelector, + ExistingAddresses: existingAddresses, + ContractMeta: contractMeta, + } + + // Execute the sequence + report, err := cldf_ops.ExecuteSequence( + e.OperationsBundle, + fquUpdater.SequenceFeeQuoterInputCreation(), + e.BlockChains, + input, + ) + + // Verify the sequence executed successfully + require.NoError(t, err, "SequenceFeeQuoterInputCreation should not error for chain %d", chainSelector) + require.NotNil(t, report, "Report should not be nil for chain %d", chainSelector) + + // Verify the output is not empty + output := report.Output + isEmpty, err := output.IsEmpty() + require.NoError(t, err, "IsEmpty check should not error") + require.False(t, isEmpty, "Output should not be empty for chain %d", chainSelector) + + // Verify basic output structure + require.Equal(t, chainSelector, output.ChainSelector, "Chain selector should match input") + require.Equal(t, existingAddresses, output.ExistingAddresses, "Existing addresses should match input") + + // Get expected output (hardcoded based on contract_metadata.json) + expectedMap := getExpectedOutput() + expected, hasExpected := expectedMap[chainSelector] + require.True(t, hasExpected, "Expected output should exist for chain %d", chainSelector) + + // Verify that the output has meaningful data + // At least one of these should be populated: + // - ConstructorArgs + // - DestChainConfigs + // - TokenTransferFeeConfigUpdates + // - AuthorizedCallerUpdates + hasData := !sequences.IsConstructorArgsEmpty(output.ConstructorArgs) || + len(output.DestChainConfigs) > 0 || + len(output.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs) > 0 || + len(output.AuthorizedCallerUpdates.AddedCallers) > 0 || + len(output.AuthorizedCallerUpdates.RemovedCallers) > 0 + + require.True(t, hasData, "Output should have at least some configuration data for chain %d", chainSelector) + // Assert against expected values + if !sequences.IsConstructorArgsEmpty(expected.ConstructorArgs) { + require.False(t, sequences.IsConstructorArgsEmpty(output.ConstructorArgs), "ConstructorArgs should be present for new deployment on chain %d", chainSelector) + require.Equal(t, expected.ConstructorArgs.StaticConfig.LinkToken, output.ConstructorArgs.StaticConfig.LinkToken, + "LinkToken should match expected value on chain %d", chainSelector) + // MaxFeeJuelsPerMsg must be one of the values present in contract metadata for this chain + // (FeeQuoter StaticCfg or OnRamp MaxNopFeesJuels); the sequence uses one or the other depending + // on whether the v1.6 path finds a FeeQuoter ref. + validMaxFee := validMaxFeeJuelsPerMsgFromMetadata(chainSelector, contractMetadata) + require.NotEmpty(t, validMaxFee, "contract metadata for chain %d should define at least one MaxFeeJuelsPerMsg source", chainSelector) + require.True(t, validMaxFee[output.ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg.String()], + "MaxFeeJuelsPerMsg should be one of the values from contract metadata (FeeQuoter or OnRamp) on chain %d", chainSelector) + require.ElementsMatch(t, expected.ConstructorArgs.PriceUpdaters, output.ConstructorArgs.PriceUpdaters, + "PriceUpdaters should match expected value on chain %d", chainSelector) + } else { + // For existing deployments, ConstructorArgs should be empty + require.True(t, sequences.IsConstructorArgsEmpty(output.ConstructorArgs), "ConstructorArgs should be empty for existing deployment on chain %d", chainSelector) + } + + // Assert specific values based on the sequence logic in feequoterupdater.go + // The sequence merges outputs from CreateFeeQuoterUpdateInputFromV16x and CreateFeeQuoterUpdateInputFromV150 + + // Verify DestChainConfigs against expected values + // Build a map of expected dest chain configs for easier lookup + expectedDestChainConfigsMap := make(map[uint64]fqops.DestChainConfigArgs) + for _, cfg := range expected.DestChainConfigs { + expectedDestChainConfigsMap[cfg.DestChainSelector] = cfg + } + require.Len(t, output.DestChainConfigs, len(expectedDestChainConfigsMap), + "Number of DestChainConfigs should match expected value on chain %d", chainSelector) + + for _, destChainCfg := range output.DestChainConfigs { + if expectedCfg, exists := expectedDestChainConfigsMap[destChainCfg.DestChainSelector]; exists { + require.Equal(t, expectedCfg, destChainCfg, "DestChainConfig should match expected value for "+ + "DestChainSelector %d on chain %d", destChainCfg.DestChainSelector, chainSelector) + } + } + for _, cfg := range expected.ConstructorArgs.DestChainConfigArgs { + expectedDestChainConfigsMap[cfg.DestChainSelector] = cfg + } + require.Len(t, output.ConstructorArgs.DestChainConfigArgs, len(expectedDestChainConfigsMap), + "Number of Constructor DestChainConfigArgs should match expected value for chain %d", chainSelector) + + for _, destChainCfg := range output.ConstructorArgs.DestChainConfigArgs { + if expectedCfg, exists := expectedDestChainConfigsMap[destChainCfg.DestChainSelector]; exists { + require.Equal(t, expectedCfg, destChainCfg, "Constructor DestChainConfig should match expected value for "+ + "DestChainSelector %d on chain %d", destChainCfg.DestChainSelector, chainSelector) + } + } + + require.Len(t, output.ConstructorArgs.TokenTransferFeeConfigArgs, len(expected.ConstructorArgs.TokenTransferFeeConfigArgs), + "Number of TokenTransferFeeConfigArgs should match expected value for chain %d", chainSelector) + require.Len(t, output.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs, len(expected.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs), + "Number of TokenTransferFeeConfigUpdates should match expected value for chain %d", chainSelector) + for _, tokenTransferFeeConfig := range output.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs { + found := false + for _, expectedCfg := range expected.TokenTransferFeeConfigUpdates.TokenTransferFeeConfigArgs { + if tokenTransferFeeConfig.DestChainSelector == expectedCfg.DestChainSelector { + require.ElementsMatch(t, expectedCfg.TokenTransferFeeConfigs, tokenTransferFeeConfig.TokenTransferFeeConfigs, + "TokenTransferFeeConfigs should match expected value for DestChainSelector %d on chain %d", + tokenTransferFeeConfig.DestChainSelector, chainSelector) + found = true + break + } + } + require.True(t, found, "Unexpected TokenTransferFeeConfig for DestChainSelector %d on chain %d", + tokenTransferFeeConfig.DestChainSelector, chainSelector) + } + + for _, tokenTransferFeeConfig := range output.ConstructorArgs.TokenTransferFeeConfigArgs { + found := false + for _, expectedCfg := range expected.ConstructorArgs.TokenTransferFeeConfigArgs { + if tokenTransferFeeConfig.DestChainSelector == expectedCfg.DestChainSelector { + require.ElementsMatch(t, expectedCfg.TokenTransferFeeConfigs, tokenTransferFeeConfig.TokenTransferFeeConfigs, + "Constructor TokenTransferFeeConfigs should match expected value for DestChainSelector %d on chain %d", + tokenTransferFeeConfig.DestChainSelector, chainSelector) + found = true + break + } + } + require.True(t, found, "Unexpected Constructor TokenTransferFeeConfig for DestChainSelector %d on chain %d", + tokenTransferFeeConfig.DestChainSelector, chainSelector) + } + + // Verify AuthorizedCallerUpdates if present (for existing deployments) + require.ElementsMatch(t, expected.AuthorizedCallerUpdates.AddedCallers, output.AuthorizedCallerUpdates.AddedCallers, + "AuthorizedCallerUpdates.AddedCallers should match expected value on chain %d", chainSelector) + require.ElementsMatch(t, expected.AuthorizedCallerUpdates.RemovedCallers, output.AuthorizedCallerUpdates.RemovedCallers, + "AuthorizedCallerUpdates.RemovedCallers should match expected value on chain %d", chainSelector) + + t.Logf("Successfully executed SequenceFeeQuoterInputCreation for chain %d", chainSelector) + } +} diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go new file mode 100644 index 0000000000..d0df79a3e0 --- /dev/null +++ b/deployment/deploy/feequoterupdater.go @@ -0,0 +1,11 @@ +package deploy + +import ( + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" +) + +type FeeQuoterUpdateInput struct { + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef + ContractMeta []datastore.ContractMetadata +} diff --git a/deployment/utils/common.go b/deployment/utils/common.go index 740f4a8ae9..5bac8de372 100644 --- a/deployment/utils/common.go +++ b/deployment/utils/common.go @@ -51,22 +51,29 @@ const ( SuiFamilySelector = "c4e05953" ) -func GetSelectorHex(selector uint64) []byte { +func GetSelectorHex(selector uint64) [4]byte { destFamily, _ := chain_selectors.GetSelectorFamily(selector) - var familySelector []byte + + var hexStr string switch destFamily { case chain_selectors.FamilyEVM: - familySelector, _ = hex.DecodeString(EVMFamilySelector) + hexStr = EVMFamilySelector case chain_selectors.FamilySolana: - familySelector, _ = hex.DecodeString(SVMFamilySelector) + hexStr = SVMFamilySelector case chain_selectors.FamilyAptos: - familySelector, _ = hex.DecodeString(AptosFamilySelector) + hexStr = AptosFamilySelector case chain_selectors.FamilyTon: - familySelector, _ = hex.DecodeString(TVMFamilySelector) + hexStr = TVMFamilySelector case chain_selectors.FamilySui: - familySelector, _ = hex.DecodeString(SuiFamilySelector) + hexStr = SuiFamilySelector + default: + panic(fmt.Sprintf("unsupported chain family: %s", destFamily)) } - return familySelector + + b, _ := hex.DecodeString(hexStr) + var out [4]byte + copy(out[:], b) + return out } var ( diff --git a/deployment/utils/datastore/datastore.go b/deployment/utils/datastore/datastore.go index 15def16d9f..968bf5476c 100644 --- a/deployment/utils/datastore/datastore.go +++ b/deployment/utils/datastore/datastore.go @@ -1,7 +1,9 @@ package datastore import ( + "encoding/json" "fmt" + "strings" "github.com/Masterminds/semver/v3" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" @@ -11,7 +13,7 @@ import ( // FormatFn is a function that formats a datastore.AddressRef into a specific type T. type FormatFn[T any] = func(ref datastore.AddressRef) (T, error) -// FindRef queries the datastore for an AddressRef. +// FindAndFormatRef queries the datastore for an AddressRef. // The inputted AddressRef may have only a subset of fields set (e.g. Type and Version). // This function enforces that exactly one match is found for the AddressRef. // It then formats the AddressRef into the desired type T using the provided FormatFn. @@ -21,7 +23,7 @@ func FindAndFormatRef[T any](ds datastore.DataStore, ref datastore.AddressRef, c // We set the chain selector here to ensure we are searching within the correct chain scope. // Chain selector is usually not provided in the ref since it is often implied by the context of the greater input. ref.ChainSelector = chainSelector - refFromStore, err := findRef(ds, ref) + refFromStore, _, err := findRef(ds, ref) if err != nil { return empty, err } @@ -33,6 +35,47 @@ func FindAndFormatRef[T any](ds datastore.DataStore, ref datastore.AddressRef, c return formattedRef, nil } +// FindAndFormatFirstRef queries the datastore for multiple AddressRefs in order. +// The inputted AddressRefs may have only a subset of fields set (e.g. Type and Version). +// If none of the provided refs are found, an error is returned. +// If any of the refs return multiple matches, an error is returned. +// If a unique match is found for a ref, it is formatted into the desired type T using the provided FormatFn. +// Example usage: Find the first available contract reference for multiple contract types, returning it as a native address type. +func FindAndFormatFirstRef[T any](ds datastore.DataStore, chainSelector uint64, format FormatFn[T], refs ...datastore.AddressRef) (T, error) { + var empty T + if len(refs) == 0 { + return empty, fmt.Errorf("at least one address ref must be specified") + } + + for _, ref := range refs { + ref.ChainSelector = chainSelector + refFromStore, foundRefs, err := findRef(ds, ref) + if foundRefs == 0 { + // No refs found, try the next one + continue + } + if err != nil { + return empty, err + } + + // Successfully found a unique ref + formattedRef, err := format(refFromStore) + if err != nil { + return empty, fmt.Errorf("failed to format ref %s: %w", SprintRef(refFromStore), err) + } + return formattedRef, nil + } + + // No refs found + var refsString strings.Builder + for _, r := range refs { + refsString.WriteString(SprintRef(r)) + refsString.WriteString(",") + } + + return empty, fmt.Errorf("failed to uniquely find any of the provided refs: %v", refsString.String()) +} + // SprintRef returns a one-line string representation of a datastore.AddressRef for logging. func SprintRef(ref datastore.AddressRef) string { return fmt.Sprintf("{ChainSelector: %d, Type: %s, Version: %s, Qualifier: %s, Address: %s}", ref.ChainSelector, ref.Type, ref.Version, ref.Qualifier, ref.Address) @@ -40,7 +83,7 @@ func SprintRef(ref datastore.AddressRef) string { // findRef queries the datastore for an AddressRef matching a subset of fields provided by AddressRef. // It enforces that exactly one match is found. -func findRef(ds datastore.DataStore, ref datastore.AddressRef) (datastore.AddressRef, error) { +func findRef(ds datastore.DataStore, ref datastore.AddressRef) (datastore.AddressRef, int, error) { filterFns := make([]datastore.FilterFunc[datastore.AddressRefKey, datastore.AddressRef], 0, 5) // Filter by largest scope (chain) to smallest scope (address) // Address is the smallest scope because there can only be one of each address on a given chain @@ -61,10 +104,20 @@ func findRef(ds datastore.DataStore, ref datastore.AddressRef) (datastore.Addres } refs := ds.Addresses().Filter(filterFns...) if len(refs) != 1 { - return datastore.AddressRef{}, fmt.Errorf("expected to find exactly 1 ref with criteria %s, found %d", SprintRef(ref), len(refs)) + return datastore.AddressRef{}, len(refs), fmt.Errorf("expected to find exactly 1 ref with criteria %s, found %d", SprintRef(ref), len(refs)) } - return refs[0], nil + return refs[0], 1, nil +} + +// IsAddressRefEmpty checks if an AddressRef is empty. +func IsAddressRefEmpty(ref datastore.AddressRef) bool { + return ref.Address == "" && + ref.Type == "" && + ref.Version == nil && + ref.Qualifier == "" && + ref.ChainSelector == 0 && + ref.Labels.Length() == 0 } // FullRef returns the entire datastore.AddressRef @@ -94,7 +147,75 @@ func GetAddressRef( return datastore.AddressRef{} } -// Takes in two refs and merges them, giving precedence to non-empty fields in the first ref. +func FilterContractMetaByContractTypeAndVersion( + addressRefs []datastore.AddressRef, + contractMetadata []datastore.ContractMetadata, + contractType cldf.ContractType, + contractVersion *semver.Version, + qualifier string, + chainSelector uint64, +) ([]datastore.ContractMetadata, error) { + ds := datastore.NewMemoryDataStore() + for _, ref := range addressRefs { + if err := ds.Addresses().Add(ref); err != nil { + return nil, fmt.Errorf("failed to add address ref to datastore: %w", err) + } + } + filterFns := []datastore.FilterFunc[datastore.AddressRefKey, datastore.AddressRef]{ + datastore.AddressRefByChainSelector(chainSelector), + datastore.AddressRefByType(datastore.ContractType(contractType)), + datastore.AddressRefByVersion(contractVersion), + } + if qualifier != "" { + filterFns = append(filterFns, datastore.AddressRefByQualifier(qualifier)) + } + filteredAddressRefs := ds.Addresses().Filter(filterFns...) + + if len(filteredAddressRefs) == 0 { + return nil, fmt.Errorf("no address ref found for contract type %s and version %s on chain %d", + contractType, contractVersion.String(), chainSelector) + } + var filteredContractMetadata []datastore.ContractMetadata + for _, meta := range contractMetadata { + for _, ref := range filteredAddressRefs { + if meta.Address == ref.Address && meta.ChainSelector == ref.ChainSelector { + filteredContractMetadata = append(filteredContractMetadata, meta) + } + } + } + return filteredContractMetadata, nil +} + +// ConvertMetadataToType converts metadata to a typed struct +// Handles both typed structs and map[string]interface{} from JSON unmarshaling +// T is the target type that the metadata should be converted to +func ConvertMetadataToType[T any](metadata interface{}) (T, error) { + var zero T + + // If already the correct type, return it + if typed, ok := metadata.(T); ok { + return typed, nil + } + + // If it's a map (from JSON), convert it + if metaMap, ok := metadata.(map[string]interface{}); ok { + metadataBytes, err := json.Marshal(metaMap) + if err != nil { + return zero, fmt.Errorf("failed to marshal metadata: %w", err) + } + + var typed T + if err := json.Unmarshal(metadataBytes, &typed); err != nil { + return zero, fmt.Errorf("failed to unmarshal metadata: %w", err) + } + + return typed, nil + } + + return zero, fmt.Errorf("metadata is neither the expected type nor map[string]interface{}") +} + +// Takes in two refs and merges them, giving precedence to non-empty fields in the first ref. // Returns an error if the refs are contradictory (e.g. both have non-empty but different addresses). func MergeRefs(ref1, ref2 *datastore.AddressRef) (datastore.AddressRef, error) { merged := datastore.AddressRef{} @@ -147,4 +268,4 @@ func MergeRefs(ref1, ref2 *datastore.AddressRef) (datastore.AddressRef, error) { } return merged, nil -} \ No newline at end of file +} From 4374eb0449fb361e611a71aa16dd5eb896554537 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Thu, 5 Mar 2026 10:44:54 -0800 Subject: [PATCH 24/41] support FQ 2.0 upgrade on main (#1799) * support downgrade * wip * wip * getting closer to passing * working * 1.5 import * doc * 2.0 --- .../v1_2_0/adapters/laneversionresolver.go | 86 +++++ .../price_registry/price_registry.go | 27 ++ .../v1_5_0/adapters/configimport.go | 165 +++++---- .../v1_5_0/operations/onramp/onramp.go | 11 + .../evm/deployment/v1_5_0/sequences/onramp.go | 32 ++ .../v1_6_0/adapters/configimport.go | 160 +++++---- .../v1_6_0/adapters/rampupdatewithfq.go | 123 +++++++ chains/evm/deployment/v2_0_0/adapters/init.go | 20 ++ .../SequenceFeeQuoterInputCreation_Mapping.md | 55 +++ deployment/deploy/feequoterupdater.go | 336 ++++++++++++++++++ deployment/deploy/product.go | 10 +- deployment/utils/changesets/output.go | 21 ++ deployment/utils/common.go | 7 + .../update_to_FeeQuoter_2_0_test.go | 212 +++++++++++ 14 files changed, 1119 insertions(+), 146 deletions(-) create mode 100644 chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go create mode 100644 chains/evm/deployment/v1_2_0/operations/price_registry/price_registry.go create mode 100644 chains/evm/deployment/v1_6_0/adapters/rampupdatewithfq.go create mode 100644 chains/evm/deployment/v2_0_0/adapters/init.go create mode 100644 chains/evm/deployment/v2_0_0/sequences/SequenceFeeQuoterInputCreation_Mapping.md create mode 100644 integration-tests/deployment/update_to_FeeQuoter_2_0_test.go diff --git a/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go new file mode 100644 index 0000000000..64771e4779 --- /dev/null +++ b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go @@ -0,0 +1,86 @@ +package adapters + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils" + evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" + routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" +) + +type LaneVersionResolver struct{} + +// DeriveLaneVersionsForChain derives the versions of the lanes for a given chain by looking at the router's offramps and onramps. +// It returns a map of remote chain selector to lane version, a list of unique lane versions, and an error if any. +func (r *LaneVersionResolver) DeriveLaneVersionsForChain(e cldf.Environment, chainSel uint64) (map[uint64]*semver.Version, []*semver.Version, error) { + // get the router + routerAddr, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(routerops.ContractType), + Version: routerops.Version, + ChainSelector: chainSel, + }, chainSel, evm_datastore_utils.ToEVMAddress) + if err != nil { + return nil, nil, err + } + chain, ok := e.BlockChains.EVMChains()[chainSel] + if !ok { + return nil, nil, fmt.Errorf("EVM chain with selector %d not found in environment", chainSel) + } + // get the offRamps + routerC, err := router.NewRouter(routerAddr, chain.Client) + if err != nil { + return nil, nil, fmt.Errorf("failed to bind router contract at address %s: %w", routerAddr.Hex(), err) + } + // all lanes are bi-directional, so we can just check the offramps to determine which chains this router can talk to + offRamps, err := routerC.GetOffRamps(&bind.CallOpts{ + Context: e.GetContext(), + }) + if err != nil { + return nil, nil, fmt.Errorf("failed to get offramps from router at address %s for chain %d: %w", routerAddr.Hex(), chainSel, err) + } + remoteChains := make(map[uint64]struct{}) + for _, offRamp := range offRamps { + if offRamp.OffRamp == (common.Address{}) { + continue + } + remoteChains[offRamp.SourceChainSelector] = struct{}{} + } + versions := make(map[string]*semver.Version) + laneVersionForRemoteChain := make(map[uint64]*semver.Version) + // for all remote chains, find the onRamp and check its version , if unique add it to the list of versions to import + for remoteChain := range remoteChains { + onRamp, err := routerC.GetOnRamp(&bind.CallOpts{ + Context: e.GetContext(), + }, remoteChain) + if err != nil { + return nil, nil, fmt.Errorf("failed to get onramp for remote chain %d from router at address %s for chain %d: %w", remoteChain, routerAddr.Hex(), chainSel, err) + } + if onRamp == (common.Address{}) { + continue + } + _, version, err := utils.TypeAndVersion(onRamp, chain.Client) + if err != nil { + return nil, nil, fmt.Errorf("failed to get version for onramp at address %s on chain %d: %w", onRamp.Hex(), chainSel, err) + } + if _, exists := versions[version.String()]; !exists { + versions[version.String()] = version + } + laneVersionForRemoteChain[remoteChain] = version + } + if len(versions) == 0 { + return nil, nil, fmt.Errorf("version not found for any onramps connected to router at address %s for chain %d", routerAddr.Hex(), chainSel) + } + versionList := make([]*semver.Version, 0, len(versions)) + for _, version := range versions { + versionList = append(versionList, version) + } + return laneVersionForRemoteChain, versionList, nil +} diff --git a/chains/evm/deployment/v1_2_0/operations/price_registry/price_registry.go b/chains/evm/deployment/v1_2_0/operations/price_registry/price_registry.go new file mode 100644 index 0000000000..ea1d7c6a36 --- /dev/null +++ b/chains/evm/deployment/v1_2_0/operations/price_registry/price_registry.go @@ -0,0 +1,27 @@ +package price_registry + +import ( + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/price_registry" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" +) + +var ( + ContractType = cldf.ContractType("PriceRegistry") + Version = semver.MustParse("1.2.0") +) + +var PriceRegistryGetFeeToken = contract.NewRead(contract.ReadParams[any, []common.Address, *price_registry.PriceRegistry]{ + Name: "price_registry:getfeetokens", + Version: Version, + Description: "gets fee token from price registry 1.2", + ContractType: ContractType, + NewContract: price_registry.NewPriceRegistry, + CallContract: func(pr *price_registry.PriceRegistry, opts *bind.CallOpts, args any) ([]common.Address, error) { + return pr.GetFeeTokens(opts) + }, +}) diff --git a/chains/evm/deployment/v1_5_0/adapters/configimport.go b/chains/evm/deployment/v1_5_0/adapters/configimport.go index 6f2b02d16e..e2626dc6f2 100644 --- a/chains/evm/deployment/v1_5_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_5_0/adapters/configimport.go @@ -5,21 +5,25 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" + priceregistryops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/price_registry" + routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" offrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/offramp" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/onramp" tokenadminops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/token_admin_registry" seq1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_offramp" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" api "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" @@ -28,77 +32,105 @@ import ( var GetTokensPaginationSize = uint64(20) type ConfigImportAdapter struct { - OnRamp map[uint64]map[uint64]common.Address - OffRamp map[uint64]map[uint64]common.Address - TokenAdminReg map[uint64]common.Address + OnRamp map[uint64]common.Address + OffRamp map[uint64]common.Address + TokenAdminReg common.Address + PriceRegistry common.Address + Router common.Address } -func (ci *ConfigImportAdapter) InitializeAdapter(e cldf.Environment, selectors []uint64) error { - ci.OnRamp = make(map[uint64]map[uint64]common.Address) - ci.OffRamp = make(map[uint64]map[uint64]common.Address) - ci.TokenAdminReg = make(map[uint64]common.Address) - for _, sel := range selectors { - ci.OnRamp[sel] = make(map[uint64]common.Address) - onRampRefs := e.DataStore.Addresses().Filter( - datastore.AddressRefByType(datastore.ContractType(onrampops.ContractType)), - datastore.AddressRefByVersion(onrampops.Version), - datastore.AddressRefByChainSelector(sel), - ) +func (ci *ConfigImportAdapter) InitializeAdapter(e cldf.Environment, sel uint64) error { + ci.OnRamp = make(map[uint64]common.Address) + onRampRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByType(datastore.ContractType(onrampops.ContractType)), + datastore.AddressRefByVersion(onrampops.Version), + datastore.AddressRefByChainSelector(sel), + ) - if len(onRampRefs) == 0 { - return fmt.Errorf("failed to get onramp ref for chain %d", sel) - } - chain := e.BlockChains.EVMChains()[sel] - for _, ref := range onRampRefs { - onRampC, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(ref.Address), chain.Client) - if err != nil { - return fmt.Errorf("failed to instantiate onramp contract for chain %d: %w", sel, err) - } - staticCfg, err := onRampC.GetStaticConfig(nil) - if err != nil { - return err - } - ci.OnRamp[sel][staticCfg.DestChainSelector] = common.HexToAddress(ref.Address) + if len(onRampRefs) == 0 { + return fmt.Errorf("failed to get onramp ref for chain %d", sel) + } + chain := e.BlockChains.EVMChains()[sel] + for _, ref := range onRampRefs { + onRampC, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(ref.Address), chain.Client) + if err != nil { + return fmt.Errorf("failed to instantiate onramp contract for chain %d: %w", sel, err) } - offRampRefs := e.DataStore.Addresses().Filter( - datastore.AddressRefByType(datastore.ContractType(offrampops.ContractType)), - datastore.AddressRefByVersion(offrampops.Version), - datastore.AddressRefByChainSelector(sel), - ) - if len(offRampRefs) == 0 { - return fmt.Errorf("failed to get offramp ref for chain %d", sel) + staticCfg, err := onRampC.GetStaticConfig(nil) + if err != nil { + return err } - for _, ref := range offRampRefs { - offRampC, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress(ref.Address), chain.Client) - if err != nil { - return fmt.Errorf("failed to instantiate offramp contract for chain %d: %w", sel, err) - } - staticCfg, err := offRampC.GetStaticConfig(nil) - if err != nil { - return err - } - ci.OffRamp[sel][staticCfg.SourceChainSelector] = common.HexToAddress(ref.Address) + ci.OnRamp[staticCfg.DestChainSelector] = common.HexToAddress(ref.Address) + } + offRampRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByType(datastore.ContractType(offrampops.ContractType)), + datastore.AddressRefByVersion(offrampops.Version), + datastore.AddressRefByChainSelector(sel), + ) + if len(offRampRefs) == 0 { + return fmt.Errorf("failed to get offramp ref for chain %d", sel) + } + ci.OffRamp = make(map[uint64]common.Address) + for _, ref := range offRampRefs { + offRampC, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress(ref.Address), chain.Client) + if err != nil { + return fmt.Errorf("failed to instantiate offramp contract for chain %d: %w", sel, err) } - tokenAdminRegRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType(tokenadminops.ContractType), - Version: tokenadminops.Version, - }, sel, evm_datastore_utils.ToEVMAddress) + staticCfg, err := offRampC.GetStaticConfig(nil) if err != nil { - return fmt.Errorf("failed to find token admin registry contract ref for chain %d: %w", sel, err) + return err } - ci.TokenAdminReg[sel] = tokenAdminRegRef + ci.OffRamp[staticCfg.SourceChainSelector] = common.HexToAddress(ref.Address) + } + tokenAdminRegRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(tokenadminops.ContractType), + Version: tokenadminops.Version, + }, sel, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find token admin registry contract ref for chain %d: %w", sel, err) } + ci.TokenAdminReg = tokenAdminRegRef + priceRegistryRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(priceregistryops.ContractType), + Version: priceregistryops.Version, + }, sel, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find price registry contract ref for chain %d: %w", sel, err) + } + ci.PriceRegistry = priceRegistryRef + routerRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(routerops.ContractType), + Version: routerops.Version, + }, sel, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find router contract ref for chain %d: %w", sel, err) + } + ci.Router = routerRef return nil } -func (ci *ConfigImportAdapter) ConnectedChains(_ cldf.Environment, chainsel uint64) ([]uint64, error) { - onRamps, ok := ci.OnRamp[chainsel] +func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint64) ([]uint64, error) { + var connected []uint64 + // to ensure deduplication in case there are multiple onramps addresses in datastore for the same remote chain selector + var mapConnectedChains = make(map[uint64]bool) + chain, ok := e.BlockChains.EVMChains()[chainsel] if !ok { - return nil, fmt.Errorf("no onramps found for chain %d", chainsel) + return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } - var connected []uint64 - for destSel := range onRamps { - connected = append(connected, destSel) + routerC, err := router.NewRouter(ci.Router, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to instantiate router contract at %s on chain %d: %w", ci.Router.String(), chain.Selector, err) + } + for destSel, onrampForDest := range ci.OnRamp { + onRamp, err := routerC.GetOnRamp(nil, destSel) + if err != nil { + return nil, fmt.Errorf("failed to get onramp for dest chain %d from router at %s on chain %d: %w", destSel, ci.Router.String(), chain.Selector, err) + } + // if the onramp address from the router doesn't match the onramp address we have, then this chain is not actually connected with 1.5 + if onRamp == onrampForDest && !mapConnectedChains[destSel] { + connected = append(connected, destSel) + mapConnectedChains[destSel] = true + } } return connected, nil } @@ -108,12 +140,8 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, if !ok { return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } - tokenAdminRegAddr, ok := ci.TokenAdminReg[chainsel] - if !ok { - return nil, fmt.Errorf("token admin registry address not found for chain %d", chainsel) - } // get all supported tokens from token admin registry - return GetSupportedTokensPerRemoteChain(tokenAdminRegAddr, chain) + return GetSupportedTokensPerRemoteChain(ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.ImportConfigPerChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { @@ -133,8 +161,9 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp seq1_5.OnRampImportConfigSequence, seq1_5.OnRampImportConfigSequenceInput{ ChainSelector: chainSelector, - OnRampsPerRemoteChain: ci.OnRamp[chainSelector], + OnRampsPerRemoteChain: ci.OnRamp, SupportedTokensPerChain: in.TokensPerRemoteChain, + PriceRegistry: ci.PriceRegistry, }, result) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to import onramp config for chain %d: %w", chainSelector, err) @@ -143,7 +172,7 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp seq1_5.OffRampImportConfigSequence, seq1_5.OffRampImportConfigSequenceInput{ ChainSelector: chainSelector, - OffRampsPerRemoteChain: ci.OffRamp[chainSelector], + OffRampsPerRemoteChain: ci.OffRamp, }, result) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to import offramp config for chain %d: %w", chainSelector, err) diff --git a/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go b/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go index d33c23990d..0fbba7ff1c 100644 --- a/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go +++ b/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go @@ -69,3 +69,14 @@ var OnRampDynamicConfig = contract.NewRead(contract.ReadParams[any, evm_2_evm_on return onRamp.GetDynamicConfig(opts) }, }) + +var OnRampFeeTokenConfig = contract.NewRead(contract.ReadParams[common.Address, evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, *evm_2_evm_onramp.EVM2EVMOnRamp]{ + Name: "onramp:fee-token-config", + Version: Version, + Description: "Reads the fee token config for a given token from the OnRamp 1.5.0 contract", + ContractType: ContractType, + NewContract: evm_2_evm_onramp.NewEVM2EVMOnRamp, + CallContract: func(onRamp *evm_2_evm_onramp.EVM2EVMOnRamp, opts *bind.CallOpts, args common.Address) (evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, error) { + return onRamp.GetFeeTokenConfig(opts, args) + }, +}) diff --git a/chains/evm/deployment/v1_5_0/sequences/onramp.go b/chains/evm/deployment/v1_5_0/sequences/onramp.go index b3774f2d03..9683f6e83f 100644 --- a/chains/evm/deployment/v1_5_0/sequences/onramp.go +++ b/chains/evm/deployment/v1_5_0/sequences/onramp.go @@ -12,6 +12,7 @@ import ( mcms_types "github.com/smartcontractkit/mcms/types" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + priceregistryops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/price_registry" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/onramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" @@ -25,6 +26,7 @@ type OnRampSetTokenTransferFeeConfigSequenceInput struct { type OnRampImportConfigSequenceInput struct { ChainSelector uint64 + PriceRegistry common.Address OnRampsPerRemoteChain map[uint64]common.Address SupportedTokensPerChain map[uint64][]common.Address } @@ -34,6 +36,7 @@ type OnRampImportConfigSequenceOutput struct { TokenTransferFeeConfig map[common.Address]evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig StaticConfig evm_2_evm_onramp.EVM2EVMOnRampStaticConfig DynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig + FeeTokenConfig map[common.Address]evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig } var ( @@ -92,6 +95,31 @@ var ( return sequences.OnChainOutput{}, fmt.Errorf("failed to execute OnRampDynamicConfigOp "+ "on %s for remote chain %d: %w", chain.String(), remoteChainSelector, err) } + feetokenOut, err := operations.ExecuteOperation(b, priceregistryops.PriceRegistryGetFeeToken, chain, contract.FunctionInput[any]{ + ChainSelector: chain.Selector, + Address: input.PriceRegistry, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to execute PriceRegistryGetFeeTokenOp "+ + "on %s for price registry %s: %w", chain.String(), input.PriceRegistry.String(), err) + } + feeTokens := feetokenOut.Output + feeTokenConfig := make(map[common.Address]evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig) + for _, token := range feeTokens { + feeTokenConfigOut, err := operations.ExecuteOperation(b, onramp.OnRampFeeTokenConfig, chain, contract.FunctionInput[common.Address]{ + ChainSelector: chain.Selector, + Address: onRampAddress, + Args: token, + }) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to execute OnRampFeeTokenConfigOp "+ + "on %s for remote chain %d and token %s: %w", chain.String(), remoteChainSelector, token.String(), err) + } + if !feeTokenConfigOut.Output.Enabled { + continue + } + feeTokenConfig[token] = feeTokenConfigOut.Output + } tokenTransferFeeConfig := make(map[common.Address]evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig) for _, token := range input.SupportedTokensPerChain[remoteChainSelector] { ttfcOut, err := operations.ExecuteOperation(b, onramp.OnRampGetTokenTransferFeeConfig, chain, contract.FunctionInput[common.Address]{ @@ -103,6 +131,9 @@ var ( return sequences.OnChainOutput{}, fmt.Errorf("failed to execute OnRampGetTokenTransferFeeConfigOp "+ "on %s for remote chain %d and token %s: %w", chain.String(), remoteChainSelector, token.String(), err) } + if !ttfcOut.Output.IsEnabled { + continue + } tokenTransferFeeConfig[token] = ttfcOut.Output } contractMeta = append(contractMeta, datastore.ContractMetadata{ @@ -113,6 +144,7 @@ var ( StaticConfig: sCfgOut.Output, DynamicConfig: dCfgOut.Output, TokenTransferFeeConfig: tokenTransferFeeConfig, + FeeTokenConfig: feeTokenConfig, }, }) } diff --git a/chains/evm/deployment/v1_6_0/adapters/configimport.go b/chains/evm/deployment/v1_6_0/adapters/configimport.go index 3dcbc7a986..e6bcc7ace8 100644 --- a/chains/evm/deployment/v1_6_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_6_0/adapters/configimport.go @@ -11,78 +11,77 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" + routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" adapters1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/adapters" tokenadminops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/token_admin_registry" fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" offrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" seq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/sequences" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" api "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" ) type ConfigImportAdapter struct { - FeeQuoter map[uint64]common.Address - OnRamp map[uint64]common.Address - OffRamp map[uint64]common.Address - Router map[uint64]common.Address - TokenAdminReg map[uint64]common.Address + FeeQuoter common.Address + OnRamp common.Address + OffRamp common.Address + Router common.Address + TokenAdminReg common.Address } -func (ci *ConfigImportAdapter) InitializeAdapter(e cldf.Environment, selectors []uint64) error { - ci.FeeQuoter = make(map[uint64]common.Address) - ci.Router = make(map[uint64]common.Address) - ci.TokenAdminReg = make(map[uint64]common.Address) - ci.OnRamp = make(map[uint64]common.Address) - ci.OffRamp = make(map[uint64]common.Address) - for _, chainSelector := range selectors { - fqRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType(fqops.ContractType), - Version: fqops.Version, - ChainSelector: chainSelector, - }, chainSelector, evm_datastore_utils.ToEVMAddress) - if err != nil { - return fmt.Errorf("failed to find fee quoter contract ref for chain %d: %w", chainSelector, err) - } - ci.FeeQuoter[chainSelector] = fqRef - routerRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType("Router"), - Version: semver.MustParse("1.2.0"), - ChainSelector: chainSelector, - }, chainSelector, evm_datastore_utils.ToEVMAddress) - if err != nil { - return fmt.Errorf("failed to find router contract ref for chain %d: %w", chainSelector, err) - } - ci.Router[chainSelector] = routerRef - tokenAdminRegRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType(tokenadminops.ContractType), - Version: tokenadminops.Version, - ChainSelector: chainSelector, - }, chainSelector, evm_datastore_utils.ToEVMAddress) - if err != nil { - return fmt.Errorf("failed to find token admin registry contract ref for chain %d: %w", chainSelector, err) - } - ci.TokenAdminReg[chainSelector] = tokenAdminRegRef - onRampRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType(onrampops.ContractType), - Version: semver.MustParse("1.6.0"), - }, chainSelector, evm_datastore_utils.ToEVMAddress) - if err != nil { - return fmt.Errorf("failed to find onramp contract ref for chain %d: %w", chainSelector, err) - } - ci.OnRamp[chainSelector] = onRampRef - offRampRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - Type: datastore.ContractType(offrampops.ContractType), - Version: semver.MustParse("1.6.0"), - }, chainSelector, evm_datastore_utils.ToEVMAddress) - if err != nil { - return fmt.Errorf("failed to find offramp contract ref for chain %d: %w", chainSelector, err) - } - ci.OffRamp[chainSelector] = offRampRef +func (ci *ConfigImportAdapter) InitializeAdapter(e cldf.Environment, chainSelector uint64) error { + fqRef, err := seq1_6.GetFeeQuoterAddress( + e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSelector), + datastore.AddressRefByType(datastore.ContractType(fqops.ContractType)), + ), + chainSelector) + if err != nil { + return fmt.Errorf("failed to find fee quoter contract ref for chain %d: %w", chainSelector, err) + } + ci.FeeQuoter, err = evm_datastore_utils.ToEVMAddress(fqRef) + if err != nil { + return fmt.Errorf("failed to convert fee quoter address to EVM address for chain %d: %w", chainSelector, err) + } + routerRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(routerops.ContractType), + Version: routerops.Version, + ChainSelector: chainSelector, + }, chainSelector, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find router contract ref for chain %d: %w", chainSelector, err) + } + ci.Router = routerRef + tokenAdminRegRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(tokenadminops.ContractType), + Version: tokenadminops.Version, + ChainSelector: chainSelector, + }, chainSelector, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find token admin registry contract ref for chain %d: %w", chainSelector, err) + } + ci.TokenAdminReg = tokenAdminRegRef + onRampRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(onrampops.ContractType), + Version: onrampops.Version, + }, chainSelector, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find onramp contract ref for chain %d: %w", chainSelector, err) } + ci.OnRamp = onRampRef + offRampRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + Type: datastore.ContractType(offrampops.ContractType), + Version: offrampops.Version, + }, chainSelector, evm_datastore_utils.ToEVMAddress) + if err != nil { + return fmt.Errorf("failed to find offramp contract ref for chain %d: %w", chainSelector, err) + } + ci.OffRamp = offRampRef return nil } @@ -91,12 +90,8 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, if !ok { return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } - tokenAdminRegAddr, ok := ci.TokenAdminReg[chainsel] - if !ok { - return nil, fmt.Errorf("token admin registry address not found for chain %d", chainsel) - } // get all supported tokens from token admin registry - return adapters1_5.GetSupportedTokensPerRemoteChain(tokenAdminRegAddr, chain) + return adapters1_5.GetSupportedTokensPerRemoteChain(ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint64) ([]uint64, error) { @@ -104,12 +99,12 @@ func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint if !ok { return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } - routerAddr, ok := ci.Router[chainsel] - if !ok { - return nil, fmt.Errorf("router address not found for chain %d", chainsel) + routerAddr := ci.Router + if routerAddr == (common.Address{}) { + return nil, fmt.Errorf("router address not initialized for chain %d", chainsel) } // get all offRamps from router to find connected chains - routerC, err := router.NewRouter(routerAddr, chain.Client) + routerC, err := router.NewRouter(ci.Router, chain.Client) if err != nil { return nil, fmt.Errorf("failed to instantiate router contract at %s on chain %d: %w", routerAddr.String(), chain.Selector, err) } @@ -121,10 +116,21 @@ func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint } connectedChains := make([]uint64, 0) for _, offRamp := range offRamps { - if offRamp.OffRamp == (common.Address{}) { - continue // skip uninitialized off-ramps + // if the offramp's address matches our offramp, then we are connected to the source chain via 1.6 + if offRamp.OffRamp == ci.OffRamp { + // get the onRamp on router for the source chain and check if it matches our onRamp, if it does then we are connected to that chain + // lanes are always bi-directional so source and destination chain selectors are interchangeable for the purpose of finding connected chains + onRamp, err := routerC.GetOnRamp(&bind.CallOpts{ + Context: e.GetContext(), + }, offRamp.SourceChainSelector) + if err != nil { + return nil, fmt.Errorf("failed to get on ramp for source chain selector %d from router at %s on chain %d: %w", offRamp.SourceChainSelector, routerAddr.String(), chain.Selector, err) + } + if onRamp != ci.OnRamp { + continue + } + connectedChains = append(connectedChains, offRamp.SourceChainSelector) } - connectedChains = append(connectedChains, offRamp.SourceChainSelector) } return connectedChains, nil } @@ -142,9 +148,9 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp chainSelector := in.ChainSelector b.Logger.Infof("Importing configuration for chain %d (%s)", chainSelector, evmChain.Name()) // read FQ config from onchain - fqAddress, ok := ci.FeeQuoter[chainSelector] - if !ok { - return sequences.OnChainOutput{}, fmt.Errorf("fee quoter address not found for chain %d", chainSelector) + fqAddress := ci.FeeQuoter + if fqAddress == (common.Address{}) { + return sequences.OnChainOutput{}, fmt.Errorf("fee quoter address not initialized for chain %d", chainSelector) } var result sequences.OnChainOutput // fetch fee quoter config @@ -160,9 +166,9 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp return sequences.OnChainOutput{}, fmt.Errorf("failed to import fee quoter config on chain %d: %w", chainSelector, err) } // fetch onramp config - onRampAddress, ok := ci.OnRamp[chainSelector] - if !ok { - return sequences.OnChainOutput{}, fmt.Errorf("onramp address not found for chain %d", chainSelector) + onRampAddress := ci.OnRamp + if onRampAddress == (common.Address{}) { + return sequences.OnChainOutput{}, fmt.Errorf("onramp address not initialized for chain %d", chainSelector) } result, err = sequences.RunAndMergeSequence(b, chains, seq1_6.OnRampImportConfigSequence, @@ -175,9 +181,9 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp return sequences.OnChainOutput{}, fmt.Errorf("failed to import onramp config on chain %d: %w", chainSelector, err) } // fetch offramp config - offRampAddress, ok := ci.OffRamp[chainSelector] - if !ok { - return sequences.OnChainOutput{}, fmt.Errorf("offramp address not found for chain %d", chainSelector) + offRampAddress := ci.OffRamp + if offRampAddress == (common.Address{}) { + return sequences.OnChainOutput{}, fmt.Errorf("offramp address not initialized for chain %d", chainSelector) } result, err = sequences.RunAndMergeSequence(b, chains, seq1_6.OffRampImportConfigSequence, diff --git a/chains/evm/deployment/v1_6_0/adapters/rampupdatewithfq.go b/chains/evm/deployment/v1_6_0/adapters/rampupdatewithfq.go new file mode 100644 index 0000000000..c3392c5f1d --- /dev/null +++ b/chains/evm/deployment/v1_6_0/adapters/rampupdatewithfq.go @@ -0,0 +1,123 @@ +package adapters + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + 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" + offrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" + onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" + "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" +) + +type RampUpdateWithFQ struct{} + +func (ru RampUpdateWithFQ) ResolveRampsInput(e cldf.Environment, input deploy.UpdateRampsInput) (deploy.UpdateRampsInput, error) { + // fetch address of Ramps + onRampAddr := datastore_utils.GetAddressRef( + e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(input.ChainSelector), + datastore.AddressRefByType(datastore.ContractType(onrampops.ContractType)), + datastore.AddressRefByVersion(onrampops.Version), + ), + input.ChainSelector, + onrampops.ContractType, + onrampops.Version, + "", + ) + if datastore_utils.IsAddressRefEmpty(onRampAddr) { + return input, fmt.Errorf("onramp address not found for chain selector %d", input.ChainSelector) + } + input.OnRampAddressRef = onRampAddr + + offRampAddr := datastore_utils.GetAddressRef( + e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(input.ChainSelector), + datastore.AddressRefByType(datastore.ContractType(offrampops.ContractType)), + datastore.AddressRefByVersion(offrampops.Version), + ), + input.ChainSelector, + offrampops.ContractType, + offrampops.Version, + "", + ) + if datastore_utils.IsAddressRefEmpty(offRampAddr) { + return input, fmt.Errorf("offramp address not found for chain selector %d", input.ChainSelector) + } + input.OffRampAddressRef = offRampAddr + return input, nil +} + +// SequenceUpdateRampsWithFeeQuoter updates OnRamp and OffRamp contracts to use the new FeeQuoter contract +func (ru RampUpdateWithFQ) SequenceUpdateRampsWithFeeQuoter() *cldf_ops.Sequence[deploy.UpdateRampsInput, sequences.OnChainOutput, cldf_chain.BlockChains] { + return cldf_ops.NewSequence( + "ramp-update-with-fq:sequence-update-ramps-with-fee-quoter", + semver.MustParse("1.6.0"), + "Updates Ramps contracts to use the new FeeQuoter contract", + func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input deploy.UpdateRampsInput) (output sequences.OnChainOutput, err error) { + var writes []contract.WriteOutput + chain, ok := chains.EVMChains()[input.ChainSelector] + if !ok { + return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not found in environment", input.ChainSelector) + } + onDCfgReport, err := cldf_ops.ExecuteOperation(b, onrampops.GetDynamicConfig, chain, contract.FunctionInput[struct{}]{ + ChainSelector: input.ChainSelector, + Address: common.HexToAddress(input.OnRampAddressRef.Address), + }) + if err != nil { + return sequences.OnChainOutput{}, err + } + existingDynamicConfig := onDCfgReport.Output + if existingDynamicConfig.FeeQuoter != common.HexToAddress(input.FeeQuoterAddress.Address) { + // Update OnRamp's FeeQuoter address + existingDynamicConfig.FeeQuoter = common.HexToAddress(input.FeeQuoterAddress.Address) + onRampReport, err := cldf_ops.ExecuteOperation(b, onrampops.SetDynamicConfig, chain, contract.FunctionInput[onrampops.DynamicConfig]{ + ChainSelector: input.ChainSelector, + Address: common.HexToAddress(input.OnRampAddressRef.Address), + Args: existingDynamicConfig, + }) + if err != nil { + return sequences.OnChainOutput{}, err + } + writes = append(writes, onRampReport.Output) + } + // Similarly, update OffRamp's FeeQuoter address + offDCfgReport, err := cldf_ops.ExecuteOperation(b, offrampops.GetDynamicConfig, chain, contract.FunctionInput[struct{}]{ + ChainSelector: input.ChainSelector, + Address: common.HexToAddress(input.OffRampAddressRef.Address), + }) + if err != nil { + return sequences.OnChainOutput{}, err + } + existingOffDynamicConfig := offDCfgReport.Output + if existingOffDynamicConfig.FeeQuoter != common.HexToAddress(input.FeeQuoterAddress.Address) { + existingOffDynamicConfig.FeeQuoter = common.HexToAddress(input.FeeQuoterAddress.Address) + offRampReport, err := cldf_ops.ExecuteOperation(b, offrampops.SetDynamicConfig, chain, contract.FunctionInput[offrampops.DynamicConfig]{ + ChainSelector: input.ChainSelector, + Address: common.HexToAddress(input.OffRampAddressRef.Address), + Args: existingOffDynamicConfig, + }) + if err != nil { + return sequences.OnChainOutput{}, err + } + writes = append(writes, offRampReport.Output) + } + batch, err := contract.NewBatchOperationFromWrites(writes) + if err != nil { + return sequences.OnChainOutput{}, err + } + return sequences.OnChainOutput{ + BatchOps: []mcms_types.BatchOperation{batch}, + }, nil + }, + ) +} diff --git a/chains/evm/deployment/v2_0_0/adapters/init.go b/chains/evm/deployment/v2_0_0/adapters/init.go new file mode 100644 index 0000000000..8d0620db33 --- /dev/null +++ b/chains/evm/deployment/v2_0_0/adapters/init.go @@ -0,0 +1,20 @@ +package adapters + +import ( + "github.com/Masterminds/semver/v3" + + chainsel "github.com/smartcontractkit/chain-selectors" + adapters1_2 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/adapters" + adapters1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/adapters" + adapters1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/adapters" + "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" +) + +func init() { + fqReg := deploy.GetFQAndRampUpdaterRegistry() + fqReg.RegisterFeeQuoterUpdater(chainsel.FamilyEVM, semver.MustParse("2.0.0"), FeeQuoterUpdater[any]{}) + fqReg.RegisterRampUpdater(chainsel.FamilyEVM, semver.MustParse("1.6.0"), adapters1_6.RampUpdateWithFQ{}) + fqReg.RegisterConfigImporter(chainsel.FamilyEVM, semver.MustParse("1.6.0"), &adapters1_6.ConfigImportAdapter{}) + fqReg.RegisterConfigImporter(chainsel.FamilyEVM, semver.MustParse("1.5.0"), &adapters1_5.ConfigImportAdapter{}) + fqReg.RegisterConfigImporterVersionResolver(chainsel.FamilyEVM, &adapters1_2.LaneVersionResolver{}) +} diff --git a/chains/evm/deployment/v2_0_0/sequences/SequenceFeeQuoterInputCreation_Mapping.md b/chains/evm/deployment/v2_0_0/sequences/SequenceFeeQuoterInputCreation_Mapping.md new file mode 100644 index 0000000000..13bc747f1d --- /dev/null +++ b/chains/evm/deployment/v2_0_0/sequences/SequenceFeeQuoterInputCreation_Mapping.md @@ -0,0 +1,55 @@ +# SequenceFeeQuoterInputCreation Mapping Document + +## From v1.6.0 (`CreateFeeQuoterUpdateInputFromV160`) + +**Source Contract**: FeeQuoter v1.6.3 +**Target Contract**: FeeQuoter v2.0.0 + +### Field Mapping +| Target Field (FeeQuoter v2.0.0) | Source Field (FeeQuoter v1.6.3) | Notes | +|----------------------------------|----------------------------------|-------| +| `ConstructorArgs.StaticConfig.LinkToken` | `StaticCfg.LinkToken` | Direct copy | +| `ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg` | `StaticCfg.MaxFeeJuelsPerMsg` | Direct copy | +| `ConstructorArgs.PriceUpdaters` or `AuthorizedCallerUpdates.AddedCallers` | `PriceUpdaters` | Depends on new deployment vs update | +| `DestChainConfig.IsEnabled` | `RemoteChainCfgs[chain].DestChainCfg.IsEnabled` | Direct copy | +| `DestChainConfig.MaxDataBytes` | `RemoteChainCfgs[chain].DestChainCfg.MaxDataBytes` | Direct copy | +| `DestChainConfig.MaxPerMsgGasLimit` | `RemoteChainCfgs[chain].DestChainCfg.MaxPerMsgGasLimit` | Direct copy | +| `DestChainConfig.DestGasOverhead` | `RemoteChainCfgs[chain].DestChainCfg.DestGasOverhead` | Direct copy | +| `DestChainConfig.DestGasPerPayloadByteBase` | `RemoteChainCfgs[chain].DestChainCfg.DestGasPerPayloadByteBase` | Direct copy | +| `DestChainConfig.ChainFamilySelector` | `RemoteChainCfgs[chain].DestChainCfg.ChainFamilySelector` | Direct copy | +| `DestChainConfig.DefaultTokenFeeUSDCents` | `RemoteChainCfgs[chain].DestChainCfg.DefaultTokenFeeUSDCents` | Direct copy | +| `DestChainConfig.DefaultTokenDestGasOverhead` | `RemoteChainCfgs[chain].DestChainCfg.DefaultTokenDestGasOverhead` | Direct copy | +| `DestChainConfig.DefaultTxGasLimit` | `RemoteChainCfgs[chain].DestChainCfg.DefaultTxGasLimit` | Direct copy | +| `DestChainConfig.NetworkFeeUSDCents` | `RemoteChainCfgs[chain].DestChainCfg.NetworkFeeUSDCents` | Cast from `uint8` to `uint16` | +| `DestChainConfig.LinkFeeMultiplierPercent` | N/A | Hardcoded to `90` | +| `TokenTransferFeeConfig.FeeUSDCents` | `RemoteChainCfgs[chain].TokenTransferFeeCfgs[token].MinFeeUSDCents` | Direct copy | +| `TokenTransferFeeConfig.DestGasOverhead` | `RemoteChainCfgs[chain].TokenTransferFeeCfgs[token].DestGasOverhead` | Direct copy | +| `TokenTransferFeeConfig.DestBytesOverhead` | `RemoteChainCfgs[chain].TokenTransferFeeCfgs[token].DestBytesOverhead` | Direct copy | +| `TokenTransferFeeConfig.IsEnabled` | `RemoteChainCfgs[chain].TokenTransferFeeCfgs[token].IsEnabled` | Direct copy | + +## From v1.5.0 (`CreateFeeQuoterUpdateInputFromV150`) + +**Source Contract**: EVM2EVMOnRamp v1.5.0 +**Target Contract**: FeeQuoter v2.0.0 + +### Field Mapping +| Target Field (FeeQuoter v2.0.0) | Source Field (EVM2EVMOnRamp v1.5.0) | Notes | +|----------------------------------|--------------------------------------|-------| +| `ConstructorArgs.StaticConfig.LinkToken` | `OnRampCfg.StaticConfig.LinkToken` | From first OnRamp (if empty) | +| `ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg` | `OnRampCfg.StaticConfig.MaxNopFeesJuels` | From first OnRamp (if empty) | +| `ConstructorArgs.PriceUpdaters` | N/A | Empty array `[]` (TODO: what to do with price updaters for 1.5 if there is no 1.6 lanes here) | +| `DestChainConfig.IsEnabled` | N/A | Hardcoded to `true` (if chain is supported on OnRamp, enable it on FeeQuoter) | +| `DestChainConfig.MaxDataBytes` | `OnRampCfg.DynamicConfig.MaxDataBytes` | Direct copy | +| `DestChainConfig.MaxPerMsgGasLimit` | `OnRampCfg.DynamicConfig.MaxPerMsgGasLimit` | Direct copy | +| `DestChainConfig.DestGasOverhead` | `OnRampCfg.DynamicConfig.DestGasOverhead` | Direct copy | +| `DestChainConfig.DestGasPerPayloadByteBase` | `OnRampCfg.DynamicConfig.DestGasPerPayloadByte` | Cast from `uint8` | +| `DestChainConfig.ChainFamilySelector` | N/A | Hardcoded to EVM family selector `0x2812d52c` | +| `DestChainConfig.DefaultTokenFeeUSDCents` | `OnRampCfg.DynamicConfig.DefaultTokenFeeUSDCents` | Direct copy | +| `DestChainConfig.DefaultTokenDestGasOverhead` | `OnRampCfg.DynamicConfig.DefaultTokenDestGasOverhead` | Direct copy | +| `DestChainConfig.DefaultTxGasLimit` | `OnRampCfg.StaticConfig.DefaultTxGasLimit` | Cast to `uint32` | +| `DestChainConfig.NetworkFeeUSDCents` | `OnRampCfg.FeeTokenConfig[].NetworkFeeUSDCents` | From first non-zero value (same across all fee tokens) | +| `DestChainConfig.LinkFeeMultiplierPercent` | N/A | Hardcoded to `90` | +| `TokenTransferFeeConfig.FeeUSDCents` | `OnRampCfg.TokenTransferFeeConfig[token].MinFeeUSDCents` | Direct copy | +| `TokenTransferFeeConfig.DestGasOverhead` | `OnRampCfg.TokenTransferFeeConfig[token].DestGasOverhead` | Direct copy | +| `TokenTransferFeeConfig.DestBytesOverhead` | `OnRampCfg.TokenTransferFeeConfig[token].DestBytesOverhead` | Direct copy | +| `TokenTransferFeeConfig.IsEnabled` | `OnRampCfg.TokenTransferFeeConfig[token].IsEnabled` | Direct copy | diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index d0df79a3e0..866838ae70 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -1,11 +1,347 @@ package deploy import ( + "fmt" + "sync" + + "github.com/Masterminds/semver/v3" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" + + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" +) + +var ( + singletonFQAndRampUpdaterRegistry *FQAndRampUpdaterRegistry + fqupdaterOnce sync.Once ) +type UpdateFeeQuoterInput struct { + Chains map[uint64]UpdateFeeQuoterInputPerChain + MCMS mcms.Input +} + +type UpdateFeeQuoterInputPerChain struct { + FeeQuoterVersion *semver.Version + RampsVersion *semver.Version +} + type FeeQuoterUpdateInput struct { ChainSelector uint64 ExistingAddresses []datastore.AddressRef ContractMeta []datastore.ContractMetadata } + +type SourceChainConfig struct { + Router datastore.AddressRef + OnRamp datastore.AddressRef +} + +type UpdateRampsInput struct { + ChainSelector uint64 + FeeQuoterAddress datastore.AddressRef + OnRampAddressRef datastore.AddressRef + OffRampAddressRef datastore.AddressRef +} + +// FeeQuoterUpdater provides methods to update FeeQuoter contract on a chain. +type FeeQuoterUpdater[FeeQUpdateArgs any] interface { + SequenceFeeQuoterInputCreation() *cldf_ops.Sequence[FeeQuoterUpdateInput, FeeQUpdateArgs, chain.BlockChains] + SequenceDeployOrUpdateFeeQuoter() *cldf_ops.Sequence[FeeQUpdateArgs, sequences.OnChainOutput, chain.BlockChains] +} + +type RampUpdater interface { + ResolveRampsInput(e cldf.Environment, input UpdateRampsInput) (UpdateRampsInput, error) + SequenceUpdateRampsWithFeeQuoter() *cldf_ops.Sequence[UpdateRampsInput, sequences.OnChainOutput, chain.BlockChains] +} + +type FQAndRampUpdaterRegistry struct { + FeeQuoterUpdater map[string]FeeQuoterUpdater[any] + RampUpdater map[string]RampUpdater + ConfigImporter map[string]ConfigImporter + ImportconfigVersionResolver map[string]LaneVersionResolver + mu sync.Mutex +} + +func (r *FQAndRampUpdaterRegistry) RegisterFeeQuoterUpdater(family string, version *semver.Version, updater FeeQuoterUpdater[any]) { + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + if _, exists := r.FeeQuoterUpdater[id]; !exists { + r.FeeQuoterUpdater[id] = updater + } +} + +func (r *FQAndRampUpdaterRegistry) RegisterRampUpdater(family string, version *semver.Version, updater RampUpdater) { + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + if _, exists := r.RampUpdater[id]; !exists { + r.RampUpdater[id] = updater + } +} + +func (r *FQAndRampUpdaterRegistry) RegisterConfigImporter(family string, version *semver.Version, importer ConfigImporter) { + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + if _, exists := r.ConfigImporter[id]; !exists { + r.ConfigImporter[id] = importer + } +} + +func (r *FQAndRampUpdaterRegistry) RegisterConfigImporterVersionResolver(family string, resolver LaneVersionResolver) { + r.mu.Lock() + defer r.mu.Unlock() + if _, exists := r.ImportconfigVersionResolver[family]; !exists { + r.ImportconfigVersionResolver[family] = resolver + } +} + +func (r *FQAndRampUpdaterRegistry) GetConfigImporter(chainsel uint64, version *semver.Version) (ConfigImporter, bool) { + // Get the chain family from the chain selector + family, err := chain_selectors.GetSelectorFamily(chainsel) + if err != nil { + return nil, false + } + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + importer, ok := r.ConfigImporter[id] + return importer, ok +} + +func (r *FQAndRampUpdaterRegistry) GetFeeQuoterUpdater(chainsel uint64, version *semver.Version) (FeeQuoterUpdater[any], bool) { + // Get the chain family from the chain selector + family, err := chain_selectors.GetSelectorFamily(chainsel) + if err != nil { + return nil, false + } + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + updater, ok := r.FeeQuoterUpdater[id] + return updater, ok +} + +func (r *FQAndRampUpdaterRegistry) GetRampUpdater(chainsel uint64, version *semver.Version) (RampUpdater, bool) { + // Get the chain family from the chain selector + family, err := chain_selectors.GetSelectorFamily(chainsel) + if err != nil { + return nil, false + } + r.mu.Lock() + defer r.mu.Unlock() + id := utils.NewRegistererID(family, version) + updater, ok := r.RampUpdater[id] + return updater, ok +} + +func (r *FQAndRampUpdaterRegistry) GetConfigImporterVersionResolver(chainsel uint64) (LaneVersionResolver, bool) { + // Get the chain family from the chain selector + family, err := chain_selectors.GetSelectorFamily(chainsel) + if err != nil { + return nil, false + } + r.mu.Lock() + defer r.mu.Unlock() + resolver, ok := r.ImportconfigVersionResolver[family] + return resolver, ok +} + +func newFQUpdaterRegistry() *FQAndRampUpdaterRegistry { + return &FQAndRampUpdaterRegistry{ + FeeQuoterUpdater: make(map[string]FeeQuoterUpdater[any]), + RampUpdater: make(map[string]RampUpdater), + ConfigImporter: make(map[string]ConfigImporter), + ImportconfigVersionResolver: make(map[string]LaneVersionResolver), + } +} + +func GetFQAndRampUpdaterRegistry() *FQAndRampUpdaterRegistry { + fqupdaterOnce.Do(func() { + singletonFQAndRampUpdaterRegistry = newFQUpdaterRegistry() + }) + return singletonFQAndRampUpdaterRegistry +} + +// UpdateFeeQuoterChangeset creates a changeset that updates FeeQuoter contracts on specified chains. +// This can support either upgrading to a 2.0 or higher version of the FeeQuoter, which allows re-configuration of the existing contract, or deploying a new FeeQuoter and updating Ramps to point to it. +// It first optionally populates configuration values, then creates FeeQuoterUpdateInput, +// deploys or updates the FeeQuoter contract, and finally updates the Ramps contracts to use the new FeeQuoter address. +// This also supports downgrading the FQ contract to a prior version (i.e. a rollback) where only the ramps +// are updated and the existing FQ is not touched. This would be triggered when specifying a FQ version < 2.0.0, which do not support re-configuration, and an existing FQ address is found in the datastore for the chain. +func UpdateFeeQuoterChangeset(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateFeeQuoterInput] { + return cldf.CreateChangeSet(updateFeeQuoterApply(fquRegistry, mcmsRegistry), updateFeeQuoterVerify()) +} + +func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error { + return func(e cldf.Environment, input UpdateFeeQuoterInput) error { + for chainSel, perChainInput := range input.Chains { + if !e.BlockChains.Exists(chainSel) { + return fmt.Errorf("chain with selector %d not found in environment", chainSel) + } + if perChainInput.FeeQuoterVersion == nil { + return fmt.Errorf("fee quoter version is required for chain selector %d", chainSel) + } + if perChainInput.RampsVersion == nil { + return fmt.Errorf("ramps version is required for chain selector %d", chainSel) + } + _, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: chainSel, + Type: datastore.ContractType(utils.FeeQuoter), + Version: perChainInput.FeeQuoterVersion, + }, chainSel, datastore_utils.FullRef) + if err != nil { + // errors are alright if we don't expect to find the ref + // but we only support deploying/updating fee quoters with versions >= 2.0.0 + supportedVersion := semver.MustParse("2.0.0") + if perChainInput.FeeQuoterVersion.LessThan(supportedVersion) { + return fmt.Errorf("fee quoter address not found for chain selector %d and version %s: %w", chainSel, perChainInput.FeeQuoterVersion.String(), err) + } + } + } + return nil + } +} + +func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { + return func(e cldf.Environment, input UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { + batchOps := make([]mcms_types.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + addressRefs := make([]datastore.AddressRef, 0) + contractMetadata := make([]datastore.ContractMetadata, 0) + for chainSel, perChainInput := range input.Chains { + var feeQuoterAddrRef datastore.AddressRef + rampUpdater, ok := fquRegistry.GetRampUpdater(chainSel, perChainInput.RampsVersion) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("RampUpdater", chainSel, perChainInput.RampsVersion) + } + feeQuoterAddrRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: chainSel, + Type: datastore.ContractType(utils.FeeQuoter), + Version: perChainInput.FeeQuoterVersion, + }, chainSel, datastore_utils.FullRef) + // if we get an error, it could be because the address doesn't exist, which is fine - + // it means we need to deploy or update the FeeQuoter + // if we get a FQ ref, we can re-configure an existing FQ >= 2.0.0 + if err != nil || feeQuoterAddrRef.Version.GreaterThanEqual(semver.MustParse("2.0.0")) { + e.Logger.Infof("No existing FeeQuoter address found for chain selector %d and version %s, proceeding with deployment and upgrade", chainSel, perChainInput.FeeQuoterVersion.String()) + fquUpdater, ok := fquRegistry.GetFeeQuoterUpdater(chainSel, perChainInput.FeeQuoterVersion) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("FeeQuoterUpdater", chainSel, perChainInput.FeeQuoterVersion) + } + + versionResolver, ok := fquRegistry.GetConfigImporterVersionResolver(chainSel) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporterVersionResolver", chainSel, nil) + } + // Resolve the config importer version to use for this chain + _, configImporterVersions, err := versionResolver.DeriveLaneVersionsForChain(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve config importer version for chain %d: %w", chainSel, err) + } + contractMeta := make([]datastore.ContractMetadata, 0) + for _, version := range configImporterVersions { + configImporter, ok := fquRegistry.GetConfigImporter(chainSel, version) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporter", chainSel, version) + } + err := configImporter.InitializeAdapter(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to initialize config importer for chain %d: %w", chainSel, err) + } + supportedTokensPerRemoteChain, err := configImporter.SupportedTokensPerRemoteChain(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get supported tokens per remote chain for chain %d: %w", chainSel, err) + } + connectedChains, err := configImporter.ConnectedChains(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get connected chains for chain %d: %w", chainSel, err) + } + populateConfigReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, configImporter.SequenceImportConfig(), e.BlockChains, ImportConfigPerChainInput{ + ChainSelector: chainSel, + RemoteChains: connectedChains, + TokensPerRemoteChain: supportedTokensPerRemoteChain, + }) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to populate config for FeeQuoter on chain %d: %w", chainSel, err) + } + if len(populateConfigReport.Output.Metadata.Contracts) == 0 { + return cldf.ChangesetOutput{}, fmt.Errorf("no contract metadata returned from populate config for FeeQuoter on chain %d", chainSel) + } + + contractMeta = append(contractMeta, populateConfigReport.Output.Metadata.Contracts...) + contractMetadata = append(contractMetadata, populateConfigReport.Output.Metadata.Contracts...) + } + // Create FeeQuoterUpdateInput + reportFQInputCreation, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceFeeQuoterInputCreation(), e.BlockChains, FeeQuoterUpdateInput{ + ChainSelector: chainSel, + ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), + ContractMeta: contractMeta, + }) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) + } + // Deploy or update FeeQuoter + reportFQUpdate, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceDeployOrUpdateFeeQuoter(), e.BlockChains, reportFQInputCreation.Output) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to deploy or update FeeQuoter for chain %d: %w", chainSel, err) + } + batchOps = append(batchOps, reportFQUpdate.Output.BatchOps...) + addressRefs = append(addressRefs, reportFQUpdate.Output.Addresses...) + reports = append(reports, reportFQUpdate.ExecutionReports...) + if len(reportFQUpdate.Output.Addresses) == 0 { + return cldf.ChangesetOutput{}, fmt.Errorf("no FeeQuoter address returned for chain %d", chainSel) + } + // Update Ramps with new FeeQuoter address + // fetch the address refs + feeQuoterAddrRef = reportFQUpdate.Output.Addresses[len(reportFQUpdate.Output.Addresses)-1] + } + if perChainInput.RampsVersion != nil { + rampsInput := UpdateRampsInput{ + ChainSelector: chainSel, + FeeQuoterAddress: feeQuoterAddrRef, + } + // Resolve Ramps input + resolvedRampsInput, err := rampUpdater.ResolveRampsInput(e, rampsInput) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve ramps input for chain %d: %w", chainSel, err) + } + // Execute Ramps update sequence + reportRampsUpdate, err := cldf_ops.ExecuteSequence(e.OperationsBundle, rampUpdater.SequenceUpdateRampsWithFeeQuoter(), e.BlockChains, resolvedRampsInput) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to update ramps with FeeQuoter for chain %d: %w", chainSel, err) + } + batchOps = append(batchOps, reportRampsUpdate.Output.BatchOps...) + addressRefs = append(addressRefs, reportRampsUpdate.Output.Addresses...) + reports = append(reports, reportRampsUpdate.ExecutionReports...) + } + } + // Prepare datastore with all address refs + ds := datastore.NewMemoryDataStore() + for _, addrRef := range addressRefs { + if err := ds.Addresses().Add(addrRef); err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to add %s %s with address %s on chain with selector %d to datastore: %w", addrRef.Type, addrRef.Version, addrRef.Address, addrRef.ChainSelector, err) + } + } + if err := sequences.WriteMetadataToDatastore(ds, sequences.Metadata{ + Contracts: contractMetadata, + }); err != nil { + return cldf.ChangesetOutput{Reports: reports}, fmt.Errorf("failed to write metadata to datastore: %w", err) + } + return changesets.NewOutputBuilder(e, mcmsRegistry). + WithReports(reports). + WithDataStore(ds). + WithSingleBatchOpPerChain(batchOps). + Build(input.MCMS) + } +} \ No newline at end of file diff --git a/deployment/deploy/product.go b/deployment/deploy/product.go index 64adf7f31a..c6f087fe03 100644 --- a/deployment/deploy/product.go +++ b/deployment/deploy/product.go @@ -97,8 +97,16 @@ type TransferOwnershipAdapter interface { } type ConfigImporter interface { - InitializeAdapter(e cldf.Environment, selectors []uint64) error + InitializeAdapter(e cldf.Environment, selectors uint64) error ConnectedChains(e cldf.Environment, chainsel uint64) ([]uint64, error) SupportedTokensPerRemoteChain(e cldf.Environment, chainSelector uint64) (map[uint64][]common.Address, error) SequenceImportConfig() *cldf_ops.Sequence[ImportConfigPerChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] } + +// LaneVersionResolver is an interface for resolving the versions of lane deployed on a chain. +// This is used to determine which version of the lane is connected to a remote chain from a particular chain. +// For example - in case of EVM chains, we can look at the onramps and offramps connected to the router to determine +// which version of the lane is deployed for each remote chain. +type LaneVersionResolver interface { + DeriveLaneVersionsForChain(e cldf.Environment, chainSel uint64) (map[uint64]*semver.Version, []*semver.Version, error) +} diff --git a/deployment/utils/changesets/output.go b/deployment/utils/changesets/output.go index 82bb3e5343..303ee6b1ad 100644 --- a/deployment/utils/changesets/output.go +++ b/deployment/utils/changesets/output.go @@ -117,6 +117,27 @@ func (b *OutputBuilder) WithBatchOps(ops []mcms_types.BatchOperation) *OutputBui return b } +// WithSingleBatchOpPerChain sets the batch operations on the OutputBuilder, ensuring that there is at most one batch operation per chain selector. +// It is helpful to enforce the atomicity guarantees of MCMS proposals, which require that all operations for a given chain be included in a single batch operation. +func (b *OutputBuilder) WithSingleBatchOpPerChain(ops []mcms_types.BatchOperation) *OutputBuilder { + // Filter out any batch operations that have no transactions. + txPerChains := make(map[mcms_types.ChainSelector][]mcms_types.Transaction) + for _, op := range ops { + if len(op.Transactions) > 0 { + txPerChains[op.ChainSelector] = append(txPerChains[op.ChainSelector], op.Transactions...) + } + } + filteredOps := make([]mcms_types.BatchOperation, 0, len(txPerChains)) + for chainSelector, txs := range txPerChains { + filteredOps = append(filteredOps, mcms_types.BatchOperation{ + ChainSelector: chainSelector, + Transactions: txs, + }) + } + b.batchOps = filteredOps + return b +} + // Build constructs the final ChangesetOutput, including building an MCMS proposal if there are write operations that have not been executed. func (b *OutputBuilder) Build(input mcms_utils.Input) (deployment.ChangesetOutput, error) { if len(b.batchOps) == 0 { diff --git a/deployment/utils/common.go b/deployment/utils/common.go index 5bac8de372..92978d5719 100644 --- a/deployment/utils/common.go +++ b/deployment/utils/common.go @@ -31,6 +31,7 @@ const ( BurnWithFromMintTokenPool cldf.ContractType = "BurnWithFromMintTokenPool" BurnFromMintTokenPool cldf.ContractType = "BurnFromMintTokenPool" CCTPTokenPool cldf.ContractType = "CCTPTokenPool" + FeeQuoter cldf.ContractType = "FeeQuoter" // CLL Identifiers CLLQualifier = "CLLCCIP" RMNTimelockQualifier = "RMNMCMS" @@ -81,6 +82,12 @@ var ( ErrNoAdapterRegistered = func(family string, version *semver.Version) error { return fmt.Errorf("no adapter registered for chain family %s and version %s", family, version.String()) } + ErrNoAdapterForSelectorRegistered = func(adapetrName string, selector uint64, version *semver.Version) error { + if version != nil { + return fmt.Errorf("no %s adapter registered for chain selector %d and version %s", adapetrName, selector, version.String()) + } + return fmt.Errorf("no %s adapter registered for chain selector %d", adapetrName, selector) + } ) var ( diff --git a/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go b/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go new file mode 100644 index 0000000000..b70a35eaa4 --- /dev/null +++ b/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go @@ -0,0 +1,212 @@ +package deployment + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldf "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/stretchr/testify/require" + + fq16ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" + fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" + _ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/adapters" + fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/onramp" + offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + lanesapi "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" + cs_core "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" +) + +func TestUpdateToFeeQuoter_2_0(t *testing.T) { + chains := []uint64{ + chain_selectors.ETHEREUM_MAINNET.Selector, + chain_selectors.AVALANCHE_MAINNET.Selector, + } + + e, err := environment.New(t.Context(), + environment.WithEVMSimulated(t, chains), + ) + require.NoError(t, err, "Failed to create test environment") + require.NotNil(t, e, "Environment should be created") + mcmsRegistry := cs_core.GetRegistry() + dReg := deployops.GetRegistry() + version := semver.MustParse("1.6.0") + chainInput := make(map[uint64]deployops.ContractDeploymentConfigPerChain) + fqInput := make(map[uint64]deployops.UpdateFeeQuoterInputPerChain) + + for _, chainSel := range chains { + chainInput[chainSel] = deployops.ContractDeploymentConfigPerChain{ + Version: version, + // FEE QUOTER CONFIG + MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1e18)), + TokenPriceStalenessThreshold: uint32(24 * 60 * 60), + LinkPremiumMultiplier: 9e17, // 0.9 ETH + NativeTokenPremiumMultiplier: 1e18, // 1.0 ETH + // OFFRAMP CONFIG + PermissionLessExecutionThresholdSeconds: uint32((20 * time.Minute).Seconds()), + GasForCallExactCheck: uint16(5000), + } + fqInput[chainSel] = deployops.UpdateFeeQuoterInputPerChain{ + FeeQuoterVersion: semver.MustParse("2.0.0"), + RampsVersion: semver.MustParse("1.6.0"), + } + } + out, err := deployops.DeployContracts(dReg).Apply(*e, deployops.ContractDeploymentConfig{ + MCMS: mcms.Input{}, + Chains: chainInput, + }) + require.NoError(t, err, "Failed to apply DeployChainContracts changeset") + require.NoError(t, out.DataStore.Merge(e.DataStore)) + e.DataStore = out.DataStore.Seal() + chain1 := lanesapi.ChainDefinition{ + Selector: chain_selectors.ETHEREUM_MAINNET.Selector, + GasPrice: big.NewInt(1e9), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.ETHEREUM_MAINNET.Selector), + } + chain2 := lanesapi.ChainDefinition{ + Selector: chain_selectors.AVALANCHE_MAINNET.Selector, + GasPrice: big.NewInt(1e9), + FeeQuoterDestChainConfig: lanesapi.DefaultFeeQuoterDestChainConfig(true, chain_selectors.AVALANCHE_MAINNET.Selector), + } + _, err = lanesapi.ConnectChains(lanesapi.GetLaneAdapterRegistry(), mcmsRegistry).Apply(*e, lanesapi.ConnectChainsConfig{ + Lanes: []lanesapi.LaneConfig{ + { + Version: version, + ChainA: chain1, + ChainB: chain2, + }, + }, + }) + require.NoError(t, err, "Failed to apply ConnectChains changeset") + fqReg := deployops.GetFQAndRampUpdaterRegistry() + // now update to FeeQuoter 2.0.0 + fqUpdateChangeset := deployops.UpdateFeeQuoterChangeset(fqReg, nil) + out, err = fqUpdateChangeset.Apply(*e, deployops.UpdateFeeQuoterInput{ + Chains: fqInput, + }) + require.NoError(t, err, "Failed to apply UpdateFeeQuoterChangeset changeset") + // update datastore with changeset output + require.NoError(t, out.DataStore.Merge(e.DataStore), "Failed to merge changeset output datastore") + e.DataStore = out.DataStore.Seal() + for _, chainSel := range chains { + fqUpgradeValidation(t, e, chainSel, chains, true) + } + // do this to reset cached executions + bundle := operations.NewBundle( + func() context.Context { return context.Background() }, + e.Logger, + operations.NewMemoryReporter(), + ) + e.OperationsBundle = bundle + // downgrade back to 1.6.0 to make sure the changeset is reversible + for _, chainSel := range chains { + fqInput[chainSel] = deployops.UpdateFeeQuoterInputPerChain{ + FeeQuoterVersion: fq163ops.Version, + RampsVersion: semver.MustParse("1.6.0"), + } + } + // now update to FeeQuoter 2.0.0 + fqUpdateChangeset = deployops.UpdateFeeQuoterChangeset(fqReg, nil) + out, err = fqUpdateChangeset.Apply(*e, deployops.UpdateFeeQuoterInput{ + Chains: fqInput, + }) + require.NoError(t, err, "Failed to apply UpdateFeeQuoterChangeset changeset") + require.Len(t, out.DataStore.Addresses().Filter(), 0, "new addresses found on downgrade") + + for _, chainSel := range chains { + fqUpgradeValidation(t, e, chainSel, chains, false) + } +} + +func fqUpgradeValidation(t *testing.T, e *cldf.Environment, chainSel uint64, chains []uint64, expected17fq bool) { + chain := e.BlockChains.EVMChains()[chainSel] + + // get fee quoter address and check config + fq17AddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(fqops.ContractType)), + datastore.AddressRefByVersion(fqops.Version), + ) + require.Len(t, fq17AddrRefs, 1, "Expected exactly 1 FeeQuoter address ref for chain selector %d", chainSel) + fq17Addr := common.HexToAddress(fq17AddrRefs[0].Address) + fq17Contract, err := fqops.NewFeeQuoterContract(fq17Addr, chain.Client) + require.NoError(t, err, "Failed to instantiate FeeQuoter 2.0 contract for chain selector %d", chainSel) + fq16AddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(fq16ops.ContractType)), + datastore.AddressRefByVersion(fq163ops.Version), + ) + require.Len(t, fq16AddrRefs, 1, "Expected exactly 1 FeeQuoter address ref for version 1.6.0 and chain selector %d", chainSel) + fq16Addr := common.HexToAddress(fq16AddrRefs[0].Address) + // check that the new fee quoter has the same config as the old fee quoter + fq16Contract, err := fq163ops.NewFeeQuoterContract(fq16Addr, chain.Client) + require.NoError(t, err, "Failed to instantiate old FeeQuoter 1.6.0 contract for chain selector %d", chainSel) + staticConfig16, err := fq16Contract.GetStaticConfig(nil) + require.NoError(t, err, "Failed to get FeeQuoter config for old contract for chain selector %d", chainSel) + staticConfig17, err := fq17Contract.GetStaticConfig(nil) + require.NoError(t, err, "Failed to get FeeQuoter config for chain selector %d", chainSel) + require.Equal(t, staticConfig16.MaxFeeJuelsPerMsg, staticConfig17.MaxFeeJuelsPerMsg, "MaxFeeJuelsPerMsg should be the same after update for chain selector %d", chainSel) + require.Equal(t, staticConfig16.LinkToken, staticConfig17.LinkToken, "LinkToken address should be the same after update for chain selector %d", chainSel) + updaters16, err := fq16Contract.GetAllAuthorizedCallers(nil) + require.NoError(t, err, "Failed to get FeeQuoter dynamic config for old contract for chain selector %d", chainSel) + updaters17, err := fq17Contract.GetAllAuthorizedCallers(nil) + require.NoError(t, err, "Failed to get FeeQuoter dynamic config for chain selector %d", chainSel) + require.ElementsMatch(t, updaters16, updaters17) + + var remoteChainSelector uint64 + for _, sel := range chains { + if sel != chainSel { + remoteChainSelector = sel + break + } + } + // check the destination chain config for the lane for few elements to make sure it was copied correctly + destChainConfig17, err := fq17Contract.GetDestChainConfig(nil, remoteChainSelector) + require.NoError(t, err, "Failed to get FeeQuoter dest chain config for chain selector %d", chainSel) + destChainConfig16, err := fq16Contract.GetDestChainConfig(nil, remoteChainSelector) + require.NoError(t, err, "Failed to get FeeQuoter dest chain config for old contract for chain selector %d", chainSel) + require.Equal(t, destChainConfig16.IsEnabled, destChainConfig17.IsEnabled, "IsEnabled in dest chain config should be the same after update for chain selector %d", chainSel) + require.Equal(t, destChainConfig16.DefaultTxGasLimit, destChainConfig17.DefaultTxGasLimit, "DefaultTxGasLimit in dest chain config should be the same after update for chain selector %d", chainSel) + + // get the onramp and offramp + onRampAddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(onrampops.ContractType)), + datastore.AddressRefByVersion(onrampops.Version), + ) + require.Len(t, onRampAddrRefs, 1, "Expected exactly 1 OnRamp address ref for chain selector %d", chainSel) + onRampAddr := common.HexToAddress(onRampAddrRefs[0].Address) + offRampAddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(offrampops.ContractType)), + datastore.AddressRefByVersion(offrampops.Version), + ) + require.Len(t, offRampAddrRefs, 1, "Expected exactly 1 OffRamp address ref for chain selector %d", chainSel) + offRampAddr := common.HexToAddress(offRampAddrRefs[0].Address) + onRampContract, err := onramp.NewOnRamp(onRampAddr, chain.Client) + require.NoError(t, err, "Failed to instantiate OnRamp contract for chain selector %d", chainSel) + offRampContract, err := offramp.NewOffRamp(offRampAddr, chain.Client) + require.NoError(t, err, "Failed to instantiate OffRamp contract for chain selector %d", chainSel) + onRampDCfg, err := onRampContract.GetDynamicConfig(nil) + require.NoError(t, err, "Failed to get OnRamp static config for chain selector %d", chainSel) + offRampDCfg, err := offRampContract.GetDynamicConfig(nil) + require.NoError(t, err, "Failed to get OffRamp static config for chain selector %d", chainSel) + expectedFQAddr := fq17Addr + if !expected17fq { + expectedFQAddr = fq16Addr + } + require.Equal(t, onRampDCfg.FeeQuoter, expectedFQAddr, "OnRamp should point to expected FeeQuoter after update for chain selector %d", chainSel) + require.Equal(t, offRampDCfg.FeeQuoter, expectedFQAddr, "OffRamp should point to expected FeeQuoter after update for chain selector %d", chainSel) +} From 0e21a8f9dc27904508af7782aa67b5c7cbf2c264 Mon Sep 17 00:00:00 2001 From: Austin <107539019+0xAustinWang@users.noreply.github.com> Date: Thu, 5 Mar 2026 16:05:05 -0500 Subject: [PATCH 25/41] Aw/defensive proto (#1800) * add more nil checks against bytes32 parsing * use more proto accessors * character line length --- pkg/ocrtypecodec/v1/commit.go | 6 +- pkg/ocrtypecodec/v1/exec.go | 38 ++++++++++-- pkg/ocrtypecodec/v1/translate.go | 102 +++++++++++++++++++++++-------- 3 files changed, 111 insertions(+), 35 deletions(-) diff --git a/pkg/ocrtypecodec/v1/commit.go b/pkg/ocrtypecodec/v1/commit.go index 1095813008..22c3bab8bc 100644 --- a/pkg/ocrtypecodec/v1/commit.go +++ b/pkg/ocrtypecodec/v1/commit.go @@ -72,10 +72,10 @@ func (c *CommitCodecProto) DecodeQuery(data []byte) (committypes.Query, error) { q := committypes.Query{ MerkleRootQuery: merkleroot.Query{ - RetryRMNSignatures: pbQ.MerkleRootQuery.RetryRmnSignatures, + RetryRMNSignatures: pbQ.GetMerkleRootQuery().GetRetryRmnSignatures(), RMNSignatures: &rmn.ReportSignatures{ - Signatures: c.tr.rmnSignaturesFromProto(pbQ.MerkleRootQuery.RmnSignatures.Signatures), - LaneUpdates: c.tr.laneUpdatesFromProto(pbQ.MerkleRootQuery.RmnSignatures.LaneUpdates), + Signatures: c.tr.rmnSignaturesFromProto(pbQ.GetMerkleRootQuery().GetRmnSignatures().GetSignatures()), + LaneUpdates: c.tr.laneUpdatesFromProto(pbQ.GetMerkleRootQuery().GetRmnSignatures().GetLaneUpdates()), }, }, TokenPriceQuery: tokenprice.Query{}, diff --git a/pkg/ocrtypecodec/v1/exec.go b/pkg/ocrtypecodec/v1/exec.go index 1d1b7e7bce..58aac1c235 100644 --- a/pkg/ocrtypecodec/v1/exec.go +++ b/pkg/ocrtypecodec/v1/exec.go @@ -65,10 +65,23 @@ func (e *ExecCodecProto) DecodeObservation(data []byte) (obs exectypes.Observati return obs, fmt.Errorf("proto unmarshal ExecObservation: %w", err) } + commitReports, err := e.tr.commitReportsFromProto(pbObs.GetCommitReports()) + if err != nil { + return obs, fmt.Errorf("commit reports from proto: %w", err) + } + messages, err := e.tr.messageObservationsFromProto(pbObs.GetSeqNumsToMsgs()) + if err != nil { + return obs, fmt.Errorf("message observations from proto: %w", err) + } + hashes, err := e.tr.messageHashesFromProto(pbObs.GetMsgHashes()) + if err != nil { + return obs, fmt.Errorf("message hashes from proto: %w", err) + } + return exectypes.Observation{ - CommitReports: e.tr.commitReportsFromProto(pbObs.GetCommitReports()), - Messages: e.tr.messageObservationsFromProto(pbObs.GetSeqNumsToMsgs()), - Hashes: e.tr.messageHashesFromProto(pbObs.GetMsgHashes()), + CommitReports: commitReports, + Messages: messages, + Hashes: hashes, TokenData: e.tr.tokenDataObservationsFromProto(pbObs.GetTokenDataObservations().GetTokenData()), Nonces: e.tr.nonceObservationsFromProto(pbObs.GetNonces()), Contracts: discoverytypes.Observation{ @@ -116,17 +129,30 @@ func (e *ExecCodecProto) DecodeOutcome(data []byte) (exectypes.Outcome, error) { return exectypes.Outcome{}, fmt.Errorf("proto unmarshal ExecOutcome: %w", err) } + commitReports, err := e.tr.commitDataSliceFromProto(pbOtcm.GetCommitReports()) + if err != nil { + return exectypes.Outcome{}, fmt.Errorf("commit reports from proto: %w", err) + } + reports, err := e.tr.execPluginReportsFromProto(pbOtcm.GetExecutePluginReports()) + if err != nil { + return exectypes.Outcome{}, fmt.Errorf("exec plugin reports from proto: %w", err) + } otcm := exectypes.Outcome{ State: exectypes.PluginState(pbOtcm.GetPluginState()), - CommitReports: e.tr.commitDataSliceFromProto(pbOtcm.GetCommitReports()), - Reports: e.tr.execPluginReportsFromProto(pbOtcm.GetExecutePluginReports()), + CommitReports: commitReports, + Reports: reports, } // Decode the legacy Report field into the new Reports field. This way the plugin layer doesn't // need to worry about type migration. // TODO: Remove temporary migration code after a few releases. if pbOtcm.ExecutePluginReport != nil { - otcm.Reports = e.tr.execPluginReportsFromProto([]*ocrtypecodecpb.ExecutePluginReport{pbOtcm.GetExecutePluginReport()}) + reports, err := e.tr.execPluginReportsFromProto( + []*ocrtypecodecpb.ExecutePluginReport{pbOtcm.GetExecutePluginReport()}) + if err != nil { + return exectypes.Outcome{}, fmt.Errorf("exec plugin reports from proto: %w", err) + } + otcm.Reports = reports } // Decode the new report format into the legacy field as an intermediate step for implementing this feature. diff --git a/pkg/ocrtypecodec/v1/translate.go b/pkg/ocrtypecodec/v1/translate.go index 211e54ef32..55d82e30be 100644 --- a/pkg/ocrtypecodec/v1/translate.go +++ b/pkg/ocrtypecodec/v1/translate.go @@ -583,23 +583,39 @@ func (t *protoTranslator) commitDataSliceToProto(commits []exectypes.CommitData) func (t *protoTranslator) commitReportsFromProto( pbObservations map[uint64]*ocrtypecodecpb.CommitObservations, -) exectypes.CommitObservations { +) (exectypes.CommitObservations, error) { var commitReports exectypes.CommitObservations if len(pbObservations) > 0 { commitReports = make(exectypes.CommitObservations, len(pbObservations)) } for chainSel, commitObs := range pbObservations { - commitReports[cciptypes.ChainSelector(chainSel)] = t.commitDataSliceFromProto(commitObs.CommitData) + commitDataSlice, err := t.commitDataSliceFromProto(commitObs.CommitData) + if err != nil { + return nil, err + } + commitReports[cciptypes.ChainSelector(chainSel)] = commitDataSlice } - return commitReports + return commitReports, nil } -func (t *protoTranslator) commitDataSliceFromProto(pbCommits []*ocrtypecodecpb.CommitData) []exectypes.CommitData { +func (t *protoTranslator) commitDataSliceFromProto( + pbCommits []*ocrtypecodecpb.CommitData) ([]exectypes.CommitData, error) { commitData := make([]exectypes.CommitData, len(pbCommits)) for i, commit := range pbCommits { + if len(commit.MerkleRoot) != 32 { + return nil, fmt.Errorf("merkle root length is not 32: %d", len(commit.MerkleRoot)) + } + hashes, err := t.bytes32SliceFromProto(commit.Hashes) + if err != nil { + return nil, err + } + messages, err := t.decodeMessages(commit.Messages) + if err != nil { + return nil, err + } commitData[i] = exectypes.CommitData{ SourceChain: cciptypes.ChainSelector(commit.SourceChain), OnRampAddress: commit.OnRampAddress, @@ -611,13 +627,13 @@ func (t *protoTranslator) commitDataSliceFromProto(pbCommits []*ocrtypecodecpb.C cciptypes.SeqNum(commit.SequenceNumberRange.MaxMsgNr), ), ExecutedMessages: t.decodeSeqNums(commit.ExecutedMessages), - Messages: t.decodeMessages(commit.Messages), - Hashes: t.bytes32SliceFromProto(commit.Hashes), + Messages: messages, + Hashes: hashes, MessageTokenData: t.decodeMessageTokenData(commit.MessageTokenData), } } - return commitData + return commitData, nil } func (t *protoTranslator) messagesToProto(messages []cciptypes.Message) []*ocrtypecodecpb.Message { @@ -699,17 +715,20 @@ func (t *protoTranslator) bytes32SliceToProto(slice []cciptypes.Bytes32) [][]byt return result } -func (t *protoTranslator) bytes32SliceFromProto(pbSlice [][]byte) []cciptypes.Bytes32 { +func (t *protoTranslator) bytes32SliceFromProto(pbSlice [][]byte) ([]cciptypes.Bytes32, error) { var result []cciptypes.Bytes32 if len(pbSlice) > 0 { result = make([]cciptypes.Bytes32, len(pbSlice)) } for i, val := range pbSlice { + if len(val) != 32 { + return nil, fmt.Errorf("bytes32 length is not 32: %d", len(val)) + } result[i] = cciptypes.Bytes32(val) } - return result + return result, nil } func (t *protoTranslator) messageTokenDataSliceToProto( @@ -763,7 +782,7 @@ func (t *protoTranslator) messageObservationsToProto( func (t *protoTranslator) messageObservationsFromProto( pbMsgs map[uint64]*ocrtypecodecpb.SeqNumToMessage, -) exectypes.MessageObservations { +) (exectypes.MessageObservations, error) { var messages exectypes.MessageObservations if len(pbMsgs) > 0 { messages = make(exectypes.MessageObservations, len(pbMsgs)) @@ -772,12 +791,16 @@ func (t *protoTranslator) messageObservationsFromProto( for chainSel, msgMap := range pbMsgs { innerMap := make(map[cciptypes.SeqNum]cciptypes.Message, len(msgMap.Messages)) for seqNum, msg := range msgMap.Messages { - innerMap[cciptypes.SeqNum(seqNum)] = t.decodeMessage(msg) + decodedMsg, err := t.decodeMessage(msg) + if err != nil { + return nil, err + } + innerMap[cciptypes.SeqNum(seqNum)] = decodedMsg } messages[cciptypes.ChainSelector(chainSel)] = innerMap } - return messages + return messages, nil } func (t *protoTranslator) messageHashesToProto( @@ -801,7 +824,7 @@ func (t *protoTranslator) messageHashesToProto( func (t *protoTranslator) messageHashesFromProto( pbHashes map[uint64]*ocrtypecodecpb.SeqNumToBytes, -) exectypes.MessageHashes { +) (exectypes.MessageHashes, error) { var hashes exectypes.MessageHashes if len(pbHashes) > 0 { hashes = make(exectypes.MessageHashes, len(pbHashes)) @@ -810,12 +833,15 @@ func (t *protoTranslator) messageHashesFromProto( for chainSel, hashMap := range pbHashes { innerMap := make(map[cciptypes.SeqNum]cciptypes.Bytes32, len(hashMap.SeqNumToBytes)) for seqNum, hash := range hashMap.SeqNumToBytes { + if len(hash) != 32 { + return nil, fmt.Errorf("bytes32 length is not 32: %d", len(hash)) + } innerMap[cciptypes.SeqNum(seqNum)] = cciptypes.Bytes32(hash) } hashes[cciptypes.ChainSelector(chainSel)] = innerMap } - return hashes + return hashes, nil } func (t *protoTranslator) tokenDataObservationsToProto( @@ -921,7 +947,7 @@ func (t *protoTranslator) execPluginReportsToProto( func (t *protoTranslator) execPluginReportsFromProto( pbReports []*ocrtypecodecpb.ExecutePluginReport, -) []cciptypes.ExecutePluginReport { +) ([]cciptypes.ExecutePluginReport, error) { reports := make([]cciptypes.ExecutePluginReport, len(pbReports)) for i, r := range pbReports { @@ -934,17 +960,26 @@ func (t *protoTranslator) execPluginReportsFromProto( offchainTokenData = append(offchainTokenData, data.Items) } + proofs, err := t.bytes32SliceFromProto(cr.Proofs) + if err != nil { + return nil, err + } + + messages, err := t.decodeMessages(cr.Messages) + if err != nil { + return nil, err + } reports[i].ChainReports[j] = cciptypes.ExecutePluginReportSingleChain{ SourceChainSelector: cciptypes.ChainSelector(cr.SourceChainSelector), - Messages: t.decodeMessages(cr.Messages), + Messages: messages, OffchainTokenData: offchainTokenData, - Proofs: t.bytes32SliceFromProto(cr.Proofs), + Proofs: proofs, ProofFlagBits: cciptypes.NewBigInt(big.NewInt(0).SetBytes(cr.ProofFlagBits)), } } } - return reports + return reports, nil } func (t *protoTranslator) decodeMessageTokenData(data []*ocrtypecodecpb.MessageTokenData) []exectypes.MessageTokenData { @@ -971,21 +1006,29 @@ func (t *protoTranslator) decodeSeqNums(seqNums []uint64) []cciptypes.SeqNum { return result } -func (t *protoTranslator) decodeMessages(messages []*ocrtypecodecpb.Message) []cciptypes.Message { +func (t *protoTranslator) decodeMessages(messages []*ocrtypecodecpb.Message) ([]cciptypes.Message, error) { var result []cciptypes.Message if len(messages) > 0 { result = make([]cciptypes.Message, len(messages)) } for i, msg := range messages { - result[i] = t.decodeMessage(msg) + decodedMsg, err := t.decodeMessage(msg) + if err != nil { + return nil, err + } + result[i] = decodedMsg } - return result + return result, nil } -func (t *protoTranslator) decodeMessage(msg *ocrtypecodecpb.Message) cciptypes.Message { +func (t *protoTranslator) decodeMessage(msg *ocrtypecodecpb.Message) (cciptypes.Message, error) { + header, err := t.decodeMessageHeader(msg.Header) + if err != nil { + return cciptypes.Message{}, err + } return cciptypes.Message{ - Header: t.decodeMessageHeader(msg.Header), + Header: header, Sender: msg.Sender, Data: msg.Data, Receiver: msg.Receiver, @@ -994,10 +1037,17 @@ func (t *protoTranslator) decodeMessage(msg *ocrtypecodecpb.Message) cciptypes.M FeeTokenAmount: cciptypes.NewBigInt(big.NewInt(0).SetBytes(msg.FeeTokenAmount)), FeeValueJuels: cciptypes.NewBigInt(big.NewInt(0).SetBytes(msg.FeeValueJuels)), TokenAmounts: t.decodeRampTokenAmounts(msg.TokenAmounts), - } + }, nil } -func (t *protoTranslator) decodeMessageHeader(header *ocrtypecodecpb.RampMessageHeader) cciptypes.RampMessageHeader { +func (t *protoTranslator) decodeMessageHeader( + header *ocrtypecodecpb.RampMessageHeader) (cciptypes.RampMessageHeader, error) { + if len(header.MessageId) != 32 { + return cciptypes.RampMessageHeader{}, fmt.Errorf("message id length is not 32: %d", len(header.MessageId)) + } + if len(header.MsgHash) != 32 { + return cciptypes.RampMessageHeader{}, fmt.Errorf("msg hash length is not 32: %d", len(header.MsgHash)) + } return cciptypes.RampMessageHeader{ MessageID: cciptypes.Bytes32(header.MessageId), SourceChainSelector: cciptypes.ChainSelector(header.SourceChainSelector), @@ -1007,7 +1057,7 @@ func (t *protoTranslator) decodeMessageHeader(header *ocrtypecodecpb.RampMessage MsgHash: cciptypes.Bytes32(header.MsgHash), OnRamp: header.OnRamp, TxHash: header.TxHash, - } + }, nil } func (t *protoTranslator) decodeRampTokenAmounts( From 55094bee6779262907a370bab9a406ea36031b4e Mon Sep 17 00:00:00 2001 From: Rens Rooimans <5789419+RensR@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:19:47 +0100 Subject: [PATCH 26/41] Bump go deps (#1797) * bump root refs * bump carpenter * bump otel * undo --- chains/evm/deployment/go.mod | 47 ++++---- chains/evm/deployment/go.sum | 106 +++++++++--------- ...rapper-dependency-versions-do-not-edit.txt | 2 +- chains/solana/deployment/go.mod | 45 ++++---- chains/solana/deployment/go.sum | 102 ++++++++--------- chains/solana/go.mod | 13 ++- chains/solana/go.sum | 26 +++-- cmd/carpenter/go.mod | 47 ++++---- cmd/carpenter/go.sum | 105 +++++++++-------- deployment/go.mod | 45 ++++---- deployment/go.sum | 102 ++++++++--------- devenv/go.mod | 41 ++++--- devenv/go.sum | 56 ++++----- go.md | 7 +- go.mod | 44 ++++---- go.sum | 92 +++++++-------- integration-tests/go.mod | 47 ++++---- integration-tests/go.sum | 106 +++++++++--------- 18 files changed, 529 insertions(+), 504 deletions(-) diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index f643fc0276..7d119938bc 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -14,14 +14,14 @@ replace github.com/smartcontractkit/chainlink-ccip/deployment => ../../../deploy require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/aws/smithy-go v1.24.2 + github.com/ethereum/go-ethereum v1.17.1 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.0 github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd @@ -30,7 +30,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/xssnick/tonutils-go v1.14.1 github.com/zksync-sdk/zksync2-go v1.1.1-0.20250620124214-2c742ee399c6 - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 golang.org/x/sync v0.19.0 ) @@ -84,7 +84,7 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v28.5.1+incompatible // indirect @@ -92,7 +92,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -217,9 +217,10 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect @@ -231,7 +232,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -251,7 +252,7 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -262,26 +263,26 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect - golang.org/x/crypto v0.47.0 // indirect - golang.org/x/net v0.48.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/time v0.14.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/chains/evm/deployment/go.sum b/chains/evm/deployment/go.sum index 874601bf88..4678601545 100644 --- a/chains/evm/deployment/go.sum +++ b/chains/evm/deployment/go.sum @@ -71,8 +71,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlV github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= -github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= -github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= +github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= +github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -195,8 +195,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -222,12 +222,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -681,8 +681,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= +github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 h1:8R5BstwQlzucsa/wfHXsIG5lOD6B1fYPHHC/yFYossw= @@ -693,12 +693,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 h1:EaLuGs7jZ6Vm2iv6rNK3bQ3XN5CRbFd4knjjvaD1zFc= @@ -750,8 +752,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -810,8 +812,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -832,20 +834,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -892,11 +894,11 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -909,8 +911,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -939,8 +941,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= @@ -1005,10 +1007,10 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523 h1:H52Mhyrc44wBgLTGzq6+0cmuVuF3LURCSXsLMOqfFos= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523/go.mod h1:ArQvPJS723nJQietgilmZA+shuB3CZxH1n2iXq9VSfs= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1018,8 +1020,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1031,10 +1033,10 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1055,8 +1057,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1066,8 +1068,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1083,8 +1085,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 8852f13bb5..afe267a7fa 100644 --- a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ -GETH_VERSION: 1.17.0 +GETH_VERSION: 1.17.1 burn_from_mint_token_pool: ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.abi.json ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.bin 4d1365eeafb6edc657e618fb7868e4712914ef7a256c6ef1c74f3d0f79e77f9d burn_mint_token_pool: ../solc/ccip/BurnMintTokenPool/BurnMintTokenPool.sol/BurnMintTokenPool.abi.json ../solc/ccip/BurnMintTokenPool/BurnMintTokenPool.sol/BurnMintTokenPool.bin 56228bebbb4dec1f664ae27c0f06d43a86a4b564cf51c6969c81a30a1165c0a4 burn_mint_with_lock_release_flag_token_pool: ../solc/ccip/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.sol/BurnMintWithLockReleaseFlagTokenPool.abi.json ../solc/ccip/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.sol/BurnMintWithLockReleaseFlagTokenPool.bin 4fa84bfd8fe0b6bfaa3450e199c591ac64cc202ed130b14b7b9904f0ea0e550a diff --git a/chains/solana/deployment/go.mod b/chains/solana/deployment/go.mod index f550071649..0175e807a5 100644 --- a/chains/solana/deployment/go.mod +++ b/chains/solana/deployment/go.mod @@ -18,7 +18,7 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/binary v0.8.0 github.com/gagliardetto/solana-go v1.13.0 github.com/rs/zerolog v1.34.0 @@ -27,7 +27,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.0 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 github.com/smartcontractkit/mcms v0.30.3-0.20251107201522-ab5062fb9a32 github.com/stretchr/testify v1.11.1 @@ -72,10 +72,10 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -179,9 +179,10 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect @@ -190,7 +191,7 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -210,7 +211,7 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -221,28 +222,28 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect - golang.org/x/crypto v0.47.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/time v0.14.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/chains/solana/deployment/go.sum b/chains/solana/deployment/go.sum index 42bfa5e534..75790fc909 100644 --- a/chains/solana/deployment/go.sum +++ b/chains/solana/deployment/go.sum @@ -205,8 +205,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -237,12 +237,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -802,8 +802,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= +github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 h1:VkzslEC/a7Ze5qqLdX1ZNL7ug0TwVd5w3hL5jA/DvWE= @@ -814,12 +814,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 h1:PWwLGimBt37eDzpbfZ9V/ZkW4oCjcwKjKiAwKlSfPc0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 h1:EaLuGs7jZ6Vm2iv6rNK3bQ3XN5CRbFd4knjjvaD1zFc= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471/go.mod h1:VlyZhVw+a93Sk8rVHOIH6tpiXrMzuWLZrjs1eTIExW8= github.com/smartcontractkit/chainlink-testing-framework/framework v0.11.2 h1:Bl6eBzGmhjtYG3HF9tD3TccwfrPy8nqh8/RxY3Dthb4= @@ -878,8 +880,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -951,8 +953,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -973,20 +975,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1041,8 +1043,8 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1053,8 +1055,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1079,8 +1081,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1125,8 +1127,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1214,10 +1216,10 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1228,8 +1230,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1243,13 +1245,13 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1298,8 +1300,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1309,8 +1311,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1366,8 +1368,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/chains/solana/go.mod b/chains/solana/go.mod index dc9779894b..2a2df3ea0e 100644 --- a/chains/solana/go.mod +++ b/chains/solana/go.mod @@ -22,6 +22,7 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -48,9 +49,9 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.6.0 // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/text v0.33.0 // indirect @@ -84,13 +85,13 @@ require ( github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect go.mongodb.org/mongo-driver v1.12.2 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect go.uber.org/zap v1.27.1 // indirect - golang.org/x/sys v0.40.0 // indirect + golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.39.0 // indirect golang.org/x/time v0.12.0 // indirect google.golang.org/protobuf v1.36.11 // indirect diff --git a/chains/solana/go.sum b/chains/solana/go.sum index 60fd136f14..e187dea083 100644 --- a/chains/solana/go.sum +++ b/chains/solana/go.sum @@ -61,6 +61,8 @@ github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7 github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -395,8 +397,8 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -419,18 +421,18 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -588,8 +590,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/cmd/carpenter/go.mod b/cmd/carpenter/go.mod index e962c73d6f..0fa4e67653 100644 --- a/cmd/carpenter/go.mod +++ b/cmd/carpenter/go.mod @@ -1,34 +1,36 @@ module github.com/smartcontractkit/chainlink-ccip/cmd/carpenter -go 1.24.0 +go 1.24.2 require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/go-viper/mapstructure/v2 v2.5.0 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250422094245-d734371d67f2 + github.com/smartcontractkit/chainlink-ccip v0.1.1-solana github.com/stretchr/testify v1.11.1 - github.com/urfave/cli/v3 v3.0.0-beta1 - golang.org/x/term v0.37.0 + github.com/urfave/cli/v3 v3.7.0 + golang.org/x/term v0.40.0 ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect - github.com/charmbracelet/x/ansi v0.8.0 // indirect - github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect - github.com/charmbracelet/x/term v0.2.1 // indirect + github.com/charmbracelet/colorprofile v0.4.2 // indirect + github.com/charmbracelet/x/ansi v0.11.6 // indirect + github.com/charmbracelet/x/cellbuf v0.0.15 // indirect + github.com/charmbracelet/x/term v0.2.2 // indirect + github.com/clipperhouse/displaywidth v0.11.0 // indirect + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect - github.com/ethereum/go-ethereum v1.16.8 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/ethereum/go-ethereum v1.17.1 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/holiman/uint256 v1.3.2 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mattn/go-runewidth v0.0.20 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -40,23 +42,24 @@ require ( github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/smartcontractkit/chain-selectors v1.0.47 // indirect + github.com/smartcontractkit/chain-selectors v1.0.97 // indirect github.com/smartcontractkit/chainlink-common v0.4.2-0.20250121163309-3e179a73cb92 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect + github.com/smartcontractkit/libocr v0.0.0-20250408131511-c90716988ee0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.45.0 // indirect golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect - golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.38.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.67.1 // indirect - google.golang.org/protobuf v1.35.1 // indirect + golang.org/x/sync v0.18.0 // indirect + golang.org/x/sys v0.41.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/grpc v1.77.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cmd/carpenter/go.sum b/cmd/carpenter/go.sum index e657c110e3..aad8dac26e 100644 --- a/cmd/carpenter/go.sum +++ b/cmd/carpenter/go.sum @@ -4,35 +4,41 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs= -github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk= +github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY= +github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE= -github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= -github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8= -github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= -github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= -github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= +github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= +github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= +github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= +github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= +github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= +github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= +github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= +github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= -github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9igY7law= -github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE= github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA= @@ -45,12 +51,12 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= +github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ= +github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= @@ -72,21 +78,20 @@ github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJ github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/smartcontractkit/chain-selectors v1.0.47 h1:hQ2icGwDv2NklB1J3krLVZkafCK9LjPLsrAbKOg6MNU= -github.com/smartcontractkit/chain-selectors v1.0.47/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250422094245-d734371d67f2 h1:N9SMjTLdXJbydYFAPLKBpx3q3T5gdeZX6kkk9ac9TQA= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250422094245-d734371d67f2/go.mod h1:Jb05WL6lj5H89XGcaaOinxTf4Gdj+vXO4TcUhqTgqIM= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= +github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana h1:ICWYnxVdoh0ds3CPNml7K4L0xt3Jn1cFnOHcLH9q0Z0= +github.com/smartcontractkit/chainlink-ccip v0.1.1-solana/go.mod h1:zPpo78Fv3zQE3WVZFEqRiRNER9QHaCzl+HNeTSaS0kE= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250121163309-3e179a73cb92 h1:9zmJi4TctSNvmVdmRh2UpbNRDnrWKYn4o+PZDAIhqqc= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250121163309-3e179a73cb92/go.mod h1:V3BHfvLnQNBUoZ4bGjD29ZPhyzPE++DkYkhvPb9tcRs= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20250408131511-c90716988ee0 h1:yGD0bRNoIQ9vOILzlYg4AiGKMKpJNqi7eIMpW7QIO9Y= +github.com/smartcontractkit/libocr v0.0.0-20250408131511-c90716988ee0/go.mod h1:lzZ0Hq8zK1FfPb7aHuKQKrsWlrsCtBs6gNRNXh59H7Q= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -98,18 +103,20 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/urfave/cli/v3 v3.0.0-beta1 h1:6DTaaUarcM0wX7qj5Hcvs+5Dm3dyUTBbEwIWAjcw9Zg= -github.com/urfave/cli/v3 v3.0.0-beta1/go.mod h1:FnIeEMYu+ko8zP1F9Ypr3xkZMIDqW3DR92yUtY39q1Y= +github.com/urfave/cli/v3 v3.7.0 h1:AGSnbUyjtLiM+WJUb4dzXKldl/gL+F8OwmRDtVr6g2U= +github.com/urfave/cli/v3 v3.7.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= -go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= -go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= -go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -122,23 +129,23 @@ golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5Z golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= -gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= -gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= +google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/deployment/go.mod b/deployment/go.mod index a48cce8694..f61f619028 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -8,12 +8,12 @@ replace github.com/smartcontractkit/chainlink-ccip => ../. require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aptos-labs/aptos-go-sdk v1.11.0 - github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/deckarep/golang-set/v2 v2.8.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/solana-go v1.13.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.0 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 @@ -61,7 +61,7 @@ require ( github.com/dchest/siphash v1.2.3 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -165,9 +165,10 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect @@ -176,7 +177,7 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -196,7 +197,7 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -207,28 +208,28 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect - golang.org/x/crypto v0.47.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/time v0.14.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 0bbb91a379..3fd92a6b2a 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -150,8 +150,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -177,12 +177,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -619,8 +619,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= +github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 h1:VkzslEC/a7Ze5qqLdX1ZNL7ug0TwVd5w3hL5jA/DvWE= @@ -631,12 +631,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 h1:PWwLGimBt37eDzpbfZ9V/ZkW4oCjcwKjKiAwKlSfPc0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 h1:EaLuGs7jZ6Vm2iv6rNK3bQ3XN5CRbFd4knjjvaD1zFc= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471/go.mod h1:VlyZhVw+a93Sk8rVHOIH6tpiXrMzuWLZrjs1eTIExW8= github.com/smartcontractkit/chainlink-testing-framework/framework v0.11.2 h1:Bl6eBzGmhjtYG3HF9tD3TccwfrPy8nqh8/RxY3Dthb4= @@ -682,8 +684,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -740,8 +742,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -762,20 +764,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -822,11 +824,11 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -839,8 +841,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -869,8 +871,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -928,10 +930,10 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -941,8 +943,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -954,10 +956,10 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -978,8 +980,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -989,8 +991,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1006,8 +1008,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/devenv/go.mod b/devenv/go.mod index d8dae5b582..049e80bd48 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -19,13 +19,12 @@ replace ( require ( dario.cat/mergo v1.0.2 - github.com/BurntSushi/toml v1.5.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 + github.com/aws/smithy-go v1.24.2 github.com/c-bata/go-prompt v0.2.6 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/docker/docker v28.5.1+incompatible - github.com/docker/go-connections v0.6.0 // indirect - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/solana-go v1.13.0 github.com/go-resty/resty/v2 v2.17.1 github.com/google/uuid v1.6.0 @@ -41,26 +40,21 @@ require ( github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 + github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122 + github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d github.com/smartcontractkit/mcms v0.35.1-0.20260209175626-b68b54b6e8d0 github.com/spf13/cobra v1.10.1 github.com/stretchr/testify v1.11.1 github.com/xssnick/tonutils-go v1.14.1 go.uber.org/zap v1.27.1 - golang.org/x/crypto v0.47.0 + golang.org/x/crypto v0.48.0 golang.org/x/sync v0.19.0 ) -require ( - github.com/aws/smithy-go v1.24.0 - github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260304170252-bc133a323122 - github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260304170252-bc133a323122 -) - require ( cloud.google.com/go/auth v0.14.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect @@ -71,6 +65,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect + github.com/BurntSushi/toml v1.5.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/sprig/v3 v3.3.0 // indirect @@ -129,18 +124,19 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/distribution/reference v0.6.0 // indirect + github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ebitengine/purego v0.9.0 // indirect github.com/edsrzf/mmap-go v1.2.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/fatih/color v1.18.0 // indirect @@ -339,6 +335,7 @@ require ( github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde // indirect github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect + github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 // indirect github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect @@ -358,7 +355,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -394,7 +391,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -406,11 +403,11 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect go.opentelemetry.io/otel/log v0.15.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/goleak v1.3.0 // indirect @@ -422,9 +419,9 @@ require ( golang.org/x/mod v0.32.0 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/api v0.221.0 // indirect diff --git a/devenv/go.sum b/devenv/go.sum index ac225534d9..0796883b85 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -163,8 +163,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlV github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= -github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= -github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= +github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= +github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= @@ -328,8 +328,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -377,12 +377,12 @@ github.com/envoyproxy/go-control-plane/envoy v1.35.0/go.mod h1:09qwbGVuSWWAyN5t/ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -1297,8 +1297,8 @@ github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -1428,8 +1428,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0. go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0/go.mod h1:54CaSNqYEXvpzDh8KPjiMVoWm60t5R0dZRt0leEPgAs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1452,18 +1452,18 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1526,8 +1526,8 @@ golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZP golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1728,8 +1728,8 @@ golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= @@ -1747,8 +1747,8 @@ golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1766,8 +1766,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/go.md b/go.md index e06ce1db00..11e284b61b 100644 --- a/go.md +++ b/go.md @@ -9,11 +9,11 @@ flowchart LR chainlink-ccip --> chainlink-evm/gethwrappers/helpers chainlink-ccip --> chainlink-protos/rmn/v1.6/go click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip" - chainlink-common --> chain-selectors chainlink-common --> chainlink-common/pkg/chipingress chainlink-common --> chainlink-protos/billing/go chainlink-common --> chainlink-protos/cre/go chainlink-common --> chainlink-protos/linking-service/go + chainlink-common --> chainlink-protos/node-platform chainlink-common --> chainlink-protos/storage-service chainlink-common --> chainlink-protos/workflows/go chainlink-common --> freeport @@ -26,10 +26,12 @@ flowchart LR click chainlink-evm/gethwrappers/helpers href "https://github.com/smartcontractkit/chainlink-evm" chainlink-protos/billing/go click chainlink-protos/billing/go href "https://github.com/smartcontractkit/chainlink-protos" - chainlink-protos/cre/go + chainlink-protos/cre/go --> chain-selectors click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/linking-service/go click chainlink-protos/linking-service/go href "https://github.com/smartcontractkit/chainlink-protos" + chainlink-protos/node-platform + click chainlink-protos/node-platform href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/rmn/v1.6/go click chainlink-protos/rmn/v1.6/go href "https://github.com/smartcontractkit/chainlink-protos" chainlink-protos/storage-service @@ -53,6 +55,7 @@ flowchart LR chainlink-protos/billing/go chainlink-protos/cre/go chainlink-protos/linking-service/go + chainlink-protos/node-platform chainlink-protos/rmn/v1.6/go chainlink-protos/storage-service chainlink-protos/workflows/go diff --git a/go.mod b/go.mod index 2df6fbf9e5..72474523c0 100644 --- a/go.mod +++ b/go.mod @@ -3,24 +3,24 @@ module github.com/smartcontractkit/chainlink-ccip go 1.25.3 require ( - github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/deckarep/golang-set/v2 v2.8.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/prometheus/client_golang v1.22.0 + github.com/prometheus/client_golang v1.23.0 github.com/prometheus/client_model v0.6.2 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.0 github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d github.com/stretchr/testify v1.11.1 github.com/zksync-sdk/zksync2-go v1.1.0 - go.opentelemetry.io/otel v1.39.0 - go.opentelemetry.io/otel/metric v1.39.0 + go.opentelemetry.io/otel v1.41.0 + go.opentelemetry.io/otel/metric v1.41.0 go.uber.org/zap v1.27.1 - golang.org/x/crypto v0.47.0 + golang.org/x/crypto v0.48.0 golang.org/x/sync v0.19.0 - golang.org/x/time v0.12.0 + golang.org/x/time v0.14.0 google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v3 v3.0.1 ) @@ -45,7 +45,7 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect @@ -78,11 +78,11 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect @@ -99,19 +99,19 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/net v0.48.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect ) diff --git a/go.sum b/go.sum index cc8a058895..c1457b836d 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -91,12 +91,12 @@ github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbz github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -263,8 +263,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= -github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= +github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= @@ -287,14 +287,14 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= +github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f h1:qzv+V6DYNBkE+hyNbHg9Rv2mtCHsfwlmOt2+Fa6hTgk= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f/go.mod h1:M12ilwUxmghxow0gO2jDtzLiJHLfP1DnzxyQYZ1b5tw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= @@ -310,8 +310,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= @@ -334,8 +334,8 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -356,20 +356,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -381,17 +381,17 @@ go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= @@ -409,28 +409,28 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 90efa4ed17..c5f3f8ae7d 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -21,8 +21,8 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/aws/smithy-go v1.24.2 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/solana-go v1.13.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d @@ -40,7 +40,7 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect ) require ( @@ -92,7 +92,7 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v28.5.1+incompatible // indirect @@ -100,7 +100,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -223,10 +223,11 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde // indirect github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 // indirect + github.com/smartcontractkit/chainlink-common v0.10.0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.12.6 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect @@ -239,7 +240,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -260,7 +261,7 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -271,28 +272,28 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect - golang.org/x/crypto v0.47.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.40.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/time v0.14.0 // indirect + golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 4c96321dbc..80f9314268 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -111,8 +111,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlV github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= -github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= -github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= +github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= +github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= @@ -249,8 +249,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -281,12 +281,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -858,8 +858,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= +github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 h1:8R5BstwQlzucsa/wfHXsIG5lOD6B1fYPHHC/yFYossw= @@ -868,12 +868,14 @@ github.com/smartcontractkit/chainlink-evm v0.3.3 h1:JqwyJEtnNEUaoQQPoOBTT4sn2lpd github.com/smartcontractkit/chainlink-evm v0.3.3/go.mod h1:q0ZBvaoisNaqC8NcMYWNPTjee88nQktDEeJMQHq3hVI= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd h1:sK+pK4epQp20yQ7XztwrVgkTkRAr4FY+TvEegW8RuQk= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20251104205009-00bd79b81471 h1:EaLuGs7jZ6Vm2iv6rNK3bQ3XN5CRbFd4knjjvaD1zFc= @@ -938,8 +940,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -1011,8 +1013,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1033,20 +1035,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1101,8 +1103,8 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1113,8 +1115,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1139,8 +1141,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1185,8 +1187,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1279,10 +1281,10 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523 h1:H52Mhyrc44wBgLTGzq6+0cmuVuF3LURCSXsLMOqfFos= -golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523/go.mod h1:ArQvPJS723nJQietgilmZA+shuB3CZxH1n2iXq9VSfs= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo= +golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1293,8 +1295,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1308,13 +1310,13 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1363,8 +1365,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1374,8 +1376,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1431,8 +1433,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From bbf4ace96f0eebb50377166f24eaa345e5be0507 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Mon, 9 Mar 2026 09:40:11 -0700 Subject: [PATCH 27/41] Laneversion check before importing config from Feequoter 1.6 and OnRamp 1.5 (#1807) * do a version check before importing config * co-pilot comments * handle nil scenario * fixing test * adding selective remote chains for config import --- .../v1_2_0/adapters/laneversionresolver.go | 40 +++- .../v1_5_0/operations/onramp/onramp.go | 22 ++ .../deployment/v2_0_0/sequences/fee_quoter.go | 75 +++++- ...sequence_fee_quoter_input_creation_test.go | 223 +++++++++++++----- deployment/deploy/feequoterupdater.go | 21 +- 5 files changed, 307 insertions(+), 74 deletions(-) diff --git a/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go index 64771e4779..be609fa215 100644 --- a/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go +++ b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go @@ -1,15 +1,18 @@ package adapters import ( + "context" "fmt" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils" evm_datastore_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" @@ -57,19 +60,13 @@ func (r *LaneVersionResolver) DeriveLaneVersionsForChain(e cldf.Environment, cha laneVersionForRemoteChain := make(map[uint64]*semver.Version) // for all remote chains, find the onRamp and check its version , if unique add it to the list of versions to import for remoteChain := range remoteChains { - onRamp, err := routerC.GetOnRamp(&bind.CallOpts{ - Context: e.GetContext(), - }, remoteChain) + version, err := GetLaneVersionForRemoteChain(e.GetContext(), chain, remoteChain, routerAddr) if err != nil { - return nil, nil, fmt.Errorf("failed to get onramp for remote chain %d from router at address %s for chain %d: %w", remoteChain, routerAddr.Hex(), chainSel, err) + return nil, nil, fmt.Errorf("failed to get version for remoteChain %d on chain %d: %w", remoteChain, chainSel, err) } - if onRamp == (common.Address{}) { + if version == nil { continue } - _, version, err := utils.TypeAndVersion(onRamp, chain.Client) - if err != nil { - return nil, nil, fmt.Errorf("failed to get version for onramp at address %s on chain %d: %w", onRamp.Hex(), chainSel, err) - } if _, exists := versions[version.String()]; !exists { versions[version.String()] = version } @@ -84,3 +81,26 @@ func (r *LaneVersionResolver) DeriveLaneVersionsForChain(e cldf.Environment, cha } return laneVersionForRemoteChain, versionList, nil } + +func GetLaneVersionForRemoteChain(ctx context.Context, chain evm.Chain, remoteChain uint64, routerAddr common.Address) (*semver.Version, error) { + routerC, err := router.NewRouter(routerAddr, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to bind router contract at address %s: %w", routerAddr.Hex(), err) + } + // get the onRamp for the remote chain and check its version + onRamp, err := routerC.GetOnRamp(&bind.CallOpts{ + Context: ctx, + }, remoteChain) + if err != nil { + return nil, fmt.Errorf("failed to get onramp for remote chain %d from router at address %s: %w", remoteChain, routerAddr.Hex(), err) + } + // if there is no onramp for this remote chain, return nil + if onRamp == (common.Address{}) { + return nil, nil + } + _, version, err := utils.TypeAndVersion(onRamp, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to get type and version for onramp at address %s: %w", onRamp.Hex(), err) + } + return version, nil +} diff --git a/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go b/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go index 0fbba7ff1c..9aaf76a23e 100644 --- a/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go +++ b/chains/evm/deployment/v1_5_0/operations/onramp/onramp.go @@ -18,6 +18,28 @@ var ( Version *semver.Version = semver.MustParse("1.5.0") ) +type ConstructorArgs struct { + StaticConfig evm_2_evm_onramp.EVM2EVMOnRampStaticConfig + DynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig + RateLimiterConfig evm_2_evm_onramp.RateLimiterConfig + FeeTokenConfigs []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs + TokenTransferFeeConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs + NopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight +} + +var DeployOnRamp = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ + Name: "onramp:deploy", + Version: Version, + Description: "Deploys the OnRamp 1.5.0 contract", + ContractMetadata: evm_2_evm_onramp.EVM2EVMOnRampMetaData, + Validate: func(args ConstructorArgs) error { return nil }, + BytecodeByTypeAndVersion: map[string]contract.Bytecode{ + cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { + EVM: common.FromHex(evm_2_evm_onramp.EVM2EVMOnRampBin), + }, + }, +}) + type SetTokenTransferFeeConfigInput struct { TokenTransferFeeConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs TokensToUseDefaultFeeConfigs []common.Address diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go index 263638bd77..9cac80baf8 100644 --- a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go @@ -16,6 +16,8 @@ import ( "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + adapters1_2 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/adapters" + routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/onramp" seq1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" fq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" @@ -209,6 +211,17 @@ var ( return FeeQuoterUpdate{}, fmt.Errorf("failed to convert metadata to "+ "FeeQuoterImportConfigSequenceOutput for chain selector %d: %w", input.ChainSelector, err) } + routerAddr := datastore_utils.GetAddressRef( + input.ExistingAddresses, + input.ChainSelector, + routerops.ContractType, + routerops.Version, + "", + ) + if routerAddr.Address == "" { + return FeeQuoterUpdate{}, fmt.Errorf("failed to find router address ref for chain selector %d", input.ChainSelector) + } + // is feeQuoter going to be deployed or fetched from existing addresses? feeQuoterRef := datastore_utils.GetAddressRef( input.ExistingAddresses, @@ -220,10 +233,35 @@ var ( isNewFQV2Deployment := datastore_utils.IsAddressRefEmpty(feeQuoterRef) tokenTransferFeeConfigArgs := make([]fqops.TokenTransferFeeConfigArgs, 0) allDestChainConfigs := make([]fqops.DestChainConfigArgs, 0) + var providedRemoteChains map[uint64]struct{} + if len(input.RemoteChainSelectors) > 0 { + // initialize providedRemoteChains map if remote chains are provided in the input, + // this means we only want to import config for those remote chains from 1.6 + providedRemoteChains = make(map[uint64]struct{}) + for _, remoteChain := range input.RemoteChainSelectors { + providedRemoteChains[remoteChain] = struct{}{} + } + } for remoteChain, cfg := range fqOutput.RemoteChainCfgs { if !cfg.DestChainCfg.IsEnabled { continue } + // check if the remote chain is connected with 1.6 deployment, if not, we skip importing config for that remote chain from FQ 1.6 + // this is to safeguard against having incorrect config import from 1.6 + version, err := adapters1_2.GetLaneVersionForRemoteChain(b.GetContext(), chain, remoteChain, common.HexToAddress(routerAddr.Address)) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to get lane version for remote chain %d: %w", remoteChain, err) + } + if version == nil || !version.Equal(semver.MustParse("1.6.0")) { + continue + } + // if remote chains are provided in the input, we only import config for those remote chains, + // otherwise we import config for all supported remote chains in 1.6 + if providedRemoteChains != nil { + if _, exists := providedRemoteChains[remoteChain]; !exists { + continue + } + } destChainConfig := cfg.DestChainCfg outDestchainCfg := fqops.DestChainConfigArgs{ DestChainSelector: remoteChain, @@ -317,6 +355,16 @@ var ( if len(onRampMetadata) == 0 { return FeeQuoterUpdate{}, fmt.Errorf("no metadata found for EVM2EVMOnRamp v1.5.0 on chain selector %d", input.ChainSelector) } + routerAddr := datastore_utils.GetAddressRef( + input.ExistingAddresses, + input.ChainSelector, + routerops.ContractType, + routerops.Version, + "", + ) + if routerAddr.Address == "" { + return FeeQuoterUpdate{}, fmt.Errorf("failed to find router address ref for chain selector %d", input.ChainSelector) + } // get the commit stores and that will act like price updaters for fee quoter var commitStoreRefs []datastore.AddressRef for _, addressRef := range input.ExistingAddresses { @@ -349,7 +397,15 @@ var ( var staticCfg fqops.StaticConfig var destChainCfgs []fqops.DestChainConfigArgs var tokenTransferFeeConfigArgsForAll []fqops.TokenTransferFeeConfigArgs - + var providedRemoteChains map[uint64]struct{} + if len(input.RemoteChainSelectors) > 0 { + // initialize providedRemoteChains map if remote chain selectors are provided in the input, + // so that we can check against this map when importing config for each remote chain from onRamp 1.5.0 + providedRemoteChains = make(map[uint64]struct{}) + for _, remoteChain := range input.RemoteChainSelectors { + providedRemoteChains[remoteChain] = struct{}{} + } + } for _, meta := range onRampMetadata { var tokenTransferFeeConfigArgs []fqops.TokenTransferFeeConfigSingleTokenArgs @@ -359,6 +415,23 @@ var ( return FeeQuoterUpdate{}, fmt.Errorf("failed to convert metadata to "+ "OnRampImportConfigSequenceOutput for chain selector %d: %w", input.ChainSelector, err) } + remoteChain := onRampCfg.RemoteChainSelector + // check if the remote chain is connected with 1.5 deployment, if not, we skip importing config for that remote chain from OnRamp 1.5 + // this is to safeguard against having incorrect config import from 1.5 + version, err := adapters1_2.GetLaneVersionForRemoteChain(b.GetContext(), chain, remoteChain, common.HexToAddress(routerAddr.Address)) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to get lane version for remote chain %d: %w", remoteChain, err) + } + if version == nil || !version.Equal(semver.MustParse("1.5.0")) { + continue + } + // if remote chains are provided in the input, we only import config for those remote chains, + // otherwise we import config for all supported remote chains in the 1.5 + if providedRemoteChains != nil { + if _, exists := providedRemoteChains[remoteChain]; !exists { + continue + } + } if staticCfg.LinkToken == (common.Address{}) { staticCfg = fqops.StaticConfig{ LinkToken: onRampCfg.StaticConfig.LinkToken, diff --git a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go index a73621211c..19c34e7b16 100644 --- a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go +++ b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go @@ -7,23 +7,29 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + utils2 "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + routerops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" + onrampv1_5ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/onramp" seq1_5 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/sequences" fee_quoter_v1_6_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + onrampv1_6ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" seq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/sequences" + evmadapter "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/adapters" + fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" evm_2_evm_onramp_v1_5_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" dseq "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" - - evmadapter "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/adapters" - fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" ) // dummyAddressRefs is hardcoded address refs (previously from address_refs.json). @@ -426,6 +432,8 @@ func getExpectedOutput() map[uint64]sequences.FeeQuoterUpdate { // Chain 5009297550715157269: Has FeeQuoter v1.6.3 + OnRamp v1.5.0 // Since no FeeQuoter v2.0.0 exists, it's a new deployment (ConstructorArgs populated) + // we will use only use RemoteChainSelector 15971525489660198786 in sequence input for 5009297550715157269 + // therefore only 15971525489660198786's DestChainConfig and TokenTransferFeeConfig will be included in expected output expected[5009297550715157269] = sequences.FeeQuoterUpdate{ ChainSelector: 5009297550715157269, ConstructorArgs: fqops.ConstructorArgs{ @@ -455,22 +463,6 @@ func getExpectedOutput() map[uint64]sequences.FeeQuoterUpdate { LinkFeeMultiplierPercent: 90, }, }, - { - DestChainSelector: 4949039107694359620, - DestChainConfig: fqops.DestChainConfig{ - IsEnabled: true, - MaxDataBytes: 10000, - MaxPerMsgGasLimit: 5000000, - DestGasOverhead: 100000, - DestGasPerPayloadByteBase: 16, - ChainFamilySelector: utils.GetSelectorHex(4949039107694359620), - DefaultTokenFeeUSDCents: 0, - DefaultTokenDestGasOverhead: 0, - DefaultTxGasLimit: 200000, - NetworkFeeUSDCents: 10, - LinkFeeMultiplierPercent: 90, - }, - }, }, TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{ { @@ -487,29 +479,6 @@ func getExpectedOutput() map[uint64]sequences.FeeQuoterUpdate { }, }, }, - { - DestChainSelector: 4949039107694359620, - TokenTransferFeeConfigs: []fqops.TokenTransferFeeConfigSingleTokenArgs{ - { - Token: common.HexToAddress("0x2222222222222222222222222222222222222222"), - TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ - FeeUSDCents: 5, - DestGasOverhead: 30000, - DestBytesOverhead: 100, - IsEnabled: true, - }, - }, - { - Token: common.HexToAddress("0x3333333333333333333333333333333333333333"), - TokenTransferFeeConfig: fqops.TokenTransferFeeConfig{ - FeeUSDCents: 10, - DestGasOverhead: 40000, - DestBytesOverhead: 200, - IsEnabled: true, - }, - }, - }, - }, }, }, } @@ -771,9 +740,43 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { }) require.NoError(t, err, "Failed to write contract metadata to datastore") + // deploy a router in each chain + for _, chainSelector := range chainSelectorList { + chain := e.BlockChains.EVMChains()[chainSelector] + dRep, err2 := cldf_ops.ExecuteOperation(e.OperationsBundle, routerops.Deploy, chain, contract.DeployInput[routerops.ConstructorArgs]{ + ChainSelector: chainSelector, + TypeAndVersion: cldf.NewTypeAndVersion(routerops.ContractType, *routerops.Version), + Args: routerops.ConstructorArgs{ + WrappedNative: utils2.RandomAddress(), // not relevant to this test, just needs to be populated with a valid address + RMNProxy: utils2.RandomAddress(), // not relevant to this test, just needs to be populated with a valid address + }, + }) + require.NoError(t, err2, "Failed to deploy router on chain %d", chainSelector) + require.NoError(t, ds.Addresses().Add(datastore.AddressRef{ + ChainSelector: chainSelector, + Type: datastore.ContractType(routerops.ContractType), + Version: routerops.Version, + Address: dRep.Output.Address, + })) + } // Seal the datastore for use in the test e.DataStore = ds.Seal() - + deployOnRamps(t, e, 5009297550715157269, map[uint64]*semver.Version{ + 4949039107694359620: semver.MustParse("1.5.0"), + 15971525489660198786: semver.MustParse("1.6.0"), + }) + deployOnRamps(t, e, 4949039107694359620, map[uint64]*semver.Version{ + 5009297550715157269: semver.MustParse("1.5.0"), + 15971525489660198786: semver.MustParse("1.6.0"), + }) + deployOnRamps(t, e, 15971525489660198786, map[uint64]*semver.Version{ + 5009297550715157269: semver.MustParse("1.5.0"), + }) + deployOnRamps(t, e, 5936861837188149645, map[uint64]*semver.Version{ + 15971525489660198786: semver.MustParse("1.5.0"), + 5009297550715157269: semver.MustParse("1.6.0"), + 4949039107694359620: semver.MustParse("1.6.0"), + }) // Get the FeeQuoterUpdater adapter (use concrete type so report.Output is sequences.FeeQuoterUpdate) fquUpdater := evmadapter.FeeQuoterUpdater[sequences.FeeQuoterUpdate]{} @@ -784,12 +787,7 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { // Build input from original slices so Version/Type match exactly (sealed datastore // can alter refs and break GetAddressRef lookup for FeeQuoter 1.6.0). - existingAddresses := make([]datastore.AddressRef, 0) - for _, ref := range addressRefs { - if ref.ChainSelector == chainSelector { - existingAddresses = append(existingAddresses, ref) - } - } + existingAddresses := e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSelector)) contractMeta := make([]datastore.ContractMetadata, 0) for _, meta := range contractMetadata { if meta.ChainSelector == chainSelector { @@ -813,6 +811,15 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { ContractMeta: contractMeta, } + // Get expected output (hardcoded based on contract_metadata.json) + expectedMap := getExpectedOutput() + expected, hasExpected := expectedMap[chainSelector] + require.True(t, hasExpected, "Expected output should exist for chain %d", chainSelector) + + // to test selective remote Chain selectors + if chainSelector == 5009297550715157269 { + input.RemoteChainSelectors = []uint64{15971525489660198786} + } // Execute the sequence report, err := cldf_ops.ExecuteSequence( e.OperationsBundle, @@ -835,11 +842,6 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { require.Equal(t, chainSelector, output.ChainSelector, "Chain selector should match input") require.Equal(t, existingAddresses, output.ExistingAddresses, "Existing addresses should match input") - // Get expected output (hardcoded based on contract_metadata.json) - expectedMap := getExpectedOutput() - expected, hasExpected := expectedMap[chainSelector] - require.True(t, hasExpected, "Expected output should exist for chain %d", chainSelector) - // Verify that the output has meaningful data // At least one of these should be populated: // - ConstructorArgs @@ -946,3 +948,114 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { t.Logf("Successfully executed SequenceFeeQuoterInputCreation for chain %d", chainSelector) } } + +// placeholder addresses used for OnRamp deploy in tests (contracts are not validated on simulated chain beyond non-zero) +var ( + linkToken = common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") + rmnProxyPlaceholder = common.HexToAddress("0x7777777777777777777777777777777777777777") + tokenAdminRegistryPlaceholder = common.HexToAddress("0x8888888888888888888888888888888888888888") + priceRegistryPlaceholder = common.HexToAddress("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") +) + +func deployOnRamps(t *testing.T, e *cldf.Environment, chainSelector uint64, remoteChains map[uint64]*semver.Version) { + chain := e.BlockChains.EVMChains()[chainSelector] + routerOnRamps := make([]router.RouterOnRamp, 0) + routerRef := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSelector), + datastore.AddressRefByType(datastore.ContractType(routerops.ContractType)), + datastore.AddressRefByVersion(routerops.Version)) + require.Len(t, routerRef, 1, "There should be exactly one router deployed for chain %d", chainSelector) + routerAddr := common.HexToAddress(routerRef[0].Address) + + for remoteChainSelector, version := range remoteChains { + var rampAddr datastore.AddressRef + switch version.String() { + case "1.5.0": + out, err := cldf_ops.ExecuteOperation(e.OperationsBundle, onrampv1_5ops.DeployOnRamp, chain, contract.DeployInput[onrampv1_5ops.ConstructorArgs]{ + ChainSelector: chainSelector, + TypeAndVersion: cldf.NewTypeAndVersion(onrampv1_5ops.ContractType, *onrampv1_5ops.Version), + Args: onrampv1_5ops.ConstructorArgs{ + StaticConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampStaticConfig{ + LinkToken: linkToken, + ChainSelector: chainSelector, + DestChainSelector: remoteChainSelector, + DefaultTxGasLimit: 200000, + MaxNopFeesJuels: big.NewInt(1000000000000000000), + PrevOnRamp: common.Address{}, + RmnProxy: rmnProxyPlaceholder, + TokenAdminRegistry: tokenAdminRegistryPlaceholder, + }, + DynamicConfig: evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampDynamicConfig{ + Router: routerAddr, + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 100000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 50000, + DestGasPerDataAvailabilityByte: 10, + DestDataAvailabilityMultiplierBps: 1000, + PriceRegistry: priceRegistryPlaceholder, + MaxDataBytes: 10000, + MaxPerMsgGasLimit: 5000000, + DefaultTokenFeeUSDCents: 0, + DefaultTokenDestGasOverhead: 0, + EnforceOutOfOrder: false, + }, + RateLimiterConfig: evm_2_evm_onramp_v1_5_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + }, + FeeTokenConfigs: []evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampFeeTokenConfigArgs{}, + TokenTransferFeeConfigArgs: []evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{}, + NopsAndWeights: []evm_2_evm_onramp_v1_5_0.EVM2EVMOnRampNopAndWeight{}, + }, + }) + require.NoError(t, err) + rampAddr = out.Output + case "1.6.0": + out, err := cldf_ops.ExecuteOperation(e.OperationsBundle, onrampv1_6ops.Deploy, chain, contract.DeployInput[onrampv1_6ops.ConstructorArgs]{ + ChainSelector: chainSelector, + TypeAndVersion: cldf.NewTypeAndVersion(onrampv1_6ops.ContractType, *onrampv1_6ops.Version), + Args: onrampv1_6ops.ConstructorArgs{ + StaticConfig: onrampv1_6ops.StaticConfig{ + ChainSelector: chainSelector, + RmnRemote: rmnProxyPlaceholder, + NonceManager: utils2.RandomAddress(), + TokenAdminRegistry: tokenAdminRegistryPlaceholder, + }, + DynamicConfig: onrampv1_6ops.DynamicConfig{ + FeeQuoter: utils2.RandomAddress(), + ReentrancyGuardEntered: false, + MessageInterceptor: common.Address{}, + FeeAggregator: chain.DeployerKey.From, + AllowlistAdmin: chain.DeployerKey.From, + }, + DestChainConfigArgs: []onrampv1_6ops.DestChainConfigArgs{ + { + DestChainSelector: remoteChainSelector, + Router: routerAddr, + AllowlistEnabled: false, + }, + }, + }, + }) + require.NoError(t, err) + rampAddr = out.Output + } + routerOnRamps = append(routerOnRamps, router.RouterOnRamp{ + DestChainSelector: remoteChainSelector, + OnRamp: common.HexToAddress(rampAddr.Address), + }) + } + + _, err := cldf_ops.ExecuteOperation(e.OperationsBundle, routerops.ApplyRampUpdates, chain, contract.FunctionInput[routerops.ApplyRampsUpdatesArgs]{ + ChainSelector: chainSelector, + Address: routerAddr, + Args: routerops.ApplyRampsUpdatesArgs{ + OnRampUpdates: routerOnRamps, + OffRampAdds: []router.RouterOffRamp{}, + OffRampRemoves: nil, + }, + }) + require.NoError(t, err, "Failed to apply ramp updates for router on chain %d", chainSelector) +} diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index 866838ae70..0e68283228 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -31,13 +31,17 @@ type UpdateFeeQuoterInput struct { type UpdateFeeQuoterInputPerChain struct { FeeQuoterVersion *semver.Version - RampsVersion *semver.Version + // RemoteChainSelectors is used to determine which remote chains to pull config for when populating config for the FeeQuoter + // if RemoteChainSelectors is empty, it will pull all remote chain configs using 1.5.0 and 1.6.0 config importer + RemoteChainSelectors []uint64 + RampsVersion *semver.Version } type FeeQuoterUpdateInput struct { - ChainSelector uint64 - ExistingAddresses []datastore.AddressRef - ContractMeta []datastore.ContractMetadata + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef + RemoteChainSelectors []uint64 + ContractMeta []datastore.ContractMetadata } type SourceChainConfig struct { @@ -284,9 +288,10 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c } // Create FeeQuoterUpdateInput reportFQInputCreation, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceFeeQuoterInputCreation(), e.BlockChains, FeeQuoterUpdateInput{ - ChainSelector: chainSel, - ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), - ContractMeta: contractMeta, + ChainSelector: chainSel, + ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), + ContractMeta: contractMeta, + RemoteChainSelectors: perChainInput.RemoteChainSelectors, }) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) @@ -344,4 +349,4 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c WithSingleBatchOpPerChain(batchOps). Build(input.MCMS) } -} \ No newline at end of file +} From f0cd9bdc16faff8b7099e0a49b058b47c196a98b Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:06:16 -0700 Subject: [PATCH 28/41] If GasPriceStalenessThreshold is zero for allowed chain family , set gas prices manually (#1811) * changes * changes * changes * fix error * addressed comments * more comments * few more updates * updates * changes --- .../v2_0_0/adapters/feequoterupdater.go | 2 +- .../deployment/v2_0_0/sequences/fee_quoter.go | 65 +++++++++++- ...sequence_fee_quoter_input_creation_test.go | 98 ++++++++++++++++++- deployment/deploy/feequoterupdater.go | 48 ++++++--- deployment/lanes/lane_update.go | 1 + 5 files changed, 195 insertions(+), 19 deletions(-) diff --git a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go index 8bfb23146d..7d5cdb91bb 100644 --- a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go +++ b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go @@ -53,7 +53,7 @@ func (fqu FeeQuoterUpdater[FeeQUpdateArgs]) SequenceFeeQuoterInputCreation() *cl if empty { return zero, fmt.Errorf("could not create input for fee quoter 2.0.0 update sequence: output is empty") } - + out.ChainSelector = input.ChainSelector out.ExistingAddresses = input.ExistingAddresses return any(out).(FeeQUpdateArgs), nil diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go index 9cac80baf8..86f469c862 100644 --- a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go @@ -3,10 +3,12 @@ package sequences import ( "encoding/json" "fmt" + "math/big" "strings" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + chain_selectors "github.com/smartcontractkit/chain-selectors" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" @@ -35,6 +37,13 @@ const ( NetworkFeeUSDCents uint16 = 10 ) +var ( + gasPriceMandatoryForChainFamily = map[string]struct{}{ + chain_selectors.FamilyAptos: {}, + chain_selectors.FamilySui: {}, + } +) + type FeeQuoterUpdate struct { ChainSelector uint64 ExistingAddresses []datastore.AddressRef @@ -263,6 +272,13 @@ var ( } } destChainConfig := cfg.DestChainCfg + // check if gasprice stateness threashold is zero + if destChainConfig.GasPriceStalenessThreshold == 0 { + output.PriceUpdates, err = HandleEmptyGasPriceStalenessThreshold(remoteChain, input) + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to handle empty gas price staleness threshold for remote chain %d: %w", remoteChain, err) + } + } outDestchainCfg := fqops.DestChainConfigArgs{ DestChainSelector: remoteChain, DestChainConfig: fqops.DestChainConfig{ @@ -301,12 +317,14 @@ var ( allDestChainConfigs = append(allDestChainConfigs, outDestchainCfg) } if isNewFQV2Deployment { + // if new deployment, adding deployer key as price updater so that + // manual gas prices can be set right after deployment if needed output.ConstructorArgs = fqops.ConstructorArgs{ StaticConfig: fqops.StaticConfig{ LinkToken: fqOutput.StaticCfg.LinkToken, MaxFeeJuelsPerMsg: fqOutput.StaticCfg.MaxFeeJuelsPerMsg, }, - PriceUpdaters: fqOutput.PriceUpdaters, + PriceUpdaters: append(fqOutput.PriceUpdaters, chain.DeployerKey.From), TokenTransferFeeConfigArgs: tokenTransferFeeConfigArgs, DestChainConfigArgs: allDestChainConfigs, } @@ -480,7 +498,7 @@ var ( }, DestChainConfigArgs: destChainCfgs, TokenTransferFeeConfigArgs: tokenTransferFeeConfigArgsForAll, - PriceUpdaters: priceUpdaters, + PriceUpdaters: append(priceUpdaters, chain.DeployerKey.From), } } else { output.DestChainConfigs = destChainCfgs @@ -633,3 +651,46 @@ func IsConstructorArgsEmpty(a fqops.ConstructorArgs) bool { len(a.TokenTransferFeeConfigArgs) == 0 && len(a.DestChainConfigArgs) == 0 } + +// HandleEmptyGasPriceStalenessThreshold handles the case when GasPriceStalenessThreshold is zero for a remote chain. +// It checks if gas price needs to be set manually for the chain family ( mainly for aptos and sui), +// if yes it - +// +// - looks for gas price for that remote chain in the input additional config and adds it to the price updates output; +// - throws an error if gas price for that remote chain is not provided in the input additional config +// because gas price staleness threshold cannot be zero without providing gas price for chains that need manual gas price. +// +// if not, it returns empty price updates output because gas price does not need to be manually set for that remote chain. +// It is exported for testing. +func HandleEmptyGasPriceStalenessThreshold(remoteChain uint64, input deploy.FeeQuoterUpdateInput) (output fqops.PriceUpdates, err error) { + // check if gasprice can be set manually for the chain family, + // if not, we return an error because gas price staleness threshold cannot be zero + // for chains that do not have manual gas price + chainFamily, err := chain_selectors.GetSelectorFamily(remoteChain) + if err != nil { + return fqops.PriceUpdates{}, fmt.Errorf("failed to get chain family for remote chain %d: %w", remoteChain, err) + } + _, exists := gasPriceMandatoryForChainFamily[chainFamily] + // if manual gas price is not mandatory for the chain family but gas price staleness threshold is zero, + // we can skip setting gas price for that remote chain and return empty price updates + if !exists { + return fqops.PriceUpdates{}, nil + } + if input.AdditionalConfig == nil || input.AdditionalConfig.GasPricesPerRemoteChain == nil { + return fqops.PriceUpdates{}, fmt.Errorf("gas price staleness threshold is zero for remote chain %d, "+ + "please provide gas price for this remote chain in the input additional config", remoteChain) + } + if gaspriceStr, ok := input.AdditionalConfig.GasPricesPerRemoteChain[remoteChain]; ok { + gasprice, success := new(big.Int).SetString(gaspriceStr, 10) + if !success { + return fqops.PriceUpdates{}, fmt.Errorf("invalid gas price %s for remote chain %d in input additional config", gaspriceStr, remoteChain) + } + output.GasPriceUpdates = append(output.GasPriceUpdates, fqops.GasPriceUpdate{ + DestChainSelector: remoteChain, + UsdPerUnitGas: gasprice, + }) + return output, nil + } + return fqops.PriceUpdates{}, fmt.Errorf("gas price staleness threshold is zero for remote chain %d, "+ + "please provide gas price for this remote chain in the input additional config", remoteChain) +} diff --git a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go index 19c34e7b16..9b7893c1fe 100644 --- a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go +++ b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" utils2 "github.com/smartcontractkit/chainlink-evm/pkg/utils" @@ -74,7 +75,7 @@ var dummyContractMetadata = []datastore.ContractMetadata{ DefaultTokenDestGasOverhead: 40000, DefaultTxGasLimit: 180000, GasMultiplierWeiPerEth: 0, - GasPriceStalenessThreshold: 0, + GasPriceStalenessThreshold: 10, NetworkFeeUSDCents: 10, }, TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{ @@ -176,7 +177,7 @@ var dummyContractMetadata = []datastore.ContractMetadata{ DefaultTokenDestGasOverhead: 40000, DefaultTxGasLimit: 180000, GasMultiplierWeiPerEth: 0, - GasPriceStalenessThreshold: 0, + GasPriceStalenessThreshold: 10, NetworkFeeUSDCents: 10, }, TokenTransferFeeCfgs: map[common.Address]fee_quoter_v1_6_0.TokenTransferFeeConfig{ @@ -782,7 +783,7 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { // Test the sequence for each chain selector that has a FeeQuoter for _, chainSelector := range chainSelectorList { - _, ok := e.BlockChains.EVMChains()[chainSelector] + chain, ok := e.BlockChains.EVMChains()[chainSelector] require.True(t, ok, "Chain with selector %d should exist", chainSelector) // Build input from original slices so Version/Type match exactly (sealed datastore @@ -867,6 +868,14 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { require.NotEmpty(t, validMaxFee, "contract metadata for chain %d should define at least one MaxFeeJuelsPerMsg source", chainSelector) require.True(t, validMaxFee[output.ConstructorArgs.StaticConfig.MaxFeeJuelsPerMsg.String()], "MaxFeeJuelsPerMsg should be one of the values from contract metadata (FeeQuoter or OnRamp) on chain %d", chainSelector) + // sort PriceUpdaters for deterministic comparison since sequence may merge from multiple sources + sort.Slice(output.ConstructorArgs.PriceUpdaters, func(i, j int) bool { + return output.ConstructorArgs.PriceUpdaters[i].Hex() < output.ConstructorArgs.PriceUpdaters[j].Hex() + }) + expected.ConstructorArgs.PriceUpdaters = append(expected.ConstructorArgs.PriceUpdaters, chain.DeployerKey.From) + sort.Slice(expected.ConstructorArgs.PriceUpdaters, func(i, j int) bool { + return expected.ConstructorArgs.PriceUpdaters[i].Hex() < expected.ConstructorArgs.PriceUpdaters[j].Hex() + }) require.ElementsMatch(t, expected.ConstructorArgs.PriceUpdaters, output.ConstructorArgs.PriceUpdaters, "PriceUpdaters should match expected value on chain %d", chainSelector) } else { @@ -949,6 +958,89 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { } } +// TestHandleEmptyGasPriceStalenessThreshold verifies HandleEmptyGasPriceStalenessThreshold behavior for +// chains with zero GasPriceStalenessThreshold (e.g. Aptos/Sui that require manual gas price). +// GasPricesPerRemoteChain uses string values (parsed as base-10 big.Int). +func TestHandleEmptyGasPriceStalenessThreshold(t *testing.T) { + aptosSelector := uint64(743186221051783445) + + // EVM chain is not in gasPriceMandatoryForChainFamily -> expect error + t.Run("EVM_chain_returns_error", func(t *testing.T) { + evmChainSelector := uint64(5009297550715157269) + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: 1, + AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{ + GasPricesPerRemoteChain: map[uint64]string{evmChainSelector: "1000000000"}, + }, + } + priceUpdates, err := sequences.HandleEmptyGasPriceStalenessThreshold(evmChainSelector, input) + require.NoError(t, err) + require.Empty(t, priceUpdates, "Expected no gas price updates for EVM chain since staleness threshold is not empty") + }) + + // Chain in gasPriceMandatoryForChainFamily but AdditionalConfig is nil -> expect error + t.Run("Aptos_or_Sui_with_nil_AdditionalConfig_returns_error", func(t *testing.T) { + input := deploy.FeeQuoterUpdateInput{ChainSelector: 1} + _, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) + require.Error(t, err) + require.Contains(t, err.Error(), "please provide gas price for this remote chain in the input additional config") + }) + + // Chain in gasPriceMandatoryForChainFamily but GasPricesPerRemoteChain is nil -> expect error + t.Run("Aptos_or_Sui_with_nil_GasPricesPerRemoteChain_returns_error", func(t *testing.T) { + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: 1, + AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{}, + } + _, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) + require.Error(t, err) + require.Contains(t, err.Error(), "please provide gas price for this remote chain in the input additional config") + }) + + // Chain in gasPriceMandatoryForChainFamily but remote chain not in map -> expect error + t.Run("Aptos_or_Sui_with_missing_remote_chain_in_map_returns_error", func(t *testing.T) { + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: 1, + AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{ + GasPricesPerRemoteChain: map[uint64]string{999: "1000000000"}, + }, + } + _, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) + require.Error(t, err) + require.Contains(t, err.Error(), "please provide gas price for this remote chain in the input additional config") + }) + + // Invalid gas price string (not a number) -> expect error + t.Run("invalid_gas_price_string_returns_error", func(t *testing.T) { + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: 1, + AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{ + GasPricesPerRemoteChain: map[uint64]string{aptosSelector: "not-a-number"}, + }, + } + _, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) + require.Error(t, err) + require.Contains(t, err.Error(), "invalid gas price") + require.Contains(t, err.Error(), "in input additional config") + }) + + // Chain in gasPriceMandatoryForChainFamily with valid gas price string -> success + t.Run("Aptos_or_Sui_with_gas_price_returns_updates", func(t *testing.T) { + gasPriceStr := "2000000000" + input := deploy.FeeQuoterUpdateInput{ + ChainSelector: 1, + AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{ + GasPricesPerRemoteChain: map[uint64]string{aptosSelector: gasPriceStr}, + }, + } + output, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) + require.NoError(t, err) + require.Len(t, output.GasPriceUpdates, 1) + require.Equal(t, aptosSelector, output.GasPriceUpdates[0].DestChainSelector) + require.Equal(t, 0, big.NewInt(2e9).Cmp(output.GasPriceUpdates[0].UsdPerUnitGas), "UsdPerUnitGas should match parsed value") + }) +} + // placeholder addresses used for OnRamp deploy in tests (contracts are not validated on simulated chain beyond non-zero) var ( linkToken = common.HexToAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA") diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index 0e68283228..adad27afa7 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -2,6 +2,7 @@ package deploy import ( "fmt" + "math/big" "sync" "github.com/Masterminds/semver/v3" @@ -31,16 +32,22 @@ type UpdateFeeQuoterInput struct { type UpdateFeeQuoterInputPerChain struct { FeeQuoterVersion *semver.Version + FeeQuoterConfig *AdditionalFeeQuoterConfig + RampsVersion *semver.Version // RemoteChainSelectors is used to determine which remote chains to pull config for when populating config for the FeeQuoter // if RemoteChainSelectors is empty, it will pull all remote chain configs using 1.5.0 and 1.6.0 config importer RemoteChainSelectors []uint64 - RampsVersion *semver.Version +} + +type AdditionalFeeQuoterConfig struct { + GasPricesPerRemoteChain map[uint64]string // uses string values (parsed as base-10 big.Int). } type FeeQuoterUpdateInput struct { ChainSelector uint64 ExistingAddresses []datastore.AddressRef RemoteChainSelectors []uint64 + AdditionalConfig *AdditionalFeeQuoterConfig ContractMeta []datastore.ContractMetadata } @@ -196,8 +203,14 @@ func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error if perChainInput.FeeQuoterVersion == nil { return fmt.Errorf("fee quoter version is required for chain selector %d", chainSel) } - if perChainInput.RampsVersion == nil { - return fmt.Errorf("ramps version is required for chain selector %d", chainSel) + if perChainInput.FeeQuoterConfig != nil { + for remoteChainSel := range perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain { + // check big.Int strings are valid + _, ok := new(big.Int).SetString(perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain[remoteChainSel], 10) + if !ok { + return fmt.Errorf("invalid gas price %s for remote chain selector %d in fee quoter config for chain selector %d", perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain[remoteChainSel], remoteChainSel, chainSel) + } + } } _, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ ChainSelector: chainSel, @@ -225,19 +238,20 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c contractMetadata := make([]datastore.ContractMetadata, 0) for chainSel, perChainInput := range input.Chains { var feeQuoterAddrRef datastore.AddressRef - rampUpdater, ok := fquRegistry.GetRampUpdater(chainSel, perChainInput.RampsVersion) - if !ok { - return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("RampUpdater", chainSel, perChainInput.RampsVersion) + feeQuoterAddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(utils.FeeQuoter)), + datastore.AddressRefByVersion(perChainInput.FeeQuoterVersion), + ) + if len(feeQuoterAddrRefs) > 0 { + feeQuoterAddrRef = feeQuoterAddrRefs[0] + e.Logger.Infof("Found existing FeeQuoter address %s for chain selector %d and version %s", + feeQuoterAddrRef.Address, chainSel, perChainInput.FeeQuoterVersion.String()) } - feeQuoterAddrRef, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ - ChainSelector: chainSel, - Type: datastore.ContractType(utils.FeeQuoter), - Version: perChainInput.FeeQuoterVersion, - }, chainSel, datastore_utils.FullRef) - // if we get an error, it could be because the address doesn't exist, which is fine - + // if the address doesn't exist, it's fine - // it means we need to deploy or update the FeeQuoter // if we get a FQ ref, we can re-configure an existing FQ >= 2.0.0 - if err != nil || feeQuoterAddrRef.Version.GreaterThanEqual(semver.MustParse("2.0.0")) { + if perChainInput.FeeQuoterVersion.GreaterThanEqual(semver.MustParse("2.0.0")) { e.Logger.Infof("No existing FeeQuoter address found for chain selector %d and version %s, proceeding with deployment and upgrade", chainSel, perChainInput.FeeQuoterVersion.String()) fquUpdater, ok := fquRegistry.GetFeeQuoterUpdater(chainSel, perChainInput.FeeQuoterVersion) if !ok { @@ -292,6 +306,7 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), ContractMeta: contractMeta, RemoteChainSelectors: perChainInput.RemoteChainSelectors, + AdditionalConfig: perChainInput.FeeQuoterConfig, }) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) @@ -312,6 +327,13 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c feeQuoterAddrRef = reportFQUpdate.Output.Addresses[len(reportFQUpdate.Output.Addresses)-1] } if perChainInput.RampsVersion != nil { + if feeQuoterAddrRef.Address == "" { + return cldf.ChangesetOutput{}, fmt.Errorf("fee quoter address ref is required to update ramps for chain %d", chainSel) + } + rampUpdater, ok := fquRegistry.GetRampUpdater(chainSel, perChainInput.RampsVersion) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("RampUpdater", chainSel, perChainInput.RampsVersion) + } rampsInput := UpdateRampsInput{ ChainSelector: chainSel, FeeQuoterAddress: feeQuoterAddrRef, diff --git a/deployment/lanes/lane_update.go b/deployment/lanes/lane_update.go index 37d46e8ae7..0e1262f11f 100644 --- a/deployment/lanes/lane_update.go +++ b/deployment/lanes/lane_update.go @@ -6,6 +6,7 @@ import ( "github.com/Masterminds/semver/v3" chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-ccip/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" ) From 002bcc352cbfa603b727166ec4161b4d7db40d53 Mon Sep 17 00:00:00 2001 From: tt-cll <141346969+tt-cll@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:15:22 -0700 Subject: [PATCH 29/41] transfer fq2 to timelock (#1809) * transfer fq2 to timelock * comments * timelock as price updater --- .../v2_0_0/adapters/feequoterupdater.go | 11 +++ deployment/deploy/feequoterupdater.go | 39 +++++++- deployment/deploy/transfer_ownership.go | 91 +++++++++++++++---- integration-tests/deployment/helpers.go | 1 - .../update_to_FeeQuoter_2_0_test.go | 48 ++++++++-- 5 files changed, 161 insertions(+), 29 deletions(-) diff --git a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go index 7d5cdb91bb..6877243217 100644 --- a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go +++ b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" @@ -56,6 +57,16 @@ func (fqu FeeQuoterUpdater[FeeQUpdateArgs]) SequenceFeeQuoterInputCreation() *cl out.ChainSelector = input.ChainSelector out.ExistingAddresses = input.ExistingAddresses + + if input.TimelockAddress != "" { + timelockAddr := common.HexToAddress(input.TimelockAddress) + if !fqseq.IsConstructorArgsEmpty(out.ConstructorArgs) { + out.ConstructorArgs.PriceUpdaters = append(out.ConstructorArgs.PriceUpdaters, timelockAddr) + } else { + out.AuthorizedCallerUpdates.AddedCallers = append(out.AuthorizedCallerUpdates.AddedCallers, timelockAddr) + } + } + return any(out).(FeeQUpdateArgs), nil }, ) diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index adad27afa7..d82b158265 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -49,6 +49,8 @@ type FeeQuoterUpdateInput struct { RemoteChainSelectors []uint64 AdditionalConfig *AdditionalFeeQuoterConfig ContractMeta []datastore.ContractMetadata + // TimelockAddress is the address of the CCIP timelock contract to be added as a price updater on the fee quoter. + TimelockAddress string } type SourceChainConfig struct { @@ -190,8 +192,8 @@ func GetFQAndRampUpdaterRegistry() *FQAndRampUpdaterRegistry { // deploys or updates the FeeQuoter contract, and finally updates the Ramps contracts to use the new FeeQuoter address. // This also supports downgrading the FQ contract to a prior version (i.e. a rollback) where only the ramps // are updated and the existing FQ is not touched. This would be triggered when specifying a FQ version < 2.0.0, which do not support re-configuration, and an existing FQ address is found in the datastore for the chain. -func UpdateFeeQuoterChangeset(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateFeeQuoterInput] { - return cldf.CreateChangeSet(updateFeeQuoterApply(fquRegistry, mcmsRegistry), updateFeeQuoterVerify()) +func UpdateFeeQuoterChangeset() cldf.ChangeSetV2[UpdateFeeQuoterInput] { + return cldf.CreateChangeSet(updateFeeQuoterApply(), updateFeeQuoterVerify()) } func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error { @@ -230,12 +232,14 @@ func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error } } -func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { +func updateFeeQuoterApply() func(cldf.Environment, UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { return func(e cldf.Environment, input UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { batchOps := make([]mcms_types.BatchOperation, 0) reports := make([]cldf_ops.Report[any, any], 0) addressRefs := make([]datastore.AddressRef, 0) contractMetadata := make([]datastore.ContractMetadata, 0) + fquRegistry := GetFQAndRampUpdaterRegistry() + mcmsRegistry := changesets.GetRegistry() for chainSel, perChainInput := range input.Chains { var feeQuoterAddrRef datastore.AddressRef feeQuoterAddrRefs := e.DataStore.Addresses().Filter( @@ -248,6 +252,7 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c e.Logger.Infof("Found existing FeeQuoter address %s for chain selector %d and version %s", feeQuoterAddrRef.Address, chainSel, perChainInput.FeeQuoterVersion.String()) } + isNewFeeQuoterDeployment := len(feeQuoterAddrRefs) == 0 // if the address doesn't exist, it's fine - // it means we need to deploy or update the FeeQuoter // if we get a FQ ref, we can re-configure an existing FQ >= 2.0.0 @@ -300,12 +305,30 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c contractMeta = append(contractMeta, populateConfigReport.Output.Metadata.Contracts...) contractMetadata = append(contractMetadata, populateConfigReport.Output.Metadata.Contracts...) } + // Resolve the timelock address so it can be added as a price updater on the fee quoter + timelockAddr := "" + family, err := chain_selectors.GetSelectorFamily(chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", chainSel, err) + } + mcmsReader, ok := mcmsRegistry.GetMCMSReader(family) + if !ok { + return cldf.ChangesetOutput{}, fmt.Errorf("no MCMS reader registered for chain family '%s'", family) + } + timelockRef, err := mcmsReader.GetTimelockRef(e, chainSel, input.MCMS) + if err != nil { + e.Logger.Warnf("Could not resolve timelock ref for chain %d, skipping timelock as price updater: %v", chainSel, err) + } else { + timelockAddr = timelockRef.Address + } + // Create FeeQuoterUpdateInput reportFQInputCreation, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceFeeQuoterInputCreation(), e.BlockChains, FeeQuoterUpdateInput{ ChainSelector: chainSel, ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), ContractMeta: contractMeta, RemoteChainSelectors: perChainInput.RemoteChainSelectors, + TimelockAddress: timelockAddr, AdditionalConfig: perChainInput.FeeQuoterConfig, }) if err != nil { @@ -325,6 +348,16 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c // Update Ramps with new FeeQuoter address // fetch the address refs feeQuoterAddrRef = reportFQUpdate.Output.Addresses[len(reportFQUpdate.Output.Addresses)-1] + + // Transfer ownership of newly deployed FeeQuoter to timelock + if isNewFeeQuoterDeployment { + fqTransferBatches, fqTransferReports, err := TransferToTimelock(chainSel, &e, input.MCMS, []datastore.AddressRef{feeQuoterAddrRef}) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to transfer ownership to timelock for chain %d: %w", chainSel, err) + } + batchOps = append(batchOps, fqTransferBatches...) + reports = append(reports, fqTransferReports...) + } } if perChainInput.RampsVersion != nil { if feeQuoterAddrRef.Address == "" { diff --git a/deployment/deploy/transfer_ownership.go b/deployment/deploy/transfer_ownership.go index b52071bc73..53ba9dd8c5 100644 --- a/deployment/deploy/transfer_ownership.go +++ b/deployment/deploy/transfer_ownership.go @@ -1,7 +1,10 @@ package deploy import ( + "fmt" + "github.com/Masterminds/semver/v3" + chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" @@ -86,10 +89,6 @@ func transferOwnershipApply(cr *TransferOwnershipAdapterRegistry, mcmsRegistry * if err != nil { return cldf.ChangesetOutput{}, err } - err = adapter.InitializeTimelockAddress(e, input.MCMS) - if err != nil { - return cldf.ChangesetOutput{}, err - } // if partial refs are provided, resolve to full refs for i, contractRef := range perChainInputs.ContractRef { fullRef, err := datastore_utils.FindAndFormatRef(e.DataStore, contractRef, perChainInputs.ChainSelector, datastore_utils.FullRef) @@ -98,24 +97,12 @@ func transferOwnershipApply(cr *TransferOwnershipAdapterRegistry, mcmsRegistry * } perChainInputs.ContractRef[i] = fullRef } - report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, adapter.SequenceTransferOwnershipViaMCMS(), e.BlockChains, perChainInputs) + chainBatchOps, chainReports, err := transferAndAcceptOwnership(e, adapter, perChainInputs, input.MCMS) if err != nil { return cldf.ChangesetOutput{}, err } - batchOps = append(batchOps, report.Output.BatchOps...) - reports = append(reports, report.ExecutionReports...) - needAcceptOwnership, err := adapter.ShouldAcceptOwnershipWithTransferOwnership(e, perChainInputs) - if err != nil { - return cldf.ChangesetOutput{}, err - } - if needAcceptOwnership { - report, err = cldf_ops.ExecuteSequence(e.OperationsBundle, adapter.SequenceAcceptOwnership(), e.BlockChains, perChainInputs) - if err != nil { - return cldf.ChangesetOutput{}, err - } - batchOps = append(batchOps, report.Output.BatchOps...) - reports = append(reports, report.ExecutionReports...) - } + batchOps = append(batchOps, chainBatchOps...) + reports = append(reports, chainReports...) } return changesets.NewOutputBuilder(e, mcmsRegistry). WithReports(reports). @@ -132,3 +119,69 @@ func transferOwnershipVerify(cr *TransferOwnershipAdapterRegistry, mcmsRegistry return nil } } + +func TransferToTimelock(chainSel uint64, e *cldf.Environment, mcmsInput mcms.Input, addressRefs []datastore.AddressRef) ([]mcms_types.BatchOperation, []cldf_ops.Report[any, any], error) { + mcmsRegistry := changesets.GetRegistry() + transferOwnershipReg := GetTransferOwnershipRegistry() + family, err := chain_selectors.GetSelectorFamily(chainSel) + if err != nil { + return nil, nil, fmt.Errorf("failed to get chain family for selector %d: %w", chainSel, err) + } + mcmsReader, ok := mcmsRegistry.GetMCMSReader(family) + if !ok { + return nil, nil, fmt.Errorf("no MCMS reader registered for chain family '%s'", family) + } + timelockRef, err := mcmsReader.GetTimelockRef(*e, chainSel, mcmsInput) + if err != nil { + return nil, nil, fmt.Errorf("failed to get timelock ref for chain %d: %w", chainSel, err) + } + + adapter, err := transferOwnershipReg.GetAdapterByChainSelector(chainSel, MCMSVersion) + if err != nil { + return nil, nil, fmt.Errorf("failed to get transfer ownership adapter for chain %d: %w", chainSel, err) + } + + ownershipInput := TransferOwnershipPerChainInput{ + ChainSelector: chainSel, + ContractRef: addressRefs, + ProposedOwner: timelockRef.Address, + } + return transferAndAcceptOwnership(*e, adapter, ownershipInput, mcmsInput) +} + +// transferAndAcceptOwnership executes the transfer ownership sequence via MCMS and, +// if needed, the accept ownership sequence for the given contracts on a single chain. +func transferAndAcceptOwnership( + e cldf.Environment, + adapter TransferOwnershipAdapter, + input TransferOwnershipPerChainInput, + mcmsInput mcms.Input, +) ([]mcms_types.BatchOperation, []cldf_ops.Report[any, any], error) { + batchOps := make([]mcms_types.BatchOperation, 0) + reports := make([]cldf_ops.Report[any, any], 0) + + if err := adapter.InitializeTimelockAddress(e, mcmsInput); err != nil { + return nil, nil, fmt.Errorf("failed to initialize timelock address for chain %d: %w", input.ChainSelector, err) + } + + transferReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, adapter.SequenceTransferOwnershipViaMCMS(), e.BlockChains, input) + if err != nil { + return nil, nil, fmt.Errorf("failed to transfer ownership on chain %d: %w", input.ChainSelector, err) + } + batchOps = append(batchOps, transferReport.Output.BatchOps...) + reports = append(reports, transferReport.ExecutionReports...) + + needAccept, err := adapter.ShouldAcceptOwnershipWithTransferOwnership(e, input) + if err != nil { + return nil, nil, fmt.Errorf("failed to check accept ownership on chain %d: %w", input.ChainSelector, err) + } + if needAccept { + acceptReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, adapter.SequenceAcceptOwnership(), e.BlockChains, input) + if err != nil { + return nil, nil, fmt.Errorf("failed to accept ownership on chain %d: %w", input.ChainSelector, err) + } + batchOps = append(batchOps, acceptReport.Output.BatchOps...) + reports = append(reports, acceptReport.ExecutionReports...) + } + return batchOps, reports, nil +} diff --git a/integration-tests/deployment/helpers.go b/integration-tests/deployment/helpers.go index ee60de95e6..2dcc1e2227 100644 --- a/integration-tests/deployment/helpers.go +++ b/integration-tests/deployment/helpers.go @@ -364,7 +364,6 @@ func EVMTransferOwnership(t *testing.T, e *cldf_deployment.Environment, selector Description: "Transfer ownership test", }, } - transferOutput, err := mcmsapi.TransferOwnershipChangeset(mcmsapi.GetTransferOwnershipRegistry(), mcmsreaderapi.GetRegistry()).Apply(*e, mcmsInput) require.NoError(t, err) require.Greater(t, len(transferOutput.Reports), 0) diff --git a/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go b/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go index b70a35eaa4..6a77435df8 100644 --- a/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go +++ b/integration-tests/deployment/update_to_FeeQuoter_2_0_test.go @@ -13,6 +13,7 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcms_types "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" fq16ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" @@ -25,7 +26,10 @@ import ( offrampops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/offramp" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" lanesapi "github.com/smartcontractkit/chainlink-ccip/deployment/lanes" + "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" + common_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" cs_core "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" ) @@ -90,13 +94,27 @@ func TestUpdateToFeeQuoter_2_0(t *testing.T) { }, }) require.NoError(t, err, "Failed to apply ConnectChains changeset") - fqReg := deployops.GetFQAndRampUpdaterRegistry() + // Deploy MCMS + DeployMCMS(t, e, chain_selectors.ETHEREUM_MAINNET.Selector, []string{common_utils.CLLQualifier}) + DeployMCMS(t, e, chain_selectors.AVALANCHE_MAINNET.Selector, []string{common_utils.CLLQualifier}) // now update to FeeQuoter 2.0.0 - fqUpdateChangeset := deployops.UpdateFeeQuoterChangeset(fqReg, nil) + fqUpdateChangeset := deployops.UpdateFeeQuoterChangeset() out, err = fqUpdateChangeset.Apply(*e, deployops.UpdateFeeQuoterInput{ Chains: fqInput, + MCMS: mcms.Input{ + OverridePreviousRoot: false, + ValidUntil: 3759765795, + TimelockDelay: mcms_types.MustParseDuration("0s"), + TimelockAction: mcms_types.TimelockActionSchedule, + Qualifier: common_utils.CLLQualifier, + Description: "Transfer ownership FQ2", + }, }) require.NoError(t, err, "Failed to apply UpdateFeeQuoterChangeset changeset") + require.Greater(t, len(out.Reports), 0) + require.Equal(t, 1, len(out.MCMSTimelockProposals)) + + testhelpers.ProcessTimelockProposals(t, *e, out.MCMSTimelockProposals, false) // update datastore with changeset output require.NoError(t, out.DataStore.Merge(e.DataStore), "Failed to merge changeset output datastore") e.DataStore = out.DataStore.Seal() @@ -110,15 +128,15 @@ func TestUpdateToFeeQuoter_2_0(t *testing.T) { operations.NewMemoryReporter(), ) e.OperationsBundle = bundle - // downgrade back to 1.6.0 to make sure the changeset is reversible + // downgrade back to 1.6.3 to make sure the changeset is reversible for _, chainSel := range chains { fqInput[chainSel] = deployops.UpdateFeeQuoterInputPerChain{ FeeQuoterVersion: fq163ops.Version, RampsVersion: semver.MustParse("1.6.0"), } } - // now update to FeeQuoter 2.0.0 - fqUpdateChangeset = deployops.UpdateFeeQuoterChangeset(fqReg, nil) + // now downgrade back to FeeQuoter 1.6.3 + fqUpdateChangeset = deployops.UpdateFeeQuoterChangeset() out, err = fqUpdateChangeset.Apply(*e, deployops.UpdateFeeQuoterInput{ Chains: fqInput, }) @@ -163,7 +181,25 @@ func fqUpgradeValidation(t *testing.T, e *cldf.Environment, chainSel uint64, cha require.NoError(t, err, "Failed to get FeeQuoter dynamic config for old contract for chain selector %d", chainSel) updaters17, err := fq17Contract.GetAllAuthorizedCallers(nil) require.NoError(t, err, "Failed to get FeeQuoter dynamic config for chain selector %d", chainSel) - require.ElementsMatch(t, updaters16, updaters17) + for _, caller := range updaters16 { + require.Contains(t, updaters17, caller, "FQ 2.0 should contain all authorized callers from FQ 1.6 for chain selector %d", chainSel) + } + + if expected17fq { + timelockRef := datastore_utils.GetAddressRef( + e.DataStore.Addresses().Filter(), + chainSel, + common_utils.RBACTimelock, + semver.MustParse("1.0.0"), + common_utils.CLLQualifier, + ) + require.NotEmpty(t, timelockRef.Address, "Expected timelock address for chain selector %d", chainSel) + timelockAddr := common.HexToAddress(timelockRef.Address) + require.Contains(t, updaters17, timelockAddr, "FQ 2.0 should have timelock as a price updater for chain selector %d", chainSel) + fq17Owner, err := fq17Contract.Owner(nil) + require.NoError(t, err, "Failed to get FeeQuoter 2.0 owner for chain selector %d", chainSel) + require.Equal(t, timelockAddr, fq17Owner, "FeeQuoter 2.0 should be owned by timelock after ownership transfer for chain selector %d", chainSel) + } var remoteChainSelector uint64 for _, sel := range chains { From e8980275db04bded6ec3066eb802f2b89b9550c4 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:09:21 -0700 Subject: [PATCH 30/41] fix price update bug (#1814) --- .../evm/deployment/v2_0_0/sequences/fee_quoter.go | 4 +++- .../sequence_fee_quoter_input_creation_test.go | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go index 86f469c862..f11d2f5a4b 100644 --- a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go @@ -274,10 +274,12 @@ var ( destChainConfig := cfg.DestChainCfg // check if gasprice stateness threashold is zero if destChainConfig.GasPriceStalenessThreshold == 0 { - output.PriceUpdates, err = HandleEmptyGasPriceStalenessThreshold(remoteChain, input) + priceUpdates, err := HandleEmptyGasPriceStalenessThreshold(remoteChain, input) if err != nil { return FeeQuoterUpdate{}, fmt.Errorf("failed to handle empty gas price staleness threshold for remote chain %d: %w", remoteChain, err) } + output.PriceUpdates.GasPriceUpdates = append(output.PriceUpdates.GasPriceUpdates, priceUpdates.GasPriceUpdates...) + output.PriceUpdates.TokenPriceUpdates = append(output.PriceUpdates.TokenPriceUpdates, priceUpdates.TokenPriceUpdates...) } outDestchainCfg := fqops.DestChainConfigArgs{ DestChainSelector: remoteChain, diff --git a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go index 9b7893c1fe..3335cbb3eb 100644 --- a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go +++ b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go @@ -963,6 +963,7 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { // GasPricesPerRemoteChain uses string values (parsed as base-10 big.Int). func TestHandleEmptyGasPriceStalenessThreshold(t *testing.T) { aptosSelector := uint64(743186221051783445) + suiSelector := uint64(9762610643973837292) // EVM chain is not in gasPriceMandatoryForChainFamily -> expect error t.Run("EVM_chain_returns_error", func(t *testing.T) { @@ -1025,12 +1026,15 @@ func TestHandleEmptyGasPriceStalenessThreshold(t *testing.T) { }) // Chain in gasPriceMandatoryForChainFamily with valid gas price string -> success - t.Run("Aptos_or_Sui_with_gas_price_returns_updates", func(t *testing.T) { + t.Run("Aptos_and_Sui_with_gas_price_returns_updates", func(t *testing.T) { gasPriceStr := "2000000000" input := deploy.FeeQuoterUpdateInput{ ChainSelector: 1, AdditionalConfig: &deploy.AdditionalFeeQuoterConfig{ - GasPricesPerRemoteChain: map[uint64]string{aptosSelector: gasPriceStr}, + GasPricesPerRemoteChain: map[uint64]string{ + aptosSelector: gasPriceStr, + suiSelector: gasPriceStr, + }, }, } output, err := sequences.HandleEmptyGasPriceStalenessThreshold(aptosSelector, input) @@ -1038,6 +1042,12 @@ func TestHandleEmptyGasPriceStalenessThreshold(t *testing.T) { require.Len(t, output.GasPriceUpdates, 1) require.Equal(t, aptosSelector, output.GasPriceUpdates[0].DestChainSelector) require.Equal(t, 0, big.NewInt(2e9).Cmp(output.GasPriceUpdates[0].UsdPerUnitGas), "UsdPerUnitGas should match parsed value") + output, err = sequences.HandleEmptyGasPriceStalenessThreshold(suiSelector, input) + require.NoError(t, err) + require.Len(t, output.GasPriceUpdates, 1) + require.Equal(t, suiSelector, output.GasPriceUpdates[0].DestChainSelector) + require.Equal(t, 0, big.NewInt(2e9).Cmp(output.GasPriceUpdates[0].UsdPerUnitGas), "UsdPerUnitGas should match parsed value") + }) } From 8d0f0e3832880a40ba87e82eb76d8679d4c2e6ff Mon Sep 17 00:00:00 2001 From: Will Winder Date: Tue, 10 Mar 2026 14:31:31 -0400 Subject: [PATCH 31/41] Fix usdc config validation. (#1817) * Fix usdc config validation. * Fix tests and add new test. --- chains/evm/deployment/go.mod | 4 +- chains/evm/deployment/go.sum | 8 ++-- chains/solana/deployment/go.mod | 4 +- chains/solana/deployment/go.sum | 8 ++-- deployment/go.mod | 4 +- deployment/go.sum | 8 ++-- devenv/go.mod | 4 +- devenv/go.sum | 8 ++-- go.mod | 4 +- go.sum | 8 ++-- integration-tests/go.mod | 4 +- integration-tests/go.sum | 8 ++-- pluginconfig/token.go | 6 +-- pluginconfig/token_test.go | 80 +++++++++++++++++++++++++++++++-- 14 files changed, 116 insertions(+), 42 deletions(-) diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index 7d119938bc..953bdddda1 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -21,7 +21,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-common v0.10.0 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd @@ -217,7 +217,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect diff --git a/chains/evm/deployment/go.sum b/chains/evm/deployment/go.sum index 4678601545..fb4563a427 100644 --- a/chains/evm/deployment/go.sum +++ b/chains/evm/deployment/go.sum @@ -681,8 +681,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= -github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 h1:8R5BstwQlzucsa/wfHXsIG5lOD6B1fYPHHC/yFYossw= @@ -693,8 +693,8 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/chains/solana/deployment/go.mod b/chains/solana/deployment/go.mod index 0175e807a5..0e7d317abb 100644 --- a/chains/solana/deployment/go.mod +++ b/chains/solana/deployment/go.mod @@ -27,7 +27,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-common v0.10.0 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 github.com/smartcontractkit/mcms v0.30.3-0.20251107201522-ab5062fb9a32 github.com/stretchr/testify v1.11.1 @@ -179,7 +179,7 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect diff --git a/chains/solana/deployment/go.sum b/chains/solana/deployment/go.sum index 75790fc909..168f3cc74d 100644 --- a/chains/solana/deployment/go.sum +++ b/chains/solana/deployment/go.sum @@ -802,8 +802,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= -github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= -github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 h1:VkzslEC/a7Ze5qqLdX1ZNL7ug0TwVd5w3hL5jA/DvWE= @@ -814,8 +814,8 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 h1:PWwLGimBt37eDzpbfZ9V/ZkW4oCjcwKjKiAwKlSfPc0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/deployment/go.mod b/deployment/go.mod index f61f619028..dae3582df0 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -13,7 +13,7 @@ require ( github.com/gagliardetto/solana-go v1.13.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.10.0 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 @@ -165,7 +165,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 3fd92a6b2a..676f3b23ec 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -619,8 +619,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= -github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.56.0 h1:VkzslEC/a7Ze5qqLdX1ZNL7ug0TwVd5w3hL5jA/DvWE= @@ -631,8 +631,8 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1 h1:PWwLGimBt37eDzpbfZ9V/ZkW4oCjcwKjKiAwKlSfPc0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.13.1/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/devenv/go.mod b/devenv/go.mod index 049e80bd48..690883f61b 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -38,7 +38,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 @@ -338,7 +338,7 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect diff --git a/devenv/go.sum b/devenv/go.sum index 0796883b85..f42f493ad0 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -1193,8 +1193,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 h1:XTZ3crmZ5BsK2pUblJMDUb0nE3gap5mKTr4tFXnwilI= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82/go.mod h1:KsZAvGHRP0+mHRwrMQY5nNJYaIXu222n0FQoaMeSkeo= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= @@ -1207,8 +1207,8 @@ github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-235 github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 h1:IXF7+k8I1YY/yvXC1wnS3FAAggtCy6ByEQ9hv/F2FvQ= github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/go.mod b/go.mod index 72474523c0..1a7ac30768 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/prometheus/client_golang v1.23.0 github.com/prometheus/client_model v0.6.2 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.10.0 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d @@ -78,7 +78,7 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/stretchr/objx v0.5.2 // indirect diff --git a/go.sum b/go.sum index c1457b836d..983a5215d6 100644 --- a/go.sum +++ b/go.sum @@ -287,14 +287,14 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= -github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= -github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f h1:qzv+V6DYNBkE+hyNbHg9Rv2mtCHsfwlmOt2+Fa6hTgk= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260113095857-e13e0dd04d9f/go.mod h1:M12ilwUxmghxow0gO2jDtzLiJHLfP1DnzxyQYZ1b5tw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index c5f3f8ae7d..1d0c472c60 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -40,7 +40,7 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect ) require ( @@ -223,7 +223,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde // indirect github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect - github.com/smartcontractkit/chainlink-common v0.10.0 // indirect + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 80f9314268..27ee402f1d 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -858,8 +858,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246 h1:DmBFNYpN07aFjFzJaX0Cr9KU/Y7JONB+mQmUfoMzyok= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260304183236-7a28a8641246/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= -github.com/smartcontractkit/chainlink-common v0.10.0 h1:d90b9UPJecrIryzhl43F1oQwkJQoug3TaANlJ1xLHyI= -github.com/smartcontractkit/chainlink-common v0.10.0/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.75.2-0.20260120092221-c83e6ba1e827 h1:8R5BstwQlzucsa/wfHXsIG5lOD6B1fYPHHC/yFYossw= @@ -868,8 +868,8 @@ github.com/smartcontractkit/chainlink-evm v0.3.3 h1:JqwyJEtnNEUaoQQPoOBTT4sn2lpd github.com/smartcontractkit/chainlink-evm v0.3.3/go.mod h1:q0ZBvaoisNaqC8NcMYWNPTjee88nQktDEeJMQHq3hVI= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd h1:sK+pK4epQp20yQ7XztwrVgkTkRAr4FY+TvEegW8RuQk= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/pluginconfig/token.go b/pluginconfig/token.go index 22412a32f5..f553af56f5 100644 --- a/pluginconfig/token.go +++ b/pluginconfig/token.go @@ -299,10 +299,10 @@ type USDCCCTPTokenConfig struct { } func (t USDCCCTPTokenConfig) Validate() error { - if t.SourcePoolAddress == "" { + if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(t.SourcePoolAddress) { return errors.New("SourcePoolAddress not set") } - if t.SourceMessageTransmitterAddr == "" { + if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(t.SourceMessageTransmitterAddr) { return errors.New("SourceMessageTransmitterAddress not set") } return nil @@ -330,7 +330,7 @@ func (c *LBTCObserverConfig) Validate() error { return errors.New("SourcePoolAddressByChain is not set") } for _, sourcePoolAddress := range c.SourcePoolAddressByChain { - if sourcePoolAddress == "" { + if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(sourcePoolAddress) { return errors.New("SourcePoolAddressByChain is empty") } } diff --git a/pluginconfig/token_test.go b/pluginconfig/token_test.go index d4cd2ac607..f5beee4970 100644 --- a/pluginconfig/token_test.go +++ b/pluginconfig/token_test.go @@ -543,8 +543,8 @@ func Test_TokenDataObserver_Validation(t *testing.T) { AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ 1: { - SourcePoolAddress: "0xabc", - SourceMessageTransmitterAddr: "0xefg", + SourcePoolAddress: "0xabcd", + SourceMessageTransmitterAddr: "0x1234", }, }, } @@ -564,7 +564,7 @@ func Test_TokenDataObserver_Validation(t *testing.T) { ObserveTimeout: commonconfig.MustNewDuration(5 * time.Second), }, SourcePoolAddressByChain: map[cciptypes.ChainSelector]string{ - 1: "0xabc", + 1: "0xabcd", }, } } @@ -626,6 +626,58 @@ func Test_TokenDataObserver_Validation(t *testing.T) { wantErr: true, errMsg: "Tokens not set", }, + { + name: "usdc type is set but token address is missing", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "usdc-cctp", + Version: "1.0", + USDCCCTPObserverConfig: &USDCCCTPObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), + Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ + 1: { + SourcePoolAddress: "", + SourceMessageTransmitterAddr: "", + }, + }, + }, + }), + usdcEnabled: true, + lbtcEnabled: false, + wantErr: true, + errMsg: "SourcePoolAddress not set", + }, + { + name: "usdc type is set but token address is zero", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "usdc-cctp", + Version: "1.0", + USDCCCTPObserverConfig: &USDCCCTPObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), + Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ + 1: { + SourcePoolAddress: "0x1234", + SourceMessageTransmitterAddr: "0x0000", + }, + }, + }, + }), + usdcEnabled: true, + lbtcEnabled: false, + wantErr: true, + errMsg: "SourceMessageTransmitterAddress not set", + }, { name: "lbtc type is set but tokens are missing", config: withBaseConfig( @@ -645,6 +697,28 @@ func Test_TokenDataObserver_Validation(t *testing.T) { wantErr: true, errMsg: "SourcePoolAddressByChain is not set", }, + { + name: "lbtc type is set but tokens set to zero address", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "lbtc", + Version: "1.0", + LBTCObserverConfig: &LBTCObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + SourcePoolAddressByChain: map[cciptypes.ChainSelector]string{ + 1: "0x0000", + }, + }, + }), + usdcEnabled: false, + lbtcEnabled: true, + wantErr: true, + errMsg: "SourcePoolAddressByChain is empty", + }, { name: "the same observer can't bet set twice", config: withBaseConfig( From ae27433bb6bd57f3d79ccd70a87d8ef36610d425 Mon Sep 17 00:00:00 2001 From: Chris De Leon <147140544+chris-de-leon-cll@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:09:01 -0700 Subject: [PATCH 32/41] feat: infer solana token metadata for manual registration (#1808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: infer token data for solana manual reg * fix: make logic best-effort * fix: don’t use non-resolved tokenMint * chore: refactor logic * chore: clean up * chore: address AI feedback * chore: add extra check for token program ID --- chains/solana/deployment/utils/utils.go | 37 +++++++- .../deployment/v1_6_0/sequences/tokens.go | 91 +++++++++++++++++-- 2 files changed, 117 insertions(+), 11 deletions(-) diff --git a/chains/solana/deployment/utils/utils.go b/chains/solana/deployment/utils/utils.go index e8ec288b20..302f573074 100644 --- a/chains/solana/deployment/utils/utils.go +++ b/chains/solana/deployment/utils/utils.go @@ -49,7 +49,8 @@ func GetSolProgramSize(chain cldf_solana.Chain, programID solana.PublicKey) (int func GetSolProgramData(client *solrpc.Client, programID solana.PublicKey) (struct { DataType uint32 Address solana.PublicKey -}, error) { +}, error, +) { var programData struct { DataType uint32 Address solana.PublicKey @@ -126,6 +127,19 @@ func GetTokenProgramID(programName cldf_deployment.ContractType) (solana.PublicK return programID, nil } +func GetTokenProgramType(programID solana.PublicKey) (cldf_deployment.ContractType, error) { + tokenPrograms := map[solana.PublicKey]cldf_deployment.ContractType{ + solana.TokenProgramID: SPLTokens, + solana.Token2022ProgramID: SPL2022Tokens, + } + + programName, ok := tokenPrograms[programID] + if !ok { + return "", fmt.Errorf("invalid token program ID: %s. Must be one of: %s, %s", programID, solana.TokenProgramID, solana.Token2022ProgramID) + } + return programName, nil +} + func MintTokens(chain cldf_solana.Chain, tokenProgramID, mint solana.PublicKey, amountToAddress map[string]uint64) error { for toAddress, amount := range amountToAddress { toAddressBase58 := solana.MustPublicKeyFromBase58(toAddress) @@ -183,3 +197,24 @@ func GetTokenDecimals(chain cldf_solana.Chain, tokenMint solana.PublicKey) (uint } return mintData.Decimals, nil } + +func FetchTokenProgramID(ctx context.Context, chain cldf_solana.Chain, tokenPubKey solana.PublicKey) (solana.PublicKey, error) { + tokenAcctInfo, err := chain.Client.GetAccountInfo(ctx, tokenPubKey) + if err != nil { + return solana.PublicKey{}, fmt.Errorf("failed to get account info for token %s: %w", tokenPubKey.String(), err) + } + + // Best-effort safeguard: if this truly is a token, then we should be able to fetch its decimals + _, err = GetTokenDecimals(chain, tokenPubKey) + if err != nil { + return solana.PublicKey{}, fmt.Errorf("failed to get token decimals for token %s: %w", tokenPubKey.String(), err) + } + + // Safeguard: make sure that the token program ID is one we actually support + programID := tokenAcctInfo.Value.Owner + if _, err = GetTokenProgramType(programID); err != nil { + return solana.PublicKey{}, fmt.Errorf("account %s is owned by %s, which is not a supported token program: %w", tokenPubKey.String(), programID.String(), err) + } + + return programID, nil +} diff --git a/chains/solana/deployment/v1_6_0/sequences/tokens.go b/chains/solana/deployment/v1_6_0/sequences/tokens.go index f769a2f934..07d1c2a1db 100644 --- a/chains/solana/deployment/v1_6_0/sequences/tokens.go +++ b/chains/solana/deployment/v1_6_0/sequences/tokens.go @@ -1,6 +1,7 @@ package sequences import ( + "errors" "fmt" "github.com/gagliardetto/solana-go" @@ -201,10 +202,46 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR if !ok { return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) } - tokenRef, tokenProgramId, err := getTokenMintAndTokenProgram(input.ExistingDataStore, input.TokenRef, chain) - if err != nil { - return sequences.OnChainOutput{}, fmt.Errorf("failed to get token and token program address using the specified reference (%+v): %w", input.TokenRef, err) + + // NOTE: we only need token metadata if we're creating a token multisig. If we + // don't need to create one, then we can avoid sending extraneous RPC calls to + // the chain. + needTokenMultisig := input.SVMExtraArgs != nil && len(input.SVMExtraArgs.CustomerMintAuthorities) > 0 + tokenSymb := input.TokenRef.Qualifier + + // NOTE: we attempt to resolve the token from the datastore first to avoid RPC calls. + // If the token does not exist there, then we will try to infer all the info from the + // chain *if* the token ref includes an address. Otherwise, we don't have enough info + // to proceed. + var tokenProg solana.PublicKey + var tokenMint solana.PublicKey + if tokRef, tokProgramID, err := getTokenMintAndTokenProgram(input.ExistingDataStore, input.TokenRef, chain); err != nil { + b.Logger.Warnf("Failed to get token mint and program ID from datastore for ref (%s) (err = %v). Falling back to on-chain lookup if possible.", datastore_utils.SprintRef(input.TokenRef), err) + if input.TokenRef.Address == "" { + return sequences.OnChainOutput{}, errors.New("token information could not be resolved from datastore and token reference does not include an address to attempt on-chain resolution") + } + + tokenAddr := solana.MustPublicKeyFromBase58(input.TokenRef.Address) + tokProgramID, err := utils.FetchTokenProgramID(b.GetContext(), chain, tokenAddr) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token program ID for token mint '%s': %w", tokenAddr.String(), err) + } + + tokenProg = tokProgramID + tokenMint = tokenAddr + if needTokenMultisig && tokenSymb == "" { + if tokenMeta, _, err := tokens.GetTokenMetadata(b.GetContext(), chain.Client, tokenAddr); err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token metadata for token mint '%s': %w", tokenAddr.String(), err) + } else { + tokenSymb = tokenMeta.Data.Symbol + } + } + } else { + tokenMint = solana.MustPublicKeyFromBase58(tokRef.Address) + tokenSymb = tokRef.Qualifier + tokenProg = tokProgramID } + routerAddr, err := a.GetRouterAddress(input.ExistingDataStore, chain.Selector) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to get router address: %w", err) @@ -222,7 +259,7 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR rtarOut, err := operations.ExecuteOperation(b, routerops.RegisterTokenAdminRegistry, chains.SolanaChains()[chain.Selector], routerops.TokenAdminRegistryParams{ Router: solana.PublicKeyFromBytes(routerAddr), - TokenMint: solana.MustPublicKeyFromBase58(tokenRef.Address), + TokenMint: tokenMint, Admin: tokenAdmin, ExistingAddresses: input.ExistingDataStore.Addresses().Filter(), }) @@ -240,9 +277,8 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to find token pool address using the specified reference (%+v): %w", input.TokenPoolRef, err) } - tokenMint := solana.MustPublicKeyFromBase58(tokenRef.Address) - tokenPool := solana.MustPublicKeyFromBase58(tokenPoolRef.Address) + tokenPool := solana.MustPublicKeyFromBase58(tokenPoolRef.Address) if input.SVMExtraArgs == nil || !input.SVMExtraArgs.SkipTokenPoolInit { initTPOp := tokenpoolops.InitializeBurnMint transferOwnershipTPOp := tokenpoolops.TransferOwnershipBurnMint @@ -263,7 +299,7 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR initTPOut, err := operations.ExecuteOperation(b, initTPOp, chains.SolanaChains()[chain.Selector], tokenpoolops.Params{ TokenPool: tokenPool, TokenMint: tokenMint, - TokenProgramID: tokenProgramId, + TokenProgramID: tokenProg, Router: solana.PublicKeyFromBytes(routerAddr), RMNRemote: solana.PublicKeyFromBytes(rmnRemoteAddr), }) @@ -288,7 +324,7 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR /// Create Token Multisig /// ///////////////////////////// - if input.SVMExtraArgs != nil && len(input.SVMExtraArgs.CustomerMintAuthorities) > 0 { + if needTokenMultisig { // The multisig will be used as the mint authority (or owner) depending on the pool flow. // We include the TokenPoolSigner PDA as one of the multisig signers so the Token Pool Program // can "sign" via PDA seeds when it needs to act (PDA signing). @@ -304,10 +340,10 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR } createTokenMultisigOutput, err := operations.ExecuteOperation(b, tokensops.CreateTokenMultisig, chains.SolanaChains()[chain.Selector], tokensops.TokenMultisigParams{ - TokenProgram: tokenProgramId, + TokenProgram: tokenProg, Signers: signers, TokenMint: tokenMint, - TokenSymbol: tokenRef.Qualifier, + TokenSymbol: tokenSymb, }) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to create token multisig on-chain: %w", err) @@ -316,6 +352,41 @@ func (a *SolanaAdapter) ManualRegistration() *cldf_ops.Sequence[tokenapi.ManualR result.BatchOps = append(result.BatchOps, createTokenMultisigOutput.Output.BatchOps...) } + // Manual registration can be used on tokens that aren't in the datastore + // (e.g. a customer deployed the token themselves). If we come across one + // of these tokens, then it will only be added to the datastore if (1) we + // have enough info to rebuild the full ref, and (2) it truly is the case + // that the ref does not already exist in the datastore. + if tokenSymb != "" && !tokenMint.IsZero() && !tokenProg.IsZero() { + tokenType, err := utils.GetTokenProgramType(tokenProg) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get token program type: %w", err) + } + + tokenRef := datastore.AddressRef{ + ChainSelector: input.ChainSelector, + Qualifier: tokenSymb, + Address: tokenMint.String(), + Version: tokensops.Version, + Labels: datastore.NewLabelSet(), + Type: datastore.ContractType(tokenType.String()), + } + + results := input.ExistingDataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(tokenRef.ChainSelector), + datastore.AddressRefByQualifier(tokenRef.Qualifier), + datastore.AddressRefByVersion(tokenRef.Version), + datastore.AddressRefByAddress(tokenRef.Address), + datastore.AddressRefByType(tokenRef.Type), + ) + if len(results) == 0 { + b.Logger.Infof("No existing datastore entry found for ref (%s). Adding to results.", datastore_utils.SprintRef(tokenRef)) + result.Addresses = append(result.Addresses, tokenRef) + } else { + b.Logger.Infof("Datastore entry already exists for ref (%s). Not adding to results.", datastore_utils.SprintRef(tokenRef)) + } + } + return result, nil }) } From b39a695c09854062284a1524747829849e7d999a Mon Sep 17 00:00:00 2001 From: Chris De Leon <147140544+chris-de-leon-cll@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:28:55 -0700 Subject: [PATCH 33/41] fix: skip EVM TPRL proposal if we do not own the pool (#1812) * fix: skip tprl proposal if we do not own the pool * fix: update comment * chore: refactor * chore: clean up * fix: resolve typo in comment * chore: more clean up * chore: update comment * fix: rate must be <= capacity * feat: add gate for permission checks * fix: move isSupportedChain behind gate * fix: pass through --- .../v1_6_0/sequences/token_and_pools.go | 68 ++++++++++++++++++- deployment/tokens/rate_limits.go | 31 ++++++--- 2 files changed, 88 insertions(+), 11 deletions(-) diff --git a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go index 20afe1ba66..65b50f78a8 100644 --- a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go +++ b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go @@ -24,6 +24,7 @@ import ( // between these two versions. "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + datastore_utils_evm "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/datastore" deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" tokensapi "github.com/smartcontractkit/chainlink-ccip/deployment/tokens" cciputils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -227,6 +228,69 @@ func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLR return sequences.OnChainOutput{}, fmt.Errorf("chain with selector %d not defined", input.ChainSelector) } + // NOTE: the top level changeset will fully populate `input.TokenPoolRef` BEFORE calling this sequence, + // so we can safely assume all its fields will be accounted for and avoid re-querying the datastore. We + // use `AddressRefToBytes(*)` as a shortcut to avoid writing the same `common.IsHexAddress` followed by + // `common.HexToAddress` boilerplate. + tokenPoolAddrBytes, err := a.AddressRefToBytes(input.TokenPoolRef) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to convert token pool address ref to bytes: %w", err) + } + tokenPoolAddr := common.BytesToAddress(tokenPoolAddrBytes) + if tokenPoolAddr == (common.Address{}) { + return sequences.OnChainOutput{}, fmt.Errorf("token pool address for ref (%+v) is zero address", input.TokenPoolRef) + } + + // If desired, try to validate pool permissions up front - if there is some sort of gap in permissions, then avoid running + // the operation. + if input.EnablePermissionChecks { + // The remote chain needs to be supported by the token pool in order to set rate limits for that chain. If it isn't, then + // we fail loudly since this indicates a misconfiguration in the input data that needs to be fixed before proceeding. + tokenPool, err := token_pool.NewTokenPool(tokenPoolAddr, chain.Client) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to instantiate token pool contract: %w", err) + } + isSupported, err := tokenPool.IsSupportedChain(&bind.CallOpts{Context: b.GetContext()}, input.RemoteChainSelector) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to check if remote chain selector %d is supported by token pool at address %q on chain %d: %w", input.RemoteChainSelector, tokenPoolAddr.Hex(), chain.Selector, err) + } + if !isSupported { + return sequences.OnChainOutput{}, fmt.Errorf("remote chain selector %d is not supported by token pool at address %q on chain %d", input.RemoteChainSelector, tokenPoolAddr.Hex(), chain.Selector) + } + + // We need to look up the timelock address, pool owner, and rate limit admin in order to determine if we have the right + // permissions to proceed with setting the rate limits. + timelockFltr := datastore.AddressRef{Type: datastore.ContractType(cciputils.RBACTimelock), ChainSelector: chain.Selector, Qualifier: cciputils.CLLQualifier} + timelockAddr, err := datastore_utils.FindAndFormatRef(input.ExistingDataStore, timelockFltr, chain.Selector, datastore_utils_evm.ToEVMAddress) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to find timelock address for chain %d: %w", chain.Selector, err) + } + poolOwner, err := tokenPool.Owner(&bind.CallOpts{Context: b.GetContext()}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get owner of token pool at address %q on chain %d: %w", tokenPoolAddr.Hex(), chain.Selector, err) + } + rlAdmin, err := tokenPool.GetRateLimitAdmin(&bind.CallOpts{Context: b.GetContext()}) + if err != nil { + return sequences.OnChainOutput{}, fmt.Errorf("failed to get rate limit admin of token pool at address %q on chain %d: %w", tokenPoolAddr.Hex(), chain.Selector, err) + } + + // NOTE: there are certain situations where we don't have access to change the rate limits (e.g. the customer is the + // pool owner and rate limit admin). In these cases, we should NOT attempt to set the rate limit or generate an MCMS + // batch since we know for certain that the transaction will fail. Instead, we log a warning and skip the rate limit + // configuration for that chain (which effectively turns this into a no-op). + isRateLimitAdmin := rlAdmin == timelockAddr || rlAdmin == chain.DeployerKey.From + isPoolOwner := poolOwner == timelockAddr || poolOwner == chain.DeployerKey.From + if !isRateLimitAdmin && !isPoolOwner { + b.Logger.Warnf( + "Timelock address %q and deployer address %q are not the owner or rate limit admin for token pool at address %q on chain selector %d. Skipping rate limiter config for this chain.", + timelockAddr.Hex(), chain.DeployerKey.From.Hex(), tokenPoolAddr.Hex(), chain.Selector, + ) + return sequences.OnChainOutput{}, nil + } + } + + // At this point, it's assumed that the transaction has a chance to succeed, + // so we proceed with generating the batch operation to set the rate limits. var output evm_contract.WriteOutput switch input.TokenPoolRef.Version.String() { case tpOpsV1_5_1.Version.String(): @@ -234,7 +298,7 @@ func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLR tpOpsV1_5_1.SetChainRateLimiterConfig, chain, evm_contract.FunctionInput[tpOpsV1_5_1.SetChainRateLimiterConfigArgs]{ ChainSelector: chain.Selector, - Address: common.HexToAddress(input.TokenPoolRef.Address), + Address: tokenPoolAddr, Args: tpOpsV1_5_1.SetChainRateLimiterConfigArgs{ OutboundRateLimitConfig: token_pool.RateLimiterConfig{ IsEnabled: input.OutboundRateLimiterConfig.IsEnabled, @@ -258,7 +322,7 @@ func (a *EVMAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokensapi.TPRLR tpOpsV1_6_1.SetChainRateLimiterConfig, chain, evm_contract.FunctionInput[tpOpsV1_6_1.SetChainRateLimiterConfigArgs]{ ChainSelector: chain.Selector, - Address: common.HexToAddress(input.TokenPoolRef.Address), + Address: tokenPoolAddr, Args: tpOpsV1_6_1.SetChainRateLimiterConfigArgs{ OutboundConfig: tpOpsV1_6_1.Config{ IsEnabled: input.OutboundRateLimiterConfig.IsEnabled, diff --git a/deployment/tokens/rate_limits.go b/deployment/tokens/rate_limits.go index 1f7666de72..ac3bc0b81f 100644 --- a/deployment/tokens/rate_limits.go +++ b/deployment/tokens/rate_limits.go @@ -21,10 +21,11 @@ type TPRLInput struct { } type TPRLConfig struct { - ChainAdapterVersion *semver.Version `yaml:"chainAdapterVersion" json:"chainAdapterVersion"` - TokenRef datastore.AddressRef `yaml:"tokenRef" json:"tokenRef"` - TokenPoolRef datastore.AddressRef `yaml:"tokenPoolRef" json:"tokenPoolRef"` - RemoteOutbounds map[uint64]RateLimiterConfigFloatInput `yaml:"remoteOutbounds" json:"remoteOutbounds"` + ChainAdapterVersion *semver.Version `yaml:"chainAdapterVersion" json:"chainAdapterVersion"` + TokenRef datastore.AddressRef `yaml:"tokenRef" json:"tokenRef"` + TokenPoolRef datastore.AddressRef `yaml:"tokenPoolRef" json:"tokenPoolRef"` + EnablePermissionChecks bool `yaml:"enablePermissionChecks" json:"enablePermissionChecks"` + RemoteOutbounds map[uint64]RateLimiterConfigFloatInput `yaml:"remoteOutbounds" json:"remoteOutbounds"` } type TPRLRemotes struct { @@ -35,6 +36,14 @@ type TPRLRemotes struct { TokenRef datastore.AddressRef TokenPoolRef datastore.AddressRef ExistingDataStore datastore.DataStore + + // If true, the changeset will check if timelock or the deployer key has sufficient permissions to set rate limits + // on the token pool. If either account is missing permissions (i.e. not the pool owner or rate limit admin), then + // a warning will be logged and the changeset will NOT perform the rate limit update since it has a high chance of + // failure. This flag is disabled by default so that it still allows flexibility for callers to schedule both rate + // limit permission updates AND token pool rate limit updates in parallel / in the same batch. At the time of this + // writing, this flag is only applicable for EVM, but can be extended to other chains in the future if needed. + EnablePermissionChecks bool } // SetTokenPoolRateLimits returns a changeset that sets rate limits for token pools on multiple chains. @@ -50,6 +59,9 @@ func setTokenPoolRateLimitsVerify() func(cldf.Environment, TPRLInput) error { if input.Capacity <= 0 || input.Rate <= 0 { return fmt.Errorf("outbound rate limiter config for remote chain %d is enabled but capacity or rate is invalid", remoteSelector) } + if input.Rate > input.Capacity { + return fmt.Errorf("outbound rate limiter config for remote chain %d has rate greater than capacity", remoteSelector) + } } } } @@ -91,11 +103,12 @@ func setTokenPoolRateLimitsApply() func(cldf.Environment, TPRLInput) (cldf.Chang } for remoteSelector, inputs := range config.RemoteOutbounds { tprlRemote := TPRLRemotes{ - ChainSelector: selector, - RemoteChainSelector: remoteSelector, - TokenRef: tokenFull, - TokenPoolRef: tokenPool, - ExistingDataStore: e.DataStore, + EnablePermissionChecks: config.EnablePermissionChecks, + ChainSelector: selector, + RemoteChainSelector: remoteSelector, + TokenRef: tokenFull, + TokenPoolRef: tokenPool, + ExistingDataStore: e.DataStore, } // We derive the inbound rate limiter config from counterpart's outbound config for simplicity From 28f9affca9218f1c594b0ae0ef26523811841032 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:38:09 -0700 Subject: [PATCH 34/41] fix token fetching (#1818) --- .../deployment/v1_5_0/adapters/configimport.go | 16 +++++++++++----- .../deployment/v1_6_0/adapters/configimport.go | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/chains/evm/deployment/v1_5_0/adapters/configimport.go b/chains/evm/deployment/v1_5_0/adapters/configimport.go index e2626dc6f2..1751d6171e 100644 --- a/chains/evm/deployment/v1_5_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_5_0/adapters/configimport.go @@ -5,13 +5,15 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_offramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" @@ -141,7 +143,7 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } // get all supported tokens from token admin registry - return GetSupportedTokensPerRemoteChain(ci.TokenAdminReg, chain) + return GetSupportedTokensPerRemoteChain(e.Logger, ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.ImportConfigPerChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { @@ -181,7 +183,7 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp }) } -func GetSupportedTokensPerRemoteChain(tokenAdminRegAddr common.Address, chain evm.Chain) (map[uint64][]common.Address, error) { +func GetSupportedTokensPerRemoteChain(l logger.Logger, tokenAdminRegAddr common.Address, chain evm.Chain) (map[uint64][]common.Address, error) { // get all supported tokens from token admin registry tokenAdminRegC, err := token_admin_registry.NewTokenAdminRegistry(tokenAdminRegAddr, chain.Client) if err != nil { @@ -216,11 +218,15 @@ func GetSupportedTokensPerRemoteChain(tokenAdminRegAddr common.Address, chain ev } chains, err := tokenPoolC.GetSupportedChains(nil) if err != nil { - return nil, fmt.Errorf("failed to get supported chains from token pool at %s on chain %d: %w", poolAddr.String(), chain.Selector, err) + // if we fail to get supported chains for a pool, we skip it and move on to the next one, since we don't want one bad pool to cause the entire config import to fail + l.Warnf("failed to get supported chains for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) + continue } tokenAddr, err := tokenPoolC.GetToken(nil) if err != nil { - return nil, fmt.Errorf("failed to get token address from token pool at %s on chain %d: %w", poolAddr.String(), chain.Selector, err) + // if we fail to get the token address for a pool, we skip it and move on to the next one, since we don't want one bad pool to cause the entire config import to fail + l.Warnf("failed to get token address for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) + continue } for _, remoteChain := range chains { tokensPerRemoteChain[remoteChain] = append(tokensPerRemoteChain[remoteChain], tokenAddr) diff --git a/chains/evm/deployment/v1_6_0/adapters/configimport.go b/chains/evm/deployment/v1_6_0/adapters/configimport.go index e6bcc7ace8..88e3fbb175 100644 --- a/chains/evm/deployment/v1_6_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_6_0/adapters/configimport.go @@ -91,7 +91,7 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } // get all supported tokens from token admin registry - return adapters1_5.GetSupportedTokensPerRemoteChain(ci.TokenAdminReg, chain) + return adapters1_5.GetSupportedTokensPerRemoteChain(e.Logger, ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint64) ([]uint64, error) { From 8d699018af0eee6c9fc885dc213cd853853c4411 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 11 Mar 2026 13:28:43 -0400 Subject: [PATCH 35/41] Allow weirdly formatted addresses for Solana. (#1820) --- pluginconfig/token.go | 16 +++++++++++++--- pluginconfig/token_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/pluginconfig/token.go b/pluginconfig/token.go index f553af56f5..389ae210a3 100644 --- a/pluginconfig/token.go +++ b/pluginconfig/token.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "strings" "time" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -298,11 +299,20 @@ type USDCCCTPTokenConfig struct { SourceMessageTransmitterAddr string `json:"sourceMessageTransmitterAddress"` } +// validAddress performs strict validation on hex based addresses, and allows unknown stuff for AltVM addresses. +func invalidAddress(addr string) bool { + if strings.HasPrefix(addr, "0x") { + return cciptypes.IsZeroOrEmptyOrInvalidHexAddress(addr) + } + // If it is not hex, just ensure that there is some non-zero content in the address. + return len(strings.Replace(addr, "0", "", -1)) == 0 +} + func (t USDCCCTPTokenConfig) Validate() error { - if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(t.SourcePoolAddress) { + if invalidAddress(t.SourcePoolAddress) { return errors.New("SourcePoolAddress not set") } - if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(t.SourceMessageTransmitterAddr) { + if invalidAddress(t.SourceMessageTransmitterAddr) { return errors.New("SourceMessageTransmitterAddress not set") } return nil @@ -330,7 +340,7 @@ func (c *LBTCObserverConfig) Validate() error { return errors.New("SourcePoolAddressByChain is not set") } for _, sourcePoolAddress := range c.SourcePoolAddressByChain { - if cciptypes.IsZeroOrEmptyOrInvalidHexAddress(sourcePoolAddress) { + if invalidAddress(sourcePoolAddress) { return errors.New("SourcePoolAddressByChain is empty") } } diff --git a/pluginconfig/token_test.go b/pluginconfig/token_test.go index f5beee4970..3be11a9623 100644 --- a/pluginconfig/token_test.go +++ b/pluginconfig/token_test.go @@ -678,6 +678,32 @@ func Test_TokenDataObserver_Validation(t *testing.T) { wantErr: true, errMsg: "SourceMessageTransmitterAddress not set", }, + { + name: "usdc type is set but token address is a weird zero", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "usdc-cctp", + Version: "1.0", + USDCCCTPObserverConfig: &USDCCCTPObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), + Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ + 1: { + SourcePoolAddress: "0x1234", + SourceMessageTransmitterAddr: "0000", + }, + }, + }, + }), + usdcEnabled: true, + lbtcEnabled: false, + wantErr: true, + errMsg: "SourceMessageTransmitterAddress not set", + }, { name: "lbtc type is set but tokens are missing", config: withBaseConfig( From c5c8baa319e91f56f8592082df5a34535a8f5675 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:34:15 -0700 Subject: [PATCH 36/41] Fetch Tokens with multiple go routines to speed up config fetching (#1819) * parallel token fetching * addressing review comments * more review comments --- .../v1_5_0/adapters/configimport.go | 77 +++++++++++++------ .../v1_6_0/adapters/configimport.go | 2 +- 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/chains/evm/deployment/v1_5_0/adapters/configimport.go b/chains/evm/deployment/v1_5_0/adapters/configimport.go index 1751d6171e..83177bf9e4 100644 --- a/chains/evm/deployment/v1_5_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_5_0/adapters/configimport.go @@ -1,9 +1,12 @@ package adapters import ( + "context" "fmt" + "sync" "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink-common/pkg/logger" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -11,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "golang.org/x/sync/errgroup" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" @@ -31,7 +35,12 @@ import ( "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" ) -var GetTokensPaginationSize = uint64(20) +var ( + getTokensPaginationSize = uint64(20) + // getSupportedTokensPoolConcurrency caps concurrent RPC calls when fetching supported tokens per pool. + // Limits in-flight requests to avoid overwhelming the node/provider (rate limits, timeouts) and memory. + getSupportedTokensPoolConcurrency = 10 +) type ConfigImportAdapter struct { OnRamp map[uint64]common.Address @@ -143,7 +152,7 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } // get all supported tokens from token admin registry - return GetSupportedTokensPerRemoteChain(e.Logger, ci.TokenAdminReg, chain) + return GetSupportedTokensPerRemoteChain(e.GetContext(), e.Logger, ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.ImportConfigPerChainInput, sequences.OnChainOutput, cldf_chain.BlockChains] { @@ -183,7 +192,7 @@ func (ci *ConfigImportAdapter) SequenceImportConfig() *cldf_ops.Sequence[api.Imp }) } -func GetSupportedTokensPerRemoteChain(l logger.Logger, tokenAdminRegAddr common.Address, chain evm.Chain) (map[uint64][]common.Address, error) { +func GetSupportedTokensPerRemoteChain(ctx context.Context, l logger.Logger, tokenAdminRegAddr common.Address, chain evm.Chain) (map[uint64][]common.Address, error) { // get all supported tokens from token admin registry tokenAdminRegC, err := token_admin_registry.NewTokenAdminRegistry(tokenAdminRegAddr, chain.Client) if err != nil { @@ -192,13 +201,13 @@ func GetSupportedTokensPerRemoteChain(l logger.Logger, tokenAdminRegAddr common. startIndex := uint64(0) allTokens := make([]common.Address, 0) for { - fetchedTokens, err := tokenAdminRegC.GetAllConfiguredTokens(nil, startIndex, GetTokensPaginationSize) + fetchedTokens, err := tokenAdminRegC.GetAllConfiguredTokens(nil, startIndex, getTokensPaginationSize) if err != nil { return nil, err } allTokens = append(allTokens, fetchedTokens...) - startIndex += GetTokensPaginationSize - if uint64(len(fetchedTokens)) < GetTokensPaginationSize { + startIndex += getTokensPaginationSize + if uint64(len(fetchedTokens)) < getTokensPaginationSize { break } } @@ -207,30 +216,48 @@ func GetSupportedTokensPerRemoteChain(l logger.Logger, tokenAdminRegAddr common. return nil, fmt.Errorf("failed to get pools for tokens from token admin registry at %s on chain %d: %w", tokenAdminRegAddr.String(), chain.Selector, err) } tokensPerRemoteChain := make(map[uint64][]common.Address) + var mu sync.Mutex + grp, grpCtx := errgroup.WithContext(ctx) + grp.SetLimit(getSupportedTokensPoolConcurrency) for _, poolAddr := range pools { // there is no supported pool for this token if poolAddr == (common.Address{}) { continue } - tokenPoolC, err := token_pool.NewTokenPool(poolAddr, chain.Client) - if err != nil { - return nil, fmt.Errorf("failed to instantiate token pool contract at %s on chain %d: %w", poolAddr.String(), chain.Selector, err) - } - chains, err := tokenPoolC.GetSupportedChains(nil) - if err != nil { - // if we fail to get supported chains for a pool, we skip it and move on to the next one, since we don't want one bad pool to cause the entire config import to fail - l.Warnf("failed to get supported chains for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) - continue - } - tokenAddr, err := tokenPoolC.GetToken(nil) - if err != nil { - // if we fail to get the token address for a pool, we skip it and move on to the next one, since we don't want one bad pool to cause the entire config import to fail - l.Warnf("failed to get token address for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) - continue - } - for _, remoteChain := range chains { - tokensPerRemoteChain[remoteChain] = append(tokensPerRemoteChain[remoteChain], tokenAddr) - } + poolAddr := poolAddr + grp.Go(func() error { + tokenPoolC, err := token_pool.NewTokenPool(poolAddr, chain.Client) + if err != nil { + return fmt.Errorf("failed to instantiate token pool contract at %s on chain %d: %w", poolAddr.String(), chain.Selector, err) + } + chains, err := tokenPoolC.GetSupportedChains(&bind.CallOpts{ + Context: grpCtx, + }) + if err != nil { + // if we fail to get the supported chains for a pool, we skip it and move on to avoid failing the entire config import + // since it's possible for some pools do not support the getSupportedChains function + l.Warnf("failed to get supported chains for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) + return nil + } + tokenAddr, err := tokenPoolC.GetToken(&bind.CallOpts{ + Context: grpCtx, + }) + if err != nil { + // if we fail to get the token address for a pool, we skip it and move on to avoid failing the entire config import + // since it's possible for some pools do not support the getToken function + l.Warnf("failed to get token address for token pool at %s on chain %d: %v", poolAddr.String(), chain.Selector, err) + return nil + } + mu.Lock() + for _, remoteChain := range chains { + tokensPerRemoteChain[remoteChain] = append(tokensPerRemoteChain[remoteChain], tokenAddr) + } + mu.Unlock() + return nil + }) + } + if err := grp.Wait(); err != nil { + return nil, err } return tokensPerRemoteChain, nil } diff --git a/chains/evm/deployment/v1_6_0/adapters/configimport.go b/chains/evm/deployment/v1_6_0/adapters/configimport.go index 88e3fbb175..34adab580c 100644 --- a/chains/evm/deployment/v1_6_0/adapters/configimport.go +++ b/chains/evm/deployment/v1_6_0/adapters/configimport.go @@ -91,7 +91,7 @@ func (ci *ConfigImportAdapter) SupportedTokensPerRemoteChain(e cldf.Environment, return nil, fmt.Errorf("chain with selector %d not found in environment", chainsel) } // get all supported tokens from token admin registry - return adapters1_5.GetSupportedTokensPerRemoteChain(e.Logger, ci.TokenAdminReg, chain) + return adapters1_5.GetSupportedTokensPerRemoteChain(e.GetContext(), e.Logger, ci.TokenAdminReg, chain) } func (ci *ConfigImportAdapter) ConnectedChains(e cldf.Environment, chainsel uint64) ([]uint64, error) { From 5cbfc939dd16e901e945607679fa2db998415fb3 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 11 Mar 2026 15:08:22 -0400 Subject: [PATCH 37/41] Disallow whitespace only inputs. (#1821) --- pluginconfig/token.go | 4 +++- pluginconfig/token_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/pluginconfig/token.go b/pluginconfig/token.go index 389ae210a3..c792ad51f1 100644 --- a/pluginconfig/token.go +++ b/pluginconfig/token.go @@ -305,7 +305,9 @@ func invalidAddress(addr string) bool { return cciptypes.IsZeroOrEmptyOrInvalidHexAddress(addr) } // If it is not hex, just ensure that there is some non-zero content in the address. - return len(strings.Replace(addr, "0", "", -1)) == 0 + addr = strings.Replace(addr, "0", "", -1) + addr = strings.Replace(addr, " ", "", -1) + return len(addr) == 0 } func (t USDCCCTPTokenConfig) Validate() error { diff --git a/pluginconfig/token_test.go b/pluginconfig/token_test.go index 3be11a9623..4e08e92c33 100644 --- a/pluginconfig/token_test.go +++ b/pluginconfig/token_test.go @@ -704,6 +704,32 @@ func Test_TokenDataObserver_Validation(t *testing.T) { wantErr: true, errMsg: "SourceMessageTransmitterAddress not set", }, + { + name: "usdc type is set but token address is whitespace", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "usdc-cctp", + Version: "1.0", + USDCCCTPObserverConfig: &USDCCCTPObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), + Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ + 1: { + SourcePoolAddress: "0x1234", + SourceMessageTransmitterAddr: " ", + }, + }, + }, + }), + usdcEnabled: true, + lbtcEnabled: false, + wantErr: true, + errMsg: "SourceMessageTransmitterAddress not set", + }, { name: "lbtc type is set but tokens are missing", config: withBaseConfig( From 48d184a4267879a8dcde07f07d7049d04d8f8203 Mon Sep 17 00:00:00 2001 From: Suryansh <39276431+0xsuryansh@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:38:58 +0530 Subject: [PATCH 38/41] make USDCCCTPObserverConfig Validate log more descriptive (#1826) * make USDCCCTPObserverConfig Validate log more descriptive * fix test + add more details * lint --- pluginconfig/token.go | 18 ++++++++++++++---- pluginconfig/token_test.go | 31 +++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/pluginconfig/token.go b/pluginconfig/token.go index c792ad51f1..59c39d28c5 100644 --- a/pluginconfig/token.go +++ b/pluginconfig/token.go @@ -282,9 +282,15 @@ func (p *USDCCCTPObserverConfig) Validate() error { if len(p.Tokens) == 0 { return errors.New("Tokens not set") } - for _, token := range p.Tokens { + for chainSelector, token := range p.Tokens { if err := token.Validate(); err != nil { - return err + return fmt.Errorf( + "invalid usdc token config for chain selector %d, source pool %q, and source message transmitter %q: %w", + chainSelector, + token.SourcePoolAddress, + token.SourceMessageTransmitterAddr, + err, + ) } } return nil @@ -312,10 +318,14 @@ func invalidAddress(addr string) bool { func (t USDCCCTPTokenConfig) Validate() error { if invalidAddress(t.SourcePoolAddress) { - return errors.New("SourcePoolAddress not set") + return fmt.Errorf("SourcePoolAddress not set (source pool %q)", t.SourcePoolAddress) } if invalidAddress(t.SourceMessageTransmitterAddr) { - return errors.New("SourceMessageTransmitterAddress not set") + return fmt.Errorf( + "SourceMessageTransmitterAddress not set (source pool %q, source message transmitter %q)", + t.SourcePoolAddress, + t.SourceMessageTransmitterAddr, + ) } return nil } diff --git a/pluginconfig/token_test.go b/pluginconfig/token_test.go index 4e08e92c33..125d9263e0 100644 --- a/pluginconfig/token_test.go +++ b/pluginconfig/token_test.go @@ -641,7 +641,7 @@ func Test_TokenDataObserver_Validation(t *testing.T) { AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ 1: { - SourcePoolAddress: "", + SourcePoolAddress: "0x1111111111111111111111111111111111111111", SourceMessageTransmitterAddr: "", }, }, @@ -650,7 +650,7 @@ func Test_TokenDataObserver_Validation(t *testing.T) { usdcEnabled: true, lbtcEnabled: false, wantErr: true, - errMsg: "SourcePoolAddress not set", + errMsg: "SourceMessageTransmitterAddress not set", }, { name: "usdc type is set but token address is zero", @@ -730,6 +730,33 @@ func Test_TokenDataObserver_Validation(t *testing.T) { wantErr: true, errMsg: "SourceMessageTransmitterAddress not set", }, + { + name: "usdc token validation error includes chain selector and pool", + config: withBaseConfig( + TokenDataObserverConfig{ + Type: "usdc-cctp", + Version: "1.0", + USDCCCTPObserverConfig: &USDCCCTPObserverConfig{ + AttestationConfig: AttestationConfig{ + AttestationAPI: "http://localhost:8080", + AttestationAPITimeout: commonconfig.MustNewDuration(time.Second), + AttestationAPIInterval: commonconfig.MustNewDuration(500 * time.Millisecond), + }, + AttestationAPICooldown: commonconfig.MustNewDuration(5 * time.Minute), + Tokens: map[cciptypes.ChainSelector]USDCCCTPTokenConfig{ + 1: { + SourcePoolAddress: "0x1111111111111111111111111111111111111111", + }, + }, + }, + }), + usdcEnabled: true, + lbtcEnabled: false, + wantErr: true, + errMsg: "invalid usdc token config for chain selector 1, source pool " + + "\"0x1111111111111111111111111111111111111111\", and source message " + + "transmitter \"\": SourceMessageTransmitterAddress not set", + }, { name: "lbtc type is set but tokens are missing", config: withBaseConfig( From 48c0e2b83ea9db750e08158a9ed9877e1e822039 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Thu, 12 Mar 2026 11:19:37 -0700 Subject: [PATCH 39/41] Always refer to supported versions while populating feequoter config (#1831) * do not look for unsupported versions * fix tests * Update deployment/deploy/feequoterupdater.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../v2_0_0/adapters/feequoterupdater.go | 27 +++++++++++-------- .../deployment/v2_0_0/sequences/fee_quoter.go | 20 ++++++++++++++ ...sequence_fee_quoter_input_creation_test.go | 4 +++ deployment/deploy/feequoterupdater.go | 9 +++++-- 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go index 6877243217..edc617b6c2 100644 --- a/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go +++ b/chains/evm/deployment/v2_0_0/adapters/feequoterupdater.go @@ -29,18 +29,23 @@ func (fqu FeeQuoterUpdater[FeeQUpdateArgs]) SequenceFeeQuoterInputCreation() *cl if !ok { return zero, fmt.Errorf("chain with selector %d not found in environment", input.ChainSelector) } - // get the FeeQuoterUpdateOutput from both v1.6.0 and v1.5.0 sequences and combine them to create the input for the fee quoter update sequence - report, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV16x, chain, input) - if err != nil { - return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.6.0: %w", err) - } - output16 := report.Output - - report15, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV150, chain, input) - if err != nil { - return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.5.0: %w", err) + var output16, output15 fqseq.FeeQuoterUpdate + for _, version := range input.PreviousVersions { + switch version.String() { + case "1.6.0": + report, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV16x, chain, input) + if err != nil { + return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.6.0: %w", err) + } + output16 = report.Output + case "1.5.0": + report15, err := cldf_ops.ExecuteSequence(b, fqseq.CreateFeeQuoterUpdateInputFromV150, chain, input) + if err != nil { + return zero, fmt.Errorf("failed to create FeeQuoterUpdateInput from v1.5.0: %w", err) + } + output15 = report15.Output + } } - output15 := report15.Output // combine the outputs from both sequences to create the input for the fee quoter update sequence out, err := fqseq.MergeFeeQuoterUpdateOutputs(output16, output15) if err != nil { diff --git a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go index f11d2f5a4b..1741745573 100644 --- a/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go +++ b/chains/evm/deployment/v2_0_0/sequences/fee_quoter.go @@ -519,7 +519,27 @@ var ( // output16 takes precedence and output15 fills in only missing entries. func MergeFeeQuoterUpdateOutputs(output16, output15 FeeQuoterUpdate) (FeeQuoterUpdate, error) { result := output16 + empty16, err := output16.IsEmpty() + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to check if output16 is empty: %w", err) + } + empty15, err := output15.IsEmpty() + if err != nil { + return FeeQuoterUpdate{}, fmt.Errorf("failed to check if output15 is empty: %w", err) + } + if empty16 && empty15 { + return FeeQuoterUpdate{}, nil + } + + // if output16 is empty, we can just return output15 + if empty16 { + return output15, nil + } + // if output15 is empty, we can just return output16 + if empty15 { + return output16, nil + } // ConstructorArgs: use output15 if output16 is empty if IsConstructorArgsEmpty(result.ConstructorArgs) { result.ConstructorArgs = output15.ConstructorArgs diff --git a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go index 3335cbb3eb..bdcaf15578 100644 --- a/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go +++ b/chains/evm/deployment/v2_0_0/sequences/sequence_fee_quoter_input_creation_test.go @@ -821,6 +821,10 @@ func TestSequenceFeeQuoterInputCreation(t *testing.T) { if chainSelector == 5009297550715157269 { input.RemoteChainSelectors = []uint64{15971525489660198786} } + input.PreviousVersions = []*semver.Version{ + semver.MustParse("1.5.0"), + semver.MustParse("1.6.0"), + } // Execute the sequence report, err := cldf_ops.ExecuteSequence( e.OperationsBundle, diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index d82b158265..eeccc6603e 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -44,8 +44,12 @@ type AdditionalFeeQuoterConfig struct { } type FeeQuoterUpdateInput struct { - ChainSelector uint64 - ExistingAddresses []datastore.AddressRef + ChainSelector uint64 + ExistingAddresses []datastore.AddressRef + // PreviousVersions lists the supported config-importer / lane versions that + // should be consulted when deriving the FeeQuoter configuration for this chain. + // It does NOT refer to previous FeeQuoter contract deployment versions. + PreviousVersions []*semver.Version RemoteChainSelectors []uint64 AdditionalConfig *AdditionalFeeQuoterConfig ContractMeta []datastore.ContractMetadata @@ -330,6 +334,7 @@ func updateFeeQuoterApply() func(cldf.Environment, UpdateFeeQuoterInput) (cldf.C RemoteChainSelectors: perChainInput.RemoteChainSelectors, TimelockAddress: timelockAddr, AdditionalConfig: perChainInput.FeeQuoterConfig, + PreviousVersions: configImporterVersions, }) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) From f588f8dc6d7cb6a7795b0a4137c0774680d9965a Mon Sep 17 00:00:00 2001 From: Chris De Leon <147140544+chris-de-leon-cll@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:39:53 -0700 Subject: [PATCH 40/41] feat: infer registry address (#1833) * feat: infer registry address * chore: remove registryRef from test cases and update inference logic * chore: refactor * fix: format specifiers --- .../v1_6_0/sequences/token_and_pools.go | 3 -- .../tokens/configure_tokens_for_transfers.go | 15 +++++--- .../deployment/tokens_and_token_pools_test.go | 34 +++++-------------- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go index 65b50f78a8..3601126c0b 100644 --- a/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go +++ b/chains/evm/deployment/v1_6_0/sequences/token_and_pools.go @@ -52,9 +52,6 @@ func (a *EVMAdapter) ConfigureTokenForTransfersSequence() *cldf_ops.Sequence[tok if !common.IsHexAddress(input.TokenPoolAddress) { return sequences.OnChainOutput{}, fmt.Errorf("token pool address %q is not a valid hex address", input.TokenPoolAddress) } - if !common.IsHexAddress(input.RegistryAddress) { - return sequences.OnChainOutput{}, fmt.Errorf("registry address %q is not a valid hex address", input.RegistryAddress) - } tpAddr := common.HexToAddress(input.TokenPoolAddress) if tpAddr == (common.Address{}) { diff --git a/deployment/tokens/configure_tokens_for_transfers.go b/deployment/tokens/configure_tokens_for_transfers.go index a949c7a1c4..3adc23b56a 100644 --- a/deployment/tokens/configure_tokens_for_transfers.go +++ b/deployment/tokens/configure_tokens_for_transfers.go @@ -86,9 +86,16 @@ func processTokenConfigForChain(e deployment.Environment, cfg map[uint64]TokenTr if err != nil { return nil, nil, nil, fmt.Errorf("failed to resolve token pool ref on chain with selector %d: %w", selector, err) } - registry, err := datastore_utils.FindAndFormatRef(e.DataStore, token.RegistryRef, selector, datastore_utils.FullRef) - if err != nil { - return nil, nil, nil, fmt.Errorf("failed to resolve registry ref on chain with selector %d: %w", selector, err) + + var registryAddr string + if datastore_utils.IsAddressRefEmpty(token.RegistryRef) { + e.Logger.Warnf("Registry ref is empty for chain selector %d. We will rely on the underlying adapter to resolve this field.", selector) + } else { + if registry, err := datastore_utils.FindAndFormatRef(e.DataStore, token.RegistryRef, selector, datastore_utils.FullRef); err != nil { + return nil, nil, nil, fmt.Errorf("failed to resolve registry ref on chain with selector %d: %w", selector, err) + } else { + registryAddr = registry.Address + } } family, err := chain_selectors.GetSelectorFamily(selector) @@ -129,7 +136,7 @@ func processTokenConfigForChain(e deployment.Environment, cfg map[uint64]TokenTr TokenPoolAddress: tokenPool.Address, RemoteChains: remoteChains, ExternalAdmin: token.ExternalAdmin, - RegistryAddress: registry.Address, + RegistryAddress: registryAddr, TokenRef: token.TokenRef, PoolType: tokenPool.Type.String(), ExistingDataStore: e.DataStore, diff --git a/integration-tests/deployment/tokens_and_token_pools_test.go b/integration-tests/deployment/tokens_and_token_pools_test.go index f36ce84e20..ec82d90da0 100644 --- a/integration-tests/deployment/tokens_and_token_pools_test.go +++ b/integration-tests/deployment/tokens_and_token_pools_test.go @@ -480,7 +480,7 @@ func TestTokensAndTokenPools(t *testing.T) { TokenExpansionInputPerChain: map[uint64]tokensapi.TokenExpansionInputPerChain{ evmA.Chain.Selector: { SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 - TokenPoolVersion: v1_6_0, + TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmA.Chain.Selector, TokenPoolRef: datastore.AddressRef{ @@ -489,10 +489,7 @@ func TestTokensAndTokenPools(t *testing.T) { Type: datastore.ContractType(evmTokenPoolType), Version: v1_5_1, }, - RegistryRef: datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Address: evmA.TAR.Address().Hex(), - }, + RegistryRef: datastore.AddressRef{}, // inferred RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmB.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, @@ -502,7 +499,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, evmB.Chain.Selector: { SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 - TokenPoolVersion: v1_6_0, + TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmB.Chain.Selector, TokenPoolRef: datastore.AddressRef{ @@ -511,10 +508,7 @@ func TestTokensAndTokenPools(t *testing.T) { Type: datastore.ContractType(evmTokenPoolType), Version: v1_5_1, }, - RegistryRef: datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Address: evmB.TAR.Address().Hex(), - }, + RegistryRef: datastore.AddressRef{}, // inferred RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmA.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, @@ -804,11 +798,7 @@ func TestTokensAndTokenPools(t *testing.T) { ChainSelector: solbnm.Chain.Selector, Address: tokenAddr.Address, }, - RegistryRef: datastore.AddressRef{ - ChainSelector: solbnm.Chain.Selector, - Address: routerProgramId.String(), - Version: v1_6_0, - }, + RegistryRef: datastore.AddressRef{}, // inferred RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ evmA.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, @@ -821,7 +811,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, evmA.Chain.Selector: { SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 - TokenPoolVersion: v1_6_0, + TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmA.Chain.Selector, TokenPoolRef: datastore.AddressRef{ @@ -830,10 +820,7 @@ func TestTokensAndTokenPools(t *testing.T) { Type: datastore.ContractType(evmTokenPoolType), Version: v1_5_1, }, - RegistryRef: datastore.AddressRef{ - ChainSelector: evmA.Chain.Selector, - Address: evmA.TAR.Address().Hex(), - }, + RegistryRef: datastore.AddressRef{}, // inferred RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ solbnm.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, @@ -843,7 +830,7 @@ func TestTokensAndTokenPools(t *testing.T) { }, evmB.Chain.Selector: { SkipOwnershipTransfer: true, // https://smartcontract-it.atlassian.net/browse/NONEVM-2902 - TokenPoolVersion: v1_6_0, + TokenPoolVersion: v1_6_0, TokenTransferConfig: &tokensapi.TokenTransferConfig{ ChainSelector: evmB.Chain.Selector, TokenPoolRef: datastore.AddressRef{ @@ -852,10 +839,7 @@ func TestTokensAndTokenPools(t *testing.T) { Type: datastore.ContractType(evmTokenPoolType), Version: v1_5_1, }, - RegistryRef: datastore.AddressRef{ - ChainSelector: evmB.Chain.Selector, - Address: evmB.TAR.Address().Hex(), - }, + RegistryRef: datastore.AddressRef{}, // inferred RemoteChains: map[uint64]tokensapi.RemoteChainConfig[*datastore.AddressRef, datastore.AddressRef]{ solbnm.Chain.Selector: { OutboundRateLimiterConfig: defaultRL, From b1c65be227747c2fe21f057e1363667723af8d29 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 13 Mar 2026 13:00:31 +0100 Subject: [PATCH 41/41] fix: resolve merge conflicts and add main-only additions - Add GetLaneVersionForRemoteChain helper to laneversionresolver - Add UpdateMCMSConfig method to v1_6_0 EVMAdapter - Add AdditionalFeeQuoterConfig and related fields to FeeQuoterUpdateInput - Remove unused fmt import in devenv/cldf.go - Update go.mod/go.sum after dependency reconciliation --- ccv/chains/evm/deployment/go.mod | 33 +-- ccv/chains/evm/deployment/go.sum | 70 +++--- chains/evm/deployment/go.mod | 37 +-- chains/evm/deployment/go.sum | 70 +++--- .../v1_0_0/adapters/deployer_test.go | 38 +-- .../v1_2_0/adapters/laneversionresolver.go | 23 ++ .../sequences/deploy_chain_contracts.go | 22 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- chains/solana/deployment/go.mod | 35 +-- chains/solana/deployment/go.sum | 74 +++--- deployment/deploy/feequoterupdater.go | 216 +++++++++++++----- deployment/go.mod | 33 +-- deployment/go.sum | 70 +++--- devenv/cldf.go | 1 - devenv/go.mod | 42 ++-- devenv/go.sum | 88 ++++--- go.md | 16 +- go.mod | 34 +-- go.sum | 72 +++--- .../update_to_FeeQuoter_1_7_test.go | 8 +- integration-tests/go.mod | 35 +-- integration-tests/go.sum | 74 +++--- 22 files changed, 630 insertions(+), 463 deletions(-) diff --git a/ccv/chains/evm/deployment/go.mod b/ccv/chains/evm/deployment/go.mod index 3483d960ce..850e5b8e75 100644 --- a/ccv/chains/evm/deployment/go.mod +++ b/ccv/chains/evm/deployment/go.mod @@ -13,18 +13,18 @@ replace github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment => ../. require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260312161144-d895b42081a0 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd github.com/smartcontractkit/mcms v0.36.0 github.com/stretchr/testify v1.11.1 - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 ) require ( @@ -80,7 +80,7 @@ require ( github.com/creachadair/mds v0.13.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v28.5.1+incompatible // indirect @@ -89,7 +89,7 @@ require ( github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/fatih/color v1.18.0 // indirect @@ -226,9 +226,10 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect @@ -244,7 +245,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -265,7 +266,7 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -276,12 +277,12 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect @@ -293,11 +294,11 @@ require ( golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/ccv/chains/evm/deployment/go.sum b/ccv/chains/evm/deployment/go.sum index 7a88582ff0..7e3ea85daf 100644 --- a/ccv/chains/evm/deployment/go.sum +++ b/ccv/chains/evm/deployment/go.sum @@ -201,8 +201,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -230,12 +230,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -737,8 +737,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -747,12 +747,14 @@ github.com/smartcontractkit/chainlink-evm v0.3.3 h1:JqwyJEtnNEUaoQQPoOBTT4sn2lpd github.com/smartcontractkit/chainlink-evm v0.3.3/go.mod h1:q0ZBvaoisNaqC8NcMYWNPTjee88nQktDEeJMQHq3hVI= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd h1:sK+pK4epQp20yQ7XztwrVgkTkRAr4FY+TvEegW8RuQk= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= @@ -808,8 +810,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -870,8 +872,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -892,20 +894,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -955,8 +957,8 @@ golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZP golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -1093,8 +1095,8 @@ golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1126,8 +1128,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1143,8 +1145,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/chains/evm/deployment/go.mod b/chains/evm/deployment/go.mod index e5f08fe3a0..cbdf949b6d 100644 --- a/chains/evm/deployment/go.mod +++ b/chains/evm/deployment/go.mod @@ -10,19 +10,22 @@ replace github.com/smartcontractkit/chainlink-ccip/deployment => ../../../deploy require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260312161144-d895b42081a0 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd + github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 github.com/smartcontractkit/mcms v0.36.0 github.com/stretchr/testify v1.11.1 + github.com/xssnick/tonutils-go v1.14.1 github.com/zksync-sdk/zksync2-go v1.1.1-0.20250620124214-2c742ee399c6 + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 golang.org/x/sync v0.19.0 ) @@ -78,7 +81,7 @@ require ( github.com/creachadair/mds v0.13.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v28.5.1+incompatible // indirect @@ -87,7 +90,7 @@ require ( github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -221,13 +224,13 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect - github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -239,7 +242,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -254,13 +257,12 @@ require ( github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect - github.com/xssnick/tonutils-go v1.14.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -271,28 +273,27 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect golang.org/x/crypto v0.48.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect diff --git a/chains/evm/deployment/go.sum b/chains/evm/deployment/go.sum index 4d1de50bda..2293ffc404 100644 --- a/chains/evm/deployment/go.sum +++ b/chains/evm/deployment/go.sum @@ -201,8 +201,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -230,12 +230,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -733,8 +733,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -745,12 +745,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= @@ -806,8 +808,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -870,8 +872,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -892,20 +894,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -955,8 +957,8 @@ golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZP golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -1093,8 +1095,8 @@ golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1126,8 +1128,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1143,8 +1145,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go index 43d691ab47..c123e08b2d 100644 --- a/chains/evm/deployment/v1_0_0/adapters/deployer_test.go +++ b/chains/evm/deployment/v1_0_0/adapters/deployer_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/adapters" ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations" - v1_0 "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" + deployops "github.com/smartcontractkit/chainlink-ccip/deployment/deploy" "github.com/smartcontractkit/chainlink-ccip/deployment/testhelpers" "github.com/smartcontractkit/chainlink-ccip/deployment/utils" deploymentutils "github.com/smartcontractkit/chainlink-ccip/deployment/utils" @@ -39,12 +39,12 @@ func TestDeployMCMS(t *testing.T) { evmChain2 := env.BlockChains.EVMChains()[selector2] evmDeployer := &adapters.EVMDeployer{} - dReg := v1_0.GetRegistry() - dReg.RegisterDeployer(chainsel.FamilyEVM, v1_0.MCMSVersion, evmDeployer) - cs := v1_0.DeployMCMS(dReg, nil) - output, err := cs.Apply(*env, v1_0.MCMSDeploymentConfig{ - AdapterVersion: v1_0.MCMSVersion, - Chains: map[uint64]v1_0.MCMSDeploymentConfigPerChain{ + dReg := deployops.GetRegistry() + dReg.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) + cs := deployops.DeployMCMS(dReg, nil) + output, err := cs.Apply(*env, deployops.MCMSDeploymentConfig{ + AdapterVersion: deployops.MCMSVersion, + Chains: map[uint64]deployops.MCMSDeploymentConfigPerChain{ selector1: { Canceller: testhelpers.SingleGroupMCMS(), Bypasser: testhelpers.SingleGroupMCMS(), @@ -270,14 +270,14 @@ func TestGrantAdminRoleToTimelock(t *testing.T) { evmChain2 := env.BlockChains.EVMChains()[selector2] evmDeployer := &adapters.EVMDeployer{} - dReg := v1_0.GetRegistry() - dReg.RegisterDeployer(chainsel.FamilyEVM, v1_0.MCMSVersion, evmDeployer) + dReg := deployops.GetRegistry() + dReg.RegisterDeployer(chainsel.FamilyEVM, deployops.MCMSVersion, evmDeployer) // deploy two timelocks on each chain so we can set one as the admin of the other - deployMCMS := v1_0.DeployMCMS(dReg, nil) - output, err := deployMCMS.Apply(*env, v1_0.MCMSDeploymentConfig{ - AdapterVersion: v1_0.MCMSVersion, - Chains: map[uint64]v1_0.MCMSDeploymentConfigPerChain{ + deployMCMS := deployops.DeployMCMS(dReg, nil) + output, err := deployMCMS.Apply(*env, deployops.MCMSDeploymentConfig{ + AdapterVersion: deployops.MCMSVersion, + Chains: map[uint64]deployops.MCMSDeploymentConfigPerChain{ selector1: { Canceller: testhelpers.SingleGroupMCMS(), Bypasser: testhelpers.SingleGroupMCMS(), @@ -300,9 +300,9 @@ func TestGrantAdminRoleToTimelock(t *testing.T) { require.Greater(t, len(output.Reports), 0) ds := output.DataStore - output, err = deployMCMS.Apply(*env, v1_0.MCMSDeploymentConfig{ - AdapterVersion: v1_0.MCMSVersion, - Chains: map[uint64]v1_0.MCMSDeploymentConfigPerChain{ + output, err = deployMCMS.Apply(*env, deployops.MCMSDeploymentConfig{ + AdapterVersion: deployops.MCMSVersion, + Chains: map[uint64]deployops.MCMSDeploymentConfigPerChain{ selector1: { Canceller: testhelpers.SingleGroupMCMS(), Bypasser: testhelpers.SingleGroupMCMS(), @@ -371,10 +371,10 @@ func TestGrantAdminRoleToTimelock(t *testing.T) { } // grant admin role to timelock - grantAdminRoleMCMS := v1_0.GrantAdminRoleToTimelock(dReg, nil) - output, err = grantAdminRoleMCMS.Apply(*env, v1_0.GrantAdminRoleToTimelockConfig{ + grantAdminRoleMCMS := deployops.GrantAdminRoleToTimelock(dReg, nil) + output, err = grantAdminRoleMCMS.Apply(*env, deployops.GrantAdminRoleToTimelockConfig{ AdapterVersion: semver.MustParse("1.0.0"), - Chains: map[uint64]v1_0.GrantAdminRoleToTimelockConfigPerChain{ + Chains: map[uint64]deployops.GrantAdminRoleToTimelockConfigPerChain{ selector1: { TimelockToTransferRef: datastore.AddressRef{ Type: datastore.ContractType(deploymentutils.RBACTimelock), diff --git a/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go index 64771e4779..c4d74becf3 100644 --- a/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go +++ b/chains/evm/deployment/v1_2_0/adapters/laneversionresolver.go @@ -1,12 +1,14 @@ package adapters import ( + "context" "fmt" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -84,3 +86,24 @@ func (r *LaneVersionResolver) DeriveLaneVersionsForChain(e cldf.Environment, cha } return laneVersionForRemoteChain, versionList, nil } + +func GetLaneVersionForRemoteChain(ctx context.Context, chain evm.Chain, remoteChain uint64, routerAddr common.Address) (*semver.Version, error) { + routerC, err := router.NewRouter(routerAddr, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to bind router contract at address %s: %w", routerAddr.Hex(), err) + } + onRamp, err := routerC.GetOnRamp(&bind.CallOpts{ + Context: ctx, + }, remoteChain) + if err != nil { + return nil, fmt.Errorf("failed to get onramp for remote chain %d from router at address %s: %w", remoteChain, routerAddr.Hex(), err) + } + if onRamp == (common.Address{}) { + return nil, nil + } + _, version, err := utils.TypeAndVersion(onRamp, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to get type and version for onramp at address %s: %w", onRamp.Hex(), err) + } + return version, nil +} diff --git a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go index 2734f70d8d..a4f8471555 100644 --- a/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go +++ b/chains/evm/deployment/v1_6_0/sequences/deploy_chain_contracts.go @@ -27,6 +27,7 @@ import ( pingpongdappops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/ping_pong_dapp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/token_admin_registry" fqops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/nonce_manager" offrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/offramp" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" @@ -57,6 +58,11 @@ func (a *EVMAdapter) GrantAdminRoleToTimelock() *operations.Sequence[deployops.G return evmDeployer.GrantAdminRoleToTimelock() } +func (a *EVMAdapter) UpdateMCMSConfig() *operations.Sequence[deployops.UpdateMCMSConfigInputPerChainWithSelector, sequences.OnChainOutput, chain.BlockChains] { + evmDeployer := &evm1_0_0.EVMDeployer{} + return evmDeployer.UpdateMCMSConfig() +} + var DeployChainContracts = cldf_ops.NewSequence( "deploy-chain-contracts", semver.MustParse("1.6.0"), @@ -180,11 +186,11 @@ var DeployChainContracts = cldf_ops.NewSequence( addresses = append(addresses, nonceManagerRef) // Deploy FeeQuoter - feeQuoterRef, err := contract.MaybeDeployContract(b, fqops.Deploy, chain, contract.DeployInput[fqops.ConstructorArgs]{ - TypeAndVersion: deployment.NewTypeAndVersion(fqops.ContractType, *fqops.Version), + feeQuoterRef, err := contract.MaybeDeployContract(b, fq163ops.Deploy, chain, contract.DeployInput[fq163ops.ConstructorArgs]{ + TypeAndVersion: deployment.NewTypeAndVersion(fq163ops.ContractType, *fq163ops.Version), ChainSelector: chain.Selector, - Args: fqops.ConstructorArgs{ - StaticConfig: fqops.StaticConfig{ + Args: fq163ops.ConstructorArgs{ + StaticConfig: fq163ops.StaticConfig{ MaxFeeJuelsPerMsg: input.MaxFeeJuelsPerMsg, LinkToken: common.HexToAddress(linkRef.Address), TokenPriceStalenessThreshold: input.TokenPriceStalenessThreshold, @@ -197,9 +203,9 @@ var DeployChainContracts = cldf_ops.NewSequence( common.HexToAddress(linkRef.Address), common.HexToAddress(wethRef.Address), }, - TokenPriceFeeds: []fqops.TokenPriceFeedUpdate{}, - TokenTransferFeeConfigArgs: []fqops.TokenTransferFeeConfigArgs{}, - PremiumMultiplierWeiPerEthArgs: []fqops.FeeTokenArgs{ + TokenPriceFeeds: []fq163ops.TokenPriceFeedUpdate{}, + TokenTransferFeeConfigArgs: []fq163ops.TokenTransferFeeConfigArgs{}, + PremiumMultiplierWeiPerEthArgs: []fq163ops.PremiumMultiplierWeiPerEthArgs{ { PremiumMultiplierWeiPerEth: input.LinkPremiumMultiplier, Token: common.HexToAddress(linkRef.Address), @@ -209,7 +215,7 @@ var DeployChainContracts = cldf_ops.NewSequence( Token: common.HexToAddress(wethRef.Address), }, }, - DestChainConfigArgs: []fqops.DestChainConfigArgs{}, + DestChainConfigArgs: []fq163ops.DestChainConfigArgs{}, }, }, input.ExistingAddresses) if err != nil { diff --git a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 5b0f188ecd..f49e9ce6cb 100644 --- a/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ -GETH_VERSION: 1.17.0 +GETH_VERSION: 1.17.1 advanced_pool_hooks: ../solc/ccip/AdvancedPoolHooks/AdvancedPoolHooks.sol/AdvancedPoolHooks.abi.json ../solc/ccip/AdvancedPoolHooks/AdvancedPoolHooks.sol/AdvancedPoolHooks.bin f1c8260d2adb1b0eb01af60956d3b2c615641ae68b1e2fb9c59f4c5c216b2e37 advanced_pool_hooks_extractor: ../solc/ccip/AdvancedPoolHooksExtractor/AdvancedPoolHooksExtractor.sol/AdvancedPoolHooksExtractor.abi.json ../solc/ccip/AdvancedPoolHooksExtractor/AdvancedPoolHooksExtractor.sol/AdvancedPoolHooksExtractor.bin b830a2462c65673e018fd0ec625dccebef701779c458800f93875d5c179ed49e burn_from_mint_token_pool: ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.abi.json ../solc/ccip/BurnFromMintTokenPool/BurnFromMintTokenPool.sol/BurnFromMintTokenPool.bin 903ecb55c90e819eca28e48a56522bba91792d8607159511c0491ee115d5b926 diff --git a/chains/solana/deployment/go.mod b/chains/solana/deployment/go.mod index 44a28aa645..a265b9651f 100644 --- a/chains/solana/deployment/go.mod +++ b/chains/solana/deployment/go.mod @@ -18,16 +18,16 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/binary v0.8.0 github.com/gagliardetto/solana-go v1.13.0 github.com/rs/zerolog v1.34.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/mcms v0.36.0 github.com/stretchr/testify v1.11.1 @@ -36,6 +36,7 @@ require ( require ( github.com/creachadair/jrpc2 v1.2.0 // indirect github.com/creachadair/mds v0.13.4 // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 // indirect github.com/stellar/go-stellar-sdk v0.1.0 // indirect github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 // indirect @@ -81,10 +82,10 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -188,7 +189,7 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect @@ -199,7 +200,7 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -219,7 +220,7 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -230,28 +231,28 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect golang.org/x/crypto v0.48.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/chains/solana/deployment/go.sum b/chains/solana/deployment/go.sum index 5a97421bfb..951e8b407e 100644 --- a/chains/solana/deployment/go.sum +++ b/chains/solana/deployment/go.sum @@ -239,8 +239,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -273,12 +273,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -862,10 +862,10 @@ github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0ku github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h1:vGdeMwHO3ow88HvxfhA4DDPYNY0X9jmdux7L83UF/W8= github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 h1:cMzoreLtepEiB5pfYrvreXNoZideVRzQQKNr5Io5J7M= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c h1:zHOzhm2TaGQKzPSlooyBkyT18xEZDO/PuEFf61cGsuU= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -876,12 +876,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= @@ -948,8 +950,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -1025,8 +1027,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1047,20 +1049,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1126,8 +1128,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1323,8 +1325,8 @@ golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1384,8 +1386,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1441,8 +1443,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/deployment/deploy/feequoterupdater.go b/deployment/deploy/feequoterupdater.go index 8ba2ea4466..fe9486fc79 100644 --- a/deployment/deploy/feequoterupdater.go +++ b/deployment/deploy/feequoterupdater.go @@ -2,6 +2,7 @@ package deploy import ( "fmt" + "math/big" "sync" "github.com/Masterminds/semver/v3" @@ -14,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/deployment/utils" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets" + datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/mcms" "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" ) @@ -30,13 +32,29 @@ type UpdateFeeQuoterInput struct { type UpdateFeeQuoterInputPerChain struct { FeeQuoterVersion *semver.Version + FeeQuoterConfig *AdditionalFeeQuoterConfig RampsVersion *semver.Version + // RemoteChainSelectors is used to determine which remote chains to pull config for when populating config for the FeeQuoter + // if RemoteChainSelectors is empty, it will pull all remote chain configs using 1.5.0 and 1.6.0 config importer + RemoteChainSelectors []uint64 +} + +type AdditionalFeeQuoterConfig struct { + GasPricesPerRemoteChain map[uint64]string // uses string values (parsed as base-10 big.Int). } type FeeQuoterUpdateInput struct { ChainSelector uint64 ExistingAddresses []datastore.AddressRef - ContractMeta []datastore.ContractMetadata + // PreviousVersions lists the supported config-importer / lane versions that + // should be consulted when deriving the FeeQuoter configuration for this chain. + // It does NOT refer to previous FeeQuoter contract deployment versions. + PreviousVersions []*semver.Version + RemoteChainSelectors []uint64 + AdditionalConfig *AdditionalFeeQuoterConfig + ContractMeta []datastore.ContractMetadata + // TimelockAddress is the address of the CCIP timelock contract to be added as a price updater on the fee quoter. + TimelockAddress string } type SourceChainConfig struct { @@ -106,7 +124,6 @@ func (r *FQAndRampUpdaterRegistry) RegisterConfigImporterVersionResolver(family } func (r *FQAndRampUpdaterRegistry) GetConfigImporter(chainsel uint64, version *semver.Version) (ConfigImporter, bool) { - // Get the chain family from the chain selector family, err := chain_selectors.GetSelectorFamily(chainsel) if err != nil { return nil, false @@ -119,7 +136,6 @@ func (r *FQAndRampUpdaterRegistry) GetConfigImporter(chainsel uint64, version *s } func (r *FQAndRampUpdaterRegistry) GetFeeQuoterUpdater(chainsel uint64, version *semver.Version) (FeeQuoterUpdater[any], bool) { - // Get the chain family from the chain selector family, err := chain_selectors.GetSelectorFamily(chainsel) if err != nil { return nil, false @@ -132,7 +148,6 @@ func (r *FQAndRampUpdaterRegistry) GetFeeQuoterUpdater(chainsel uint64, version } func (r *FQAndRampUpdaterRegistry) GetRampUpdater(chainsel uint64, version *semver.Version) (RampUpdater, bool) { - // Get the chain family from the chain selector family, err := chain_selectors.GetSelectorFamily(chainsel) if err != nil { return nil, false @@ -145,7 +160,6 @@ func (r *FQAndRampUpdaterRegistry) GetRampUpdater(chainsel uint64, version *semv } func (r *FQAndRampUpdaterRegistry) GetConfigImporterVersionResolver(chainsel uint64) (LaneVersionResolver, bool) { - // Get the chain family from the chain selector family, err := chain_selectors.GetSelectorFamily(chainsel) if err != nil { return nil, false @@ -173,10 +187,13 @@ func GetFQAndRampUpdaterRegistry() *FQAndRampUpdaterRegistry { } // UpdateFeeQuoterChangeset creates a changeset that updates FeeQuoter contracts on specified chains. +// This can support either upgrading to a 2.0 or higher version of the FeeQuoter, which allows re-configuration of the existing contract, or deploying a new FeeQuoter and updating Ramps to point to it. // It first optionally populates configuration values, then creates FeeQuoterUpdateInput, // deploys or updates the FeeQuoter contract, and finally updates the Ramps contracts to use the new FeeQuoter address. -func UpdateFeeQuoterChangeset(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) cldf.ChangeSetV2[UpdateFeeQuoterInput] { - return cldf.CreateChangeSet(updateFeeQuoterApply(fquRegistry, mcmsRegistry), updateFeeQuoterVerify()) +// This also supports downgrading the FQ contract to a prior version (i.e. a rollback) where only the ramps +// are updated and the existing FQ is not touched. This would be triggered when specifying a FQ version < 2.0.0, which do not support re-configuration, and an existing FQ address is found in the datastore for the chain. +func UpdateFeeQuoterChangeset() cldf.ChangeSetV2[UpdateFeeQuoterInput] { + return cldf.CreateChangeSet(updateFeeQuoterApply(), updateFeeQuoterVerify()) } func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error { @@ -188,88 +205,166 @@ func updateFeeQuoterVerify() func(cldf.Environment, UpdateFeeQuoterInput) error if perChainInput.FeeQuoterVersion == nil { return fmt.Errorf("fee quoter version is required for chain selector %d", chainSel) } - if perChainInput.RampsVersion == nil { - return fmt.Errorf("ramps version is required for chain selector %d", chainSel) + if perChainInput.FeeQuoterConfig != nil { + for remoteChainSel := range perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain { + _, ok := new(big.Int).SetString(perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain[remoteChainSel], 10) + if !ok { + return fmt.Errorf("invalid gas price %s for remote chain selector %d in fee quoter config for chain selector %d", perChainInput.FeeQuoterConfig.GasPricesPerRemoteChain[remoteChainSel], remoteChainSel, chainSel) + } + } + } + _, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{ + ChainSelector: chainSel, + Type: datastore.ContractType(utils.FeeQuoter), + Version: perChainInput.FeeQuoterVersion, + }, chainSel, datastore_utils.FullRef) + if err != nil { + // errors are alright if we don't expect to find the ref + // but we only support deploying/updating fee quoters with versions >= 2.0.0 + supportedVersion := semver.MustParse("2.0.0") + if perChainInput.FeeQuoterVersion.LessThan(supportedVersion) { + return fmt.Errorf("fee quoter address not found for chain selector %d and version %s: %w", chainSel, perChainInput.FeeQuoterVersion.String(), err) + } } } return nil } } -func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *changesets.MCMSReaderRegistry) func(cldf.Environment, UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { +func updateFeeQuoterApply() func(cldf.Environment, UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { return func(e cldf.Environment, input UpdateFeeQuoterInput) (cldf.ChangesetOutput, error) { batchOps := make([]mcms_types.BatchOperation, 0) reports := make([]cldf_ops.Report[any, any], 0) addressRefs := make([]datastore.AddressRef, 0) contractMetadata := make([]datastore.ContractMetadata, 0) + fquRegistry := GetFQAndRampUpdaterRegistry() + mcmsRegistry := changesets.GetRegistry() for chainSel, perChainInput := range input.Chains { - fquUpdater, ok := fquRegistry.GetFeeQuoterUpdater(chainSel, perChainInput.FeeQuoterVersion) - if !ok { - return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("FeeQuoterUpdater", chainSel, perChainInput.FeeQuoterVersion) - } - rampUpdater, ok := fquRegistry.GetRampUpdater(chainSel, perChainInput.RampsVersion) - if !ok { - return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("RampUpdater", chainSel, perChainInput.RampsVersion) - } - versionResolver, ok := fquRegistry.GetConfigImporterVersionResolver(chainSel) - if !ok { - return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporterVersionResolver", chainSel, nil) - } - // Resolve the config importer version to use for this chain - _, configImporterVersions, err := versionResolver.DeriveLaneVersionsForChain(e, chainSel) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve config importer version for chain %d: %w", chainSel, err) + var feeQuoterAddrRef datastore.AddressRef + feeQuoterAddrRefs := e.DataStore.Addresses().Filter( + datastore.AddressRefByChainSelector(chainSel), + datastore.AddressRefByType(datastore.ContractType(utils.FeeQuoter)), + datastore.AddressRefByVersion(perChainInput.FeeQuoterVersion), + ) + if len(feeQuoterAddrRefs) > 0 { + feeQuoterAddrRef = feeQuoterAddrRefs[0] + e.Logger.Infof("Found existing FeeQuoter address %s for chain selector %d and version %s", + feeQuoterAddrRef.Address, chainSel, perChainInput.FeeQuoterVersion.String()) } - contractMeta := make([]datastore.ContractMetadata, 0) - for _, version := range configImporterVersions { - configImporter, ok := fquRegistry.GetConfigImporter(chainSel, version) + isNewFeeQuoterDeployment := len(feeQuoterAddrRefs) == 0 + if perChainInput.FeeQuoterVersion.GreaterThanEqual(semver.MustParse("2.0.0")) { + e.Logger.Infof("No existing FeeQuoter address found for chain selector %d and version %s, proceeding with deployment and upgrade", chainSel, perChainInput.FeeQuoterVersion.String()) + fquUpdater, ok := fquRegistry.GetFeeQuoterUpdater(chainSel, perChainInput.FeeQuoterVersion) if !ok { - return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporter", chainSel, version) + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("FeeQuoterUpdater", chainSel, perChainInput.FeeQuoterVersion) } - populateCfgOutput, err := PopulateMetaDataFromConfigImporter(e, configImporter, chainSel) + + versionResolver, ok := fquRegistry.GetConfigImporterVersionResolver(chainSel) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporterVersionResolver", chainSel, nil) + } + _, configImporterVersions, err := versionResolver.DeriveLaneVersionsForChain(e, chainSel) if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to populate metadata from config importer for chain %d: %w", chainSel, err) + return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve config importer version for chain %d: %w", chainSel, err) } - if len(populateCfgOutput.Metadata.Contracts) == 0 { - return cldf.ChangesetOutput{}, fmt.Errorf("no contract metadata returned from populate config on chain %d", chainSel) + contractMeta := make([]datastore.ContractMetadata, 0) + for _, version := range configImporterVersions { + configImporter, ok := fquRegistry.GetConfigImporter(chainSel, version) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("ConfigImporter", chainSel, version) + } + err := configImporter.InitializeAdapter(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to initialize config importer for chain %d: %w", chainSel, err) + } + supportedTokensPerRemoteChain, err := configImporter.SupportedTokensPerRemoteChain(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get supported tokens per remote chain for chain %d: %w", chainSel, err) + } + connectedChains, err := configImporter.ConnectedChains(e, chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get connected chains for chain %d: %w", chainSel, err) + } + populateConfigReport, err := cldf_ops.ExecuteSequence(e.OperationsBundle, configImporter.SequenceImportConfig(), e.BlockChains, ImportConfigPerChainInput{ + ChainSelector: chainSel, + RemoteChains: connectedChains, + TokensPerRemoteChain: supportedTokensPerRemoteChain, + }) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to populate config for FeeQuoter on chain %d: %w", chainSel, err) + } + if len(populateConfigReport.Output.Metadata.Contracts) == 0 { + return cldf.ChangesetOutput{}, fmt.Errorf("no contract metadata returned from populate config for FeeQuoter on chain %d", chainSel) + } + + contractMeta = append(contractMeta, populateConfigReport.Output.Metadata.Contracts...) + contractMetadata = append(contractMetadata, populateConfigReport.Output.Metadata.Contracts...) } - contractMeta = append(contractMeta, populateCfgOutput.Metadata.Contracts...) - contractMetadata = append(contractMetadata, populateCfgOutput.Metadata.Contracts...) - } - // Create FeeQuoterUpdateInput - reportFQInputCreation, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceFeeQuoterInputCreation(), e.BlockChains, FeeQuoterUpdateInput{ - ChainSelector: chainSel, - ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), - ContractMeta: contractMeta, - }) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) - } - // Deploy or update FeeQuoter - reportFQUpdate, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceDeployOrUpdateFeeQuoter(), e.BlockChains, reportFQInputCreation.Output) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to deploy or update FeeQuoter for chain %d: %w", chainSel, err) + timelockAddr := "" + family, err := chain_selectors.GetSelectorFamily(chainSel) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to get chain family for selector %d: %w", chainSel, err) + } + mcmsReader, ok := mcmsRegistry.GetMCMSReader(family) + if !ok { + return cldf.ChangesetOutput{}, fmt.Errorf("no MCMS reader registered for chain family '%s'", family) + } + timelockRef, err := mcmsReader.GetTimelockRef(e, chainSel, input.MCMS) + if err != nil { + e.Logger.Warnf("Could not resolve timelock ref for chain %d, skipping timelock as price updater: %v", chainSel, err) + } else { + timelockAddr = timelockRef.Address + } + + reportFQInputCreation, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceFeeQuoterInputCreation(), e.BlockChains, FeeQuoterUpdateInput{ + ChainSelector: chainSel, + ExistingAddresses: e.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(chainSel)), + ContractMeta: contractMeta, + RemoteChainSelectors: perChainInput.RemoteChainSelectors, + TimelockAddress: timelockAddr, + AdditionalConfig: perChainInput.FeeQuoterConfig, + PreviousVersions: configImporterVersions, + }) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to create FeeQuoterUpdateInput for chain %d: %w", chainSel, err) + } + reportFQUpdate, err := cldf_ops.ExecuteSequence(e.OperationsBundle, fquUpdater.SequenceDeployOrUpdateFeeQuoter(), e.BlockChains, reportFQInputCreation.Output) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to deploy or update FeeQuoter for chain %d: %w", chainSel, err) + } + batchOps = append(batchOps, reportFQUpdate.Output.BatchOps...) + addressRefs = append(addressRefs, reportFQUpdate.Output.Addresses...) + reports = append(reports, reportFQUpdate.ExecutionReports...) + if len(reportFQUpdate.Output.Addresses) == 0 { + return cldf.ChangesetOutput{}, fmt.Errorf("no FeeQuoter address returned for chain %d", chainSel) + } + feeQuoterAddrRef = reportFQUpdate.Output.Addresses[len(reportFQUpdate.Output.Addresses)-1] + + if isNewFeeQuoterDeployment && timelockAddr != "" { + fqTransferBatches, fqTransferReports, err := TransferToTimelock(chainSel, &e, input.MCMS, []datastore.AddressRef{feeQuoterAddrRef}) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to transfer ownership to timelock for chain %d: %w", chainSel, err) + } + batchOps = append(batchOps, fqTransferBatches...) + reports = append(reports, fqTransferReports...) } - batchOps = append(batchOps, reportFQUpdate.Output.BatchOps...) - addressRefs = append(addressRefs, reportFQUpdate.Output.Addresses...) - reports = append(reports, reportFQUpdate.ExecutionReports...) - if len(reportFQUpdate.Output.Addresses) == 0 { - return cldf.ChangesetOutput{}, fmt.Errorf("no FeeQuoter address returned for chain %d", chainSel) } - // Update Ramps with new FeeQuoter address - // fetch the address refs - feeQuoterAddrRef := reportFQUpdate.Output.Addresses[len(reportFQUpdate.Output.Addresses)-1] if perChainInput.RampsVersion != nil { + if feeQuoterAddrRef.Address == "" { + return cldf.ChangesetOutput{}, fmt.Errorf("fee quoter address ref is required to update ramps for chain %d", chainSel) + } + rampUpdater, ok := fquRegistry.GetRampUpdater(chainSel, perChainInput.RampsVersion) + if !ok { + return cldf.ChangesetOutput{}, utils.ErrNoAdapterForSelectorRegistered("RampUpdater", chainSel, perChainInput.RampsVersion) + } rampsInput := UpdateRampsInput{ ChainSelector: chainSel, FeeQuoterAddress: feeQuoterAddrRef, } - // Resolve Ramps input resolvedRampsInput, err := rampUpdater.ResolveRampsInput(e, rampsInput) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve ramps input for chain %d: %w", chainSel, err) } - // Execute Ramps update sequence reportRampsUpdate, err := cldf_ops.ExecuteSequence(e.OperationsBundle, rampUpdater.SequenceUpdateRampsWithFeeQuoter(), e.BlockChains, resolvedRampsInput) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to update ramps with FeeQuoter for chain %d: %w", chainSel, err) @@ -279,7 +374,6 @@ func updateFeeQuoterApply(fquRegistry *FQAndRampUpdaterRegistry, mcmsRegistry *c reports = append(reports, reportRampsUpdate.ExecutionReports...) } } - // Prepare datastore with all address refs ds := datastore.NewMemoryDataStore() for _, addrRef := range addressRefs { if err := ds.Addresses().Add(addrRef); err != nil { diff --git a/deployment/go.mod b/deployment/go.mod index 7e8d9e4a67..fdd641dae1 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -10,21 +10,21 @@ require ( github.com/BurntSushi/toml v1.5.0 github.com/Masterminds/semver/v3 v3.4.0 github.com/aptos-labs/aptos-go-sdk v1.11.0 - github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/deckarep/golang-set/v2 v2.8.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/evanphx/json-patch/v5 v5.9.11 github.com/gagliardetto/solana-go v1.13.0 github.com/google/uuid v1.6.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260129103204-4c8453dd8139 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/chainlink-evm v0.3.3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/mcms v0.36.0 github.com/stretchr/testify v1.11.1 - google.golang.org/grpc v1.77.0 + google.golang.org/grpc v1.78.0 ) require ( @@ -68,7 +68,7 @@ require ( github.com/dchest/siphash v1.2.3 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -171,8 +171,9 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 // indirect @@ -185,7 +186,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -205,7 +206,7 @@ require ( go.mongodb.org/mongo-driver v1.17.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -216,24 +217,24 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect golang.org/x/crypto v0.48.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 9a8c203400..933dc4629c 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -184,8 +184,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -213,12 +213,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -683,8 +683,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -695,12 +695,14 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= @@ -754,8 +756,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -816,8 +818,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -838,20 +840,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -900,8 +902,8 @@ golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZP golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -1033,8 +1035,8 @@ golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1066,8 +1068,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1083,8 +1085,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/devenv/cldf.go b/devenv/cldf.go index cc6e618d8c..e4ff6bad76 100644 --- a/devenv/cldf.go +++ b/devenv/cldf.go @@ -4,7 +4,6 @@ import ( "context" // "encoding/hex" "errors" - "fmt" "os" "path/filepath" "sync" diff --git a/devenv/go.mod b/devenv/go.mod index 929045f60f..11b926d621 100644 --- a/devenv/go.mod +++ b/devenv/go.mod @@ -26,7 +26,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/docker/docker v28.5.1+incompatible github.com/docker/go-connections v0.6.0 // indirect - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/solana-go v1.13.0 github.com/go-resty/resty/v2 v2.17.1 github.com/google/uuid v1.6.0 @@ -39,14 +39,16 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20251014191100-bad58388f0c9 + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260312161144-d895b42081a0 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/chainlink-evm v0.3.3 // indirect github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd - github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0 + github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 + github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260312222135-d3b481b567a2 + github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260312222135-d3b481b567a2 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d github.com/smartcontractkit/mcms v0.36.0 github.com/spf13/cobra v1.10.1 @@ -72,6 +74,7 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect + github.com/TyphonHill/go-mermaid v1.0.0 // indirect github.com/VictoriaMetrics/fastcache v1.13.0 // indirect github.com/XSAM/otelsql v0.37.0 // indirect github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect @@ -126,7 +129,7 @@ require ( github.com/creachadair/jrpc2 v1.2.0 // indirect github.com/creachadair/mds v0.13.4 // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -137,7 +140,7 @@ require ( github.com/edsrzf/mmap-go v1.2.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/fatih/color v1.18.0 // indirect @@ -216,6 +219,7 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.7 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/memberlist v0.5.2 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/yamux v0.1.2 // indirect @@ -336,9 +340,11 @@ require ( github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect @@ -354,7 +360,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -390,7 +396,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -401,12 +407,12 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/goleak v1.3.0 // indirect @@ -414,19 +420,19 @@ require ( go.uber.org/ratelimit v0.3.1 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.21.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/mod v0.32.0 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/api v0.221.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect diff --git a/devenv/go.sum b/devenv/go.sum index 0a00012b88..cdc38f7e37 100644 --- a/devenv/go.sum +++ b/devenv/go.sum @@ -85,6 +85,8 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= +github.com/TyphonHill/go-mermaid v1.0.0 h1:VtmgQwgZA+KNHJvG/O591ibBVuDkGhg2+F/olVXnXAs= +github.com/TyphonHill/go-mermaid v1.0.0/go.mod h1:BqMEbKnr2HHpZ4lJJvGjL47v6rZAUpJcOaE/db1Ppwc= github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0= github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU= github.com/Workiva/go-datastructures v1.1.5 h1:5YfhQ4ry7bZc2Mc7R0YZyYwpf5c6t1cEFvdAhd6Mkf4= @@ -330,8 +332,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -379,12 +381,12 @@ github.com/envoyproxy/go-control-plane/envoy v1.35.0/go.mod h1:09qwbGVuSWWAyN5t/ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -708,6 +710,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -1020,8 +1024,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= -github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM= +github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1205,8 +1209,8 @@ github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260312161144-d895b4 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260312161144-d895b42081a0/go.mod h1:hl57wj/oxsh+ieJkvTkYxyB6+Gv22QiVjjcmh7fa0AI= github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260116092715-df6a64d4bf00 h1:bsmRSGuUXKWRhhTxW2MQzJ/swIEqhZ83mjyhTSQuF/g= github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260116092715-df6a64d4bf00/go.mod h1:Gl35ExaFLinqVhp50+Yq1GnMuHb3fnDtZUFPCtcfV3M= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -1217,18 +1221,22 @@ github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 h1:JU1JUrkzdAUHsOYdS9DENPkJfmrxweFRPRSztad6oPM= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 h1:IXF7+k8I1YY/yvXC1wnS3FAAggtCy6ByEQ9hv/F2FvQ= +github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9/go.mod h1:KpEWZJMLwbdMHeHQz9rbkES0vRrx4nk6OQXyhlHb9/8= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0 h1:uaTiz6bA2gttm5AwCeqeT7ElrOkP9DIY1PPwSj5EeNs= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0/go.mod h1:43xdIQuqw/gzfazsqJkBrGdF25TIJDiY/Ak/YrWFTmU= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1 h1:w1KRBigXgoBYQBi4IU0gKbA2mBF6vq5vW/zbtan+mPo= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1/go.mod h1:43xdIQuqw/gzfazsqJkBrGdF25TIJDiY/Ak/YrWFTmU= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0/go.mod h1:lyAu+oMXdNUzEDScj2DXB2IueY+SDXPPfyl/kb63tMM= github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 h1:ZJ/8Jx6Be5//TyjPi1pS1uotnmcYq5vVkSyISIymSj8= @@ -1237,6 +1245,10 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2 h1:QFO9Ar1z github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.2/go.mod h1:OLczwaAvyObFG+eq4tQHkWqkbPBB0cHkZj0JzY3inik= github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0 h1:+5wW8HbwNhHEBOanhSiT7sxyFAAeDP9TvQ6GwJ4STps= github.com/smartcontractkit/chainlink-ton v0.0.0-20260213025045-83535910e2c0/go.mod h1:IZvH2r16xcQvVLB7AtjU112wnHfEku+29OlI1vCQHCQ= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260312222135-d3b481b567a2 h1:jnLgztBTgxBRZ13ggAl9z3XZkDsfWhpeh24bKvfzLQ4= +github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260312222135-d3b481b567a2/go.mod h1:w83O9EU6BEtAJ1FifeVAqp1mQNISnH3BY+MLbYX5PBg= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260312222135-d3b481b567a2 h1:l20zXumxZAgKE9Hye9Q3knb4fkvBUjB3J1x9YyT3Szk= +github.com/smartcontractkit/chainlink-ton/devenv v0.0.0-20260312222135-d3b481b567a2/go.mod h1:W4sihns3zi0UJF956bPdBI/DbP+fF9wQ5ON0RB0U2jY= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513 h1:XRNxgcNqagXu6e4smJuS1crRK5cUAcCVd7u+iLduHDM= github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250908203554-5bd9d2fe9513/go.mod h1:ccjEgNeqOO+bjPddnL4lUrNLzyCvGCxgBjJdhFX3wa8= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20250528121202-292529af39df h1:36e3ROIZyV/qE8SvFOACXtXfMOMd9vG4+zY2v2ScXkI= @@ -1305,8 +1317,8 @@ github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -1438,8 +1450,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0. go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0/go.mod h1:54CaSNqYEXvpzDh8KPjiMVoWm60t5R0dZRt0leEPgAs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1460,20 +1472,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1548,8 +1560,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1781,8 +1793,8 @@ golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1844,8 +1856,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1906,8 +1918,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/go.md b/go.md index e003733128..26518bbf84 100644 --- a/go.md +++ b/go.md @@ -104,6 +104,7 @@ flowchart LR chainlink-ccip/devenv --> chainlink-ccip/ccv/chains/evm chainlink-ccip/devenv --> chainlink-ccip/chains/evm/deployment chainlink-ccip/devenv --> chainlink-ccip/chains/solana/deployment + chainlink-ccip/devenv --> chainlink-ton/devenv click chainlink-ccip/devenv href "https://github.com/smartcontractkit/chainlink-ccip" chainlink-ccip/integration-tests --> chainlink-ccip/ccv/chains/evm/deployment chainlink-ccip/integration-tests --> chainlink-ccip/chains/solana/deployment @@ -148,7 +149,7 @@ flowchart LR chainlink-framework/chains --> chainlink-common chainlink-framework/chains --> chainlink-framework/multinode click chainlink-framework/chains href "https://github.com/smartcontractkit/chainlink-framework" - chainlink-framework/metrics + chainlink-framework/metrics --> chainlink-common click chainlink-framework/metrics href "https://github.com/smartcontractkit/chainlink-framework" chainlink-framework/multinode click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework" @@ -191,6 +192,10 @@ flowchart LR chainlink-ton --> chainlink-common/pkg/monitoring chainlink-ton --> chainlink-framework/metrics click chainlink-ton href "https://github.com/smartcontractkit/chainlink-ton" + chainlink-ton/deployment --> chainlink-ccip/deployment + click chainlink-ton/deployment href "https://github.com/smartcontractkit/chainlink-ton" + chainlink-ton/devenv --> chainlink-ton/deployment + click chainlink-ton/devenv href "https://github.com/smartcontractkit/chainlink-ton" chainlink-tron/relayer --> chainlink-common chainlink-tron/relayer --> chainlink-common/pkg/values click chainlink-tron/relayer href "https://github.com/smartcontractkit/chainlink-tron" @@ -267,6 +272,13 @@ flowchart LR end click chainlink-testing-framework-repo href "https://github.com/smartcontractkit/chainlink-testing-framework" + subgraph chainlink-ton-repo[chainlink-ton] + chainlink-ton + chainlink-ton/deployment + chainlink-ton/devenv + end + click chainlink-ton-repo href "https://github.com/smartcontractkit/chainlink-ton" + classDef outline stroke-dasharray:6,fill:none; - class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo outline + class chainlink-ccip-repo,chainlink-common-repo,chainlink-evm-repo,chainlink-framework-repo,chainlink-protos-repo,chainlink-testing-framework-repo,chainlink-ton-repo outline ``` diff --git a/go.mod b/go.mod index 3df4dbfdab..4fd9257d03 100644 --- a/go.mod +++ b/go.mod @@ -3,24 +3,24 @@ module github.com/smartcontractkit/chainlink-ccip go 1.25.3 require ( - github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/deckarep/golang-set/v2 v2.8.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/prometheus/client_golang v1.22.0 + github.com/prometheus/client_golang v1.23.0 github.com/prometheus/client_model v0.6.2 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260304234246-843d03f2badc github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d github.com/stretchr/testify v1.11.1 github.com/zksync-sdk/zksync2-go v1.1.0 - go.opentelemetry.io/otel v1.39.0 - go.opentelemetry.io/otel/metric v1.39.0 + go.opentelemetry.io/otel v1.41.0 + go.opentelemetry.io/otel/metric v1.41.0 go.uber.org/zap v1.27.1 golang.org/x/crypto v0.48.0 golang.org/x/sync v0.19.0 - golang.org/x/time v0.12.0 + golang.org/x/time v0.14.0 google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v3 v3.0.1 ) @@ -45,7 +45,7 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect @@ -78,11 +78,11 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect @@ -99,19 +99,19 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/text v0.34.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect ) diff --git a/go.sum b/go.sum index e2280e44ff..4de598663e 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -91,12 +91,12 @@ github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbz github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -263,8 +263,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= -github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= +github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= @@ -287,14 +287,14 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo= github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260304234246-843d03f2badc h1:Xv7GCiWW8dVfgsvoB1O6ERD6dGpDNsE6ZgNL3b37Ex4= github.com/smartcontractkit/chainlink-evm/gethwrappers/helpers v0.0.0-20260304234246-843d03f2badc/go.mod h1:YyK80jgNa1/qrTsgZO2s4Cp0gnBa0+5JtcjEDg8gZyE= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= @@ -310,8 +310,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= @@ -334,8 +334,8 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -356,20 +356,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -383,8 +383,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -416,21 +416,21 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/integration-tests/deployment/update_to_FeeQuoter_1_7_test.go b/integration-tests/deployment/update_to_FeeQuoter_1_7_test.go index 5dc19302e6..ff4a69ee57 100644 --- a/integration-tests/deployment/update_to_FeeQuoter_1_7_test.go +++ b/integration-tests/deployment/update_to_FeeQuoter_1_7_test.go @@ -16,6 +16,7 @@ import ( fqops "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" fq16ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/fee_quoter" + fq163ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" onrampops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp" fq16 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp" @@ -88,9 +89,8 @@ func TestUpdateToFeeQuoter_1_7(t *testing.T) { }, }) require.NoError(t, err, "Failed to apply ConnectChains changeset") - fqReg := deployops.GetFQAndRampUpdaterRegistry() // Now update to FeeQuoter 2.0.0 - fqUpdateChangeset := deployops.UpdateFeeQuoterChangeset(fqReg, nil) + fqUpdateChangeset := deployops.UpdateFeeQuoterChangeset() out, err = fqUpdateChangeset.Apply(*e, deployops.UpdateFeeQuoterInput{ Chains: fqInput, }) @@ -114,9 +114,9 @@ func TestUpdateToFeeQuoter_1_7(t *testing.T) { fq16AddrRefs := e.DataStore.Addresses().Filter( datastore.AddressRefByChainSelector(chainSel), datastore.AddressRefByType(datastore.ContractType(fq16ops.ContractType)), - datastore.AddressRefByVersion(fq16ops.Version), + datastore.AddressRefByVersion(fq163ops.Version), ) - require.Len(t, fq16AddrRefs, 1, "Expected exactly 1 FeeQuoter address ref for version 1.6.0 and chain selector %d", chainSel) + require.Len(t, fq16AddrRefs, 1, "Expected exactly 1 FeeQuoter address ref for version 1.6.3 and chain selector %d", chainSel) fq16Addr := common.HexToAddress(fq16AddrRefs[0].Address) // check that the new fee quoter has the same config as the old fee quoter fq16Contract, err := fq16.NewFeeQuoter(fq16Addr, chain.Client) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 0ea8e65dd4..85da7a0044 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -23,14 +23,14 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/aws/smithy-go v1.24.0 - github.com/ethereum/go-ethereum v1.17.0 + github.com/ethereum/go-ethereum v1.17.1 github.com/gagliardetto/solana-go v1.13.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.1.1-solana.0.20251125153543-0b618525aa03 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a + github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260312161144-d895b42081a0 github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 github.com/smartcontractkit/chainlink-evm v0.3.3 @@ -46,7 +46,7 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 // indirect ) require ( @@ -100,7 +100,7 @@ require ( github.com/creachadair/mds v0.13.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v28.5.1+incompatible // indirect @@ -109,7 +109,7 @@ require ( github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect @@ -241,10 +241,11 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20250826190403-aed7f5f33cde // indirect github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 // indirect - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 // indirect + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect + github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect @@ -260,7 +261,7 @@ require ( github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/supranational/blst v0.3.16 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/testcontainers/testcontainers-go v0.39.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -281,7 +282,7 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.36.0 // indirect @@ -292,29 +293,29 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect - go.opentelemetry.io/otel/log v0.13.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/sdk v1.41.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect go.uber.org/zap v1.27.1 // indirect golang.org/x/crypto v0.48.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/time v0.12.0 // indirect + golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.41.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/grpc v1.77.0 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index a64661727c..3d76c1ba62 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -255,8 +255,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -289,12 +289,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= -github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls= +github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= -github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= +github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho= +github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -910,10 +910,10 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2 h github.com/smartcontractkit/chainlink-aptos v0.0.0-20251024142440-51f2ad2652a2/go.mod h1:iteU0WORHkArACVh/HoY/1bipV4TcNcJdTmom9uIT0E= github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260312161144-d895b42081a0 h1:pGhc95fxyMVj/ips+hbvFr9IFn8++ccKc7wbKVmq7gY= github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260312161144-d895b42081a0/go.mod h1:Zp8erzWAVrADEhbR0EjhWFbEdr98Sdz4yb0LKKMccA8= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a h1:jrP1CEWevxo5Ls7C/leXfO24LUZ53uqPMVvX+D7DDV0= -github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260206132835-4c50734ccf2a/go.mod h1:1WcontO9PeuKdUf5HXfs3nuICtzUvFNnyCmrHkTCF9Y= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96 h1:ZnBBOLyMLJjgQQm7WRJl8sA9Q2RhwagJ+WR62VnA3MY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260114142648-bd9e1b483e96/go.mod h1:DAwaVSiQMgAsCjHa8nOnIAM9GixuIQWsgEZFGpf3JxE= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c h1:zHOzhm2TaGQKzPSlooyBkyT18xEZDO/PuEFf61cGsuU= +github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260312233953-f588f8dc6d7c/go.mod h1:67YbnoglYD61Pz/jTVCgav9wFq7S35OU8UyQSvPllRw= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0 h1:eui+u6ge2RYW01F/DeXWrc5UOqc+8+lyPoi9TIAmMgo= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-deployments-framework v0.80.2 h1:M944dbKDHJiqqGOfiaeQw9nUk/uuci8ggUXSgfSzW5Q= @@ -922,12 +922,14 @@ github.com/smartcontractkit/chainlink-evm v0.3.3 h1:JqwyJEtnNEUaoQQPoOBTT4sn2lpd github.com/smartcontractkit/chainlink-evm v0.3.3/go.mod h1:q0ZBvaoisNaqC8NcMYWNPTjee88nQktDEeJMQHq3hVI= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd h1:sK+pK4epQp20yQ7XztwrVgkTkRAr4FY+TvEegW8RuQk= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd/go.mod h1:7Jlt72+V9891y3LnGwHzmQwt9tfEGYryRKiGlQHo/o8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= +github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4 h1:AEnxv4HM3WD1RbQkRiFyb9cJ6YKAcqBp1CpIcFdZfuo= github.com/smartcontractkit/chainlink-protos/op-catalog v0.0.4/go.mod h1:PjZD54vr6rIKEKQj6HNA4hllvYI/QpT+Zefj3tqkFAs= github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 h1:KyPROV+v7P8VdiU7JhVuGLcDlEBsURSpQmSCgNBTY+s= @@ -996,8 +998,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= -github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= +github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -1073,8 +1075,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs= @@ -1095,20 +1097,20 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1x go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwWBJF/mHZc7A02YHedfFDENwJEdRA0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY= -go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls= -go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ= -go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.41.0 h1:YPIEXKmiAwkGl3Gu1huk1aYWwtpRLeskpV+wPisxBp8= +go.opentelemetry.io/otel/sdk v1.41.0/go.mod h1:ahFdU0G5y8IxglBf0QBJXgSe7agzjE4GiTJ6HT9ud90= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA= go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel/sdk/metric v1.41.0 h1:siZQIYBAUd1rlIWQT2uCxWJxcCO7q3TriaMlf08rXw8= +go.opentelemetry.io/otel/sdk/metric v1.41.0/go.mod h1:HNBuSvT7ROaGtGI50ArdRLUnvRTRGniSUZbxiWxSO8Y= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1175,8 +1177,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= +golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1375,8 +1377,8 @@ golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1436,8 +1438,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1493,8 +1495,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=