From 0fd3c7a828ac3701daef2656960fa2c10ba2aeb8 Mon Sep 17 00:00:00 2001
From: Chris Cushman <104409744+vreff@users.noreply.github.com>
Date: Fri, 20 Dec 2024 12:20:40 -0500
Subject: [PATCH 01/19] [CM 661] Remove dead transmission code (#15565)
* [CM-661] Remove dead transmission service code
* Remove vendored 4337 code
* Changeset
* [Bot] Update changeset file with jira issues
* Remove golang tests
* changeset 2
* more removals
* remove github actions w/transmission
* More removals
---------
Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
---
.changeset/shaggy-carpets-deliver.md | 5 +
.../workflows/solidity-foundry-artifacts.yml | 1 -
.github/workflows/solidity-foundry.yml | 3 -
.github/workflows/solidity-hardhat.yml | 2 +-
contracts/.changeset/cold-geckos-yawn.md | 10 +
contracts/.solhintignore-test | 1 -
contracts/GNUmakefile | 2 +-
contracts/foundry.toml | 6 -
contracts/scripts/native_solc_compile_all | 2 +-
.../native_solc_compile_all_transmission | 40 -
.../transmission/dev/ERC-4337/Paymaster.sol | 134 --
.../v0.8/transmission/dev/ERC-4337/SCA.sol | 73 -
.../transmission/dev/ERC-4337/SCALibrary.sol | 48 -
.../ERC-4337/SmartContractAccountFactory.sol | 33 -
.../transmission/dev/testhelpers/Greeter.sol | 15 -
.../SmartContractAccountHelper.sol | 78 -
.../src/v0.8/transmission/test/BaseTest.t.sol | 17 -
.../transmission/test/EIP_712_1014_4337.t.sol | 365 ----
.../vendor/entrypoint/core/EntryPoint.sol | 861 --------
.../v0.8/vendor/entrypoint/core/Helpers.sol | 68 -
.../vendor/entrypoint/core/SenderCreator.sol | 28 -
.../vendor/entrypoint/core/StakeManager.sol | 124 --
.../vendor/entrypoint/interfaces/IAccount.sol | 34 -
.../entrypoint/interfaces/IAggregator.sol | 36 -
.../entrypoint/interfaces/IEntryPoint.sol | 197 --
.../entrypoint/interfaces/IPaymaster.sol | 51 -
.../entrypoint/interfaces/IStakeManager.sol | 104 -
.../entrypoint/interfaces/UserOperation.sol | 84 -
.../src/v0.8/vendor/entrypoint/utils/Exec.sol | 70 -
core/gethwrappers/go_generate.go | 1 -
.../generated/entry_point/entry_point.go | 1871 -----------------
.../greeter_wrapper/greeter_wrapper.go | 216 --
.../paymaster_wrapper/paymaster_wrapper.go | 719 -------
.../generated/sca_wrapper/sca_wrapper.go | 292 ---
.../smart_contract_account_factory.go | 333 ---
.../smart_contract_account_helper.go | 322 ---
...rapper-dependency-versions-do-not-edit.txt | 9 -
core/gethwrappers/transmission/go_generate.go | 11 -
.../services/transmission/integration_test.go | 495 -----
core/services/transmission/signature.go | 19 -
40 files changed, 18 insertions(+), 6762 deletions(-)
create mode 100644 .changeset/shaggy-carpets-deliver.md
create mode 100644 contracts/.changeset/cold-geckos-yawn.md
delete mode 100755 contracts/scripts/native_solc_compile_all_transmission
delete mode 100644 contracts/src/v0.8/transmission/dev/ERC-4337/Paymaster.sol
delete mode 100644 contracts/src/v0.8/transmission/dev/ERC-4337/SCA.sol
delete mode 100644 contracts/src/v0.8/transmission/dev/ERC-4337/SCALibrary.sol
delete mode 100644 contracts/src/v0.8/transmission/dev/ERC-4337/SmartContractAccountFactory.sol
delete mode 100644 contracts/src/v0.8/transmission/dev/testhelpers/Greeter.sol
delete mode 100644 contracts/src/v0.8/transmission/dev/testhelpers/SmartContractAccountHelper.sol
delete mode 100644 contracts/src/v0.8/transmission/test/BaseTest.t.sol
delete mode 100644 contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/core/EntryPoint.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/core/Helpers.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/core/SenderCreator.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/core/StakeManager.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/IAccount.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/IAggregator.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/IEntryPoint.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/IPaymaster.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/IStakeManager.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/interfaces/UserOperation.sol
delete mode 100644 contracts/src/v0.8/vendor/entrypoint/utils/Exec.sol
delete mode 100644 core/gethwrappers/transmission/generated/entry_point/entry_point.go
delete mode 100644 core/gethwrappers/transmission/generated/greeter_wrapper/greeter_wrapper.go
delete mode 100644 core/gethwrappers/transmission/generated/paymaster_wrapper/paymaster_wrapper.go
delete mode 100644 core/gethwrappers/transmission/generated/sca_wrapper/sca_wrapper.go
delete mode 100644 core/gethwrappers/transmission/generated/smart_contract_account_factory/smart_contract_account_factory.go
delete mode 100644 core/gethwrappers/transmission/generated/smart_contract_account_helper/smart_contract_account_helper.go
delete mode 100644 core/gethwrappers/transmission/generation/generated-wrapper-dependency-versions-do-not-edit.txt
delete mode 100644 core/gethwrappers/transmission/go_generate.go
delete mode 100644 core/services/transmission/integration_test.go
delete mode 100644 core/services/transmission/signature.go
diff --git a/.changeset/shaggy-carpets-deliver.md b/.changeset/shaggy-carpets-deliver.md
new file mode 100644
index 00000000000..676ad2fb861
--- /dev/null
+++ b/.changeset/shaggy-carpets-deliver.md
@@ -0,0 +1,5 @@
+---
+"chainlink": minor
+---
+
+#removed dead transmission tests
diff --git a/.github/workflows/solidity-foundry-artifacts.yml b/.github/workflows/solidity-foundry-artifacts.yml
index 5a971f65174..dbf31a4b442 100644
--- a/.github/workflows/solidity-foundry-artifacts.yml
+++ b/.github/workflows/solidity-foundry-artifacts.yml
@@ -16,7 +16,6 @@ on:
- "llo-feeds"
- "operatorforwarder"
- "shared"
- - "transmission"
- "vrf"
- "workflow"
commit_to_use:
diff --git a/.github/workflows/solidity-foundry.yml b/.github/workflows/solidity-foundry.yml
index f94ef29a3b8..5c6889beaf8 100644
--- a/.github/workflows/solidity-foundry.yml
+++ b/.github/workflows/solidity-foundry.yml
@@ -38,7 +38,6 @@ jobs:
{ "name": "llo-feeds", "setup": { "run-coverage": true, "min-coverage": 49.3, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*' --ir-minimum", "min-coverage": 32.6, "run-gas-snapshot": true, "run-forge-fmt": false }},
- { "name": "transmission", "setup": { "run-coverage": true, "min-coverage": 61.5, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }},
{ "name": "workflow", "setup": { "run-coverage": true, "extra-coverage-params": "--ir-minimum", "min-coverage": 96.0, "run-gas-snapshot": true, "run-forge-fmt": true }}
]
@@ -112,8 +111,6 @@ jobs:
- 'contracts/src/v0.8/mocks/**/*.sol'
- 'contracts/src/v0.8/tests/**/*.sol'
- 'contracts/src/v0.8/vendor/**/*.sol'
- transmission:
- - 'contracts/src/v0.8/transmission/**/*.sol'
workflow:
- 'contracts/src/v0.8/workflow/**/*.sol'
diff --git a/.github/workflows/solidity-hardhat.yml b/.github/workflows/solidity-hardhat.yml
index 7283e17e13f..6f27f8ca2f8 100644
--- a/.github/workflows/solidity-hardhat.yml
+++ b/.github/workflows/solidity-hardhat.yml
@@ -25,7 +25,7 @@ jobs:
with:
filters: |
src:
- - 'contracts/src/!(v0.8/(ccip|functions|keystone|l2ep|liquiditymanager|llo-feeds|transmission|vrf|workflow)/**)/**/*'
+ - 'contracts/src/!(v0.8/(ccip|functions|keystone|l2ep|liquiditymanager|llo-feeds|vrf|workflow)/**)/**/*'
- 'contracts/test/**/*'
- 'contracts/package.json'
- 'contracts/pnpm-lock.yaml'
diff --git a/contracts/.changeset/cold-geckos-yawn.md b/contracts/.changeset/cold-geckos-yawn.md
new file mode 100644
index 00000000000..e7677f1282e
--- /dev/null
+++ b/contracts/.changeset/cold-geckos-yawn.md
@@ -0,0 +1,10 @@
+---
+'@chainlink/contracts': minor
+---
+
+Remove dead transmission code
+
+
+PR issue: CM-661
+
+Solidity Review issue: CM-662
\ No newline at end of file
diff --git a/contracts/.solhintignore-test b/contracts/.solhintignore-test
index acaca4fe1e4..137ba9998c7 100644
--- a/contracts/.solhintignore-test
+++ b/contracts/.solhintignore-test
@@ -4,7 +4,6 @@
./src/v0.8/tests
./src/v0.8/llo-feeds/
./src/v0.8/automation/
-./src/v0.8/transmission/
./src/v0.8/l2ep/
./src/v0.8/shared/
./src/v0.8/operatorforwarder/
diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile
index 673198bb1e2..7361754ee0b 100644
--- a/contracts/GNUmakefile
+++ b/contracts/GNUmakefile
@@ -1,6 +1,6 @@
# ALL_FOUNDRY_PRODUCTS contains a list of all products that have a foundry
# profile defined and use the Foundry snapshots.
-ALL_FOUNDRY_PRODUCTS = ccip functions keystone l2ep liquiditymanager llo-feeds operatorforwarder shared transmission workflow
+ALL_FOUNDRY_PRODUCTS = ccip functions keystone l2ep liquiditymanager llo-feeds operatorforwarder shared workflow
# To make a snapshot for a specific product, either set the `FOUNDRY_PROFILE` env var
# or call the target with `FOUNDRY_PROFILE=product`
diff --git a/contracts/foundry.toml b/contracts/foundry.toml
index daed21c4f6c..7fe77e08c07 100644
--- a/contracts/foundry.toml
+++ b/contracts/foundry.toml
@@ -96,12 +96,6 @@ solc_version = '0.8.19'
src = 'src/v0.8/operatorforwarder'
test = 'src/v0.8/operatorforwarder/test'
-[profile.transmission]
-optimizer_runs = 1_000_000
-solc_version = '0.8.19'
-src = 'src/v0.8/transmission'
-test = 'src/v0.8/transmission/test'
-
[profile.workflow]
optimizer_runs = 1_000_000
solc_version = '0.8.24'
diff --git a/contracts/scripts/native_solc_compile_all b/contracts/scripts/native_solc_compile_all
index 090d8c8a07b..42abac3c6b3 100755
--- a/contracts/scripts/native_solc_compile_all
+++ b/contracts/scripts/native_solc_compile_all
@@ -12,7 +12,7 @@ python3 -m pip install --require-hashes -r $SCRIPTPATH/requirements.txt
# 6 and 7 are legacy contracts, for each other product we have a native_solc_compile_all_$product script
# These scripts can be run individually, or all together with this script.
# To add new CL products, simply write a native_solc_compile_all_$product script and add it to the list below.
-for product in automation events_mock feeds functions keystone llo-feeds logpoller operatorforwarder shared transmission vrf ccip liquiditymanager workflow
+for product in automation events_mock feeds functions keystone llo-feeds logpoller operatorforwarder shared vrf ccip liquiditymanager workflow
do
$SCRIPTPATH/native_solc_compile_all_$product
done
diff --git a/contracts/scripts/native_solc_compile_all_transmission b/contracts/scripts/native_solc_compile_all_transmission
deleted file mode 100755
index 9650a2b27d3..00000000000
--- a/contracts/scripts/native_solc_compile_all_transmission
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-echo " ┌──────────────────────────────────────────────┐"
-echo " │ Compiling Transmission contracts... │"
-echo " └──────────────────────────────────────────────┘"
-
-SOLC_VERSION="0.8.19"
-OPTIMIZE_RUNS=1000000
-
-SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
-ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )"
-python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt
-
-solc-select install $SOLC_VERSION
-solc-select use $SOLC_VERSION
-export SOLC_VERSION=$SOLC_VERSION
-
-compileContract () {
- local contract
- contract=$(basename "$1" ".sol")
-
- solc --overwrite --optimize --optimize-runs $OPTIMIZE_RUNS --metadata-hash none \
- -o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \
- --abi --bin --allow-paths "$ROOT"/contracts/src/v0.8\
- "$ROOT"/contracts/src/v0.8/"$1"
-}
-
-# Contracts
-compileContract transmission/dev/ERC-4337/SCA.sol
-compileContract transmission/dev/ERC-4337/Paymaster.sol
-compileContract transmission/dev/ERC-4337/SmartContractAccountFactory.sol
-
-# Testhelpers
-compileContract transmission/dev/testhelpers/SmartContractAccountHelper.sol
-compileContract transmission/dev/testhelpers/Greeter.sol
-
-# Vendor
-compileContract vendor/entrypoint/core/EntryPoint.sol
diff --git a/contracts/src/v0.8/transmission/dev/ERC-4337/Paymaster.sol b/contracts/src/v0.8/transmission/dev/ERC-4337/Paymaster.sol
deleted file mode 100644
index 932d35006c4..00000000000
--- a/contracts/src/v0.8/transmission/dev/ERC-4337/Paymaster.sol
+++ /dev/null
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.19;
-
-import {IPaymaster} from "../../../vendor/entrypoint/interfaces/IPaymaster.sol";
-import {SCALibrary} from "./SCALibrary.sol";
-import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol";
-import {AggregatorV3Interface} from "../../../shared/interfaces/AggregatorV3Interface.sol";
-import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol";
-import {UserOperation} from "../../../vendor/entrypoint/interfaces/UserOperation.sol";
-import {_packValidationData} from "../../../vendor/entrypoint/core/Helpers.sol";
-
-/// @dev LINK token paymaster implementation.
-/// TODO: more documentation.
-contract Paymaster is IPaymaster, ConfirmedOwner {
- error OnlyCallableFromLink();
- error InvalidCalldata();
- error Unauthorized(address sender, address validator);
- error UserOperationAlreadyTried(bytes32 userOpHash);
- error InsufficientFunds(uint256 juelsNeeded, uint256 subscriptionBalance);
-
- LinkTokenInterface public immutable i_linkToken;
- AggregatorV3Interface public immutable i_linkEthFeed;
- address public immutable i_entryPoint;
-
- struct Config {
- uint32 stalenessSeconds;
- int256 fallbackWeiPerUnitLink;
- }
- Config public s_config;
-
- mapping(bytes32 => bool) internal s_userOpHashMapping;
- mapping(address => uint256) internal s_subscriptions;
-
- constructor(
- LinkTokenInterface linkToken,
- AggregatorV3Interface linkEthFeed,
- address entryPoint
- ) ConfirmedOwner(msg.sender) {
- i_linkToken = linkToken;
- i_linkEthFeed = linkEthFeed;
- i_entryPoint = entryPoint;
- }
-
- function setConfig(uint32 stalenessSeconds, int256 fallbackWeiPerUnitLink) external onlyOwner {
- s_config = Config({stalenessSeconds: stalenessSeconds, fallbackWeiPerUnitLink: fallbackWeiPerUnitLink});
- }
-
- function onTokenTransfer(address /* _sender */, uint256 _amount, bytes calldata _data) external {
- if (msg.sender != address(i_linkToken)) {
- revert OnlyCallableFromLink();
- }
- if (_data.length != 32) {
- revert InvalidCalldata();
- }
-
- address subscription = abi.decode(_data, (address));
- s_subscriptions[subscription] += _amount;
- }
-
- function validatePaymasterUserOp(
- UserOperation calldata userOp,
- bytes32 userOpHash,
- uint256 maxCost
- ) external returns (bytes memory context, uint256 validationData) {
- if (msg.sender != i_entryPoint) {
- revert Unauthorized(msg.sender, i_entryPoint);
- }
- if (s_userOpHashMapping[userOpHash]) {
- revert UserOperationAlreadyTried(userOpHash);
- }
-
- uint256 extraCostJuels = _handleExtraCostJuels(userOp);
- uint256 costJuels = _getCostJuels(maxCost) + extraCostJuels;
- if (s_subscriptions[userOp.sender] < costJuels) {
- revert InsufficientFunds(costJuels, s_subscriptions[userOp.sender]);
- }
-
- s_userOpHashMapping[userOpHash] = true;
- return (abi.encode(userOp.sender, extraCostJuels), _packValidationData(false, 0, 0)); // success
- }
-
- /// @dev Calculates any extra LINK cost for the user operation, based on the funding type passed to the
- /// @dev paymaster. Handles funding the LINK token funding described in the user operation.
- /// TODO: add logic for subscription top-up.
- function _handleExtraCostJuels(UserOperation calldata userOp) internal returns (uint256 extraCost) {
- if (userOp.paymasterAndData.length == 20) {
- return 0; // no extra data, stop here
- }
-
- uint8 paymentType = uint8(userOp.paymasterAndData[20]);
-
- // For direct funding, use top-up logic.
- if (paymentType == uint8(SCALibrary.LinkPaymentType.DIRECT_FUNDING)) {
- SCALibrary.DirectFundingData memory directFundingData = abi.decode(
- userOp.paymasterAndData[21:],
- (SCALibrary.DirectFundingData)
- );
- if (
- directFundingData.topupThreshold != 0 &&
- i_linkToken.balanceOf(directFundingData.recipient) < directFundingData.topupThreshold
- ) {
- i_linkToken.transfer(directFundingData.recipient, directFundingData.topupAmount);
- extraCost = directFundingData.topupAmount;
- }
- }
- return extraCost;
- }
-
- /// @dev Deducts user subscription balance after execution.
- function postOp(PostOpMode /* mode */, bytes calldata context, uint256 actualGasCost) external {
- if (msg.sender != i_entryPoint) {
- revert Unauthorized(msg.sender, i_entryPoint);
- }
- (address sender, uint256 extraCostJuels) = abi.decode(context, (address, uint256));
- s_subscriptions[sender] -= (_getCostJuels(actualGasCost) + extraCostJuels);
- }
-
- function _getCostJuels(uint256 costWei) internal view returns (uint256 costJuels) {
- costJuels = (1e18 * costWei) / uint256(_getFeedData());
- return costJuels;
- }
-
- function _getFeedData() internal view returns (int256) {
- uint32 stalenessSeconds = s_config.stalenessSeconds;
- bool staleFallback = stalenessSeconds > 0;
- uint256 timestamp;
- int256 weiPerUnitLink;
- (, weiPerUnitLink, , timestamp, ) = i_linkEthFeed.latestRoundData();
- if (staleFallback && stalenessSeconds < block.timestamp - timestamp) {
- weiPerUnitLink = s_config.fallbackWeiPerUnitLink;
- }
- return weiPerUnitLink;
- }
-}
diff --git a/contracts/src/v0.8/transmission/dev/ERC-4337/SCA.sol b/contracts/src/v0.8/transmission/dev/ERC-4337/SCA.sol
deleted file mode 100644
index 589c55f5b3b..00000000000
--- a/contracts/src/v0.8/transmission/dev/ERC-4337/SCA.sol
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity 0.8.19;
-
-import {IAccount} from "../../../vendor/entrypoint/interfaces/IAccount.sol";
-import {SCALibrary} from "./SCALibrary.sol";
-import {UserOperation} from "../../../vendor/entrypoint/interfaces/UserOperation.sol";
-import {_packValidationData} from "../../../vendor/entrypoint/core/Helpers.sol";
-
-/// @dev Smart Contract Account, a contract deployed for a single user and that allows
-/// @dev them to invoke meta-transactions.
-/// TODO: Consider making the Smart Contract Account upgradeable.
-contract SCA is IAccount {
- uint256 public s_nonce;
- address public immutable i_owner;
- address public immutable i_entryPoint;
-
- error IncorrectNonce(uint256 currentNonce, uint256 nonceGiven);
- error NotAuthorized(address sender);
- error BadFormatOrOOG();
- error TransactionExpired(uint256 deadline, uint256 currentTimestamp);
- error InvalidSignature(bytes32 operationHash, address owner);
-
- // Assign the owner of this contract upon deployment.
- constructor(address owner, address entryPoint) {
- i_owner = owner;
- i_entryPoint = entryPoint;
- }
-
- /// @dev Validates the user operation via a signature check.
- /// TODO: Utilize a "validAfter" for a tx to be only valid _after_ a certain time.
- function validateUserOp(
- UserOperation calldata userOp,
- bytes32 userOpHash,
- uint256 /* missingAccountFunds - unused in favor of paymaster */
- ) external returns (uint256 validationData) {
- if (userOp.nonce != s_nonce) {
- // Revert for non-signature errors.
- revert IncorrectNonce(s_nonce, userOp.nonce);
- }
-
- // Verify signature on hash.
- bytes32 fullHash = SCALibrary._getUserOpFullHash(userOpHash, address(this));
- bytes memory signature = userOp.signature;
- if (SCALibrary._recoverSignature(signature, fullHash) != i_owner) {
- return _packValidationData(true, 0, 0); // signature error
- }
- s_nonce++;
-
- // Unpack deadline, return successful signature.
- (, , uint48 deadline, ) = abi.decode(userOp.callData[4:], (address, uint256, uint48, bytes));
- return _packValidationData(false, deadline, 0);
- }
-
- /// @dev Execute a transaction on behalf of the owner. This function can only
- /// @dev be called by the EntryPoint contract, and assumes that `validateUserOp` has succeeded.
- function executeTransactionFromEntryPoint(address to, uint256 value, uint48 deadline, bytes calldata data) external {
- if (msg.sender != i_entryPoint) {
- revert NotAuthorized(msg.sender);
- }
- if (deadline != 0 && block.timestamp > deadline) {
- revert TransactionExpired(deadline, block.timestamp);
- }
-
- // Execute transaction. Bubble up an error if found.
- (bool success, bytes memory returnData) = to.call{value: value}(data);
- if (!success) {
- if (returnData.length == 0) revert BadFormatOrOOG();
- assembly {
- revert(add(32, returnData), mload(returnData))
- }
- }
- }
-}
diff --git a/contracts/src/v0.8/transmission/dev/ERC-4337/SCALibrary.sol b/contracts/src/v0.8/transmission/dev/ERC-4337/SCALibrary.sol
deleted file mode 100644
index 095a3428ef4..00000000000
--- a/contracts/src/v0.8/transmission/dev/ERC-4337/SCALibrary.sol
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.19;
-
-library SCALibrary {
- // keccak256("EIP712Domain(uint256 chainId, address verifyingContract)");
- bytes32 internal constant DOMAIN_SEPARATOR = hex"1c7d3b72b37a35523e273aaadd7b4cd66f618bb81429ab053412d51f50ccea61";
-
- // keccak256("executeTransactionFromEntryPoint(address to, uint256 value, bytes calldata data)");
- bytes32 internal constant TYPEHASH = hex"4750045d47fce615521b32cee713ff8db50147e98aec5ca94926b52651ca3fa0";
-
- enum LinkPaymentType {
- DIRECT_FUNDING,
- SUBSCRIPTION // TODO: implement
- }
-
- struct DirectFundingData {
- address recipient; // recipient of the top-up
- uint256 topupThreshold; // set to zero to disable auto-topup
- uint256 topupAmount;
- }
-
- function _getUserOpFullHash(bytes32 userOpHash, address scaAddress) internal view returns (bytes32 fullHash) {
- bytes32 hashOfEncoding = keccak256(abi.encode(SCALibrary.TYPEHASH, userOpHash));
- fullHash = keccak256(
- abi.encodePacked(
- bytes1(0x19),
- bytes1(0x01),
- SCALibrary.DOMAIN_SEPARATOR,
- block.chainid,
- scaAddress,
- hashOfEncoding
- )
- );
- return fullHash;
- }
-
- function _recoverSignature(bytes memory signature, bytes32 fullHash) internal pure returns (address) {
- bytes32 r;
- bytes32 s;
- assembly {
- r := mload(add(signature, 0x20))
- s := mload(add(signature, 0x40))
- }
- uint8 v = uint8(signature[64]);
-
- return ecrecover(fullHash, v + 27, r, s);
- }
-}
diff --git a/contracts/src/v0.8/transmission/dev/ERC-4337/SmartContractAccountFactory.sol b/contracts/src/v0.8/transmission/dev/ERC-4337/SmartContractAccountFactory.sol
deleted file mode 100644
index f27c8e15cf6..00000000000
--- a/contracts/src/v0.8/transmission/dev/ERC-4337/SmartContractAccountFactory.sol
+++ /dev/null
@@ -1,33 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.19;
-
-contract SmartContractAccountFactory {
- event ContractCreated(address scaAddress);
-
- error DeploymentFailed();
-
- /// @dev Use create2 to deploy a new Smart Contract Account.
- /// @dev See EIP-1014 for more on CREATE2.
- /// TODO: Return the address of the Smart Contract Account even if it is already
- /// deployed.
- function deploySmartContractAccount(
- bytes32 abiEncodedOwnerAddress,
- bytes memory initCode
- ) external payable returns (address scaAddress) {
- assembly {
- scaAddress := create2(
- 0, // value - left at zero here
- add(0x20, initCode), // initialization bytecode
- mload(initCode), // length of initialization bytecode
- abiEncodedOwnerAddress // user-defined nonce to ensure unique SCA addresses
- )
- }
- if (scaAddress == address(0)) {
- revert DeploymentFailed();
- }
-
- emit ContractCreated(scaAddress);
-
- return scaAddress;
- }
-}
diff --git a/contracts/src/v0.8/transmission/dev/testhelpers/Greeter.sol b/contracts/src/v0.8/transmission/dev/testhelpers/Greeter.sol
deleted file mode 100644
index 5851c86581e..00000000000
--- a/contracts/src/v0.8/transmission/dev/testhelpers/Greeter.sol
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.19;
-
-/// @dev Ownerless greeter contract.
-contract Greeter {
- string private s_greeting;
-
- function setGreeting(string memory greeting) external {
- s_greeting = greeting;
- }
-
- function getGreeting() external view returns (string memory) {
- return s_greeting;
- }
-}
diff --git a/contracts/src/v0.8/transmission/dev/testhelpers/SmartContractAccountHelper.sol b/contracts/src/v0.8/transmission/dev/testhelpers/SmartContractAccountHelper.sol
deleted file mode 100644
index b080484d8cc..00000000000
--- a/contracts/src/v0.8/transmission/dev/testhelpers/SmartContractAccountHelper.sol
+++ /dev/null
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.19;
-
-import {SCA} from "../ERC-4337/SCA.sol";
-import {SmartContractAccountFactory} from "../ERC-4337/SmartContractAccountFactory.sol";
-import {SCALibrary} from "../ERC-4337/SCALibrary.sol";
-
-library SmartContractAccountHelper {
- bytes internal constant INITIALIZE_CODE = type(SCA).creationCode;
-
- function getFullEndTxEncoding(
- address endContract,
- uint256 value,
- uint256 deadline,
- bytes memory data
- ) public view returns (bytes memory encoding) {
- encoding = bytes.concat(
- SCA.executeTransactionFromEntryPoint.selector,
- abi.encode(endContract, value, block.timestamp + deadline, data)
- );
- return encoding;
- }
-
- function getFullHashForSigning(bytes32 userOpHash, address scaAddress) public view returns (bytes32) {
- return SCALibrary._getUserOpFullHash(userOpHash, scaAddress);
- }
-
- function getSCAInitCodeWithConstructor(
- address owner,
- address entryPoint
- ) public pure returns (bytes memory initCode) {
- initCode = bytes.concat(INITIALIZE_CODE, abi.encode(owner, entryPoint));
- return initCode;
- }
-
- function getInitCode(
- address factory,
- address owner,
- address entryPoint
- ) external pure returns (bytes memory initCode) {
- bytes32 salt = bytes32(uint256(uint160(owner)) << 96);
- bytes memory initializeCodeWithConstructor = bytes.concat(INITIALIZE_CODE, abi.encode(owner, entryPoint));
- initCode = bytes.concat(
- bytes20(address(factory)),
- abi.encodeWithSelector(
- SmartContractAccountFactory.deploySmartContractAccount.selector,
- salt,
- initializeCodeWithConstructor
- )
- );
- return initCode;
- }
-
- /// @dev Computes the smart contract address that results from a CREATE2 operation, per EIP-1014.
- function calculateSmartContractAccountAddress(
- address owner,
- address entryPoint,
- address factory
- ) external pure returns (address) {
- bytes32 salt = bytes32(uint256(uint160(owner)) << 96);
- bytes memory initializeCodeWithConstructor = bytes.concat(INITIALIZE_CODE, abi.encode(owner, entryPoint));
- bytes32 initializeCodeHash = keccak256(initializeCodeWithConstructor);
- return address(uint160(uint256(keccak256(abi.encodePacked(hex"ff", address(factory), salt, initializeCodeHash)))));
- }
-
- function getAbiEncodedDirectRequestData(
- address recipient,
- uint256 topupThreshold,
- uint256 topupAmount
- ) external pure returns (bytes memory) {
- SCALibrary.DirectFundingData memory data = SCALibrary.DirectFundingData({
- recipient: recipient,
- topupThreshold: topupThreshold,
- topupAmount: topupAmount
- });
- return abi.encode(data);
- }
-}
diff --git a/contracts/src/v0.8/transmission/test/BaseTest.t.sol b/contracts/src/v0.8/transmission/test/BaseTest.t.sol
deleted file mode 100644
index 4da698d1740..00000000000
--- a/contracts/src/v0.8/transmission/test/BaseTest.t.sol
+++ /dev/null
@@ -1,17 +0,0 @@
-pragma solidity ^0.8.0;
-
-import {Test} from "forge-std/Test.sol";
-
-contract BaseTest is Test {
- bool private s_baseTestInitialized;
- address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e;
-
- function setUp() public virtual {
- // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance.
- if (s_baseTestInitialized) return;
- s_baseTestInitialized = true;
-
- // Set msg.sender to OWNER until changePrank or stopPrank is called
- vm.startPrank(OWNER);
- }
-}
diff --git a/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol b/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol
deleted file mode 100644
index fdfe190de26..00000000000
--- a/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol
+++ /dev/null
@@ -1,365 +0,0 @@
-pragma solidity 0.8.19;
-
-import "../../shared/interfaces/LinkTokenInterface.sol";
-
-import "./BaseTest.t.sol";
-import "../dev/ERC-4337/SmartContractAccountFactory.sol";
-import "../dev/testhelpers/SmartContractAccountHelper.sol";
-import "../dev/ERC-4337/SCA.sol";
-import "../dev/testhelpers/Greeter.sol";
-import "../dev/ERC-4337/Paymaster.sol";
-import "../../transmission/dev/ERC-4337/SCALibrary.sol";
-import "../../mocks/MockLinkToken.sol";
-import "../../tests/MockV3Aggregator.sol";
-import "../../vrf/mocks/VRFCoordinatorMock.sol";
-import "../../vrf/testhelpers/VRFConsumer.sol";
-
-import "../../vendor/entrypoint/interfaces/UserOperation.sol";
-import "../../vendor/entrypoint/core/EntryPoint.sol";
-import "../../vendor/entrypoint/interfaces/IEntryPoint.sol";
-
-/*--------------------------------------------------------------------------------------------------------------------+
-| EIP 712 + 1014 + 4337 |
-| ________________ |
-| This implementation allows for meta-transactions to be signed by end-users and posted on-chain by executors. It |
-| utilizes the following components: |
-| - EIP-712: The method by which meta-transactions are authorized. |
-| - EIP-1014: The method by which the Smart Contract Account is generated. |
-| - EIP-4337: The method by which meta-transactions are executed. |
-| |
-| The below tests illustrate end-user flows for interacting with this meta-transaction system. For users with |
-| existing Smart Contract Accounts (SCAs), they simply sign off on the operation, after which the executor |
-| invokes the EntryPoint that authorizes the operation on the end-user's SCA, and then execute the transaction |
-| as the SCA. For users without existing SCAs, EIP-1014 ensures that the address of an SCA can be known in advance, |
-| so users can sign-off on transactions that will be executed by a not-yet-deployed SCA. The EntryPoint contract |
-| takes advantage of this functionality and allows for the SCA to be created in the same user operation that invokes |
-| it, and the end-user signs off on this creation-and-execution flow. After the initial creation-and-execution, the |
-| SCA is reused for future transactions. |
-| |
-| End-Dapps/protocols do not need to be EIP-2771-compliant or accommodate any other kind of transaction standard. |
-| They can be interacted with out-of-the-box through the SCA, which acts in place of the user's EOA as their |
-| immutable identity. |
-| |
--+---------------------------------------------------------------------------------------------------------------------*/
-
-contract EIP_712_1014_4337 is BaseTest {
- event RandomnessRequest(address indexed sender, bytes32 indexed keyHash, uint256 indexed seed, uint256 fee);
-
- address internal constant LINK_WHALE = 0xD883a6A1C22fC4AbFE938a5aDF9B2Cc31b1BF18B;
- address internal ENTRY_POINT;
-
- Greeter greeter;
- EntryPoint entryPoint;
- MockV3Aggregator linkEthFeed;
-
- // Randomly generated private/public key pair.
- uint256 END_USER_PKEY = uint256(bytes32(hex"99d518dbfea4b4ec301390f7e26d53d711fa1ca0c1a6e4cbed89617d4c578a8e"));
- address END_USER = 0xB6708257D4E1bf0b8C144793fc2Ff3193C737ed1;
-
- function setUp() public override {
- BaseTest.setUp();
- // Fund user accounts;
- vm.deal(END_USER, 10_000 ether);
- vm.deal(LINK_WHALE, 10_000 ether);
-
- // Impersonate a LINK whale.
- changePrank(LINK_WHALE);
-
- // Create simple greeter contract.
- greeter = new Greeter();
- assertEq("", greeter.getGreeting());
-
- // Create entry point contract.
- entryPoint = new EntryPoint();
- ENTRY_POINT = address(entryPoint);
-
- // Deploy link/eth feed.
- linkEthFeed = new MockV3Aggregator(18, 5000000000000000); // .005 ETH
- }
-
- /// @dev Test case for user that already has a Smart Contract Account.
- /// @dev EntryPoint.sol should use the existing SCA to execute the meta transaction.
- function testEIP712EIP4337WithExistingSmartContractAccount() public {
- // Pre-calculate user smart contract account address.
- SmartContractAccountFactory factory = new SmartContractAccountFactory();
- address toDeployAddress = SmartContractAccountHelper.calculateSmartContractAccountAddress(
- END_USER,
- ENTRY_POINT,
- address(factory)
- );
-
- // Deploy the end-contract.
- bytes32 salt = bytes32(uint256(uint160(END_USER)) << 96);
- bytes memory fullInitializeCode = SmartContractAccountHelper.getSCAInitCodeWithConstructor(END_USER, ENTRY_POINT);
- factory.deploySmartContractAccount(salt, fullInitializeCode);
- changePrank(END_USER);
-
- // Ensure a correct deployment and a functioning end-contract.
- uint256 contractCodeSize;
- assembly {
- contractCodeSize := extcodesize(toDeployAddress)
- }
- assertTrue(contractCodeSize > 0);
- assertEq(END_USER, SCA(toDeployAddress).i_owner());
-
- // Create the calldata for a setGreeting call.
- string memory greeting = "hi";
- bytes memory encodedGreetingCall = bytes.concat(Greeter.setGreeting.selector, abi.encode(greeting)); // abi.encodeWithSelector equivalent
-
- // Produce the final full end-tx encoding, to be used as calldata in the user operation.
- bytes memory fullEncoding = SmartContractAccountHelper.getFullEndTxEncoding(
- address(greeter),
- uint256(0),
- 0,
- encodedGreetingCall
- );
-
- // Construct the user operation.
- UserOperation memory op = UserOperation({
- sender: toDeployAddress,
- nonce: 0,
- initCode: "",
- callData: fullEncoding,
- callGasLimit: 1_000_000,
- verificationGasLimit: 1_000_000,
- preVerificationGas: 10_000,
- maxFeePerGas: 100,
- maxPriorityFeePerGas: 200,
- paymasterAndData: "",
- signature: ""
- });
-
- // Sign user operation.
- bytes32 userOpHash = entryPoint.getUserOpHash(op);
- bytes32 fullHash = SCALibrary._getUserOpFullHash(userOpHash, toDeployAddress);
- (uint8 v, bytes32 r, bytes32 s) = vm.sign(END_USER_PKEY, fullHash);
- op.signature = abi.encodePacked(r, s, v - 27);
-
- // Deposit funds for the transaction.
- entryPoint.depositTo{value: 10 ether}(toDeployAddress);
-
- // Execute the user operation.
- UserOperation[] memory operations = new UserOperation[](1);
- operations[0] = op;
- entryPoint.handleOps(operations, payable(END_USER));
-
- // Assert that the greeting was set.
- assertEq("hi", Greeter(greeter).getGreeting());
- assertEq(SCA(toDeployAddress).s_nonce(), uint256(1));
- }
-
- /// @dev Test case for fresh user, EntryPoint.sol should generate a
- /// @dev Smart Contract Account for them and execute the meta transaction.
- function testEIP712EIP4337AndCreateSmartContractAccount() public {
- // Pre-calculate user smart contract account address.
- SmartContractAccountFactory factory = new SmartContractAccountFactory();
- address toDeployAddress = SmartContractAccountHelper.calculateSmartContractAccountAddress(
- END_USER,
- ENTRY_POINT,
- address(factory)
- );
-
- // Construct initCode byte array.
- bytes memory fullInitializeCode = SmartContractAccountHelper.getInitCode(address(factory), END_USER, ENTRY_POINT);
-
- // Create the calldata for a setGreeting call.
- string memory greeting = "bye";
- bytes memory encodedGreetingCall = bytes.concat(Greeter.setGreeting.selector, abi.encode(greeting));
-
- // Produce the final full end-tx encoding, to be used as calldata in the user operation.
- bytes memory fullEncoding = SmartContractAccountHelper.getFullEndTxEncoding(
- address(greeter),
- uint256(0),
- 0,
- encodedGreetingCall
- );
-
- // Construct the user operation.
- UserOperation memory op = UserOperation({
- sender: toDeployAddress,
- nonce: 0,
- initCode: fullInitializeCode,
- callData: fullEncoding,
- callGasLimit: 1_000_000,
- verificationGasLimit: 1_000_000,
- preVerificationGas: 10_000,
- maxFeePerGas: 100,
- maxPriorityFeePerGas: 200,
- paymasterAndData: "",
- signature: ""
- });
-
- // Sign user operation.
- bytes32 userOpHash = entryPoint.getUserOpHash(op);
- bytes32 fullHash = SCALibrary._getUserOpFullHash(userOpHash, toDeployAddress);
- (uint8 v, bytes32 r, bytes32 s) = vm.sign(END_USER_PKEY, fullHash);
- op.signature = abi.encodePacked(r, s, v - 27);
-
- // Deposit funds for the transaction.
- entryPoint.depositTo{value: 10 ether}(toDeployAddress);
-
- // Execute the user operation.
- UserOperation[] memory operations = new UserOperation[](1);
- operations[0] = op;
- entryPoint.handleOps(operations, payable(END_USER));
-
- // Assert that the greeting was set.
- assertEq("bye", Greeter(greeter).getGreeting());
- assertEq(SCA(toDeployAddress).s_nonce(), uint256(1));
- assertEq(SCA(toDeployAddress).i_owner(), END_USER);
- }
-
- /// @dev Test case for a user executing a setGreeting with a LINK token paymaster.
- function testEIP712EIP4337AndCreateSmartContractAccountWithPaymaster() public {
- // Pre-calculate user smart contract account address.
- SmartContractAccountFactory factory = new SmartContractAccountFactory();
- address toDeployAddress = SmartContractAccountHelper.calculateSmartContractAccountAddress(
- END_USER,
- ENTRY_POINT,
- address(factory)
- );
-
- // Construct initCode byte array.
- bytes memory fullInitializeCode = SmartContractAccountHelper.getInitCode(address(factory), END_USER, ENTRY_POINT);
-
- // Create the calldata for a setGreeting call.
- string memory greeting = "good day";
- bytes memory encodedGreetingCall = bytes.concat(Greeter.setGreeting.selector, abi.encode(greeting));
-
- // Produce the final full end-tx encoding, to be used as calldata in the user operation.
- bytes memory fullEncoding = SmartContractAccountHelper.getFullEndTxEncoding(
- address(greeter),
- uint256(0),
- 0,
- encodedGreetingCall
- );
-
- // Create Link token, and deposit into paymaster.
- MockLinkToken linkToken = new MockLinkToken();
- Paymaster paymaster = new Paymaster(LinkTokenInterface(address(linkToken)), linkEthFeed, ENTRY_POINT);
- linkToken.transferAndCall(address(paymaster), 1000 ether, abi.encode(address(toDeployAddress)));
-
- // Construct the user opeartion.
- UserOperation memory op = UserOperation({
- sender: toDeployAddress,
- nonce: 0,
- initCode: fullInitializeCode,
- callData: fullEncoding,
- callGasLimit: 1_000_000,
- verificationGasLimit: 1_500_000,
- preVerificationGas: 10_000,
- maxFeePerGas: 100,
- maxPriorityFeePerGas: 200,
- paymasterAndData: abi.encodePacked(address(paymaster)),
- signature: ""
- });
-
- // Sign user operation.
- bytes32 userOpHash = entryPoint.getUserOpHash(op);
- bytes32 fullHash = SCALibrary._getUserOpFullHash(userOpHash, toDeployAddress);
- (uint8 v, bytes32 r, bytes32 s) = vm.sign(END_USER_PKEY, fullHash);
- op.signature = abi.encodePacked(r, s, v - 27);
-
- // Deposit funds for the transaction.
- entryPoint.depositTo{value: 10 ether}(address(paymaster));
-
- // Execute the user operation.
- UserOperation[] memory operations = new UserOperation[](1);
- operations[0] = op;
- entryPoint.handleOps(operations, payable(END_USER));
-
- // Assert that the greeting was set.
- assertEq("good day", Greeter(greeter).getGreeting());
- assertEq(SCA(toDeployAddress).s_nonce(), uint256(1));
- }
-
- /// @dev Test case for a VRF Request via LINK token paymaster and an SCA.
- function testEIP712EIP4337AndCreateSmartContractAccountWithPaymasterForVRFRequest() public {
- // Pre-calculate user smart contract account address.
- SmartContractAccountFactory factory = new SmartContractAccountFactory();
- address toDeployAddress = SmartContractAccountHelper.calculateSmartContractAccountAddress(
- END_USER,
- ENTRY_POINT,
- address(factory)
- );
-
- // Construct initCode byte array.
- bytes memory fullInitializeCode = SmartContractAccountHelper.getInitCode(address(factory), END_USER, ENTRY_POINT);
-
- // Create the calldata for a VRF request.
- bytes32 keyhash = bytes32(uint256(123));
- uint256 fee = 1 ether;
- bytes memory encodedVRFRequestCallData = bytes.concat(
- VRFConsumer.doRequestRandomness.selector,
- abi.encode(keyhash, fee)
- );
-
- // Create the VRF Contracts
- MockLinkToken linkToken = new MockLinkToken();
- VRFCoordinatorMock vrfCoordinator = new VRFCoordinatorMock(address(linkToken));
- VRFConsumer vrfConsumer = new VRFConsumer(address(vrfCoordinator), address(linkToken));
-
- // Produce the final full end-tx encoding, to be used as calldata in the user operation.
- bytes memory fullEncoding = SmartContractAccountHelper.getFullEndTxEncoding(
- address(vrfConsumer), // end-contract
- uint256(0), // value
- 0, // timeout (seconds)
- encodedVRFRequestCallData
- );
-
- // Create Link token, and deposit into paymaster.
- Paymaster paymaster = new Paymaster(LinkTokenInterface(address(linkToken)), linkEthFeed, ENTRY_POINT);
- linkToken.transferAndCall(address(paymaster), 1000 ether, abi.encode(address(toDeployAddress)));
-
- // Construct direct funding data.
- SCALibrary.DirectFundingData memory directFundingData = SCALibrary.DirectFundingData({
- recipient: address(vrfConsumer),
- topupThreshold: 1,
- topupAmount: 10 ether
- });
-
- // Construct the user operation.
- UserOperation memory op = UserOperation({
- sender: toDeployAddress,
- nonce: 0,
- initCode: fullInitializeCode,
- callData: fullEncoding,
- callGasLimit: 200_000,
- verificationGasLimit: 1_000_000,
- preVerificationGas: 10_000,
- maxFeePerGas: 10,
- maxPriorityFeePerGas: 10,
- paymasterAndData: abi.encodePacked(address(paymaster), uint8(0), abi.encode(directFundingData)),
- signature: ""
- });
-
- // Sign user operation.
- bytes32 fullHash = SCALibrary._getUserOpFullHash(entryPoint.getUserOpHash(op), toDeployAddress);
- op.signature = getSignature(fullHash);
-
- // Deposit funds for the transaction.
- entryPoint.depositTo{value: 10 ether}(address(paymaster));
-
- // Assert correct log is emitted for the end-contract vrf request.
- vm.expectEmit(true, true, true, true);
- emit RandomnessRequest(
- address(vrfConsumer),
- keyhash,
- 0, // seed - we use a zero seed
- fee
- );
-
- // Execute the user operation.
- UserOperation[] memory operations = new UserOperation[](1);
- operations[0] = op;
-
- // Execute user operation and ensure correct outcome.
- entryPoint.handleOps(operations, payable(END_USER));
- assertEq(SCA(toDeployAddress).s_nonce(), uint256(1));
- }
-
- function getSignature(bytes32 h) internal view returns (bytes memory) {
- (uint8 v, bytes32 r, bytes32 s) = vm.sign(END_USER_PKEY, h);
- return abi.encodePacked(r, s, v - 27);
- }
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/core/EntryPoint.sol b/contracts/src/v0.8/vendor/entrypoint/core/EntryPoint.sol
deleted file mode 100644
index 86a34b07bf7..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/core/EntryPoint.sol
+++ /dev/null
@@ -1,861 +0,0 @@
-/**
- ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.
- ** Only one instance required on each chain.
- **/
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-/* solhint-disable avoid-low-level-calls */
-/* solhint-disable no-inline-assembly */
-
-import "../interfaces/IAccount.sol";
-import "../interfaces/IPaymaster.sol";
-import "../interfaces/IEntryPoint.sol";
-
-import "../utils/Exec.sol";
-import "./StakeManager.sol";
-import "./SenderCreator.sol";
-import "./Helpers.sol";
-
-contract EntryPoint is IEntryPoint, StakeManager {
- using UserOperationLib for UserOperation;
-
- SenderCreator private immutable senderCreator = new SenderCreator();
-
- // internal value used during simulation: need to query aggregator.
- address private constant SIMULATE_FIND_AGGREGATOR = address(1);
-
- // marker for inner call revert on out of gas
- bytes32 private constant INNER_OUT_OF_GAS = hex"deaddead";
-
- uint256 private constant REVERT_REASON_MAX_LEN = 2048;
-
- /**
- * for simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value
- * in case of signature failure, instead of revert.
- */
- uint256 public constant SIG_VALIDATION_FAILED = 1;
-
- /**
- * compensate the caller's beneficiary address with the collected fees of all UserOperations.
- * @param beneficiary the address to receive the fees
- * @param amount amount to transfer.
- */
- function _compensate(address payable beneficiary, uint256 amount) internal {
- require(beneficiary != address(0), "AA90 invalid beneficiary");
- (bool success, ) = beneficiary.call{value: amount}("");
- require(success, "AA91 failed send to beneficiary");
- }
-
- /**
- * execute a user op
- * @param opIndex index into the opInfo array
- * @param userOp the userOp to execute
- * @param opInfo the opInfo filled by validatePrepayment for this userOp.
- * @return collected the total amount this userOp paid.
- */
- function _executeUserOp(
- uint256 opIndex,
- UserOperation calldata userOp,
- UserOpInfo memory opInfo
- ) private returns (uint256 collected) {
- uint256 preGas = gasleft();
- bytes memory context = getMemoryBytesFromOffset(opInfo.contextOffset);
-
- try this.innerHandleOp(userOp.callData, opInfo, context) returns (
- uint256 _actualGasCost
- ) {
- collected = _actualGasCost;
- } catch {
- bytes32 innerRevertCode;
- assembly {
- returndatacopy(0, 0, 32)
- innerRevertCode := mload(0)
- }
- // handleOps was called with gas limit too low. abort entire bundle.
- if (innerRevertCode == INNER_OUT_OF_GAS) {
- //report paymaster, since if it is not deliberately caused by the bundler,
- // it must be a revert caused by paymaster.
- revert FailedOp(opIndex, "AA95 out of gas");
- }
-
- uint256 actualGas = preGas - gasleft() + opInfo.preOpGas;
- collected = _handlePostOp(
- opIndex,
- IPaymaster.PostOpMode.postOpReverted,
- opInfo,
- context,
- actualGas
- );
- }
- }
-
- /**
- * Execute a batch of UserOperations.
- * no signature aggregator is used.
- * if any account requires an aggregator (that is, it returned an aggregator when
- * performing simulateValidation), then handleAggregatedOps() must be used instead.
- * @param ops the operations to execute
- * @param beneficiary the address to receive the fees
- */
- function handleOps(
- UserOperation[] calldata ops,
- address payable beneficiary
- ) public {
- uint256 opslen = ops.length;
- UserOpInfo[] memory opInfos = new UserOpInfo[](opslen);
-
- unchecked {
- for (uint256 i = 0; i < opslen; i++) {
- UserOpInfo memory opInfo = opInfos[i];
- (
- uint256 validationData,
- uint256 pmValidationData
- ) = _validatePrepayment(i, ops[i], opInfo);
- _validateAccountAndPaymasterValidationData(
- i,
- validationData,
- pmValidationData,
- address(0)
- );
- }
-
- uint256 collected = 0;
-
- for (uint256 i = 0; i < opslen; i++) {
- collected += _executeUserOp(i, ops[i], opInfos[i]);
- }
-
- _compensate(beneficiary, collected);
- } //unchecked
- }
-
- /**
- * Execute a batch of UserOperation with Aggregators
- * @param opsPerAggregator the operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts)
- * @param beneficiary the address to receive the fees
- */
- function handleAggregatedOps(
- UserOpsPerAggregator[] calldata opsPerAggregator,
- address payable beneficiary
- ) public {
- uint256 opasLen = opsPerAggregator.length;
- uint256 totalOps = 0;
- for (uint256 i = 0; i < opasLen; i++) {
- UserOpsPerAggregator calldata opa = opsPerAggregator[i];
- UserOperation[] calldata ops = opa.userOps;
- IAggregator aggregator = opa.aggregator;
-
- //address(1) is special marker of "signature error"
- require(
- address(aggregator) != address(1),
- "AA96 invalid aggregator"
- );
-
- if (address(aggregator) != address(0)) {
- // solhint-disable-next-line no-empty-blocks
- try aggregator.validateSignatures(ops, opa.signature) {} catch {
- revert SignatureValidationFailed(address(aggregator));
- }
- }
-
- totalOps += ops.length;
- }
-
- UserOpInfo[] memory opInfos = new UserOpInfo[](totalOps);
-
- uint256 opIndex = 0;
- for (uint256 a = 0; a < opasLen; a++) {
- UserOpsPerAggregator calldata opa = opsPerAggregator[a];
- UserOperation[] calldata ops = opa.userOps;
- IAggregator aggregator = opa.aggregator;
-
- uint256 opslen = ops.length;
- for (uint256 i = 0; i < opslen; i++) {
- UserOpInfo memory opInfo = opInfos[opIndex];
- (
- uint256 validationData,
- uint256 paymasterValidationData
- ) = _validatePrepayment(opIndex, ops[i], opInfo);
- _validateAccountAndPaymasterValidationData(
- i,
- validationData,
- paymasterValidationData,
- address(aggregator)
- );
- opIndex++;
- }
- }
-
- uint256 collected = 0;
- opIndex = 0;
- for (uint256 a = 0; a < opasLen; a++) {
- UserOpsPerAggregator calldata opa = opsPerAggregator[a];
- emit SignatureAggregatorChanged(address(opa.aggregator));
- UserOperation[] calldata ops = opa.userOps;
- uint256 opslen = ops.length;
-
- for (uint256 i = 0; i < opslen; i++) {
- collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);
- opIndex++;
- }
- }
- emit SignatureAggregatorChanged(address(0));
-
- _compensate(beneficiary, collected);
- }
-
- /// @inheritdoc IEntryPoint
- function simulateHandleOp(
- UserOperation calldata op,
- address target,
- bytes calldata targetCallData
- ) external override {
- UserOpInfo memory opInfo;
- _simulationOnlyValidations(op);
- (
- uint256 validationData,
- uint256 paymasterValidationData
- ) = _validatePrepayment(0, op, opInfo);
- ValidationData memory data = _intersectTimeRange(
- validationData,
- paymasterValidationData
- );
-
- numberMarker();
- uint256 paid = _executeUserOp(0, op, opInfo);
- numberMarker();
- bool targetSuccess;
- bytes memory targetResult;
- if (target != address(0)) {
- (targetSuccess, targetResult) = target.call(targetCallData);
- }
- revert ExecutionResult(
- opInfo.preOpGas,
- paid,
- data.validAfter,
- data.validUntil,
- targetSuccess,
- targetResult
- );
- }
-
- // A memory copy of UserOp static fields only.
- // Excluding: callData, initCode and signature. Replacing paymasterAndData with paymaster.
- struct MemoryUserOp {
- address sender;
- uint256 nonce;
- uint256 callGasLimit;
- uint256 verificationGasLimit;
- uint256 preVerificationGas;
- address paymaster;
- uint256 maxFeePerGas;
- uint256 maxPriorityFeePerGas;
- }
-
- struct UserOpInfo {
- MemoryUserOp mUserOp;
- bytes32 userOpHash;
- uint256 prefund;
- uint256 contextOffset;
- uint256 preOpGas;
- }
-
- /**
- * inner function to handle a UserOperation.
- * Must be declared "external" to open a call context, but it can only be called by handleOps.
- */
- function innerHandleOp(
- bytes memory callData,
- UserOpInfo memory opInfo,
- bytes calldata context
- ) external returns (uint256 actualGasCost) {
- uint256 preGas = gasleft();
- require(msg.sender == address(this), "AA92 internal call only");
- MemoryUserOp memory mUserOp = opInfo.mUserOp;
-
- uint256 callGasLimit = mUserOp.callGasLimit;
- unchecked {
- // handleOps was called with gas limit too low. abort entire bundle.
- if (
- gasleft() < callGasLimit + mUserOp.verificationGasLimit + 5000
- ) {
- assembly {
- mstore(0, INNER_OUT_OF_GAS)
- revert(0, 32)
- }
- }
- }
-
- IPaymaster.PostOpMode mode = IPaymaster.PostOpMode.opSucceeded;
- if (callData.length > 0) {
- bool success = Exec.call(mUserOp.sender, 0, callData, callGasLimit);
- if (!success) {
- bytes memory result = Exec.getReturnData(REVERT_REASON_MAX_LEN);
- if (result.length > 0) {
- emit UserOperationRevertReason(
- opInfo.userOpHash,
- mUserOp.sender,
- mUserOp.nonce,
- result
- );
- }
- mode = IPaymaster.PostOpMode.opReverted;
- }
- }
-
- unchecked {
- uint256 actualGas = preGas - gasleft() + opInfo.preOpGas;
- //note: opIndex is ignored (relevant only if mode==postOpReverted, which is only possible outside of innerHandleOp)
- return _handlePostOp(0, mode, opInfo, context, actualGas);
- }
- }
-
- /**
- * generate a request Id - unique identifier for this request.
- * the request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid.
- */
- function getUserOpHash(UserOperation calldata userOp)
- public
- view
- returns (bytes32)
- {
- return
- keccak256(abi.encode(userOp.hash(), address(this), block.chainid));
- }
-
- /**
- * copy general fields from userOp into the memory opInfo structure.
- */
- function _copyUserOpToMemory(
- UserOperation calldata userOp,
- MemoryUserOp memory mUserOp
- ) internal pure {
- mUserOp.sender = userOp.sender;
- mUserOp.nonce = userOp.nonce;
- mUserOp.callGasLimit = userOp.callGasLimit;
- mUserOp.verificationGasLimit = userOp.verificationGasLimit;
- mUserOp.preVerificationGas = userOp.preVerificationGas;
- mUserOp.maxFeePerGas = userOp.maxFeePerGas;
- mUserOp.maxPriorityFeePerGas = userOp.maxPriorityFeePerGas;
- bytes calldata paymasterAndData = userOp.paymasterAndData;
- if (paymasterAndData.length > 0) {
- require(
- paymasterAndData.length >= 20,
- "AA93 invalid paymasterAndData"
- );
- mUserOp.paymaster = address(bytes20(paymasterAndData[:20]));
- } else {
- mUserOp.paymaster = address(0);
- }
- }
-
- /**
- * Simulate a call to account.validateUserOp and paymaster.validatePaymasterUserOp.
- * @dev this method always revert. Successful result is ValidationResult error. other errors are failures.
- * @dev The node must also verify it doesn't use banned opcodes, and that it doesn't reference storage outside the account's data.
- * @param userOp the user operation to validate.
- */
- function simulateValidation(UserOperation calldata userOp) external {
- UserOpInfo memory outOpInfo;
-
- _simulationOnlyValidations(userOp);
- (
- uint256 validationData,
- uint256 paymasterValidationData
- ) = _validatePrepayment(0, userOp, outOpInfo);
- StakeInfo memory paymasterInfo = _getStakeInfo(
- outOpInfo.mUserOp.paymaster
- );
- StakeInfo memory senderInfo = _getStakeInfo(outOpInfo.mUserOp.sender);
- StakeInfo memory factoryInfo;
- {
- bytes calldata initCode = userOp.initCode;
- address factory = initCode.length >= 20
- ? address(bytes20(initCode[0:20]))
- : address(0);
- factoryInfo = _getStakeInfo(factory);
- }
-
- ValidationData memory data = _intersectTimeRange(
- validationData,
- paymasterValidationData
- );
- address aggregator = data.aggregator;
- bool sigFailed = aggregator == address(1);
- ReturnInfo memory returnInfo = ReturnInfo(
- outOpInfo.preOpGas,
- outOpInfo.prefund,
- sigFailed,
- data.validAfter,
- data.validUntil,
- getMemoryBytesFromOffset(outOpInfo.contextOffset)
- );
-
- if (aggregator != address(0) && aggregator != address(1)) {
- AggregatorStakeInfo memory aggregatorInfo = AggregatorStakeInfo(
- aggregator,
- _getStakeInfo(aggregator)
- );
- revert ValidationResultWithAggregation(
- returnInfo,
- senderInfo,
- factoryInfo,
- paymasterInfo,
- aggregatorInfo
- );
- }
- revert ValidationResult(
- returnInfo,
- senderInfo,
- factoryInfo,
- paymasterInfo
- );
- }
-
- function _getRequiredPrefund(MemoryUserOp memory mUserOp)
- internal
- pure
- returns (uint256 requiredPrefund)
- {
- unchecked {
- //when using a Paymaster, the verificationGasLimit is used also to as a limit for the postOp call.
- // our security model might call postOp eventually twice
- uint256 mul = mUserOp.paymaster != address(0) ? 3 : 1;
- uint256 requiredGas = mUserOp.callGasLimit +
- mUserOp.verificationGasLimit *
- mul +
- mUserOp.preVerificationGas;
-
- requiredPrefund = requiredGas * mUserOp.maxFeePerGas;
- }
- }
-
- // create the sender's contract if needed.
- function _createSenderIfNeeded(
- uint256 opIndex,
- UserOpInfo memory opInfo,
- bytes calldata initCode
- ) internal {
- if (initCode.length != 0) {
- address sender = opInfo.mUserOp.sender;
- if (sender.code.length != 0)
- revert FailedOp(opIndex, "AA10 sender already constructed");
- address sender1 = senderCreator.createSender{
- gas: opInfo.mUserOp.verificationGasLimit
- }(initCode);
- if (sender1 == address(0))
- revert FailedOp(opIndex, "AA13 initCode failed or OOG");
- if (sender1 != sender)
- revert FailedOp(opIndex, "AA14 initCode must return sender");
- if (sender1.code.length == 0)
- revert FailedOp(opIndex, "AA15 initCode must create sender");
- address factory = address(bytes20(initCode[0:20]));
- emit AccountDeployed(
- opInfo.userOpHash,
- sender,
- factory,
- opInfo.mUserOp.paymaster
- );
- }
- }
-
- /**
- * Get counterfactual sender address.
- * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation.
- * this method always revert, and returns the address in SenderAddressResult error
- * @param initCode the constructor code to be passed into the UserOperation.
- */
- function getSenderAddress(bytes calldata initCode) public {
- revert SenderAddressResult(senderCreator.createSender(initCode));
- }
-
- function _simulationOnlyValidations(UserOperation calldata userOp)
- internal
- view
- {
- // solhint-disable-next-line no-empty-blocks
- try
- this._validateSenderAndPaymaster(
- userOp.initCode,
- userOp.sender,
- userOp.paymasterAndData
- )
- {} catch Error(string memory revertReason) {
- if (bytes(revertReason).length != 0) {
- revert FailedOp(0, revertReason);
- }
- }
- }
-
- /**
- * Called only during simulation.
- * This function always reverts to prevent warm/cold storage differentiation in simulation vs execution.
- */
- function _validateSenderAndPaymaster(
- bytes calldata initCode,
- address sender,
- bytes calldata paymasterAndData
- ) external view {
- if (initCode.length == 0 && sender.code.length == 0) {
- // it would revert anyway. but give a meaningful message
- revert("AA20 account not deployed");
- }
- if (paymasterAndData.length >= 20) {
- address paymaster = address(bytes20(paymasterAndData[0:20]));
- if (paymaster.code.length == 0) {
- // it would revert anyway. but give a meaningful message
- revert("AA30 paymaster not deployed");
- }
- }
- // always revert
- revert("");
- }
-
- /**
- * call account.validateUserOp.
- * revert (with FailedOp) in case validateUserOp reverts, or account didn't send required prefund.
- * decrement account's deposit if needed
- */
- function _validateAccountPrepayment(
- uint256 opIndex,
- UserOperation calldata op,
- UserOpInfo memory opInfo,
- uint256 requiredPrefund
- )
- internal
- returns (
- uint256 gasUsedByValidateAccountPrepayment,
- uint256 validationData
- )
- {
- unchecked {
- uint256 preGas = gasleft();
- MemoryUserOp memory mUserOp = opInfo.mUserOp;
- address sender = mUserOp.sender;
- _createSenderIfNeeded(opIndex, opInfo, op.initCode);
- address paymaster = mUserOp.paymaster;
- numberMarker();
- uint256 missingAccountFunds = 0;
- if (paymaster == address(0)) {
- uint256 bal = balanceOf(sender);
- missingAccountFunds = bal > requiredPrefund
- ? 0
- : requiredPrefund - bal;
- }
- try
- IAccount(sender).validateUserOp{
- gas: mUserOp.verificationGasLimit
- }(op, opInfo.userOpHash, missingAccountFunds)
- returns (uint256 _validationData) {
- validationData = _validationData;
- } catch Error(string memory revertReason) {
- revert FailedOp(
- opIndex,
- string.concat("AA23 reverted: ", revertReason)
- );
- } catch {
- revert FailedOp(opIndex, "AA23 reverted (or OOG)");
- }
- if (paymaster == address(0)) {
- DepositInfo storage senderInfo = deposits[sender];
- uint256 deposit = senderInfo.deposit;
- if (requiredPrefund > deposit) {
- revert FailedOp(opIndex, "AA21 didn't pay prefund");
- }
- senderInfo.deposit = uint112(deposit - requiredPrefund);
- }
- gasUsedByValidateAccountPrepayment = preGas - gasleft();
- }
- }
-
- /**
- * In case the request has a paymaster:
- * Validate paymaster has enough deposit.
- * Call paymaster.validatePaymasterUserOp.
- * Revert with proper FailedOp in case paymaster reverts.
- * Decrement paymaster's deposit
- */
- function _validatePaymasterPrepayment(
- uint256 opIndex,
- UserOperation calldata op,
- UserOpInfo memory opInfo,
- uint256 requiredPreFund,
- uint256 gasUsedByValidateAccountPrepayment
- ) internal returns (bytes memory context, uint256 validationData) {
- unchecked {
- MemoryUserOp memory mUserOp = opInfo.mUserOp;
- uint256 verificationGasLimit = mUserOp.verificationGasLimit;
- require(
- verificationGasLimit > gasUsedByValidateAccountPrepayment,
- "AA41 too little verificationGas"
- );
- uint256 gas = verificationGasLimit -
- gasUsedByValidateAccountPrepayment;
-
- address paymaster = mUserOp.paymaster;
- DepositInfo storage paymasterInfo = deposits[paymaster];
- uint256 deposit = paymasterInfo.deposit;
- if (deposit < requiredPreFund) {
- revert FailedOp(opIndex, "AA31 paymaster deposit too low");
- }
- paymasterInfo.deposit = uint112(deposit - requiredPreFund);
- try
- IPaymaster(paymaster).validatePaymasterUserOp{gas: gas}(
- op,
- opInfo.userOpHash,
- requiredPreFund
- )
- returns (bytes memory _context, uint256 _validationData) {
- context = _context;
- validationData = _validationData;
- } catch Error(string memory revertReason) {
- revert FailedOp(
- opIndex,
- string.concat("AA33 reverted: ", revertReason)
- );
- } catch {
- revert FailedOp(opIndex, "AA33 reverted (or OOG)");
- }
- }
- }
-
- /**
- * revert if either account validationData or paymaster validationData is expired
- */
- function _validateAccountAndPaymasterValidationData(
- uint256 opIndex,
- uint256 validationData,
- uint256 paymasterValidationData,
- address expectedAggregator
- ) internal view {
- (address aggregator, bool outOfTimeRange) = _getValidationData(
- validationData
- );
- if (expectedAggregator != aggregator) {
- revert FailedOp(opIndex, "AA24 signature error");
- }
- if (outOfTimeRange) {
- revert FailedOp(opIndex, "AA22 expired or not due");
- }
- //pmAggregator is not a real signature aggregator: we don't have logic to handle it as address.
- // non-zero address means that the paymaster fails due to some signature check (which is ok only during estimation)
- address pmAggregator;
- (pmAggregator, outOfTimeRange) = _getValidationData(
- paymasterValidationData
- );
- if (pmAggregator != address(0)) {
- revert FailedOp(opIndex, "AA34 signature error");
- }
- if (outOfTimeRange) {
- revert FailedOp(opIndex, "AA32 paymaster expired or not due");
- }
- }
-
- function _getValidationData(uint256 validationData)
- internal
- view
- returns (address aggregator, bool outOfTimeRange)
- {
- if (validationData == 0) {
- return (address(0), false);
- }
- ValidationData memory data = _parseValidationData(validationData);
- // solhint-disable-next-line not-rely-on-time
- outOfTimeRange =
- block.timestamp > data.validUntil ||
- block.timestamp < data.validAfter;
- aggregator = data.aggregator;
- }
-
- /**
- * validate account and paymaster (if defined).
- * also make sure total validation doesn't exceed verificationGasLimit
- * this method is called off-chain (simulateValidation()) and on-chain (from handleOps)
- * @param opIndex the index of this userOp into the "opInfos" array
- * @param userOp the userOp to validate
- */
- function _validatePrepayment(
- uint256 opIndex,
- UserOperation calldata userOp,
- UserOpInfo memory outOpInfo
- )
- private
- returns (uint256 validationData, uint256 paymasterValidationData)
- {
- uint256 preGas = gasleft();
- MemoryUserOp memory mUserOp = outOpInfo.mUserOp;
- _copyUserOpToMemory(userOp, mUserOp);
- outOpInfo.userOpHash = getUserOpHash(userOp);
-
- // validate all numeric values in userOp are well below 128 bit, so they can safely be added
- // and multiplied without causing overflow
- uint256 maxGasValues = mUserOp.preVerificationGas |
- mUserOp.verificationGasLimit |
- mUserOp.callGasLimit |
- userOp.maxFeePerGas |
- userOp.maxPriorityFeePerGas;
- require(maxGasValues <= type(uint120).max, "AA94 gas values overflow");
-
- uint256 gasUsedByValidateAccountPrepayment;
- uint256 requiredPreFund = _getRequiredPrefund(mUserOp);
- (
- gasUsedByValidateAccountPrepayment,
- validationData
- ) = _validateAccountPrepayment(
- opIndex,
- userOp,
- outOpInfo,
- requiredPreFund
- );
- //a "marker" where account opcode validation is done and paymaster opcode validation is about to start
- // (used only by off-chain simulateValidation)
- numberMarker();
-
- bytes memory context;
- if (mUserOp.paymaster != address(0)) {
- (context, paymasterValidationData) = _validatePaymasterPrepayment(
- opIndex,
- userOp,
- outOpInfo,
- requiredPreFund,
- gasUsedByValidateAccountPrepayment
- );
- }
- unchecked {
- uint256 gasUsed = preGas - gasleft();
-
- if (userOp.verificationGasLimit < gasUsed) {
- revert FailedOp(opIndex, "AA40 over verificationGasLimit");
- }
- outOpInfo.prefund = requiredPreFund;
- outOpInfo.contextOffset = getOffsetOfMemoryBytes(context);
- outOpInfo.preOpGas = preGas - gasleft() + userOp.preVerificationGas;
- }
- }
-
- /**
- * process post-operation.
- * called just after the callData is executed.
- * if a paymaster is defined and its validation returned a non-empty context, its postOp is called.
- * the excess amount is refunded to the account (or paymaster - if it was used in the request)
- * @param opIndex index in the batch
- * @param mode - whether is called from innerHandleOp, or outside (postOpReverted)
- * @param opInfo userOp fields and info collected during validation
- * @param context the context returned in validatePaymasterUserOp
- * @param actualGas the gas used so far by this user operation
- */
- function _handlePostOp(
- uint256 opIndex,
- IPaymaster.PostOpMode mode,
- UserOpInfo memory opInfo,
- bytes memory context,
- uint256 actualGas
- ) private returns (uint256 actualGasCost) {
- uint256 preGas = gasleft();
- unchecked {
- address refundAddress;
- MemoryUserOp memory mUserOp = opInfo.mUserOp;
- uint256 gasPrice = getUserOpGasPrice(mUserOp);
-
- address paymaster = mUserOp.paymaster;
- if (paymaster == address(0)) {
- refundAddress = mUserOp.sender;
- } else {
- refundAddress = paymaster;
- if (context.length > 0) {
- actualGasCost = actualGas * gasPrice;
- if (mode != IPaymaster.PostOpMode.postOpReverted) {
- IPaymaster(paymaster).postOp{
- gas: mUserOp.verificationGasLimit
- }(mode, context, actualGasCost);
- } else {
- // solhint-disable-next-line no-empty-blocks
- try
- IPaymaster(paymaster).postOp{
- gas: mUserOp.verificationGasLimit
- }(mode, context, actualGasCost)
- {} catch Error(string memory reason) {
- revert FailedOp(
- opIndex,
- string.concat("AA50 postOp reverted: ", reason)
- );
- } catch {
- revert FailedOp(opIndex, "AA50 postOp revert");
- }
- }
- }
- }
- actualGas += preGas - gasleft();
- actualGasCost = actualGas * gasPrice;
- if (opInfo.prefund < actualGasCost) {
- revert FailedOp(opIndex, "AA51 prefund below actualGasCost");
- }
- uint256 refund = opInfo.prefund - actualGasCost;
- _incrementDeposit(refundAddress, refund);
- bool success = mode == IPaymaster.PostOpMode.opSucceeded;
- emit UserOperationEvent(
- opInfo.userOpHash,
- mUserOp.sender,
- mUserOp.paymaster,
- mUserOp.nonce,
- success,
- actualGasCost,
- actualGas
- );
- } // unchecked
- }
-
- /**
- * the gas price this UserOp agrees to pay.
- * relayer/block builder might submit the TX with higher priorityFee, but the user should not
- */
- function getUserOpGasPrice(MemoryUserOp memory mUserOp)
- internal
- view
- returns (uint256)
- {
- unchecked {
- uint256 maxFeePerGas = mUserOp.maxFeePerGas;
- uint256 maxPriorityFeePerGas = mUserOp.maxPriorityFeePerGas;
- if (maxFeePerGas == maxPriorityFeePerGas) {
- //legacy mode (for networks that don't support basefee opcode)
- return maxFeePerGas;
- }
- return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);
- }
- }
-
- function min(uint256 a, uint256 b) internal pure returns (uint256) {
- return a < b ? a : b;
- }
-
- function getOffsetOfMemoryBytes(bytes memory data)
- internal
- pure
- returns (uint256 offset)
- {
- assembly {
- offset := data
- }
- }
-
- function getMemoryBytesFromOffset(uint256 offset)
- internal
- pure
- returns (bytes memory data)
- {
- assembly {
- data := offset
- }
- }
-
- //place the NUMBER opcode in the code.
- // this is used as a marker during simulation, as this OP is completely banned from the simulated code of the
- // account and paymaster.
- function numberMarker() internal view {
- assembly {
- mstore(0, number())
- }
- }
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/core/Helpers.sol b/contracts/src/v0.8/vendor/entrypoint/core/Helpers.sol
deleted file mode 100644
index 71a6dc3d16b..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/core/Helpers.sol
+++ /dev/null
@@ -1,68 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-/**
- * returned data from validateUserOp.
- * validateUserOp returns a uint256, with is created by `_packedValidationData` and parsed by `_parseValidationData`
- * @param aggregator - address(0) - the account validated the signature by itself.
- * address(1) - the account failed to validate the signature.
- * otherwise - this is an address of a signature aggregator that must be used to validate the signature.
- * @param validAfter - this UserOp is valid only after this timestamp.
- * @param validaUntil - this UserOp is valid only up to this timestamp.
- */
-struct ValidationData {
- address aggregator;
- uint48 validAfter;
- uint48 validUntil;
-}
-
-//extract sigFailed, validAfter, validUntil.
-// also convert zero validUntil to type(uint48).max
-function _parseValidationData(uint validationData) pure returns (ValidationData memory data) {
- address aggregator = address(uint160(validationData));
- uint48 validUntil = uint48(validationData >> 160);
- if (validUntil == 0) {
- validUntil = type(uint48).max;
- }
- uint48 validAfter = uint48(validationData >> (48 + 160));
- return ValidationData(aggregator, validAfter, validUntil);
-}
-
-// intersect account and paymaster ranges.
-function _intersectTimeRange(
- uint256 validationData,
- uint256 paymasterValidationData
-) pure returns (ValidationData memory) {
- ValidationData memory accountValidationData = _parseValidationData(validationData);
- ValidationData memory pmValidationData = _parseValidationData(paymasterValidationData);
- address aggregator = accountValidationData.aggregator;
- if (aggregator == address(0)) {
- aggregator = pmValidationData.aggregator;
- }
- uint48 validAfter = accountValidationData.validAfter;
- uint48 validUntil = accountValidationData.validUntil;
- uint48 pmValidAfter = pmValidationData.validAfter;
- uint48 pmValidUntil = pmValidationData.validUntil;
-
- if (validAfter < pmValidAfter) validAfter = pmValidAfter;
- if (validUntil > pmValidUntil) validUntil = pmValidUntil;
- return ValidationData(aggregator, validAfter, validUntil);
-}
-
-/**
- * helper to pack the return value for validateUserOp
- * @param data - the ValidationData to pack
- */
-function _packValidationData(ValidationData memory data) pure returns (uint256) {
- return uint160(data.aggregator) | (uint256(data.validUntil) << 160) | (uint256(data.validAfter) << (160 + 48));
-}
-
-/**
- * helper to pack the return value for validateUserOp, when not using an aggregator
- * @param sigFailed - true for signature failure, false for success
- * @param validUntil last timestamp this UserOperation is valid (or zero for infinite)
- * @param validAfter first timestamp this UserOperation is valid
- */
-function _packValidationData(bool sigFailed, uint48 validUntil, uint48 validAfter) pure returns (uint256) {
- return (sigFailed ? 1 : 0) | (uint256(validUntil) << 160) | (uint256(validAfter) << (160 + 48));
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/core/SenderCreator.sol b/contracts/src/v0.8/vendor/entrypoint/core/SenderCreator.sol
deleted file mode 100644
index 36fad7b91f1..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/core/SenderCreator.sol
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-/**
- * helper contract for EntryPoint, to call userOp.initCode from a "neutral" address,
- * which is explicitly not the entryPoint itself.
- */
-contract SenderCreator {
-
- /**
- * call the "initCode" factory to create and return the sender account address
- * @param initCode the initCode value from a UserOp. contains 20 bytes of factory address, followed by calldata
- * @return sender the returned address of the created account, or zero address on failure.
- */
- function createSender(bytes calldata initCode) external returns (address sender) {
- address factory = address(bytes20(initCode[0 : 20]));
- bytes memory initCallData = initCode[20 :];
- bool success;
- /* solhint-disable no-inline-assembly */
- assembly {
- success := call(gas(), factory, 0, add(initCallData, 0x20), mload(initCallData), 0, 32)
- sender := mload(0)
- }
- if (!success) {
- sender = address(0);
- }
- }
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/core/StakeManager.sol b/contracts/src/v0.8/vendor/entrypoint/core/StakeManager.sol
deleted file mode 100644
index e5ca2b97dd4..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/core/StakeManager.sol
+++ /dev/null
@@ -1,124 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-only
-pragma solidity ^0.8.12;
-
-import "../interfaces/IStakeManager.sol";
-
-/* solhint-disable avoid-low-level-calls */
-/* solhint-disable not-rely-on-time */
-/**
- * manage deposits and stakes.
- * deposit is just a balance used to pay for UserOperations (either by a paymaster or an account)
- * stake is value locked for at least "unstakeDelay" by a paymaster.
- */
-abstract contract StakeManager is IStakeManager {
-
- /// maps paymaster to their deposits and stakes
- mapping(address => DepositInfo) public deposits;
-
- /// @inheritdoc IStakeManager
- function getDepositInfo(address account) public view returns (DepositInfo memory info) {
- return deposits[account];
- }
-
- // internal method to return just the stake info
- function _getStakeInfo(address addr) internal view returns (StakeInfo memory info) {
- DepositInfo storage depositInfo = deposits[addr];
- info.stake = depositInfo.stake;
- info.unstakeDelaySec = depositInfo.unstakeDelaySec;
- }
-
- /// return the deposit (for gas payment) of the account
- function balanceOf(address account) public view returns (uint256) {
- return deposits[account].deposit;
- }
-
- receive() external payable {
- depositTo(msg.sender);
- }
-
- function _incrementDeposit(address account, uint256 amount) internal {
- DepositInfo storage info = deposits[account];
- uint256 newAmount = info.deposit + amount;
- require(newAmount <= type(uint112).max, "deposit overflow");
- info.deposit = uint112(newAmount);
- }
-
- /**
- * add to the deposit of the given account
- */
- function depositTo(address account) public payable {
- _incrementDeposit(account, msg.value);
- DepositInfo storage info = deposits[account];
- emit Deposited(account, info.deposit);
- }
-
- /**
- * add to the account's stake - amount and delay
- * any pending unstake is first cancelled.
- * @param unstakeDelaySec the new lock duration before the deposit can be withdrawn.
- */
- function addStake(uint32 unstakeDelaySec) public payable {
- DepositInfo storage info = deposits[msg.sender];
- require(unstakeDelaySec > 0, "must specify unstake delay");
- require(unstakeDelaySec >= info.unstakeDelaySec, "cannot decrease unstake time");
- uint256 stake = info.stake + msg.value;
- require(stake > 0, "no stake specified");
- require(stake <= type(uint112).max, "stake overflow");
- deposits[msg.sender] = DepositInfo(
- info.deposit,
- true,
- uint112(stake),
- unstakeDelaySec,
- 0
- );
- emit StakeLocked(msg.sender, stake, unstakeDelaySec);
- }
-
- /**
- * attempt to unlock the stake.
- * the value can be withdrawn (using withdrawStake) after the unstake delay.
- */
- function unlockStake() external {
- DepositInfo storage info = deposits[msg.sender];
- require(info.unstakeDelaySec != 0, "not staked");
- require(info.staked, "already unstaking");
- uint48 withdrawTime = uint48(block.timestamp) + info.unstakeDelaySec;
- info.withdrawTime = withdrawTime;
- info.staked = false;
- emit StakeUnlocked(msg.sender, withdrawTime);
- }
-
-
- /**
- * withdraw from the (unlocked) stake.
- * must first call unlockStake and wait for the unstakeDelay to pass
- * @param withdrawAddress the address to send withdrawn value.
- */
- function withdrawStake(address payable withdrawAddress) external {
- DepositInfo storage info = deposits[msg.sender];
- uint256 stake = info.stake;
- require(stake > 0, "No stake to withdraw");
- require(info.withdrawTime > 0, "must call unlockStake() first");
- require(info.withdrawTime <= block.timestamp, "Stake withdrawal is not due");
- info.unstakeDelaySec = 0;
- info.withdrawTime = 0;
- info.stake = 0;
- emit StakeWithdrawn(msg.sender, withdrawAddress, stake);
- (bool success,) = withdrawAddress.call{value : stake}("");
- require(success, "failed to withdraw stake");
- }
-
- /**
- * withdraw from the deposit.
- * @param withdrawAddress the address to send withdrawn value.
- * @param withdrawAmount the amount to withdraw.
- */
- function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {
- DepositInfo storage info = deposits[msg.sender];
- require(withdrawAmount <= info.deposit, "Withdraw amount too large");
- info.deposit = uint112(info.deposit - withdrawAmount);
- emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);
- (bool success,) = withdrawAddress.call{value : withdrawAmount}("");
- require(success, "failed to withdraw");
- }
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/IAccount.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/IAccount.sol
deleted file mode 100644
index 1600de3d71e..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/IAccount.sol
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-import "./UserOperation.sol";
-
-interface IAccount {
-
- /**
- * Validate user's signature and nonce
- * the entryPoint will make the call to the recipient only if this validation call returns successfully.
- * signature failure should be reported by returning SIG_VALIDATION_FAILED (1).
- * This allows making a "simulation call" without a valid signature
- * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.
- *
- * @dev Must validate caller is the entryPoint.
- * Must validate the signature and nonce
- * @param userOp the operation that is about to be executed.
- * @param userOpHash hash of the user's request data. can be used as the basis for signature.
- * @param missingAccountFunds missing funds on the account's deposit in the entrypoint.
- * This is the minimum amount to transfer to the sender(entryPoint) to be able to make the call.
- * The excess is left as a deposit in the entrypoint, for future calls.
- * can be withdrawn anytime using "entryPoint.withdrawTo()"
- * In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.
- * @return validationData packaged ValidationData structure. use `_packValidationData` and `_unpackValidationData` to encode and decode
- * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,
- * otherwise, an address of an "authorizer" contract.
- * <6-byte> validUntil - last timestamp this operation is valid. 0 for "indefinite"
- * <6-byte> validAfter - first timestamp this operation is valid
- * If an account doesn't use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure.
- * Note that the validation code cannot use block.timestamp (or block.number) directly.
- */
- function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds)
- external returns (uint256 validationData);
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/IAggregator.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/IAggregator.sol
deleted file mode 100644
index 086c6f32241..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/IAggregator.sol
+++ /dev/null
@@ -1,36 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-import "./UserOperation.sol";
-
-/**
- * Aggregated Signatures validator.
- */
-interface IAggregator {
-
- /**
- * validate aggregated signature.
- * revert if the aggregated signature does not match the given list of operations.
- */
- function validateSignatures(UserOperation[] calldata userOps, bytes calldata signature) external view;
-
- /**
- * validate signature of a single userOp
- * This method is should be called by bundler after EntryPoint.simulateValidation() returns (reverts) with ValidationResultWithAggregation
- * First it validates the signature over the userOp. Then it returns data to be used when creating the handleOps.
- * @param userOp the userOperation received from the user.
- * @return sigForUserOp the value to put into the signature field of the userOp when calling handleOps.
- * (usually empty, unless account and aggregator support some kind of "multisig"
- */
- function validateUserOpSignature(UserOperation calldata userOp)
- external view returns (bytes memory sigForUserOp);
-
- /**
- * aggregate multiple signatures into a single value.
- * This method is called off-chain to calculate the signature to pass with handleOps()
- * bundler MAY use optimized custom code perform this aggregation
- * @param userOps array of UserOperations to collect the signatures from.
- * @return aggregatedSignature the aggregated signature
- */
- function aggregateSignatures(UserOperation[] calldata userOps) external view returns (bytes memory aggregatedSignature);
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/IEntryPoint.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/IEntryPoint.sol
deleted file mode 100644
index 22bb1b7a6e7..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/IEntryPoint.sol
+++ /dev/null
@@ -1,197 +0,0 @@
-/**
- ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.
- ** Only one instance required on each chain.
- **/
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-/* solhint-disable avoid-low-level-calls */
-/* solhint-disable no-inline-assembly */
-/* solhint-disable reason-string */
-
-import "./UserOperation.sol";
-import "./IStakeManager.sol";
-import "./IAggregator.sol";
-
-interface IEntryPoint is IStakeManager {
-
- /***
- * An event emitted after each successful request
- * @param userOpHash - unique identifier for the request (hash its entire content, except signature).
- * @param sender - the account that generates this request.
- * @param paymaster - if non-null, the paymaster that pays for this request.
- * @param nonce - the nonce value from the request.
- * @param success - true if the sender transaction succeeded, false if reverted.
- * @param actualGasCost - actual amount paid (by account or paymaster) for this UserOperation.
- * @param actualGasUsed - total gas used by this UserOperation (including preVerification, creation, validation and execution).
- */
- event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed);
-
- /**
- * account "sender" was deployed.
- * @param userOpHash the userOp that deployed this account. UserOperationEvent will follow.
- * @param sender the account that is deployed
- * @param factory the factory used to deploy this account (in the initCode)
- * @param paymaster the paymaster used by this UserOp
- */
- event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster);
-
- /**
- * An event emitted if the UserOperation "callData" reverted with non-zero length
- * @param userOpHash the request unique identifier.
- * @param sender the sender of this request
- * @param nonce the nonce used in the request
- * @param revertReason - the return bytes from the (reverted) call to "callData".
- */
- event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason);
-
- /**
- * signature aggregator used by the following UserOperationEvents within this bundle.
- */
- event SignatureAggregatorChanged(address indexed aggregator);
-
- /**
- * a custom revert error of handleOps, to identify the offending op.
- * NOTE: if simulateValidation passes successfully, there should be no reason for handleOps to fail on it.
- * @param opIndex - index into the array of ops to the failed one (in simulateValidation, this is always zero)
- * @param reason - revert reason
- * The string starts with a unique code "AAmn", where "m" is "1" for factory, "2" for account and "3" for paymaster issues,
- * so a failure can be attributed to the correct entity.
- * Should be caught in off-chain handleOps simulation and not happen on-chain.
- * Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts.
- */
- error FailedOp(uint256 opIndex, string reason);
-
- /**
- * error case when a signature aggregator fails to verify the aggregated signature it had created.
- */
- error SignatureValidationFailed(address aggregator);
-
- /**
- * Successful result from simulateValidation.
- * @param returnInfo gas and time-range returned values
- * @param senderInfo stake information about the sender
- * @param factoryInfo stake information about the factory (if any)
- * @param paymasterInfo stake information about the paymaster (if any)
- */
- error ValidationResult(ReturnInfo returnInfo,
- StakeInfo senderInfo, StakeInfo factoryInfo, StakeInfo paymasterInfo);
-
- /**
- * Successful result from simulateValidation, if the account returns a signature aggregator
- * @param returnInfo gas and time-range returned values
- * @param senderInfo stake information about the sender
- * @param factoryInfo stake information about the factory (if any)
- * @param paymasterInfo stake information about the paymaster (if any)
- * @param aggregatorInfo signature aggregation info (if the account requires signature aggregator)
- * bundler MUST use it to verify the signature, or reject the UserOperation
- */
- error ValidationResultWithAggregation(ReturnInfo returnInfo,
- StakeInfo senderInfo, StakeInfo factoryInfo, StakeInfo paymasterInfo,
- AggregatorStakeInfo aggregatorInfo);
-
- /**
- * return value of getSenderAddress
- */
- error SenderAddressResult(address sender);
-
- /**
- * return value of simulateHandleOp
- */
- error ExecutionResult(uint256 preOpGas, uint256 paid, uint48 validAfter, uint48 validUntil, bool targetSuccess, bytes targetResult);
-
- //UserOps handled, per aggregator
- struct UserOpsPerAggregator {
- UserOperation[] userOps;
-
- // aggregator address
- IAggregator aggregator;
- // aggregated signature
- bytes signature;
- }
-
- /**
- * Execute a batch of UserOperation.
- * no signature aggregator is used.
- * if any account requires an aggregator (that is, it returned an aggregator when
- * performing simulateValidation), then handleAggregatedOps() must be used instead.
- * @param ops the operations to execute
- * @param beneficiary the address to receive the fees
- */
- function handleOps(UserOperation[] calldata ops, address payable beneficiary) external;
-
- /**
- * Execute a batch of UserOperation with Aggregators
- * @param opsPerAggregator the operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts)
- * @param beneficiary the address to receive the fees
- */
- function handleAggregatedOps(
- UserOpsPerAggregator[] calldata opsPerAggregator,
- address payable beneficiary
- ) external;
-
- /**
- * generate a request Id - unique identifier for this request.
- * the request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid.
- */
- function getUserOpHash(UserOperation calldata userOp) external view returns (bytes32);
-
- /**
- * Simulate a call to account.validateUserOp and paymaster.validatePaymasterUserOp.
- * @dev this method always revert. Successful result is ValidationResult error. other errors are failures.
- * @dev The node must also verify it doesn't use banned opcodes, and that it doesn't reference storage outside the account's data.
- * @param userOp the user operation to validate.
- */
- function simulateValidation(UserOperation calldata userOp) external;
-
- /**
- * gas and return values during simulation
- * @param preOpGas the gas used for validation (including preValidationGas)
- * @param prefund the required prefund for this operation
- * @param sigFailed validateUserOp's (or paymaster's) signature check failed
- * @param validAfter - first timestamp this UserOp is valid (merging account and paymaster time-range)
- * @param validUntil - last timestamp this UserOp is valid (merging account and paymaster time-range)
- * @param paymasterContext returned by validatePaymasterUserOp (to be passed into postOp)
- */
- struct ReturnInfo {
- uint256 preOpGas;
- uint256 prefund;
- bool sigFailed;
- uint48 validAfter;
- uint48 validUntil;
- bytes paymasterContext;
- }
-
- /**
- * returned aggregated signature info.
- * the aggregator returned by the account, and its current stake.
- */
- struct AggregatorStakeInfo {
- address aggregator;
- StakeInfo stakeInfo;
- }
-
- /**
- * Get counterfactual sender address.
- * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation.
- * this method always revert, and returns the address in SenderAddressResult error
- * @param initCode the constructor code to be passed into the UserOperation.
- */
- function getSenderAddress(bytes memory initCode) external;
-
-
- /**
- * simulate full execution of a UserOperation (including both validation and target execution)
- * this method will always revert with "ExecutionResult".
- * it performs full validation of the UserOperation, but ignores signature error.
- * an optional target address is called after the userop succeeds, and its value is returned
- * (before the entire call is reverted)
- * Note that in order to collect the the success/failure of the target call, it must be executed
- * with trace enabled to track the emitted events.
- * @param op the UserOperation to simulate
- * @param target if nonzero, a target address to call after userop simulation. If called, the targetSuccess and targetResult
- * are set to the return from that call.
- * @param targetCallData callData to pass to target address
- */
- function simulateHandleOp(UserOperation calldata op, address target, bytes calldata targetCallData) external;
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/IPaymaster.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/IPaymaster.sol
deleted file mode 100644
index af50367acfc..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/IPaymaster.sol
+++ /dev/null
@@ -1,51 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-import "./UserOperation.sol";
-
-/**
- * the interface exposed by a paymaster contract, who agrees to pay the gas for user's operations.
- * a paymaster must hold a stake to cover the required entrypoint stake and also the gas for the transaction.
- */
-interface IPaymaster {
-
- enum PostOpMode {
- opSucceeded, // user op succeeded
- opReverted, // user op reverted. still has to pay for gas.
- postOpReverted //user op succeeded, but caused postOp to revert. Now it's a 2nd call, after user's op was deliberately reverted.
- }
-
- /**
- * payment validation: check if paymaster agrees to pay.
- * Must verify sender is the entryPoint.
- * Revert to reject this request.
- * Note that bundlers will reject this method if it changes the state, unless the paymaster is trusted (whitelisted)
- * The paymaster pre-pays using its deposit, and receive back a refund after the postOp method returns.
- * @param userOp the user operation
- * @param userOpHash hash of the user's request data.
- * @param maxCost the maximum cost of this transaction (based on maximum gas and gas price from userOp)
- * @return context value to send to a postOp
- * zero length to signify postOp is not required.
- * @return validationData signature and time-range of this operation, encoded the same as the return value of validateUserOperation
- * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,
- * otherwise, an address of an "authorizer" contract.
- * <6-byte> validUntil - last timestamp this operation is valid. 0 for "indefinite"
- * <6-byte> validAfter - first timestamp this operation is valid
- * Note that the validation code cannot use block.timestamp (or block.number) directly.
- */
- function validatePaymasterUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 maxCost)
- external returns (bytes memory context, uint256 validationData);
-
- /**
- * post-operation handler.
- * Must verify sender is the entryPoint
- * @param mode enum with the following options:
- * opSucceeded - user operation succeeded.
- * opReverted - user op reverted. still has to pay for gas.
- * postOpReverted - user op succeeded, but caused postOp (in mode=opSucceeded) to revert.
- * Now this is the 2nd call, after user's op was deliberately reverted.
- * @param context - the context value returned by validatePaymasterUserOp
- * @param actualGasCost - actual gas used so far (without this postOp call).
- */
- function postOp(PostOpMode mode, bytes calldata context, uint256 actualGasCost) external;
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/IStakeManager.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/IStakeManager.sol
deleted file mode 100644
index c19c1bab88b..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/IStakeManager.sol
+++ /dev/null
@@ -1,104 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-only
-pragma solidity ^0.8.12;
-
-/**
- * manage deposits and stakes.
- * deposit is just a balance used to pay for UserOperations (either by a paymaster or an account)
- * stake is value locked for at least "unstakeDelay" by the staked entity.
- */
-interface IStakeManager {
-
- event Deposited(
- address indexed account,
- uint256 totalDeposit
- );
-
- event Withdrawn(
- address indexed account,
- address withdrawAddress,
- uint256 amount
- );
-
- /// Emitted when stake or unstake delay are modified
- event StakeLocked(
- address indexed account,
- uint256 totalStaked,
- uint256 unstakeDelaySec
- );
-
- /// Emitted once a stake is scheduled for withdrawal
- event StakeUnlocked(
- address indexed account,
- uint256 withdrawTime
- );
-
- event StakeWithdrawn(
- address indexed account,
- address withdrawAddress,
- uint256 amount
- );
-
- /**
- * @param deposit the entity's deposit
- * @param staked true if this entity is staked.
- * @param stake actual amount of ether staked for this entity.
- * @param unstakeDelaySec minimum delay to withdraw the stake.
- * @param withdrawTime - first block timestamp where 'withdrawStake' will be callable, or zero if already locked
- * @dev sizes were chosen so that (deposit,staked, stake) fit into one cell (used during handleOps)
- * and the rest fit into a 2nd cell.
- * 112 bit allows for 10^15 eth
- * 48 bit for full timestamp
- * 32 bit allows 150 years for unstake delay
- */
- struct DepositInfo {
- uint112 deposit;
- bool staked;
- uint112 stake;
- uint32 unstakeDelaySec;
- uint48 withdrawTime;
- }
-
- //API struct used by getStakeInfo and simulateValidation
- struct StakeInfo {
- uint256 stake;
- uint256 unstakeDelaySec;
- }
-
- /// @return info - full deposit information of given account
- function getDepositInfo(address account) external view returns (DepositInfo memory info);
-
- /// @return the deposit (for gas payment) of the account
- function balanceOf(address account) external view returns (uint256);
-
- /**
- * add to the deposit of the given account
- */
- function depositTo(address account) external payable;
-
- /**
- * add to the account's stake - amount and delay
- * any pending unstake is first cancelled.
- * @param _unstakeDelaySec the new lock duration before the deposit can be withdrawn.
- */
- function addStake(uint32 _unstakeDelaySec) external payable;
-
- /**
- * attempt to unlock the stake.
- * the value can be withdrawn (using withdrawStake) after the unstake delay.
- */
- function unlockStake() external;
-
- /**
- * withdraw from the (unlocked) stake.
- * must first call unlockStake and wait for the unstakeDelay to pass
- * @param withdrawAddress the address to send withdrawn value.
- */
- function withdrawStake(address payable withdrawAddress) external;
-
- /**
- * withdraw from the deposit.
- * @param withdrawAddress the address to send withdrawn value.
- * @param withdrawAmount the amount to withdraw.
- */
- function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external;
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/interfaces/UserOperation.sol b/contracts/src/v0.8/vendor/entrypoint/interfaces/UserOperation.sol
deleted file mode 100644
index dfff42791f3..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/interfaces/UserOperation.sol
+++ /dev/null
@@ -1,84 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0
-pragma solidity ^0.8.12;
-
-/* solhint-disable no-inline-assembly */
-
- /**
- * User Operation struct
- * @param sender the sender account of this request.
- * @param nonce unique value the sender uses to verify it is not a replay.
- * @param initCode if set, the account contract will be created by this constructor/
- * @param callData the method call to execute on this account.
- * @param callGasLimit the gas limit passed to the callData method call.
- * @param verificationGasLimit gas used for validateUserOp and validatePaymasterUserOp.
- * @param preVerificationGas gas not calculated by the handleOps method, but added to the gas paid. Covers batch overhead.
- * @param maxFeePerGas same as EIP-1559 gas parameter.
- * @param maxPriorityFeePerGas same as EIP-1559 gas parameter.
- * @param paymasterAndData if set, this field holds the paymaster address and paymaster-specific data. the paymaster will pay for the transaction instead of the sender.
- * @param signature sender-verified signature over the entire request, the EntryPoint address and the chain ID.
- */
- struct UserOperation {
-
- address sender;
- uint256 nonce;
- bytes initCode;
- bytes callData;
- uint256 callGasLimit;
- uint256 verificationGasLimit;
- uint256 preVerificationGas;
- uint256 maxFeePerGas;
- uint256 maxPriorityFeePerGas;
- bytes paymasterAndData;
- bytes signature;
- }
-
-/**
- * Utility functions helpful when working with UserOperation structs.
- */
-library UserOperationLib {
-
- function getSender(UserOperation calldata userOp) internal pure returns (address) {
- address data;
- //read sender from userOp, which is first userOp member (saves 800 gas...)
- assembly {data := calldataload(userOp)}
- return address(uint160(data));
- }
-
- //relayer/block builder might submit the TX with higher priorityFee, but the user should not
- // pay above what he signed for.
- function gasPrice(UserOperation calldata userOp) internal view returns (uint256) {
- unchecked {
- uint256 maxFeePerGas = userOp.maxFeePerGas;
- uint256 maxPriorityFeePerGas = userOp.maxPriorityFeePerGas;
- if (maxFeePerGas == maxPriorityFeePerGas) {
- //legacy mode (for networks that don't support basefee opcode)
- return maxFeePerGas;
- }
- return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);
- }
- }
-
- function pack(UserOperation calldata userOp) internal pure returns (bytes memory ret) {
- //lighter signature scheme. must match UserOp.ts#packUserOp
- bytes calldata sig = userOp.signature;
- // copy directly the userOp from calldata up to (but not including) the signature.
- // this encoding depends on the ABI encoding of calldata, but is much lighter to copy
- // than referencing each field separately.
- assembly {
- let ofs := userOp
- let len := sub(sub(sig.offset, ofs), 32)
- ret := mload(0x40)
- mstore(0x40, add(ret, add(len, 32)))
- mstore(ret, len)
- calldatacopy(add(ret, 32), ofs, len)
- }
- }
-
- function hash(UserOperation calldata userOp) internal pure returns (bytes32) {
- return keccak256(pack(userOp));
- }
-
- function min(uint256 a, uint256 b) internal pure returns (uint256) {
- return a < b ? a : b;
- }
-}
diff --git a/contracts/src/v0.8/vendor/entrypoint/utils/Exec.sol b/contracts/src/v0.8/vendor/entrypoint/utils/Exec.sol
deleted file mode 100644
index 69d653d938a..00000000000
--- a/contracts/src/v0.8/vendor/entrypoint/utils/Exec.sol
+++ /dev/null
@@ -1,70 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-only
-pragma solidity >=0.7.5 <0.9.0;
-
-// solhint-disable no-inline-assembly
-
-/**
- * Utility functions helpful when making different kinds of contract calls in Solidity.
- */
-library Exec {
-
- function call(
- address to,
- uint256 value,
- bytes memory data,
- uint256 txGas
- ) internal returns (bool success) {
- assembly {
- success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)
- }
- }
-
- function staticcall(
- address to,
- bytes memory data,
- uint256 txGas
- ) internal view returns (bool success) {
- assembly {
- success := staticcall(txGas, to, add(data, 0x20), mload(data), 0, 0)
- }
- }
-
- function delegateCall(
- address to,
- bytes memory data,
- uint256 txGas
- ) internal returns (bool success) {
- assembly {
- success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)
- }
- }
-
- // get returned data from last call or calldelegate
- function getReturnData(uint256 maxLen) internal pure returns (bytes memory returnData) {
- assembly {
- let len := returndatasize()
- if gt(len, maxLen) {
- len := maxLen
- }
- let ptr := mload(0x40)
- mstore(0x40, add(ptr, add(len, 0x20)))
- mstore(ptr, len)
- returndatacopy(add(ptr, 0x20), 0, len)
- returnData := ptr
- }
- }
-
- // revert with explicit byte array (probably reverted info from call)
- function revertWithData(bytes memory returnData) internal pure {
- assembly {
- revert(add(returnData, 32), mload(returnData))
- }
- }
-
- function callAndRevert(address to, bytes memory data, uint256 maxLen) internal {
- bool success = call(to,0,data,gasleft());
- if (!success) {
- revertWithData(getReturnData(maxLen));
- }
- }
-}
diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go
index 25001027a59..f725ff95c06 100644
--- a/core/gethwrappers/go_generate.go
+++ b/core/gethwrappers/go_generate.go
@@ -160,7 +160,6 @@ package gethwrappers
//go:generate go generate ./llo-feeds
//go:generate go generate ./operatorforwarder
//go:generate go generate ./shared
-//go:generate go generate ./transmission
//go:generate go generate ./ccip
//go:generate go generate ./liquiditymanager
//go:generate go generate ./workflow
diff --git a/core/gethwrappers/transmission/generated/entry_point/entry_point.go b/core/gethwrappers/transmission/generated/entry_point/entry_point.go
deleted file mode 100644
index 5a22214cb0e..00000000000
--- a/core/gethwrappers/transmission/generated/entry_point/entry_point.go
+++ /dev/null
@@ -1,1871 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package entry_point
-
-import (
- "errors"
- "fmt"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-type EntryPointMemoryUserOp struct {
- Sender common.Address
- Nonce *big.Int
- CallGasLimit *big.Int
- VerificationGasLimit *big.Int
- PreVerificationGas *big.Int
- Paymaster common.Address
- MaxFeePerGas *big.Int
- MaxPriorityFeePerGas *big.Int
-}
-
-type EntryPointUserOpInfo struct {
- MUserOp EntryPointMemoryUserOp
- UserOpHash [32]byte
- Prefund *big.Int
- ContextOffset *big.Int
- PreOpGas *big.Int
-}
-
-type IEntryPointUserOpsPerAggregator struct {
- UserOps []UserOperation
- Aggregator common.Address
- Signature []byte
-}
-
-type IStakeManagerDepositInfo struct {
- Deposit *big.Int
- Staked bool
- Stake *big.Int
- UnstakeDelaySec uint32
- WithdrawTime *big.Int
-}
-
-type UserOperation struct {
- Sender common.Address
- Nonce *big.Int
- InitCode []byte
- CallData []byte
- CallGasLimit *big.Int
- VerificationGasLimit *big.Int
- PreVerificationGas *big.Int
- MaxFeePerGas *big.Int
- MaxPriorityFeePerGas *big.Int
- PaymasterAndData []byte
- Signature []byte
-}
-
-var EntryPointMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"targetSuccess\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"targetResult\",\"type\":\"bytes\"}],\"name\":\"ExecutionResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"opIndex\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"FailedOp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderAddressResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureValidationFailed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResult\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"stakeInfo\",\"type\":\"tuple\"}],\"internalType\":\"structIEntryPoint.AggregatorStakeInfo\",\"name\":\"aggregatorInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResultWithAggregation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"}],\"name\":\"AccountDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDeposit\",\"type\":\"uint256\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureAggregatorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawTime\",\"type\":\"uint256\"}],\"name\":\"StakeUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasUsed\",\"type\":\"uint256\"}],\"name\":\"UserOperationEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"revertReason\",\"type\":\"bytes\"}],\"name\":\"UserOperationRevertReason\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SIG_VALIDATION_FAILED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"}],\"name\":\"_validateSenderAndPaymaster\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"}],\"name\":\"addStake\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getDepositInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"internalType\":\"structIStakeManager.DepositInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"getSenderAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"getUserOpHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"userOps\",\"type\":\"tuple[]\"},{\"internalType\":\"contractIAggregator\",\"name\":\"aggregator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.UserOpsPerAggregator[]\",\"name\":\"opsPerAggregator\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleAggregatedOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"ops\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.MemoryUserOp\",\"name\":\"mUserOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"contextOffset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.UserOpInfo\",\"name\":\"opInfo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"}],\"name\":\"innerHandleOp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"op\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"targetCallData\",\"type\":\"bytes\"}],\"name\":\"simulateHandleOp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"simulateValidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount\",\"type\":\"uint256\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
- Bin: "0x60a0604052604051620000129062000050565b604051809103906000f0801580156200002f573d6000803e3d6000fd5b506001600160a01b03166080523480156200004957600080fd5b506200005e565b61020a8062004b0483390190565b608051614a83620000816000396000818161146e015261363e0152614a836000f3fe6080604052600436106101125760003560e01c8063957122ab116100a5578063bb9fe6bf11610074578063d6383f9411610059578063d6383f941461042c578063ee2194231461044c578063fc7e286d1461046c57600080fd5b8063bb9fe6bf146103f7578063c23a5cea1461040c57600080fd5b8063957122ab146103845780639b249f69146103a4578063a6193531146103c4578063b760faf9146103e457600080fd5b80634b1d7cf5116100e15780634b1d7cf5146101ad5780635287ce12146101cd57806370a082311461031c5780638f41ec5a1461036f57600080fd5b80630396cb60146101275780631d7327561461013a5780631fad948c1461016d578063205c28781461018d57600080fd5b366101225761012033610546565b005b600080fd5b6101206101353660046139b1565b6105c1565b34801561014657600080fd5b5061015a610155366004613c28565b610944565b6040519081526020015b60405180910390f35b34801561017957600080fd5b50610120610188366004613d33565b610af7565b34801561019957600080fd5b506101206101a8366004613d8a565b610c38565b3480156101b957600080fd5b506101206101c8366004613d33565b610e3a565b3480156101d957600080fd5b506102bd6101e8366004613db6565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091525073ffffffffffffffffffffffffffffffffffffffff1660009081526020818152604091829020825160a08101845281546dffffffffffffffffffffffffffff80821683526e010000000000000000000000000000820460ff161515948301949094526f0100000000000000000000000000000090049092169282019290925260019091015463ffffffff81166060830152640100000000900465ffffffffffff16608082015290565b6040805182516dffffffffffffffffffffffffffff908116825260208085015115159083015283830151169181019190915260608083015163ffffffff169082015260809182015165ffffffffffff169181019190915260a001610164565b34801561032857600080fd5b5061015a610337366004613db6565b73ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020546dffffffffffffffffffffffffffff1690565b34801561037b57600080fd5b5061015a600181565b34801561039057600080fd5b5061012061039f366004613dd3565b6112d9565b3480156103b057600080fd5b506101206103bf366004613e58565b611431565b3480156103d057600080fd5b5061015a6103df366004613eb3565b611533565b6101206103f2366004613db6565b610546565b34801561040357600080fd5b50610120611575565b34801561041857600080fd5b50610120610427366004613db6565b61172c565b34801561043857600080fd5b50610120610447366004613ee8565b611a2c565b34801561045857600080fd5b50610120610467366004613eb3565b611b5a565b34801561047857600080fd5b506104f9610487366004613db6565b600060208190529081526040902080546001909101546dffffffffffffffffffffffffffff808316926e010000000000000000000000000000810460ff16926f010000000000000000000000000000009091049091169063ffffffff811690640100000000900465ffffffffffff1685565b604080516dffffffffffffffffffffffffffff96871681529415156020860152929094169183019190915263ffffffff16606082015265ffffffffffff909116608082015260a001610164565b6105508134611ec2565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020818152604091829020805492516dffffffffffffffffffffffffffff909316835292917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c491015b60405180910390a25050565b33600090815260208190526040902063ffffffff8216610642576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c617900000000000060448201526064015b60405180910390fd5b600181015463ffffffff90811690831610156106ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606401610639565b80546000906106ed9034906f0100000000000000000000000000000090046dffffffffffffffffffffffffffff16613f79565b905060008111610759576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f6e6f207374616b652073706563696669656400000000000000000000000000006044820152606401610639565b6dffffffffffffffffffffffffffff8111156107d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f7374616b65206f766572666c6f770000000000000000000000000000000000006044820152606401610639565b6040805160a08101825283546dffffffffffffffffffffffffffff90811682526001602080840182815286841685870190815263ffffffff808b16606088019081526000608089018181523380835296829052908a9020985189549551945189166f01000000000000000000000000000000027fffffff0000000000000000000000000000ffffffffffffffffffffffffffffff9515156e010000000000000000000000000000027fffffffffffffffffffffffffffffffffff0000000000000000000000000000009097169190991617949094179290921695909517865551949092018054925165ffffffffffff16640100000000027fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000909316949093169390931717905590517fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c0190610937908490879091825263ffffffff16602082015260400190565b60405180910390a2505050565b6000805a90503330146109b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4141393220696e7465726e616c2063616c6c206f6e6c790000000000000000006044820152606401610639565b8451604081015160608201518101611388015a10156109f6577fdeaddead0000000000000000000000000000000000000000000000000000000060005260206000fd5b875160009015610a97576000610a13846000015160008c86611fbf565b905080610a95576000610a27610800611fd7565b805190915015610a8f57846000015173ffffffffffffffffffffffffffffffffffffffff168a602001517f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201876020015184604051610a86929190613ffa565b60405180910390a35b60019250505b505b600088608001515a8603019050610ae96000838b8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250889250612003915050565b9a9950505050505050505050565b8160008167ffffffffffffffff811115610b1357610b136139d7565b604051908082528060200260200182016040528015610b4c57816020015b610b3961390d565b815260200190600190039081610b315790505b50905060005b82811015610bc5576000828281518110610b6e57610b6e614013565b60200260200101519050600080610ba9848a8a87818110610b9157610b91614013565b9050602002810190610ba39190614042565b856123e1565b91509150610bba84838360006125a3565b505050600101610b52565b506000805b83811015610c2557610c1981888884818110610be857610be8614013565b9050602002810190610bfa9190614042565b858481518110610c0c57610c0c614013565b60200260200101516127f8565b90910190600101610bca565b50610c30848261297d565b505050505050565b33600090815260208190526040902080546dffffffffffffffffffffffffffff16821115610cc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606401610639565b8054610cdf9083906dffffffffffffffffffffffffffff16614080565b81547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff919091161781556040805173ffffffffffffffffffffffffffffffffffffffff851681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb910160405180910390a260008373ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d8060008114610dc4576040519150601f19603f3d011682016040523d82523d6000602084013e610dc9565b606091505b5050905080610e34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f6661696c656420746f20776974686472617700000000000000000000000000006044820152606401610639565b50505050565b816000805b828110156110335736868683818110610e5a57610e5a614013565b9050602002810190610e6c9190614093565b9050366000610e7b83806140c7565b90925090506000610e926040850160208601613db6565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff821601610f33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4141393620696e76616c69642061676772656761746f720000000000000000006044820152606401610639565b73ffffffffffffffffffffffffffffffffffffffff8116156110105773ffffffffffffffffffffffffffffffffffffffff811663e3563a4f8484610f7a604089018961412f565b6040518563ffffffff1660e01b8152600401610f999493929190614345565b60006040518083038186803b158015610fb157600080fd5b505afa925050508015610fc2575060015b611010576040517f86a9f75000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610639565b61101a8287613f79565b955050505050808061102b906143fc565b915050610e3f565b5060008167ffffffffffffffff81111561104f5761104f6139d7565b60405190808252806020026020018201604052801561108857816020015b61107561390d565b81526020019060019003908161106d5790505b5090506000805b8481101561117357368888838181106110aa576110aa614013565b90506020028101906110bc9190614093565b90503660006110cb83806140c7565b909250905060006110e26040850160208601613db6565b90508160005b8181101561115a57600089898151811061110457611104614013565b602002602001015190506000806111278b898987818110610b9157610b91614013565b91509150611137848383896125a3565b8a611141816143fc565b9b50505050508080611152906143fc565b9150506110e8565b505050505050808061116b906143fc565b91505061108f565b50600080915060005b85811015611299573689898381811061119757611197614013565b90506020028101906111a99190614093565b90506111bb6040820160208301613db6565b73ffffffffffffffffffffffffffffffffffffffff167f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d60405160405180910390a236600061120a83806140c7565b90925090508060005b81811015611281576112558885858481811061123157611231614013565b90506020028101906112439190614042565b8b8b81518110610c0c57610c0c614013565b61125f9088613f79565b96508761126b816143fc565b9850508080611279906143fc565b915050611213565b50505050508080611291906143fc565b91505061117c565b506040516000907f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d908290a26112cf868261297d565b5050505050505050565b831580156112fc575073ffffffffffffffffffffffffffffffffffffffff83163b155b15611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f41413230206163636f756e74206e6f74206465706c6f796564000000000000006044820152606401610639565b601481106113f557600061137a6014828486614434565b6113839161445e565b60601c9050803b6000036113f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f41413330207061796d6173746572206e6f74206465706c6f79656400000000006044820152606401610639565b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604401610639565b6040517f570e1a3600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063570e1a36906114a590859085906004016144a6565b6020604051808303816000875af11580156114c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e891906144ba565b6040517f6ca7b80600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610639565b600061153e82612ac9565b6040805160208101929092523090820152466060820152608001604051602081830303815290604052805190602001209050919050565b3360009081526020819052604081206001810154909163ffffffff90911690036115fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6e6f74207374616b6564000000000000000000000000000000000000000000006044820152606401610639565b80546e010000000000000000000000000000900460ff16611678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f616c726561647920756e7374616b696e670000000000000000000000000000006044820152606401610639565b60018101546000906116909063ffffffff16426144d7565b6001830180547fffffffffffffffffffffffffffffffffffffffffffff000000000000ffffffff1664010000000065ffffffffffff84169081029190911790915583547fffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffff16845560405190815290915033907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a906020016105b5565b33600090815260208190526040902080546f0100000000000000000000000000000090046dffffffffffffffffffffffffffff16806117c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4e6f207374616b6520746f2077697468647261770000000000000000000000006044820152606401610639565b6001820154640100000000900465ffffffffffff16611842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606401610639565b60018201544264010000000090910465ffffffffffff1611156118c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606401610639565b6001820180547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016905581547fffffff0000000000000000000000000000ffffffffffffffffffffffffffffff1682556040805173ffffffffffffffffffffffffffffffffffffffff851681526020810183905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3910160405180910390a260008373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146119bc576040519150601f19603f3d011682016040523d82523d6000602084013e6119c1565b606091505b5050905080610e34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606401610639565b611a3461390d565b611a3d85612ae2565b600080611a4c600088856123e1565b915091506000611a5c8383612bd5565b9050611a6743600052565b6000611a7560008a876127f8565b9050611a8043600052565b6000606073ffffffffffffffffffffffffffffffffffffffff8a1615611b10578973ffffffffffffffffffffffffffffffffffffffff168989604051611ac79291906144fd565b6000604051808303816000865af19150503d8060008114611b04576040519150601f19603f3d011682016040523d82523d6000602084013e611b09565b606091505b5090925090505b8660800151838560200151866040015185856040517f8b7ac9800000000000000000000000000000000000000000000000000000000081526004016106399695949392919061450d565b611b6261390d565b611b6b82612ae2565b600080611b7a600085856123e1565b845160a001516040805180820182526000808252602080830182815273ffffffffffffffffffffffffffffffffffffffff958616835282825284832080546dffffffffffffffffffffffffffff6f01000000000000000000000000000000918290048116875260019283015463ffffffff9081169094528d51518851808a018a5287815280870188815291909a16875286865288872080549390930490911689529101549091169052835180850190945281845283015293955091935090366000611c4860408a018a61412f565b909250905060006014821015611c5f576000611c7a565b611c6d601460008486614434565b611c769161445e565b60601c5b6040805180820182526000808252602080830182815273ffffffffffffffffffffffffffffffffffffffff861683529082905292902080546f0100000000000000000000000000000090046dffffffffffffffffffffffffffff1682526001015463ffffffff1690915290915093505050506000611cf88686612bd5565b90506000816000015190506000600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614905060006040518060c001604052808b6080015181526020018b6040015181526020018315158152602001856020015165ffffffffffff168152602001856040015165ffffffffffff168152602001611d8f8c6060015190565b9052905073ffffffffffffffffffffffffffffffffffffffff831615801590611dcf575073ffffffffffffffffffffffffffffffffffffffff8316600114155b15611e885760408051808201825273ffffffffffffffffffffffffffffffffffffffff851680825282518084018452600080825260208083018281529382528181529085902080546f0100000000000000000000000000000090046dffffffffffffffffffffffffffff1683526001015463ffffffff169092529082015290517ffaecb4e4000000000000000000000000000000000000000000000000000000008152610639908390899089908c9086906004016145af565b808686896040517fe0cff05f000000000000000000000000000000000000000000000000000000008152600401610639949392919061463c565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054909190611f079084906dffffffffffffffffffffffffffff16613f79565b90506dffffffffffffffffffffffffffff811115611f81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6465706f736974206f766572666c6f77000000000000000000000000000000006044820152606401610639565b81547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff919091161790555050565b6000806000845160208601878987f195945050505050565b60603d82811115611fe55750815b604051602082018101604052818152816000602083013e9392505050565b6000805a85519091506000908161201982612cbc565b60a083015190915073ffffffffffffffffffffffffffffffffffffffff81166120455782519350612293565b80935060008851111561229357868202955060028a600281111561206b5761206b614693565b146121035760608301516040517fa9a2340900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169163a9a23409916120cb908e908d908c906004016146c2565b600060405180830381600088803b1580156120e557600080fd5b5087f11580156120f9573d6000803e3d6000fd5b5050505050612293565b60608301516040517fa9a2340900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169163a9a234099161215e908e908d908c906004016146c2565b600060405180830381600088803b15801561217857600080fd5b5087f19350505050801561218a575060015b61229357612196614722565b806308c379a00361222657506121aa61473e565b806121b55750612228565b8b816040516020016121c791906147e6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f220266b60000000000000000000000000000000000000000000000000000000082526106399291600401613ffa565b505b8a6040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526012908201527f4141353020706f73744f70207265766572740000000000000000000000000000606082015260800190565b5a85038701965081870295508589604001511015612315578a6040517f220266b600000000000000000000000000000000000000000000000000000000815260040161063991815260406020808301829052908201527f414135312070726566756e642062656c6f772061637475616c476173436f7374606082015260800190565b60408901518690036123278582611ec2565b6000808c600281111561233c5761233c614693565b1490508460a0015173ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff168c602001517f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f8860200151858d8f6040516123c9949392919093845291151560208401526040830152606082015260800190565b60405180910390a45050505050505095945050505050565b60008060005a84519091506123f68682612cec565b6123ff86611533565b6020860152604081015160608201516080830151171760e087013517610100870135176effffffffffffffffffffffffffffff81111561249b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606401610639565b6000806124a784612e0c565b90506124b58a8a8a84612e66565b975091506124c243600052565b60a084015160609073ffffffffffffffffffffffffffffffffffffffff16156124f7576124f28b8b8b858761317c565b975090505b60005a87039050808b60a001351015612575578b6040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639918152604060208201819052601e908201527f41413430206f76657220766572696669636174696f6e4761734c696d69740000606082015260800190565b60408a018390528160608b015260c08b01355a8803018a608001818152505050505050505050935093915050565b6000806125af8561343f565b915091508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461265157856040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526014908201527f41413234207369676e6174757265206572726f72000000000000000000000000606082015260800190565b80156126c257856040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526017908201527f414132322065787069726564206f72206e6f7420647565000000000000000000606082015260800190565b60006126cd8561343f565b9250905073ffffffffffffffffffffffffffffffffffffffff81161561275857866040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526014908201527f41413334207369676e6174757265206572726f72000000000000000000000000606082015260800190565b81156127ef57866040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526021908201527f41413332207061796d61737465722065787069726564206f72206e6f7420647560608201527f6500000000000000000000000000000000000000000000000000000000000000608082015260a00190565b50505050505050565b6000805a9050600061280b846060015190565b905030631d732756612820606088018861412f565b87856040518563ffffffff1660e01b8152600401612841949392919061482b565b6020604051808303816000875af192505050801561289a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612897918101906148ec565b60015b61297157600060206000803e506000517f2152215300000000000000000000000000000000000000000000000000000000810161293c57866040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639918152604060208201819052600f908201527f41413935206f7574206f66206761730000000000000000000000000000000000606082015260800190565b600085608001515a61294e9086614080565b6129589190613f79565b9050612968886002888685612003565b94505050612974565b92505b50509392505050565b73ffffffffffffffffffffffffffffffffffffffff82166129fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4141393020696e76616c69642062656e656669636961727900000000000000006044820152606401610639565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612a54576040519150601f19603f3d011682016040523d82523d6000602084013e612a59565b606091505b5050905080612ac4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f41413931206661696c65642073656e6420746f2062656e6566696369617279006044820152606401610639565b505050565b6000612ad482613492565b805190602001209050919050565b3063957122ab612af5604084018461412f565b612b026020860186613db6565b612b1061012087018761412f565b6040518663ffffffff1660e01b8152600401612b30959493929190614905565b60006040518083038186803b158015612b4857600080fd5b505afa925050508015612b59575060015b612bd257612b65614722565b806308c379a003612bc65750612b7961473e565b80612b845750612bc8565b805115612bc2576000816040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639929190613ffa565b5050565b505b3d6000803e3d6000fd5b50565b6040805160608101825260008082526020820181905291810182905290612bfb846134d1565b90506000612c08846134d1565b825190915073ffffffffffffffffffffffffffffffffffffffff8116612c2c575080515b602080840151604080860151928501519085015191929165ffffffffffff8083169085161015612c5a578193505b8065ffffffffffff168365ffffffffffff161115612c76578092505b50506040805160608101825273ffffffffffffffffffffffffffffffffffffffff909416845265ffffffffffff9283166020850152911690820152925050505b92915050565b60c081015160e082015160009190808203612cd8575092915050565b612ce48248830161354f565b949350505050565b612cf96020830183613db6565b73ffffffffffffffffffffffffffffffffffffffff16815260208083013590820152608080830135604083015260a0830135606083015260c0808401359183019190915260e0808401359183019190915261010083013590820152366000612d6561012085018561412f565b90925090508015612dff576014811015612ddb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606401610639565b612de9601460008385614434565b612df29161445e565b60601c60a0840152610e34565b600060a084015250505050565b60a0810151600090819073ffffffffffffffffffffffffffffffffffffffff16612e37576001612e3a565b60035b60ff16905060008360800151828560600151028560400151010190508360c00151810292505050919050565b60008060005a8551805191925090612e8b8988612e8660408c018c61412f565b613567565b60a0820151612e9943600052565b600073ffffffffffffffffffffffffffffffffffffffff8216612f025773ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020546dffffffffffffffffffffffffffff16888111612efb57808903612efe565b60005b9150505b606084015160208a01516040517f3a871cdd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff861692633a871cdd929091612f62918f918790600401614948565b60206040518083038160008887f193505050508015612fbc575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612fb9918101906148ec565b60015b61306657612fc8614722565b806308c379a003612ff95750612fdc61473e565b80612fe75750612ffb565b8b816040516020016121c7919061496d565b505b8a6040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526016908201527f4141323320726576657274656420286f72204f4f472900000000000000000000606082015260800190565b955073ffffffffffffffffffffffffffffffffffffffff82166131695773ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902080546dffffffffffffffffffffffffffff16808a111561312d578c6040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526017908201527f41413231206469646e2774207061792070726566756e64000000000000000000606082015260800190565b81547fffffffffffffffffffffffffffffffffffff000000000000000000000000000016908a90036dffffffffffffffffffffffffffff161790555b5a85039650505050505094509492505050565b825160608181015190916000918481116131f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4141343120746f6f206c6974746c6520766572696669636174696f6e476173006044820152606401610639565b60a082015173ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902080548784039291906dffffffffffffffffffffffffffff16898110156132a7578c6040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639918152604060208201819052601e908201527f41413331207061796d6173746572206465706f73697420746f6f206c6f770000606082015260800190565b8981038260000160006101000a8154816dffffffffffffffffffffffffffff02191690836dffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff1663f465c77e858e8e602001518e6040518563ffffffff1660e01b815260040161332293929190614948565b60006040518083038160008887f19350505050801561338157506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261337e91908101906149b2565b60015b61342b5761338d614722565b806308c379a0036133be57506133a161473e565b806133ac57506133c0565b8d816040516020016121c79190614a3e565b505b8c6040517f220266b60000000000000000000000000000000000000000000000000000000081526004016106399181526040602082018190526016908201527f4141333320726576657274656420286f72204f4f472900000000000000000000606082015260800190565b909e909d509b505050505050505050505050565b6000808260000361345557506000928392509050565b6000613460846134d1565b9050806040015165ffffffffffff164211806134875750806020015165ffffffffffff1642105b905194909350915050565b60603660006134a561014085018561412f565b915091508360208184030360405194506020810185016040528085528082602087013750505050919050565b60408051606081018252600080825260208201819052918101919091528160a081901c65ffffffffffff811660000361350d575065ffffffffffff5b6040805160608101825273ffffffffffffffffffffffffffffffffffffffff909316835260d09490941c602083015265ffffffffffff16928101929092525090565b600081831061355e5781613560565b825b9392505050565b8015610e345782515173ffffffffffffffffffffffffffffffffffffffff81163b156135f857846040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639918152604060208201819052601f908201527f414131302073656e64657220616c726561647920636f6e737472756374656400606082015260800190565b8351606001516040517f570e1a3600000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163570e1a36919061367690889088906004016144a6565b60206040518083038160008887f1158015613695573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906136ba91906144ba565b905073ffffffffffffffffffffffffffffffffffffffff811661374257856040517f220266b6000000000000000000000000000000000000000000000000000000008152600401610639918152604060208201819052601b908201527f4141313320696e6974436f6465206661696c6564206f72204f4f470000000000606082015260800190565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146137df57856040517f220266b600000000000000000000000000000000000000000000000000000000815260040161063991815260406020808301829052908201527f4141313420696e6974436f6465206d7573742072657475726e2073656e646572606082015260800190565b8073ffffffffffffffffffffffffffffffffffffffff163b60000361386857856040517f220266b600000000000000000000000000000000000000000000000000000000815260040161063991815260406020808301829052908201527f4141313520696e6974436f6465206d757374206372656174652073656e646572606082015260800190565b60006138776014828688614434565b6138809161445e565b60601c90508273ffffffffffffffffffffffffffffffffffffffff1686602001517fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d83896000015160a001516040516138fc92919073ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b60405180910390a350505050505050565b6040518060a0016040528061398c604051806101000160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b8152602001600080191681526020016000815260200160008152602001600081525090565b6000602082840312156139c357600080fd5b813563ffffffff8116811461356057600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60a0810181811067ffffffffffffffff82111715613a2657613a266139d7565b60405250565b610100810181811067ffffffffffffffff82111715613a2657613a266139d7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff82111715613a9157613a916139d7565b6040525050565b600067ffffffffffffffff821115613ab257613ab26139d7565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b73ffffffffffffffffffffffffffffffffffffffff81168114612bd257600080fd5b8035613b0b81613ade565b919050565b6000818303610180811215613b2457600080fd5b604051613b3081613a06565b80925061010080831215613b4357600080fd5b6040519250613b5183613a2c565b613b5a85613b00565b835260208501356020840152604085013560408401526060850135606084015260808501356080840152613b9060a08601613b00565b60a084015260c085013560c084015260e085013560e084015282825280850135602083015250610120840135604082015261014084013560608201526101608401356080820152505092915050565b60008083601f840112613bf157600080fd5b50813567ffffffffffffffff811115613c0957600080fd5b602083019150836020828501011115613c2157600080fd5b9250929050565b6000806000806101c08587031215613c3f57600080fd5b843567ffffffffffffffff80821115613c5757600080fd5b818701915087601f830112613c6b57600080fd5b8135613c7681613a98565b604051613c838282613a4d565b8281528a6020848701011115613c9857600080fd5b82602086016020830137600060208483010152809850505050613cbe8860208901613b10565b94506101a0870135915080821115613cd557600080fd5b50613ce287828801613bdf565b95989497509550505050565b60008083601f840112613d0057600080fd5b50813567ffffffffffffffff811115613d1857600080fd5b6020830191508360208260051b8501011115613c2157600080fd5b600080600060408486031215613d4857600080fd5b833567ffffffffffffffff811115613d5f57600080fd5b613d6b86828701613cee565b9094509250506020840135613d7f81613ade565b809150509250925092565b60008060408385031215613d9d57600080fd5b8235613da881613ade565b946020939093013593505050565b600060208284031215613dc857600080fd5b813561356081613ade565b600080600080600060608688031215613deb57600080fd5b853567ffffffffffffffff80821115613e0357600080fd5b613e0f89838a01613bdf565b909750955060208801359150613e2482613ade565b90935060408701359080821115613e3a57600080fd5b50613e4788828901613bdf565b969995985093965092949392505050565b60008060208385031215613e6b57600080fd5b823567ffffffffffffffff811115613e8257600080fd5b613e8e85828601613bdf565b90969095509350505050565b60006101608284031215613ead57600080fd5b50919050565b600060208284031215613ec557600080fd5b813567ffffffffffffffff811115613edc57600080fd5b612ce484828501613e9a565b60008060008060608587031215613efe57600080fd5b843567ffffffffffffffff80821115613f1657600080fd5b613f2288838901613e9a565b955060208701359150613f3482613ade565b90935060408601359080821115613cd557600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115612cb657612cb6613f4a565b60005b83811015613fa7578181015183820152602001613f8f565b50506000910152565b60008151808452613fc8816020860160208601613f8c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b828152604060208201526000612ce46040830184613fb0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea183360301811261407657600080fd5b9190910192915050565b81810381811115612cb657612cb6613f4a565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261407657600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126140fc57600080fd5b83018035915067ffffffffffffffff82111561411757600080fd5b6020019150600581901b3603821315613c2157600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261416457600080fd5b83018035915067ffffffffffffffff82111561417f57600080fd5b602001915036819003821315613c2157600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126141c957600080fd5b830160208101925035905067ffffffffffffffff8111156141e957600080fd5b803603821315613c2157600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600061016061426d8461425385613b00565b73ffffffffffffffffffffffffffffffffffffffff169052565b602083013560208501526142846040840184614194565b82604087015261429783870182846141f8565b925050506142a86060840184614194565b85830360608701526142bb8382846141f8565b925050506080830135608085015260a083013560a085015260c083013560c085015260e083013560e085015261010080840135818601525061012061430281850185614194565b868403838801526143148482846141f8565b935050505061014061432881850185614194565b8684038388015261433a8482846141f8565b979650505050505050565b6040808252810184905260006060600586901b830181019083018783805b898110156143e5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa087860301845282357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea18c36030181126143c3578283fd5b6143cf868d8301614241565b9550506020938401939290920191600101614363565b50505050828103602084015261433a8185876141f8565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361442d5761442d613f4a565b5060010190565b6000808585111561444457600080fd5b8386111561445157600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000813581811691601485101561449e5780818660140360031b1b83161692505b505092915050565b602081526000612ce46020830184866141f8565b6000602082840312156144cc57600080fd5b815161356081613ade565b65ffffffffffff8181168382160190808211156144f6576144f6613f4a565b5092915050565b8183823760009101908152919050565b868152856020820152600065ffffffffffff8087166040840152808616606084015250831515608083015260c060a083015261454c60c0830184613fb0565b98975050505050505050565b80518252602081015160208301526040810151151560408301526000606082015165ffffffffffff8082166060860152806080850151166080860152505060a082015160c060a0850152612ce460c0850182613fb0565b60006101408083526145c381840189614558565b9150506145dd602083018780518252602090810151910152565b845160608301526020948501516080830152835160a08301529284015160c0820152815173ffffffffffffffffffffffffffffffffffffffff1660e0820152908301518051610100830152909201516101209092019190915292915050565b60e08152600061464f60e0830187614558565b9050614668602083018680518252602090810151910152565b8351606083015260208401516080830152825160a0830152602083015160c083015295945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000600385106146fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b848252606060208301526147126060830185613fb0565b9050826040830152949350505050565b600060033d111561473b5760046000803e5060005160e01c5b90565b600060443d101561474c5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561479a57505050505090565b82850191508151818111156147b25750505050505090565b843d87010160208285010111156147cc5750505050505090565b6147db60208286010187613a4d565b509095945050505050565b7f4141353020706f73744f702072657665727465643a200000000000000000000081526000825161481e816016850160208701613f8c565b9190910160160192915050565b60006101c080835261484081840187896141f8565b9050845173ffffffffffffffffffffffffffffffffffffffff808251166020860152602082015160408601526040820151606086015260608201516080860152608082015160a08601528060a08301511660c08601525060c081015160e085015260e08101516101008501525060208501516101208401526040850151610140840152606085015161016084015260808501516101808401528281036101a084015261433a8185613fb0565b6000602082840312156148fe57600080fd5b5051919050565b6060815260006149196060830187896141f8565b73ffffffffffffffffffffffffffffffffffffffff86166020840152828103604084015261454c8185876141f8565b60608152600061495b6060830186614241565b60208301949094525060400152919050565b7f414132332072657665727465643a2000000000000000000000000000000000008152600082516149a581600f850160208701613f8c565b91909101600f0192915050565b600080604083850312156149c557600080fd5b825167ffffffffffffffff8111156149dc57600080fd5b8301601f810185136149ed57600080fd5b80516149f881613a98565b604051614a058282613a4d565b828152876020848601011115614a1a57600080fd5b614a2b836020830160208701613f8c565b6020969096015195979596505050505050565b7f414133332072657665727465643a2000000000000000000000000000000000008152600082516149a581600f850160208701613f8c56fea164736f6c6343000813000a608060405234801561001057600080fd5b506101ea806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063570e1a3614610030575b600080fd5b61004361003e3660046100f9565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60008061007c601482858761016b565b61008591610195565b60601c90506000610099846014818861016b565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525084519495509360209350849250905082850182875af190506000519350806100f057600093505b50505092915050565b6000806020838503121561010c57600080fd5b823567ffffffffffffffff8082111561012457600080fd5b818501915085601f83011261013857600080fd5b81358181111561014757600080fd5b86602082850101111561015957600080fd5b60209290920196919550909350505050565b6000808585111561017b57600080fd5b8386111561018857600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000081358181169160148510156101d55780818660140360031b1b83161692505b50509291505056fea164736f6c6343000813000a",
-}
-
-var EntryPointABI = EntryPointMetaData.ABI
-
-var EntryPointBin = EntryPointMetaData.Bin
-
-func DeployEntryPoint(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EntryPoint, error) {
- parsed, err := EntryPointMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EntryPointBin), backend)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &EntryPoint{address: address, abi: *parsed, EntryPointCaller: EntryPointCaller{contract: contract}, EntryPointTransactor: EntryPointTransactor{contract: contract}, EntryPointFilterer: EntryPointFilterer{contract: contract}}, nil
-}
-
-type EntryPoint struct {
- address common.Address
- abi abi.ABI
- EntryPointCaller
- EntryPointTransactor
- EntryPointFilterer
-}
-
-type EntryPointCaller struct {
- contract *bind.BoundContract
-}
-
-type EntryPointTransactor struct {
- contract *bind.BoundContract
-}
-
-type EntryPointFilterer struct {
- contract *bind.BoundContract
-}
-
-type EntryPointSession struct {
- Contract *EntryPoint
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type EntryPointCallerSession struct {
- Contract *EntryPointCaller
- CallOpts bind.CallOpts
-}
-
-type EntryPointTransactorSession struct {
- Contract *EntryPointTransactor
- TransactOpts bind.TransactOpts
-}
-
-type EntryPointRaw struct {
- Contract *EntryPoint
-}
-
-type EntryPointCallerRaw struct {
- Contract *EntryPointCaller
-}
-
-type EntryPointTransactorRaw struct {
- Contract *EntryPointTransactor
-}
-
-func NewEntryPoint(address common.Address, backend bind.ContractBackend) (*EntryPoint, error) {
- abi, err := abi.JSON(strings.NewReader(EntryPointABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindEntryPoint(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &EntryPoint{address: address, abi: abi, EntryPointCaller: EntryPointCaller{contract: contract}, EntryPointTransactor: EntryPointTransactor{contract: contract}, EntryPointFilterer: EntryPointFilterer{contract: contract}}, nil
-}
-
-func NewEntryPointCaller(address common.Address, caller bind.ContractCaller) (*EntryPointCaller, error) {
- contract, err := bindEntryPoint(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &EntryPointCaller{contract: contract}, nil
-}
-
-func NewEntryPointTransactor(address common.Address, transactor bind.ContractTransactor) (*EntryPointTransactor, error) {
- contract, err := bindEntryPoint(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &EntryPointTransactor{contract: contract}, nil
-}
-
-func NewEntryPointFilterer(address common.Address, filterer bind.ContractFilterer) (*EntryPointFilterer, error) {
- contract, err := bindEntryPoint(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &EntryPointFilterer{contract: contract}, nil
-}
-
-func bindEntryPoint(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := EntryPointMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_EntryPoint *EntryPointRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _EntryPoint.Contract.EntryPointCaller.contract.Call(opts, result, method, params...)
-}
-
-func (_EntryPoint *EntryPointRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _EntryPoint.Contract.EntryPointTransactor.contract.Transfer(opts)
-}
-
-func (_EntryPoint *EntryPointRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _EntryPoint.Contract.EntryPointTransactor.contract.Transact(opts, method, params...)
-}
-
-func (_EntryPoint *EntryPointCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _EntryPoint.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_EntryPoint *EntryPointTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _EntryPoint.Contract.contract.Transfer(opts)
-}
-
-func (_EntryPoint *EntryPointTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _EntryPoint.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_EntryPoint *EntryPointCaller) SIGVALIDATIONFAILED(opts *bind.CallOpts) (*big.Int, error) {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "SIG_VALIDATION_FAILED")
-
- if err != nil {
- return *new(*big.Int), err
- }
-
- out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
-
- return out0, err
-
-}
-
-func (_EntryPoint *EntryPointSession) SIGVALIDATIONFAILED() (*big.Int, error) {
- return _EntryPoint.Contract.SIGVALIDATIONFAILED(&_EntryPoint.CallOpts)
-}
-
-func (_EntryPoint *EntryPointCallerSession) SIGVALIDATIONFAILED() (*big.Int, error) {
- return _EntryPoint.Contract.SIGVALIDATIONFAILED(&_EntryPoint.CallOpts)
-}
-
-func (_EntryPoint *EntryPointCaller) ValidateSenderAndPaymaster(opts *bind.CallOpts, initCode []byte, sender common.Address, paymasterAndData []byte) error {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "_validateSenderAndPaymaster", initCode, sender, paymasterAndData)
-
- if err != nil {
- return err
- }
-
- return err
-
-}
-
-func (_EntryPoint *EntryPointSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error {
- return _EntryPoint.Contract.ValidateSenderAndPaymaster(&_EntryPoint.CallOpts, initCode, sender, paymasterAndData)
-}
-
-func (_EntryPoint *EntryPointCallerSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error {
- return _EntryPoint.Contract.ValidateSenderAndPaymaster(&_EntryPoint.CallOpts, initCode, sender, paymasterAndData)
-}
-
-func (_EntryPoint *EntryPointCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "balanceOf", account)
-
- if err != nil {
- return *new(*big.Int), err
- }
-
- out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
-
- return out0, err
-
-}
-
-func (_EntryPoint *EntryPointSession) BalanceOf(account common.Address) (*big.Int, error) {
- return _EntryPoint.Contract.BalanceOf(&_EntryPoint.CallOpts, account)
-}
-
-func (_EntryPoint *EntryPointCallerSession) BalanceOf(account common.Address) (*big.Int, error) {
- return _EntryPoint.Contract.BalanceOf(&_EntryPoint.CallOpts, account)
-}
-
-func (_EntryPoint *EntryPointCaller) Deposits(opts *bind.CallOpts, arg0 common.Address) (Deposits,
-
- error) {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "deposits", arg0)
-
- outstruct := new(Deposits)
- if err != nil {
- return *outstruct, err
- }
-
- outstruct.Deposit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
- outstruct.Staked = *abi.ConvertType(out[1], new(bool)).(*bool)
- outstruct.Stake = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
- outstruct.UnstakeDelaySec = *abi.ConvertType(out[3], new(uint32)).(*uint32)
- outstruct.WithdrawTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int)
-
- return *outstruct, err
-
-}
-
-func (_EntryPoint *EntryPointSession) Deposits(arg0 common.Address) (Deposits,
-
- error) {
- return _EntryPoint.Contract.Deposits(&_EntryPoint.CallOpts, arg0)
-}
-
-func (_EntryPoint *EntryPointCallerSession) Deposits(arg0 common.Address) (Deposits,
-
- error) {
- return _EntryPoint.Contract.Deposits(&_EntryPoint.CallOpts, arg0)
-}
-
-func (_EntryPoint *EntryPointCaller) GetDepositInfo(opts *bind.CallOpts, account common.Address) (IStakeManagerDepositInfo, error) {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "getDepositInfo", account)
-
- if err != nil {
- return *new(IStakeManagerDepositInfo), err
- }
-
- out0 := *abi.ConvertType(out[0], new(IStakeManagerDepositInfo)).(*IStakeManagerDepositInfo)
-
- return out0, err
-
-}
-
-func (_EntryPoint *EntryPointSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) {
- return _EntryPoint.Contract.GetDepositInfo(&_EntryPoint.CallOpts, account)
-}
-
-func (_EntryPoint *EntryPointCallerSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) {
- return _EntryPoint.Contract.GetDepositInfo(&_EntryPoint.CallOpts, account)
-}
-
-func (_EntryPoint *EntryPointCaller) GetUserOpHash(opts *bind.CallOpts, userOp UserOperation) ([32]byte, error) {
- var out []interface{}
- err := _EntryPoint.contract.Call(opts, &out, "getUserOpHash", userOp)
-
- if err != nil {
- return *new([32]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)
-
- return out0, err
-
-}
-
-func (_EntryPoint *EntryPointSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) {
- return _EntryPoint.Contract.GetUserOpHash(&_EntryPoint.CallOpts, userOp)
-}
-
-func (_EntryPoint *EntryPointCallerSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) {
- return _EntryPoint.Contract.GetUserOpHash(&_EntryPoint.CallOpts, userOp)
-}
-
-func (_EntryPoint *EntryPointTransactor) AddStake(opts *bind.TransactOpts, unstakeDelaySec uint32) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "addStake", unstakeDelaySec)
-}
-
-func (_EntryPoint *EntryPointSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) {
- return _EntryPoint.Contract.AddStake(&_EntryPoint.TransactOpts, unstakeDelaySec)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) {
- return _EntryPoint.Contract.AddStake(&_EntryPoint.TransactOpts, unstakeDelaySec)
-}
-
-func (_EntryPoint *EntryPointTransactor) DepositTo(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "depositTo", account)
-}
-
-func (_EntryPoint *EntryPointSession) DepositTo(account common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.DepositTo(&_EntryPoint.TransactOpts, account)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) DepositTo(account common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.DepositTo(&_EntryPoint.TransactOpts, account)
-}
-
-func (_EntryPoint *EntryPointTransactor) GetSenderAddress(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "getSenderAddress", initCode)
-}
-
-func (_EntryPoint *EntryPointSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.GetSenderAddress(&_EntryPoint.TransactOpts, initCode)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.GetSenderAddress(&_EntryPoint.TransactOpts, initCode)
-}
-
-func (_EntryPoint *EntryPointTransactor) HandleAggregatedOps(opts *bind.TransactOpts, opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "handleAggregatedOps", opsPerAggregator, beneficiary)
-}
-
-func (_EntryPoint *EntryPointSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.HandleAggregatedOps(&_EntryPoint.TransactOpts, opsPerAggregator, beneficiary)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.HandleAggregatedOps(&_EntryPoint.TransactOpts, opsPerAggregator, beneficiary)
-}
-
-func (_EntryPoint *EntryPointTransactor) HandleOps(opts *bind.TransactOpts, ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "handleOps", ops, beneficiary)
-}
-
-func (_EntryPoint *EntryPointSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.HandleOps(&_EntryPoint.TransactOpts, ops, beneficiary)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.HandleOps(&_EntryPoint.TransactOpts, ops, beneficiary)
-}
-
-func (_EntryPoint *EntryPointTransactor) InnerHandleOp(opts *bind.TransactOpts, callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "innerHandleOp", callData, opInfo, context)
-}
-
-func (_EntryPoint *EntryPointSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.InnerHandleOp(&_EntryPoint.TransactOpts, callData, opInfo, context)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.InnerHandleOp(&_EntryPoint.TransactOpts, callData, opInfo, context)
-}
-
-func (_EntryPoint *EntryPointTransactor) SimulateHandleOp(opts *bind.TransactOpts, op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "simulateHandleOp", op, target, targetCallData)
-}
-
-func (_EntryPoint *EntryPointSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.SimulateHandleOp(&_EntryPoint.TransactOpts, op, target, targetCallData)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) {
- return _EntryPoint.Contract.SimulateHandleOp(&_EntryPoint.TransactOpts, op, target, targetCallData)
-}
-
-func (_EntryPoint *EntryPointTransactor) SimulateValidation(opts *bind.TransactOpts, userOp UserOperation) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "simulateValidation", userOp)
-}
-
-func (_EntryPoint *EntryPointSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) {
- return _EntryPoint.Contract.SimulateValidation(&_EntryPoint.TransactOpts, userOp)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) {
- return _EntryPoint.Contract.SimulateValidation(&_EntryPoint.TransactOpts, userOp)
-}
-
-func (_EntryPoint *EntryPointTransactor) UnlockStake(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "unlockStake")
-}
-
-func (_EntryPoint *EntryPointSession) UnlockStake() (*types.Transaction, error) {
- return _EntryPoint.Contract.UnlockStake(&_EntryPoint.TransactOpts)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) UnlockStake() (*types.Transaction, error) {
- return _EntryPoint.Contract.UnlockStake(&_EntryPoint.TransactOpts)
-}
-
-func (_EntryPoint *EntryPointTransactor) WithdrawStake(opts *bind.TransactOpts, withdrawAddress common.Address) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "withdrawStake", withdrawAddress)
-}
-
-func (_EntryPoint *EntryPointSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.WithdrawStake(&_EntryPoint.TransactOpts, withdrawAddress)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) {
- return _EntryPoint.Contract.WithdrawStake(&_EntryPoint.TransactOpts, withdrawAddress)
-}
-
-func (_EntryPoint *EntryPointTransactor) WithdrawTo(opts *bind.TransactOpts, withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) {
- return _EntryPoint.contract.Transact(opts, "withdrawTo", withdrawAddress, withdrawAmount)
-}
-
-func (_EntryPoint *EntryPointSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) {
- return _EntryPoint.Contract.WithdrawTo(&_EntryPoint.TransactOpts, withdrawAddress, withdrawAmount)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) {
- return _EntryPoint.Contract.WithdrawTo(&_EntryPoint.TransactOpts, withdrawAddress, withdrawAmount)
-}
-
-func (_EntryPoint *EntryPointTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _EntryPoint.contract.RawTransact(opts, nil)
-}
-
-func (_EntryPoint *EntryPointSession) Receive() (*types.Transaction, error) {
- return _EntryPoint.Contract.Receive(&_EntryPoint.TransactOpts)
-}
-
-func (_EntryPoint *EntryPointTransactorSession) Receive() (*types.Transaction, error) {
- return _EntryPoint.Contract.Receive(&_EntryPoint.TransactOpts)
-}
-
-type EntryPointAccountDeployedIterator struct {
- Event *EntryPointAccountDeployed
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointAccountDeployedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointAccountDeployed)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointAccountDeployed)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointAccountDeployedIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointAccountDeployedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointAccountDeployed struct {
- UserOpHash [32]byte
- Sender common.Address
- Factory common.Address
- Paymaster common.Address
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterAccountDeployed(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointAccountDeployedIterator, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "AccountDeployed", userOpHashRule, senderRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointAccountDeployedIterator{contract: _EntryPoint.contract, event: "AccountDeployed", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchAccountDeployed(opts *bind.WatchOpts, sink chan<- *EntryPointAccountDeployed, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "AccountDeployed", userOpHashRule, senderRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointAccountDeployed)
- if err := _EntryPoint.contract.UnpackLog(event, "AccountDeployed", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseAccountDeployed(log types.Log) (*EntryPointAccountDeployed, error) {
- event := new(EntryPointAccountDeployed)
- if err := _EntryPoint.contract.UnpackLog(event, "AccountDeployed", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointDepositedIterator struct {
- Event *EntryPointDeposited
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointDepositedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointDeposited)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointDeposited)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointDepositedIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointDepositedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointDeposited struct {
- Account common.Address
- TotalDeposit *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterDeposited(opts *bind.FilterOpts, account []common.Address) (*EntryPointDepositedIterator, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "Deposited", accountRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointDepositedIterator{contract: _EntryPoint.contract, event: "Deposited", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *EntryPointDeposited, account []common.Address) (event.Subscription, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "Deposited", accountRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointDeposited)
- if err := _EntryPoint.contract.UnpackLog(event, "Deposited", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseDeposited(log types.Log) (*EntryPointDeposited, error) {
- event := new(EntryPointDeposited)
- if err := _EntryPoint.contract.UnpackLog(event, "Deposited", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointSignatureAggregatorChangedIterator struct {
- Event *EntryPointSignatureAggregatorChanged
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointSignatureAggregatorChangedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointSignatureAggregatorChanged)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointSignatureAggregatorChanged)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointSignatureAggregatorChangedIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointSignatureAggregatorChangedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointSignatureAggregatorChanged struct {
- Aggregator common.Address
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterSignatureAggregatorChanged(opts *bind.FilterOpts, aggregator []common.Address) (*EntryPointSignatureAggregatorChangedIterator, error) {
-
- var aggregatorRule []interface{}
- for _, aggregatorItem := range aggregator {
- aggregatorRule = append(aggregatorRule, aggregatorItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "SignatureAggregatorChanged", aggregatorRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointSignatureAggregatorChangedIterator{contract: _EntryPoint.contract, event: "SignatureAggregatorChanged", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchSignatureAggregatorChanged(opts *bind.WatchOpts, sink chan<- *EntryPointSignatureAggregatorChanged, aggregator []common.Address) (event.Subscription, error) {
-
- var aggregatorRule []interface{}
- for _, aggregatorItem := range aggregator {
- aggregatorRule = append(aggregatorRule, aggregatorItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "SignatureAggregatorChanged", aggregatorRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointSignatureAggregatorChanged)
- if err := _EntryPoint.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseSignatureAggregatorChanged(log types.Log) (*EntryPointSignatureAggregatorChanged, error) {
- event := new(EntryPointSignatureAggregatorChanged)
- if err := _EntryPoint.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointStakeLockedIterator struct {
- Event *EntryPointStakeLocked
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointStakeLockedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeLocked)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeLocked)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointStakeLockedIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointStakeLockedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointStakeLocked struct {
- Account common.Address
- TotalStaked *big.Int
- UnstakeDelaySec *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterStakeLocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeLockedIterator, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeLocked", accountRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointStakeLockedIterator{contract: _EntryPoint.contract, event: "StakeLocked", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchStakeLocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeLocked, account []common.Address) (event.Subscription, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeLocked", accountRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointStakeLocked)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeLocked", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseStakeLocked(log types.Log) (*EntryPointStakeLocked, error) {
- event := new(EntryPointStakeLocked)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeLocked", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointStakeUnlockedIterator struct {
- Event *EntryPointStakeUnlocked
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointStakeUnlockedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeUnlocked)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeUnlocked)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointStakeUnlockedIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointStakeUnlockedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointStakeUnlocked struct {
- Account common.Address
- WithdrawTime *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterStakeUnlocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeUnlockedIterator, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeUnlocked", accountRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointStakeUnlockedIterator{contract: _EntryPoint.contract, event: "StakeUnlocked", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchStakeUnlocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeUnlocked, account []common.Address) (event.Subscription, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeUnlocked", accountRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointStakeUnlocked)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeUnlocked", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseStakeUnlocked(log types.Log) (*EntryPointStakeUnlocked, error) {
- event := new(EntryPointStakeUnlocked)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeUnlocked", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointStakeWithdrawnIterator struct {
- Event *EntryPointStakeWithdrawn
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointStakeWithdrawnIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeWithdrawn)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointStakeWithdrawn)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointStakeWithdrawnIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointStakeWithdrawnIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointStakeWithdrawn struct {
- Account common.Address
- WithdrawAddress common.Address
- Amount *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterStakeWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeWithdrawnIterator, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeWithdrawn", accountRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointStakeWithdrawnIterator{contract: _EntryPoint.contract, event: "StakeWithdrawn", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchStakeWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointStakeWithdrawn, account []common.Address) (event.Subscription, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeWithdrawn", accountRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointStakeWithdrawn)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseStakeWithdrawn(log types.Log) (*EntryPointStakeWithdrawn, error) {
- event := new(EntryPointStakeWithdrawn)
- if err := _EntryPoint.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointUserOperationEventIterator struct {
- Event *EntryPointUserOperationEvent
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointUserOperationEventIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointUserOperationEvent)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointUserOperationEvent)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointUserOperationEventIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointUserOperationEventIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointUserOperationEvent struct {
- UserOpHash [32]byte
- Sender common.Address
- Paymaster common.Address
- Nonce *big.Int
- Success bool
- ActualGasCost *big.Int
- ActualGasUsed *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterUserOperationEvent(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (*EntryPointUserOperationEventIterator, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
- var paymasterRule []interface{}
- for _, paymasterItem := range paymaster {
- paymasterRule = append(paymasterRule, paymasterItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointUserOperationEventIterator{contract: _EntryPoint.contract, event: "UserOperationEvent", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchUserOperationEvent(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationEvent, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (event.Subscription, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
- var paymasterRule []interface{}
- for _, paymasterItem := range paymaster {
- paymasterRule = append(paymasterRule, paymasterItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointUserOperationEvent)
- if err := _EntryPoint.contract.UnpackLog(event, "UserOperationEvent", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseUserOperationEvent(log types.Log) (*EntryPointUserOperationEvent, error) {
- event := new(EntryPointUserOperationEvent)
- if err := _EntryPoint.contract.UnpackLog(event, "UserOperationEvent", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointUserOperationRevertReasonIterator struct {
- Event *EntryPointUserOperationRevertReason
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointUserOperationRevertReasonIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointUserOperationRevertReason)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointUserOperationRevertReason)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointUserOperationRevertReasonIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointUserOperationRevertReasonIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointUserOperationRevertReason struct {
- UserOpHash [32]byte
- Sender common.Address
- Nonce *big.Int
- RevertReason []byte
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterUserOperationRevertReason(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointUserOperationRevertReasonIterator, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointUserOperationRevertReasonIterator{contract: _EntryPoint.contract, event: "UserOperationRevertReason", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchUserOperationRevertReason(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationRevertReason, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) {
-
- var userOpHashRule []interface{}
- for _, userOpHashItem := range userOpHash {
- userOpHashRule = append(userOpHashRule, userOpHashItem)
- }
- var senderRule []interface{}
- for _, senderItem := range sender {
- senderRule = append(senderRule, senderItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointUserOperationRevertReason)
- if err := _EntryPoint.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseUserOperationRevertReason(log types.Log) (*EntryPointUserOperationRevertReason, error) {
- event := new(EntryPointUserOperationRevertReason)
- if err := _EntryPoint.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type EntryPointWithdrawnIterator struct {
- Event *EntryPointWithdrawn
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *EntryPointWithdrawnIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointWithdrawn)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(EntryPointWithdrawn)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *EntryPointWithdrawnIterator) Error() error {
- return it.fail
-}
-
-func (it *EntryPointWithdrawnIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type EntryPointWithdrawn struct {
- Account common.Address
- WithdrawAddress common.Address
- Amount *big.Int
- Raw types.Log
-}
-
-func (_EntryPoint *EntryPointFilterer) FilterWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointWithdrawnIterator, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "Withdrawn", accountRule)
- if err != nil {
- return nil, err
- }
- return &EntryPointWithdrawnIterator{contract: _EntryPoint.contract, event: "Withdrawn", logs: logs, sub: sub}, nil
-}
-
-func (_EntryPoint *EntryPointFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointWithdrawn, account []common.Address) (event.Subscription, error) {
-
- var accountRule []interface{}
- for _, accountItem := range account {
- accountRule = append(accountRule, accountItem)
- }
-
- logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "Withdrawn", accountRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(EntryPointWithdrawn)
- if err := _EntryPoint.contract.UnpackLog(event, "Withdrawn", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_EntryPoint *EntryPointFilterer) ParseWithdrawn(log types.Log) (*EntryPointWithdrawn, error) {
- event := new(EntryPointWithdrawn)
- if err := _EntryPoint.contract.UnpackLog(event, "Withdrawn", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type Deposits struct {
- Deposit *big.Int
- Staked bool
- Stake *big.Int
- UnstakeDelaySec uint32
- WithdrawTime *big.Int
-}
-
-func (_EntryPoint *EntryPoint) ParseLog(log types.Log) (generated.AbigenLog, error) {
- switch log.Topics[0] {
- case _EntryPoint.abi.Events["AccountDeployed"].ID:
- return _EntryPoint.ParseAccountDeployed(log)
- case _EntryPoint.abi.Events["Deposited"].ID:
- return _EntryPoint.ParseDeposited(log)
- case _EntryPoint.abi.Events["SignatureAggregatorChanged"].ID:
- return _EntryPoint.ParseSignatureAggregatorChanged(log)
- case _EntryPoint.abi.Events["StakeLocked"].ID:
- return _EntryPoint.ParseStakeLocked(log)
- case _EntryPoint.abi.Events["StakeUnlocked"].ID:
- return _EntryPoint.ParseStakeUnlocked(log)
- case _EntryPoint.abi.Events["StakeWithdrawn"].ID:
- return _EntryPoint.ParseStakeWithdrawn(log)
- case _EntryPoint.abi.Events["UserOperationEvent"].ID:
- return _EntryPoint.ParseUserOperationEvent(log)
- case _EntryPoint.abi.Events["UserOperationRevertReason"].ID:
- return _EntryPoint.ParseUserOperationRevertReason(log)
- case _EntryPoint.abi.Events["Withdrawn"].ID:
- return _EntryPoint.ParseWithdrawn(log)
-
- default:
- return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0])
- }
-}
-
-func (EntryPointAccountDeployed) Topic() common.Hash {
- return common.HexToHash("0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d")
-}
-
-func (EntryPointDeposited) Topic() common.Hash {
- return common.HexToHash("0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4")
-}
-
-func (EntryPointSignatureAggregatorChanged) Topic() common.Hash {
- return common.HexToHash("0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d")
-}
-
-func (EntryPointStakeLocked) Topic() common.Hash {
- return common.HexToHash("0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01")
-}
-
-func (EntryPointStakeUnlocked) Topic() common.Hash {
- return common.HexToHash("0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a")
-}
-
-func (EntryPointStakeWithdrawn) Topic() common.Hash {
- return common.HexToHash("0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3")
-}
-
-func (EntryPointUserOperationEvent) Topic() common.Hash {
- return common.HexToHash("0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f")
-}
-
-func (EntryPointUserOperationRevertReason) Topic() common.Hash {
- return common.HexToHash("0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201")
-}
-
-func (EntryPointWithdrawn) Topic() common.Hash {
- return common.HexToHash("0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb")
-}
-
-func (_EntryPoint *EntryPoint) Address() common.Address {
- return _EntryPoint.address
-}
-
-type EntryPointInterface interface {
- SIGVALIDATIONFAILED(opts *bind.CallOpts) (*big.Int, error)
-
- ValidateSenderAndPaymaster(opts *bind.CallOpts, initCode []byte, sender common.Address, paymasterAndData []byte) error
-
- BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error)
-
- Deposits(opts *bind.CallOpts, arg0 common.Address) (Deposits,
-
- error)
-
- GetDepositInfo(opts *bind.CallOpts, account common.Address) (IStakeManagerDepositInfo, error)
-
- GetUserOpHash(opts *bind.CallOpts, userOp UserOperation) ([32]byte, error)
-
- AddStake(opts *bind.TransactOpts, unstakeDelaySec uint32) (*types.Transaction, error)
-
- DepositTo(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error)
-
- GetSenderAddress(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error)
-
- HandleAggregatedOps(opts *bind.TransactOpts, opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error)
-
- HandleOps(opts *bind.TransactOpts, ops []UserOperation, beneficiary common.Address) (*types.Transaction, error)
-
- InnerHandleOp(opts *bind.TransactOpts, callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error)
-
- SimulateHandleOp(opts *bind.TransactOpts, op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error)
-
- SimulateValidation(opts *bind.TransactOpts, userOp UserOperation) (*types.Transaction, error)
-
- UnlockStake(opts *bind.TransactOpts) (*types.Transaction, error)
-
- WithdrawStake(opts *bind.TransactOpts, withdrawAddress common.Address) (*types.Transaction, error)
-
- WithdrawTo(opts *bind.TransactOpts, withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error)
-
- Receive(opts *bind.TransactOpts) (*types.Transaction, error)
-
- FilterAccountDeployed(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointAccountDeployedIterator, error)
-
- WatchAccountDeployed(opts *bind.WatchOpts, sink chan<- *EntryPointAccountDeployed, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error)
-
- ParseAccountDeployed(log types.Log) (*EntryPointAccountDeployed, error)
-
- FilterDeposited(opts *bind.FilterOpts, account []common.Address) (*EntryPointDepositedIterator, error)
-
- WatchDeposited(opts *bind.WatchOpts, sink chan<- *EntryPointDeposited, account []common.Address) (event.Subscription, error)
-
- ParseDeposited(log types.Log) (*EntryPointDeposited, error)
-
- FilterSignatureAggregatorChanged(opts *bind.FilterOpts, aggregator []common.Address) (*EntryPointSignatureAggregatorChangedIterator, error)
-
- WatchSignatureAggregatorChanged(opts *bind.WatchOpts, sink chan<- *EntryPointSignatureAggregatorChanged, aggregator []common.Address) (event.Subscription, error)
-
- ParseSignatureAggregatorChanged(log types.Log) (*EntryPointSignatureAggregatorChanged, error)
-
- FilterStakeLocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeLockedIterator, error)
-
- WatchStakeLocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeLocked, account []common.Address) (event.Subscription, error)
-
- ParseStakeLocked(log types.Log) (*EntryPointStakeLocked, error)
-
- FilterStakeUnlocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeUnlockedIterator, error)
-
- WatchStakeUnlocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeUnlocked, account []common.Address) (event.Subscription, error)
-
- ParseStakeUnlocked(log types.Log) (*EntryPointStakeUnlocked, error)
-
- FilterStakeWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeWithdrawnIterator, error)
-
- WatchStakeWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointStakeWithdrawn, account []common.Address) (event.Subscription, error)
-
- ParseStakeWithdrawn(log types.Log) (*EntryPointStakeWithdrawn, error)
-
- FilterUserOperationEvent(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (*EntryPointUserOperationEventIterator, error)
-
- WatchUserOperationEvent(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationEvent, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (event.Subscription, error)
-
- ParseUserOperationEvent(log types.Log) (*EntryPointUserOperationEvent, error)
-
- FilterUserOperationRevertReason(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointUserOperationRevertReasonIterator, error)
-
- WatchUserOperationRevertReason(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationRevertReason, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error)
-
- ParseUserOperationRevertReason(log types.Log) (*EntryPointUserOperationRevertReason, error)
-
- FilterWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointWithdrawnIterator, error)
-
- WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointWithdrawn, account []common.Address) (event.Subscription, error)
-
- ParseWithdrawn(log types.Log) (*EntryPointWithdrawn, error)
-
- ParseLog(log types.Log) (generated.AbigenLog, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generated/greeter_wrapper/greeter_wrapper.go b/core/gethwrappers/transmission/generated/greeter_wrapper/greeter_wrapper.go
deleted file mode 100644
index 0f9e4a7719d..00000000000
--- a/core/gethwrappers/transmission/generated/greeter_wrapper/greeter_wrapper.go
+++ /dev/null
@@ -1,216 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package greeter_wrapper
-
-import (
- "errors"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-var GreeterMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[],\"name\":\"getGreeting\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"greeting\",\"type\":\"string\"}],\"name\":\"setGreeting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
- Bin: "0x608060405234801561001057600080fd5b50610443806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a41368621461003b578063fe50cc7214610050575b600080fd5b61004e61004936600461013f565b61006e565b005b61005861007e565b604051610065919061020e565b60405180910390f35b600061007a828261031c565b5050565b60606000805461008d9061027a565b80601f01602080910402602001604051908101604052809291908181526020018280546100b99061027a565b80156101065780601f106100db57610100808354040283529160200191610106565b820191906000526020600020905b8154815290600101906020018083116100e957829003601f168201915b5050505050905090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561015157600080fd5b813567ffffffffffffffff8082111561016957600080fd5b818401915084601f83011261017d57600080fd5b81358181111561018f5761018f610110565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156101d5576101d5610110565b816040528281528760208487010111156101ee57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b8181101561023b5785810183015185820160400152820161021f565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600181811c9082168061028e57607f821691505b6020821081036102c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561031757600081815260208120601f850160051c810160208610156102f45750805b601f850160051c820191505b8181101561031357828155600101610300565b5050505b505050565b815167ffffffffffffffff81111561033657610336610110565b61034a81610344845461027a565b846102cd565b602080601f83116001811461039d57600084156103675750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610313565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156103ea578886015182559484019460019091019084016103cb565b508582101561042657878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000813000a",
-}
-
-var GreeterABI = GreeterMetaData.ABI
-
-var GreeterBin = GreeterMetaData.Bin
-
-func DeployGreeter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Greeter, error) {
- parsed, err := GreeterMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GreeterBin), backend)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &Greeter{address: address, abi: *parsed, GreeterCaller: GreeterCaller{contract: contract}, GreeterTransactor: GreeterTransactor{contract: contract}, GreeterFilterer: GreeterFilterer{contract: contract}}, nil
-}
-
-type Greeter struct {
- address common.Address
- abi abi.ABI
- GreeterCaller
- GreeterTransactor
- GreeterFilterer
-}
-
-type GreeterCaller struct {
- contract *bind.BoundContract
-}
-
-type GreeterTransactor struct {
- contract *bind.BoundContract
-}
-
-type GreeterFilterer struct {
- contract *bind.BoundContract
-}
-
-type GreeterSession struct {
- Contract *Greeter
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type GreeterCallerSession struct {
- Contract *GreeterCaller
- CallOpts bind.CallOpts
-}
-
-type GreeterTransactorSession struct {
- Contract *GreeterTransactor
- TransactOpts bind.TransactOpts
-}
-
-type GreeterRaw struct {
- Contract *Greeter
-}
-
-type GreeterCallerRaw struct {
- Contract *GreeterCaller
-}
-
-type GreeterTransactorRaw struct {
- Contract *GreeterTransactor
-}
-
-func NewGreeter(address common.Address, backend bind.ContractBackend) (*Greeter, error) {
- abi, err := abi.JSON(strings.NewReader(GreeterABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindGreeter(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &Greeter{address: address, abi: abi, GreeterCaller: GreeterCaller{contract: contract}, GreeterTransactor: GreeterTransactor{contract: contract}, GreeterFilterer: GreeterFilterer{contract: contract}}, nil
-}
-
-func NewGreeterCaller(address common.Address, caller bind.ContractCaller) (*GreeterCaller, error) {
- contract, err := bindGreeter(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &GreeterCaller{contract: contract}, nil
-}
-
-func NewGreeterTransactor(address common.Address, transactor bind.ContractTransactor) (*GreeterTransactor, error) {
- contract, err := bindGreeter(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &GreeterTransactor{contract: contract}, nil
-}
-
-func NewGreeterFilterer(address common.Address, filterer bind.ContractFilterer) (*GreeterFilterer, error) {
- contract, err := bindGreeter(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &GreeterFilterer{contract: contract}, nil
-}
-
-func bindGreeter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := GreeterMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_Greeter *GreeterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _Greeter.Contract.GreeterCaller.contract.Call(opts, result, method, params...)
-}
-
-func (_Greeter *GreeterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _Greeter.Contract.GreeterTransactor.contract.Transfer(opts)
-}
-
-func (_Greeter *GreeterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _Greeter.Contract.GreeterTransactor.contract.Transact(opts, method, params...)
-}
-
-func (_Greeter *GreeterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _Greeter.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_Greeter *GreeterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _Greeter.Contract.contract.Transfer(opts)
-}
-
-func (_Greeter *GreeterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _Greeter.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_Greeter *GreeterCaller) GetGreeting(opts *bind.CallOpts) (string, error) {
- var out []interface{}
- err := _Greeter.contract.Call(opts, &out, "getGreeting")
-
- if err != nil {
- return *new(string), err
- }
-
- out0 := *abi.ConvertType(out[0], new(string)).(*string)
-
- return out0, err
-
-}
-
-func (_Greeter *GreeterSession) GetGreeting() (string, error) {
- return _Greeter.Contract.GetGreeting(&_Greeter.CallOpts)
-}
-
-func (_Greeter *GreeterCallerSession) GetGreeting() (string, error) {
- return _Greeter.Contract.GetGreeting(&_Greeter.CallOpts)
-}
-
-func (_Greeter *GreeterTransactor) SetGreeting(opts *bind.TransactOpts, greeting string) (*types.Transaction, error) {
- return _Greeter.contract.Transact(opts, "setGreeting", greeting)
-}
-
-func (_Greeter *GreeterSession) SetGreeting(greeting string) (*types.Transaction, error) {
- return _Greeter.Contract.SetGreeting(&_Greeter.TransactOpts, greeting)
-}
-
-func (_Greeter *GreeterTransactorSession) SetGreeting(greeting string) (*types.Transaction, error) {
- return _Greeter.Contract.SetGreeting(&_Greeter.TransactOpts, greeting)
-}
-
-func (_Greeter *Greeter) Address() common.Address {
- return _Greeter.address
-}
-
-type GreeterInterface interface {
- GetGreeting(opts *bind.CallOpts) (string, error)
-
- SetGreeting(opts *bind.TransactOpts, greeting string) (*types.Transaction, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generated/paymaster_wrapper/paymaster_wrapper.go b/core/gethwrappers/transmission/generated/paymaster_wrapper/paymaster_wrapper.go
deleted file mode 100644
index 63a2712ca3f..00000000000
--- a/core/gethwrappers/transmission/generated/paymaster_wrapper/paymaster_wrapper.go
+++ /dev/null
@@ -1,719 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package paymaster_wrapper
-
-import (
- "errors"
- "fmt"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-type UserOperation struct {
- Sender common.Address
- Nonce *big.Int
- InitCode []byte
- CallData []byte
- CallGasLimit *big.Int
- VerificationGasLimit *big.Int
- PreVerificationGas *big.Int
- MaxFeePerGas *big.Int
- MaxPriorityFeePerGas *big.Int
- PaymasterAndData []byte
- Signature []byte
-}
-
-var PaymasterMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"linkEthFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entryPoint\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"juelsNeeded\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"subscriptionBalance\",\"type\":\"uint256\"}],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"}],\"name\":\"UserOperationAlreadyTried\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_entryPoint\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkEthFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkToken\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enumIPaymaster.PostOpMode\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"}],\"name\":\"postOp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"maxCost\",\"type\":\"uint256\"}],\"name\":\"validatePaymasterUserOp\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"validationData\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
- Bin: "0x60e06040523480156200001157600080fd5b50604051620014c4380380620014c48339810160408190526200003491620001a3565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000df565b5050506001600160a01b0392831660805290821660a0521660c052620001f7565b336001600160a01b03821603620001395760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b0381168114620001a057600080fd5b50565b600080600060608486031215620001b957600080fd5b8351620001c6816200018a565b6020850151909350620001d9816200018a565b6040850151909250620001ec816200018a565b809150509250925092565b60805160a05160c0516112656200025f600039600081816101080152818161049f01528181610507015281816105cd015261063501526000818161018f0152610cb60152600081816101dc015281816103a201528181610ac90152610b8101526112656000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80639b9bd4de11610081578063db37983b1161005b578063db37983b146101d7578063f2fde38b146101fe578063f465c77e1461021157600080fd5b80639b9bd4de1461018a578063a4c0ed36146101b1578063a9a23409146101c457600080fd5b806379ba5097116100b257806379ba50971461014f5780638a38f365146101595780638da5cb5b1461016c57600080fd5b8063088070f5146100ce578063140fcfb114610103575b600080fd5b6002546003546100e29163ffffffff169082565b6040805163ffffffff90931683526020830191909152015b60405180910390f35b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100fa565b610157610232565b005b610157610167366004610d5b565b610334565b60005473ffffffffffffffffffffffffffffffffffffffff1661012a565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6101576101bf366004610dfb565b61038a565b6101576101d2366004610e57565b610487565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b61015761020c366004610eb7565b61059d565b61022461021f366004610edb565b6105b1565b6040516100fa929190610f2f565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61033c610849565b6040805180820190915263ffffffff9092168083526020909201819052600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000016909217909155600355565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146103f9576040517f44b0e3c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114610433576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061044182840184610eb7565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604081208054929350869290919061047b908490610fd1565b90915550505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610534576040517f295a81c100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016102af565b60008061054384860186610fe4565b9150915080610551846108cc565b61055b9190610fd1565b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602052604081208054909190610590908490611002565b9091555050505050505050565b6105a5610849565b6105ae816108f8565b50565b606060003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610662576040517f295a81c100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016102af565b60008481526004602052604090205460ff16156106ae576040517f7413dcf8000000000000000000000000000000000000000000000000000000008152600481018590526024016102af565b60006106b9866109ed565b90506000816106c7866108cc565b6106d19190610fd1565b905080600560006106e560208b018b610eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107b057806005600061073860208b018b610eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040517f03eb8b540000000000000000000000000000000000000000000000000000000081526004016102af929190918252602082015260400190565b600086815260046020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556107f690880188610eb7565b6040805173ffffffffffffffffffffffffffffffffffffffff9092166020830152810183905260600160405160208183030381529060405261083b6000806000610c29565b935093505050935093915050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102af565b565b60006108d6610c61565b6108e883670de0b6b3a7640000611015565b6108f2919061102c565b92915050565b3373ffffffffffffffffffffffffffffffffffffffff821603610977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102af565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006109fd610120830183611067565b9050601403610a0e57506000919050565b6000610a1e610120840184611067565b6014818110610a2f57610a2f6110cc565b919091013560f81c9150819050610c23576000610a50610120850185611067565b610a5e9160159082906110fb565b810190610a6b9190611125565b90508060200151600014158015610b385750602081015181516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201527f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015610b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3691906111ae565b105b15610c2157805160408083015190517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169263a9059cbb92610bd59260040173ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020604051808303816000875af1158015610bf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1891906111c7565b50806040015192505b505b50919050565b600060d08265ffffffffffff16901b60a08465ffffffffffff16901b85610c51576000610c54565b60015b60ff161717949350505050565b600254604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009263ffffffff1691821515918491829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163feaf968c9160048083019260a09291908290030181865afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d259190611208565b509450909250849150508015610d495750610d408242611002565b8463ffffffff16105b15610d5357506003545b949350505050565b60008060408385031215610d6e57600080fd5b823563ffffffff81168114610d8257600080fd5b946020939093013593505050565b73ffffffffffffffffffffffffffffffffffffffff811681146105ae57600080fd5b60008083601f840112610dc457600080fd5b50813567ffffffffffffffff811115610ddc57600080fd5b602083019150836020828501011115610df457600080fd5b9250929050565b60008060008060608587031215610e1157600080fd5b8435610e1c81610d90565b935060208501359250604085013567ffffffffffffffff811115610e3f57600080fd5b610e4b87828801610db2565b95989497509550505050565b60008060008060608587031215610e6d57600080fd5b843560038110610e7c57600080fd5b9350602085013567ffffffffffffffff811115610e9857600080fd5b610ea487828801610db2565b9598909750949560400135949350505050565b600060208284031215610ec957600080fd5b8135610ed481610d90565b9392505050565b600080600060608486031215610ef057600080fd5b833567ffffffffffffffff811115610f0757600080fd5b84016101608187031215610f1a57600080fd5b95602085013595506040909401359392505050565b604081526000835180604084015260005b81811015610f5d5760208187018101516060868401015201610f40565b5060006060828501015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168401019150508260208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108f2576108f2610fa2565b60008060408385031215610ff757600080fd5b8235610d8281610d90565b818103818111156108f2576108f2610fa2565b80820281158282048414176108f2576108f2610fa2565b600082611062577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261109c57600080fd5b83018035915067ffffffffffffffff8211156110b757600080fd5b602001915036819003821315610df457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000808585111561110b57600080fd5b8386111561111857600080fd5b5050820193919092039150565b60006060828403121561113757600080fd5b6040516060810181811067ffffffffffffffff82111715611181577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823561118f81610d90565b8152602083810135908201526040928301359281019290925250919050565b6000602082840312156111c057600080fd5b5051919050565b6000602082840312156111d957600080fd5b81518015158114610ed457600080fd5b805169ffffffffffffffffffff8116811461120357600080fd5b919050565b600080600080600060a0868803121561122057600080fd5b611229866111e9565b945060208601519350604086015192506060860151915061124c608087016111e9565b9050929550929590935056fea164736f6c6343000813000a",
-}
-
-var PaymasterABI = PaymasterMetaData.ABI
-
-var PaymasterBin = PaymasterMetaData.Bin
-
-func DeployPaymaster(auth *bind.TransactOpts, backend bind.ContractBackend, linkToken common.Address, linkEthFeed common.Address, entryPoint common.Address) (common.Address, *types.Transaction, *Paymaster, error) {
- parsed, err := PaymasterMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(PaymasterBin), backend, linkToken, linkEthFeed, entryPoint)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &Paymaster{address: address, abi: *parsed, PaymasterCaller: PaymasterCaller{contract: contract}, PaymasterTransactor: PaymasterTransactor{contract: contract}, PaymasterFilterer: PaymasterFilterer{contract: contract}}, nil
-}
-
-type Paymaster struct {
- address common.Address
- abi abi.ABI
- PaymasterCaller
- PaymasterTransactor
- PaymasterFilterer
-}
-
-type PaymasterCaller struct {
- contract *bind.BoundContract
-}
-
-type PaymasterTransactor struct {
- contract *bind.BoundContract
-}
-
-type PaymasterFilterer struct {
- contract *bind.BoundContract
-}
-
-type PaymasterSession struct {
- Contract *Paymaster
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type PaymasterCallerSession struct {
- Contract *PaymasterCaller
- CallOpts bind.CallOpts
-}
-
-type PaymasterTransactorSession struct {
- Contract *PaymasterTransactor
- TransactOpts bind.TransactOpts
-}
-
-type PaymasterRaw struct {
- Contract *Paymaster
-}
-
-type PaymasterCallerRaw struct {
- Contract *PaymasterCaller
-}
-
-type PaymasterTransactorRaw struct {
- Contract *PaymasterTransactor
-}
-
-func NewPaymaster(address common.Address, backend bind.ContractBackend) (*Paymaster, error) {
- abi, err := abi.JSON(strings.NewReader(PaymasterABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindPaymaster(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &Paymaster{address: address, abi: abi, PaymasterCaller: PaymasterCaller{contract: contract}, PaymasterTransactor: PaymasterTransactor{contract: contract}, PaymasterFilterer: PaymasterFilterer{contract: contract}}, nil
-}
-
-func NewPaymasterCaller(address common.Address, caller bind.ContractCaller) (*PaymasterCaller, error) {
- contract, err := bindPaymaster(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &PaymasterCaller{contract: contract}, nil
-}
-
-func NewPaymasterTransactor(address common.Address, transactor bind.ContractTransactor) (*PaymasterTransactor, error) {
- contract, err := bindPaymaster(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &PaymasterTransactor{contract: contract}, nil
-}
-
-func NewPaymasterFilterer(address common.Address, filterer bind.ContractFilterer) (*PaymasterFilterer, error) {
- contract, err := bindPaymaster(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &PaymasterFilterer{contract: contract}, nil
-}
-
-func bindPaymaster(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := PaymasterMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_Paymaster *PaymasterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _Paymaster.Contract.PaymasterCaller.contract.Call(opts, result, method, params...)
-}
-
-func (_Paymaster *PaymasterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _Paymaster.Contract.PaymasterTransactor.contract.Transfer(opts)
-}
-
-func (_Paymaster *PaymasterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _Paymaster.Contract.PaymasterTransactor.contract.Transact(opts, method, params...)
-}
-
-func (_Paymaster *PaymasterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _Paymaster.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_Paymaster *PaymasterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _Paymaster.Contract.contract.Transfer(opts)
-}
-
-func (_Paymaster *PaymasterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _Paymaster.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_Paymaster *PaymasterCaller) IEntryPoint(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _Paymaster.contract.Call(opts, &out, "i_entryPoint")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_Paymaster *PaymasterSession) IEntryPoint() (common.Address, error) {
- return _Paymaster.Contract.IEntryPoint(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCallerSession) IEntryPoint() (common.Address, error) {
- return _Paymaster.Contract.IEntryPoint(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCaller) ILinkEthFeed(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _Paymaster.contract.Call(opts, &out, "i_linkEthFeed")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_Paymaster *PaymasterSession) ILinkEthFeed() (common.Address, error) {
- return _Paymaster.Contract.ILinkEthFeed(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCallerSession) ILinkEthFeed() (common.Address, error) {
- return _Paymaster.Contract.ILinkEthFeed(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCaller) ILinkToken(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _Paymaster.contract.Call(opts, &out, "i_linkToken")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_Paymaster *PaymasterSession) ILinkToken() (common.Address, error) {
- return _Paymaster.Contract.ILinkToken(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCallerSession) ILinkToken() (common.Address, error) {
- return _Paymaster.Contract.ILinkToken(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _Paymaster.contract.Call(opts, &out, "owner")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_Paymaster *PaymasterSession) Owner() (common.Address, error) {
- return _Paymaster.Contract.Owner(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCallerSession) Owner() (common.Address, error) {
- return _Paymaster.Contract.Owner(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCaller) SConfig(opts *bind.CallOpts) (SConfig,
-
- error) {
- var out []interface{}
- err := _Paymaster.contract.Call(opts, &out, "s_config")
-
- outstruct := new(SConfig)
- if err != nil {
- return *outstruct, err
- }
-
- outstruct.StalenessSeconds = *abi.ConvertType(out[0], new(uint32)).(*uint32)
- outstruct.FallbackWeiPerUnitLink = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
-
- return *outstruct, err
-
-}
-
-func (_Paymaster *PaymasterSession) SConfig() (SConfig,
-
- error) {
- return _Paymaster.Contract.SConfig(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterCallerSession) SConfig() (SConfig,
-
- error) {
- return _Paymaster.Contract.SConfig(&_Paymaster.CallOpts)
-}
-
-func (_Paymaster *PaymasterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "acceptOwnership")
-}
-
-func (_Paymaster *PaymasterSession) AcceptOwnership() (*types.Transaction, error) {
- return _Paymaster.Contract.AcceptOwnership(&_Paymaster.TransactOpts)
-}
-
-func (_Paymaster *PaymasterTransactorSession) AcceptOwnership() (*types.Transaction, error) {
- return _Paymaster.Contract.AcceptOwnership(&_Paymaster.TransactOpts)
-}
-
-func (_Paymaster *PaymasterTransactor) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "onTokenTransfer", arg0, _amount, _data)
-}
-
-func (_Paymaster *PaymasterSession) OnTokenTransfer(arg0 common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) {
- return _Paymaster.Contract.OnTokenTransfer(&_Paymaster.TransactOpts, arg0, _amount, _data)
-}
-
-func (_Paymaster *PaymasterTransactorSession) OnTokenTransfer(arg0 common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) {
- return _Paymaster.Contract.OnTokenTransfer(&_Paymaster.TransactOpts, arg0, _amount, _data)
-}
-
-func (_Paymaster *PaymasterTransactor) PostOp(opts *bind.TransactOpts, arg0 uint8, context []byte, actualGasCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "postOp", arg0, context, actualGasCost)
-}
-
-func (_Paymaster *PaymasterSession) PostOp(arg0 uint8, context []byte, actualGasCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.PostOp(&_Paymaster.TransactOpts, arg0, context, actualGasCost)
-}
-
-func (_Paymaster *PaymasterTransactorSession) PostOp(arg0 uint8, context []byte, actualGasCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.PostOp(&_Paymaster.TransactOpts, arg0, context, actualGasCost)
-}
-
-func (_Paymaster *PaymasterTransactor) SetConfig(opts *bind.TransactOpts, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "setConfig", stalenessSeconds, fallbackWeiPerUnitLink)
-}
-
-func (_Paymaster *PaymasterSession) SetConfig(stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.SetConfig(&_Paymaster.TransactOpts, stalenessSeconds, fallbackWeiPerUnitLink)
-}
-
-func (_Paymaster *PaymasterTransactorSession) SetConfig(stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.SetConfig(&_Paymaster.TransactOpts, stalenessSeconds, fallbackWeiPerUnitLink)
-}
-
-func (_Paymaster *PaymasterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "transferOwnership", to)
-}
-
-func (_Paymaster *PaymasterSession) TransferOwnership(to common.Address) (*types.Transaction, error) {
- return _Paymaster.Contract.TransferOwnership(&_Paymaster.TransactOpts, to)
-}
-
-func (_Paymaster *PaymasterTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) {
- return _Paymaster.Contract.TransferOwnership(&_Paymaster.TransactOpts, to)
-}
-
-func (_Paymaster *PaymasterTransactor) ValidatePaymasterUserOp(opts *bind.TransactOpts, userOp UserOperation, userOpHash [32]byte, maxCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.contract.Transact(opts, "validatePaymasterUserOp", userOp, userOpHash, maxCost)
-}
-
-func (_Paymaster *PaymasterSession) ValidatePaymasterUserOp(userOp UserOperation, userOpHash [32]byte, maxCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.ValidatePaymasterUserOp(&_Paymaster.TransactOpts, userOp, userOpHash, maxCost)
-}
-
-func (_Paymaster *PaymasterTransactorSession) ValidatePaymasterUserOp(userOp UserOperation, userOpHash [32]byte, maxCost *big.Int) (*types.Transaction, error) {
- return _Paymaster.Contract.ValidatePaymasterUserOp(&_Paymaster.TransactOpts, userOp, userOpHash, maxCost)
-}
-
-type PaymasterOwnershipTransferRequestedIterator struct {
- Event *PaymasterOwnershipTransferRequested
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *PaymasterOwnershipTransferRequestedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(PaymasterOwnershipTransferRequested)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(PaymasterOwnershipTransferRequested)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *PaymasterOwnershipTransferRequestedIterator) Error() error {
- return it.fail
-}
-
-func (it *PaymasterOwnershipTransferRequestedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type PaymasterOwnershipTransferRequested struct {
- From common.Address
- To common.Address
- Raw types.Log
-}
-
-func (_Paymaster *PaymasterFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PaymasterOwnershipTransferRequestedIterator, error) {
-
- var fromRule []interface{}
- for _, fromItem := range from {
- fromRule = append(fromRule, fromItem)
- }
- var toRule []interface{}
- for _, toItem := range to {
- toRule = append(toRule, toItem)
- }
-
- logs, sub, err := _Paymaster.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule)
- if err != nil {
- return nil, err
- }
- return &PaymasterOwnershipTransferRequestedIterator{contract: _Paymaster.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil
-}
-
-func (_Paymaster *PaymasterFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PaymasterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) {
-
- var fromRule []interface{}
- for _, fromItem := range from {
- fromRule = append(fromRule, fromItem)
- }
- var toRule []interface{}
- for _, toItem := range to {
- toRule = append(toRule, toItem)
- }
-
- logs, sub, err := _Paymaster.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(PaymasterOwnershipTransferRequested)
- if err := _Paymaster.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_Paymaster *PaymasterFilterer) ParseOwnershipTransferRequested(log types.Log) (*PaymasterOwnershipTransferRequested, error) {
- event := new(PaymasterOwnershipTransferRequested)
- if err := _Paymaster.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type PaymasterOwnershipTransferredIterator struct {
- Event *PaymasterOwnershipTransferred
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *PaymasterOwnershipTransferredIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(PaymasterOwnershipTransferred)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(PaymasterOwnershipTransferred)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *PaymasterOwnershipTransferredIterator) Error() error {
- return it.fail
-}
-
-func (it *PaymasterOwnershipTransferredIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type PaymasterOwnershipTransferred struct {
- From common.Address
- To common.Address
- Raw types.Log
-}
-
-func (_Paymaster *PaymasterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PaymasterOwnershipTransferredIterator, error) {
-
- var fromRule []interface{}
- for _, fromItem := range from {
- fromRule = append(fromRule, fromItem)
- }
- var toRule []interface{}
- for _, toItem := range to {
- toRule = append(toRule, toItem)
- }
-
- logs, sub, err := _Paymaster.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule)
- if err != nil {
- return nil, err
- }
- return &PaymasterOwnershipTransferredIterator{contract: _Paymaster.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
-}
-
-func (_Paymaster *PaymasterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PaymasterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) {
-
- var fromRule []interface{}
- for _, fromItem := range from {
- fromRule = append(fromRule, fromItem)
- }
- var toRule []interface{}
- for _, toItem := range to {
- toRule = append(toRule, toItem)
- }
-
- logs, sub, err := _Paymaster.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule)
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(PaymasterOwnershipTransferred)
- if err := _Paymaster.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_Paymaster *PaymasterFilterer) ParseOwnershipTransferred(log types.Log) (*PaymasterOwnershipTransferred, error) {
- event := new(PaymasterOwnershipTransferred)
- if err := _Paymaster.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-type SConfig struct {
- StalenessSeconds uint32
- FallbackWeiPerUnitLink *big.Int
-}
-
-func (_Paymaster *Paymaster) ParseLog(log types.Log) (generated.AbigenLog, error) {
- switch log.Topics[0] {
- case _Paymaster.abi.Events["OwnershipTransferRequested"].ID:
- return _Paymaster.ParseOwnershipTransferRequested(log)
- case _Paymaster.abi.Events["OwnershipTransferred"].ID:
- return _Paymaster.ParseOwnershipTransferred(log)
-
- default:
- return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0])
- }
-}
-
-func (PaymasterOwnershipTransferRequested) Topic() common.Hash {
- return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278")
-}
-
-func (PaymasterOwnershipTransferred) Topic() common.Hash {
- return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0")
-}
-
-func (_Paymaster *Paymaster) Address() common.Address {
- return _Paymaster.address
-}
-
-type PaymasterInterface interface {
- IEntryPoint(opts *bind.CallOpts) (common.Address, error)
-
- ILinkEthFeed(opts *bind.CallOpts) (common.Address, error)
-
- ILinkToken(opts *bind.CallOpts) (common.Address, error)
-
- Owner(opts *bind.CallOpts) (common.Address, error)
-
- SConfig(opts *bind.CallOpts) (SConfig,
-
- error)
-
- AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error)
-
- OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error)
-
- PostOp(opts *bind.TransactOpts, arg0 uint8, context []byte, actualGasCost *big.Int) (*types.Transaction, error)
-
- SetConfig(opts *bind.TransactOpts, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int) (*types.Transaction, error)
-
- TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error)
-
- ValidatePaymasterUserOp(opts *bind.TransactOpts, userOp UserOperation, userOpHash [32]byte, maxCost *big.Int) (*types.Transaction, error)
-
- FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PaymasterOwnershipTransferRequestedIterator, error)
-
- WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PaymasterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error)
-
- ParseOwnershipTransferRequested(log types.Log) (*PaymasterOwnershipTransferRequested, error)
-
- FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PaymasterOwnershipTransferredIterator, error)
-
- WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PaymasterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error)
-
- ParseOwnershipTransferred(log types.Log) (*PaymasterOwnershipTransferred, error)
-
- ParseLog(log types.Log) (generated.AbigenLog, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generated/sca_wrapper/sca_wrapper.go b/core/gethwrappers/transmission/generated/sca_wrapper/sca_wrapper.go
deleted file mode 100644
index 989e4058685..00000000000
--- a/core/gethwrappers/transmission/generated/sca_wrapper/sca_wrapper.go
+++ /dev/null
@@ -1,292 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package sca_wrapper
-
-import (
- "errors"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-type UserOperation struct {
- Sender common.Address
- Nonce *big.Int
- InitCode []byte
- CallData []byte
- CallGasLimit *big.Int
- VerificationGasLimit *big.Int
- PreVerificationGas *big.Int
- MaxFeePerGas *big.Int
- MaxPriorityFeePerGas *big.Int
- PaymasterAndData []byte
- Signature []byte
-}
-
-var SCAMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entryPoint\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadFormatOrOOG\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonceGiven\",\"type\":\"uint256\"}],\"name\":\"IncorrectNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"operationHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentTimestamp\",\"type\":\"uint256\"}],\"name\":\"TransactionExpired\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"deadline\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"executeTransactionFromEntryPoint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_entryPoint\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"validateUserOp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"validationData\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
- Bin: "0x60c060405234801561001057600080fd5b50604051610acb380380610acb83398101604081905261002f91610062565b6001600160a01b039182166080521660a052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a051610a046100c760003960008181607101526102b801526000818161010101526101e30152610a046000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637eccf63e116100505780637eccf63e146100de57806389553be4146100e7578063dba6335f146100fc57600080fd5b8063140fcfb11461006c5780633a871cdd146100bd575b600080fd5b6100937f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d06100cb366004610646565b610123565b6040519081526020016100b4565b6100d060005481565b6100fa6100f53660046106da565b6102a0565b005b6100937f000000000000000000000000000000000000000000000000000000000000000081565b60008054846020013514610179576000546040517f7ba633940000000000000000000000000000000000000000000000000000000081526004810191909152602085013560248201526044015b60405180910390fd5b60006101858430610439565b90506000610197610140870187610777565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016915061021190508284610550565b73ffffffffffffffffffffffffffffffffffffffff161461024257610239600160008061060e565b92505050610299565b60008054908061025183610812565b90915550600090506102666060880188610777565b61027491600490829061084a565b81019061028191906108a3565b5092505050610293600082600061060e565b93505050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610311576040517f4a0bfec1000000000000000000000000000000000000000000000000000000008152336004820152602401610170565b65ffffffffffff83161580159061032f57508265ffffffffffff1642115b15610376576040517f300249d700000000000000000000000000000000000000000000000000000000815265ffffffffffff84166004820152426024820152604401610170565b6000808673ffffffffffffffffffffffffffffffffffffffff168685856040516103a192919061099f565b60006040518083038185875af1925050503d80600081146103de576040519150601f19603f3d011682016040523d82523d6000602084013e6103e3565b606091505b509150915081610430578051600003610428576040517f20e9b5d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b50505050505050565b604080517f4750045d47fce615521b32cee713ff8db50147e98aec5ca94926b52651ca3fa0602080830191909152818301859052825180830384018152606080840185528151918301919091207f190000000000000000000000000000000000000000000000000000000000000060808501527f010000000000000000000000000000000000000000000000000000000000000060818501527f1c7d3b72b37a35523e273aaadd7b4cd66f618bb81429ab053412d51f50ccea6160828501524660a28501529085901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660c284015260d6808401919091528351808403909101815260f690920190925280519101205b92915050565b602082015160408084015184516000939284918791908110610574576105746109af565b016020015160f81c905060018561058c83601b6109de565b6040805160008152602081018083529390935260ff90911690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156105db573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00151979650505050505050565b600060d08265ffffffffffff16901b60a08465ffffffffffff16901b85610636576000610639565b60015b60ff161717949350505050565b60008060006060848603121561065b57600080fd5b833567ffffffffffffffff81111561067257600080fd5b8401610160818703121561068557600080fd5b95602085013595506040909401359392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106bc57600080fd5b50565b803565ffffffffffff811681146106d557600080fd5b919050565b6000806000806000608086880312156106f257600080fd5b85356106fd8161069a565b945060208601359350610712604087016106bf565b9250606086013567ffffffffffffffff8082111561072f57600080fd5b818801915088601f83011261074357600080fd5b81358181111561075257600080fd5b89602082850101111561076457600080fd5b9699959850939650602001949392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126107ac57600080fd5b83018035915067ffffffffffffffff8211156107c757600080fd5b6020019150368190038213156107dc57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610843576108436107e3565b5060010190565b6000808585111561085a57600080fd5b8386111561086757600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080608085870312156108b957600080fd5b84356108c48161069a565b9350602085013592506108d9604086016106bf565b9150606085013567ffffffffffffffff808211156108f657600080fd5b818701915087601f83011261090a57600080fd5b81358181111561091c5761091c610874565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561096257610962610874565b816040528281528a602084870101111561097b57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60ff818116838216019081111561054a5761054a6107e356fea164736f6c6343000813000a",
-}
-
-var SCAABI = SCAMetaData.ABI
-
-var SCABin = SCAMetaData.Bin
-
-func DeploySCA(auth *bind.TransactOpts, backend bind.ContractBackend, owner common.Address, entryPoint common.Address) (common.Address, *types.Transaction, *SCA, error) {
- parsed, err := SCAMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SCABin), backend, owner, entryPoint)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &SCA{address: address, abi: *parsed, SCACaller: SCACaller{contract: contract}, SCATransactor: SCATransactor{contract: contract}, SCAFilterer: SCAFilterer{contract: contract}}, nil
-}
-
-type SCA struct {
- address common.Address
- abi abi.ABI
- SCACaller
- SCATransactor
- SCAFilterer
-}
-
-type SCACaller struct {
- contract *bind.BoundContract
-}
-
-type SCATransactor struct {
- contract *bind.BoundContract
-}
-
-type SCAFilterer struct {
- contract *bind.BoundContract
-}
-
-type SCASession struct {
- Contract *SCA
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type SCACallerSession struct {
- Contract *SCACaller
- CallOpts bind.CallOpts
-}
-
-type SCATransactorSession struct {
- Contract *SCATransactor
- TransactOpts bind.TransactOpts
-}
-
-type SCARaw struct {
- Contract *SCA
-}
-
-type SCACallerRaw struct {
- Contract *SCACaller
-}
-
-type SCATransactorRaw struct {
- Contract *SCATransactor
-}
-
-func NewSCA(address common.Address, backend bind.ContractBackend) (*SCA, error) {
- abi, err := abi.JSON(strings.NewReader(SCAABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindSCA(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &SCA{address: address, abi: abi, SCACaller: SCACaller{contract: contract}, SCATransactor: SCATransactor{contract: contract}, SCAFilterer: SCAFilterer{contract: contract}}, nil
-}
-
-func NewSCACaller(address common.Address, caller bind.ContractCaller) (*SCACaller, error) {
- contract, err := bindSCA(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &SCACaller{contract: contract}, nil
-}
-
-func NewSCATransactor(address common.Address, transactor bind.ContractTransactor) (*SCATransactor, error) {
- contract, err := bindSCA(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &SCATransactor{contract: contract}, nil
-}
-
-func NewSCAFilterer(address common.Address, filterer bind.ContractFilterer) (*SCAFilterer, error) {
- contract, err := bindSCA(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &SCAFilterer{contract: contract}, nil
-}
-
-func bindSCA(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := SCAMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_SCA *SCARaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SCA.Contract.SCACaller.contract.Call(opts, result, method, params...)
-}
-
-func (_SCA *SCARaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SCA.Contract.SCATransactor.contract.Transfer(opts)
-}
-
-func (_SCA *SCARaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SCA.Contract.SCATransactor.contract.Transact(opts, method, params...)
-}
-
-func (_SCA *SCACallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SCA.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_SCA *SCATransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SCA.Contract.contract.Transfer(opts)
-}
-
-func (_SCA *SCATransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SCA.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_SCA *SCACaller) IEntryPoint(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _SCA.contract.Call(opts, &out, "i_entryPoint")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_SCA *SCASession) IEntryPoint() (common.Address, error) {
- return _SCA.Contract.IEntryPoint(&_SCA.CallOpts)
-}
-
-func (_SCA *SCACallerSession) IEntryPoint() (common.Address, error) {
- return _SCA.Contract.IEntryPoint(&_SCA.CallOpts)
-}
-
-func (_SCA *SCACaller) IOwner(opts *bind.CallOpts) (common.Address, error) {
- var out []interface{}
- err := _SCA.contract.Call(opts, &out, "i_owner")
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_SCA *SCASession) IOwner() (common.Address, error) {
- return _SCA.Contract.IOwner(&_SCA.CallOpts)
-}
-
-func (_SCA *SCACallerSession) IOwner() (common.Address, error) {
- return _SCA.Contract.IOwner(&_SCA.CallOpts)
-}
-
-func (_SCA *SCACaller) SNonce(opts *bind.CallOpts) (*big.Int, error) {
- var out []interface{}
- err := _SCA.contract.Call(opts, &out, "s_nonce")
-
- if err != nil {
- return *new(*big.Int), err
- }
-
- out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
-
- return out0, err
-
-}
-
-func (_SCA *SCASession) SNonce() (*big.Int, error) {
- return _SCA.Contract.SNonce(&_SCA.CallOpts)
-}
-
-func (_SCA *SCACallerSession) SNonce() (*big.Int, error) {
- return _SCA.Contract.SNonce(&_SCA.CallOpts)
-}
-
-func (_SCA *SCATransactor) ExecuteTransactionFromEntryPoint(opts *bind.TransactOpts, to common.Address, value *big.Int, deadline *big.Int, data []byte) (*types.Transaction, error) {
- return _SCA.contract.Transact(opts, "executeTransactionFromEntryPoint", to, value, deadline, data)
-}
-
-func (_SCA *SCASession) ExecuteTransactionFromEntryPoint(to common.Address, value *big.Int, deadline *big.Int, data []byte) (*types.Transaction, error) {
- return _SCA.Contract.ExecuteTransactionFromEntryPoint(&_SCA.TransactOpts, to, value, deadline, data)
-}
-
-func (_SCA *SCATransactorSession) ExecuteTransactionFromEntryPoint(to common.Address, value *big.Int, deadline *big.Int, data []byte) (*types.Transaction, error) {
- return _SCA.Contract.ExecuteTransactionFromEntryPoint(&_SCA.TransactOpts, to, value, deadline, data)
-}
-
-func (_SCA *SCATransactor) ValidateUserOp(opts *bind.TransactOpts, userOp UserOperation, userOpHash [32]byte, arg2 *big.Int) (*types.Transaction, error) {
- return _SCA.contract.Transact(opts, "validateUserOp", userOp, userOpHash, arg2)
-}
-
-func (_SCA *SCASession) ValidateUserOp(userOp UserOperation, userOpHash [32]byte, arg2 *big.Int) (*types.Transaction, error) {
- return _SCA.Contract.ValidateUserOp(&_SCA.TransactOpts, userOp, userOpHash, arg2)
-}
-
-func (_SCA *SCATransactorSession) ValidateUserOp(userOp UserOperation, userOpHash [32]byte, arg2 *big.Int) (*types.Transaction, error) {
- return _SCA.Contract.ValidateUserOp(&_SCA.TransactOpts, userOp, userOpHash, arg2)
-}
-
-func (_SCA *SCA) Address() common.Address {
- return _SCA.address
-}
-
-type SCAInterface interface {
- IEntryPoint(opts *bind.CallOpts) (common.Address, error)
-
- IOwner(opts *bind.CallOpts) (common.Address, error)
-
- SNonce(opts *bind.CallOpts) (*big.Int, error)
-
- ExecuteTransactionFromEntryPoint(opts *bind.TransactOpts, to common.Address, value *big.Int, deadline *big.Int, data []byte) (*types.Transaction, error)
-
- ValidateUserOp(opts *bind.TransactOpts, userOp UserOperation, userOpHash [32]byte, arg2 *big.Int) (*types.Transaction, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generated/smart_contract_account_factory/smart_contract_account_factory.go b/core/gethwrappers/transmission/generated/smart_contract_account_factory/smart_contract_account_factory.go
deleted file mode 100644
index aa9205641c5..00000000000
--- a/core/gethwrappers/transmission/generated/smart_contract_account_factory/smart_contract_account_factory.go
+++ /dev/null
@@ -1,333 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package smart_contract_account_factory
-
-import (
- "errors"
- "fmt"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-var SmartContractAccountFactoryMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[],\"name\":\"DeploymentFailed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"scaAddress\",\"type\":\"address\"}],\"name\":\"ContractCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"abiEncodedOwnerAddress\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"deploySmartContractAccount\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"scaAddress\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]",
- Bin: "0x608060405234801561001057600080fd5b5061021e806100206000396000f3fe60806040526004361061001e5760003560e01c80630af4926f14610023575b600080fd5b610036610031366004610138565b61005f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000828251836020016000f5905073ffffffffffffffffffffffffffffffffffffffff81166100ba576040517f3011642500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff821681527fcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca3129060200160405180910390a192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806040838503121561014b57600080fd5b82359150602083013567ffffffffffffffff8082111561016a57600080fd5b818501915085601f83011261017e57600080fd5b81358181111561019057610190610109565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156101d6576101d6610109565b816040528281528860208487010111156101ef57600080fd5b826020860160208301376000602084830101528095505050505050925092905056fea164736f6c6343000813000a",
-}
-
-var SmartContractAccountFactoryABI = SmartContractAccountFactoryMetaData.ABI
-
-var SmartContractAccountFactoryBin = SmartContractAccountFactoryMetaData.Bin
-
-func DeploySmartContractAccountFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SmartContractAccountFactory, error) {
- parsed, err := SmartContractAccountFactoryMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SmartContractAccountFactoryBin), backend)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &SmartContractAccountFactory{address: address, abi: *parsed, SmartContractAccountFactoryCaller: SmartContractAccountFactoryCaller{contract: contract}, SmartContractAccountFactoryTransactor: SmartContractAccountFactoryTransactor{contract: contract}, SmartContractAccountFactoryFilterer: SmartContractAccountFactoryFilterer{contract: contract}}, nil
-}
-
-type SmartContractAccountFactory struct {
- address common.Address
- abi abi.ABI
- SmartContractAccountFactoryCaller
- SmartContractAccountFactoryTransactor
- SmartContractAccountFactoryFilterer
-}
-
-type SmartContractAccountFactoryCaller struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountFactoryTransactor struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountFactoryFilterer struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountFactorySession struct {
- Contract *SmartContractAccountFactory
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type SmartContractAccountFactoryCallerSession struct {
- Contract *SmartContractAccountFactoryCaller
- CallOpts bind.CallOpts
-}
-
-type SmartContractAccountFactoryTransactorSession struct {
- Contract *SmartContractAccountFactoryTransactor
- TransactOpts bind.TransactOpts
-}
-
-type SmartContractAccountFactoryRaw struct {
- Contract *SmartContractAccountFactory
-}
-
-type SmartContractAccountFactoryCallerRaw struct {
- Contract *SmartContractAccountFactoryCaller
-}
-
-type SmartContractAccountFactoryTransactorRaw struct {
- Contract *SmartContractAccountFactoryTransactor
-}
-
-func NewSmartContractAccountFactory(address common.Address, backend bind.ContractBackend) (*SmartContractAccountFactory, error) {
- abi, err := abi.JSON(strings.NewReader(SmartContractAccountFactoryABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindSmartContractAccountFactory(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountFactory{address: address, abi: abi, SmartContractAccountFactoryCaller: SmartContractAccountFactoryCaller{contract: contract}, SmartContractAccountFactoryTransactor: SmartContractAccountFactoryTransactor{contract: contract}, SmartContractAccountFactoryFilterer: SmartContractAccountFactoryFilterer{contract: contract}}, nil
-}
-
-func NewSmartContractAccountFactoryCaller(address common.Address, caller bind.ContractCaller) (*SmartContractAccountFactoryCaller, error) {
- contract, err := bindSmartContractAccountFactory(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountFactoryCaller{contract: contract}, nil
-}
-
-func NewSmartContractAccountFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartContractAccountFactoryTransactor, error) {
- contract, err := bindSmartContractAccountFactory(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountFactoryTransactor{contract: contract}, nil
-}
-
-func NewSmartContractAccountFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SmartContractAccountFactoryFilterer, error) {
- contract, err := bindSmartContractAccountFactory(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountFactoryFilterer{contract: contract}, nil
-}
-
-func bindSmartContractAccountFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := SmartContractAccountFactoryMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SmartContractAccountFactory.Contract.SmartContractAccountFactoryCaller.contract.Call(opts, result, method, params...)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.SmartContractAccountFactoryTransactor.contract.Transfer(opts)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.SmartContractAccountFactoryTransactor.contract.Transact(opts, method, params...)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SmartContractAccountFactory.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.contract.Transfer(opts)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryTransactor) DeploySmartContractAccount(opts *bind.TransactOpts, abiEncodedOwnerAddress [32]byte, initCode []byte) (*types.Transaction, error) {
- return _SmartContractAccountFactory.contract.Transact(opts, "deploySmartContractAccount", abiEncodedOwnerAddress, initCode)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactorySession) DeploySmartContractAccount(abiEncodedOwnerAddress [32]byte, initCode []byte) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.DeploySmartContractAccount(&_SmartContractAccountFactory.TransactOpts, abiEncodedOwnerAddress, initCode)
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryTransactorSession) DeploySmartContractAccount(abiEncodedOwnerAddress [32]byte, initCode []byte) (*types.Transaction, error) {
- return _SmartContractAccountFactory.Contract.DeploySmartContractAccount(&_SmartContractAccountFactory.TransactOpts, abiEncodedOwnerAddress, initCode)
-}
-
-type SmartContractAccountFactoryContractCreatedIterator struct {
- Event *SmartContractAccountFactoryContractCreated
-
- contract *bind.BoundContract
- event string
-
- logs chan types.Log
- sub ethereum.Subscription
- done bool
- fail error
-}
-
-func (it *SmartContractAccountFactoryContractCreatedIterator) Next() bool {
-
- if it.fail != nil {
- return false
- }
-
- if it.done {
- select {
- case log := <-it.logs:
- it.Event = new(SmartContractAccountFactoryContractCreated)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- default:
- return false
- }
- }
-
- select {
- case log := <-it.logs:
- it.Event = new(SmartContractAccountFactoryContractCreated)
- if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
- it.fail = err
- return false
- }
- it.Event.Raw = log
- return true
-
- case err := <-it.sub.Err():
- it.done = true
- it.fail = err
- return it.Next()
- }
-}
-
-func (it *SmartContractAccountFactoryContractCreatedIterator) Error() error {
- return it.fail
-}
-
-func (it *SmartContractAccountFactoryContractCreatedIterator) Close() error {
- it.sub.Unsubscribe()
- return nil
-}
-
-type SmartContractAccountFactoryContractCreated struct {
- ScaAddress common.Address
- Raw types.Log
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryFilterer) FilterContractCreated(opts *bind.FilterOpts) (*SmartContractAccountFactoryContractCreatedIterator, error) {
-
- logs, sub, err := _SmartContractAccountFactory.contract.FilterLogs(opts, "ContractCreated")
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountFactoryContractCreatedIterator{contract: _SmartContractAccountFactory.contract, event: "ContractCreated", logs: logs, sub: sub}, nil
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryFilterer) WatchContractCreated(opts *bind.WatchOpts, sink chan<- *SmartContractAccountFactoryContractCreated) (event.Subscription, error) {
-
- logs, sub, err := _SmartContractAccountFactory.contract.WatchLogs(opts, "ContractCreated")
- if err != nil {
- return nil, err
- }
- return event.NewSubscription(func(quit <-chan struct{}) error {
- defer sub.Unsubscribe()
- for {
- select {
- case log := <-logs:
-
- event := new(SmartContractAccountFactoryContractCreated)
- if err := _SmartContractAccountFactory.contract.UnpackLog(event, "ContractCreated", log); err != nil {
- return err
- }
- event.Raw = log
-
- select {
- case sink <- event:
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- case err := <-sub.Err():
- return err
- case <-quit:
- return nil
- }
- }
- }), nil
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactoryFilterer) ParseContractCreated(log types.Log) (*SmartContractAccountFactoryContractCreated, error) {
- event := new(SmartContractAccountFactoryContractCreated)
- if err := _SmartContractAccountFactory.contract.UnpackLog(event, "ContractCreated", log); err != nil {
- return nil, err
- }
- event.Raw = log
- return event, nil
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactory) ParseLog(log types.Log) (generated.AbigenLog, error) {
- switch log.Topics[0] {
- case _SmartContractAccountFactory.abi.Events["ContractCreated"].ID:
- return _SmartContractAccountFactory.ParseContractCreated(log)
-
- default:
- return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0])
- }
-}
-
-func (SmartContractAccountFactoryContractCreated) Topic() common.Hash {
- return common.HexToHash("0xcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca312")
-}
-
-func (_SmartContractAccountFactory *SmartContractAccountFactory) Address() common.Address {
- return _SmartContractAccountFactory.address
-}
-
-type SmartContractAccountFactoryInterface interface {
- DeploySmartContractAccount(opts *bind.TransactOpts, abiEncodedOwnerAddress [32]byte, initCode []byte) (*types.Transaction, error)
-
- FilterContractCreated(opts *bind.FilterOpts) (*SmartContractAccountFactoryContractCreatedIterator, error)
-
- WatchContractCreated(opts *bind.WatchOpts, sink chan<- *SmartContractAccountFactoryContractCreated) (event.Subscription, error)
-
- ParseContractCreated(log types.Log) (*SmartContractAccountFactoryContractCreated, error)
-
- ParseLog(log types.Log) (generated.AbigenLog, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generated/smart_contract_account_helper/smart_contract_account_helper.go b/core/gethwrappers/transmission/generated/smart_contract_account_helper/smart_contract_account_helper.go
deleted file mode 100644
index 36e63e3683e..00000000000
--- a/core/gethwrappers/transmission/generated/smart_contract_account_helper/smart_contract_account_helper.go
+++ /dev/null
@@ -1,322 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package smart_contract_account_helper
-
-import (
- "errors"
- "math/big"
- "strings"
-
- ethereum "github.com/ethereum/go-ethereum"
- "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"
- "github.com/ethereum/go-ethereum/event"
-)
-
-var (
- _ = errors.New
- _ = big.NewInt
- _ = strings.NewReader
- _ = ethereum.NotFound
- _ = bind.Bind
- _ = common.Big1
- _ = types.BloomLookup
- _ = event.NewSubscription
- _ = abi.ConvertType
-)
-
-var SmartContractAccountHelperMetaData = &bind.MetaData{
- ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entryPoint\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"}],\"name\":\"calculateSmartContractAccountAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"topupThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"topupAmount\",\"type\":\"uint256\"}],\"name\":\"getAbiEncodedDirectRequestData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"endContract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"getFullEndTxEncoding\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encoding\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"scaAddress\",\"type\":\"address\"}],\"name\":\"getFullHashForSigning\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entryPoint\",\"type\":\"address\"}],\"name\":\"getInitCode\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entryPoint\",\"type\":\"address\"}],\"name\":\"getSCAInitCodeWithConstructor\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
- Bin: "0x61161361003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061007c5760003560e01c8063e0237bef1161005a578063e0237bef14610134578063e464b3631461016c578063fc59bac31461017f57600080fd5b80632c86cb35146100815780634b770f561461010057806382311e3314610113575b600080fd5b6100ea61008f36600461076d565b604080516060808201835273ffffffffffffffffffffffffffffffffffffffff959095168082526020808301958652918301938452825191820152925183820152905182840152805180830390930183526080909101905290565b6040516100f7919061080e565b60405180910390f35b6100ea61010e366004610821565b610192565b610126610121366004610864565b610336565b6040519081526020016100f7565b610147610142366004610821565b610456565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f7565b6100ea61017a366004610890565b6105e1565b6100ea61018d3660046108e9565b61069f565b6040516060907fffffffffffffffffffffffffffffffffffffffff00000000000000000000000084831b16906000906101cd60208201610737565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff8881166020840152871690820152606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261026292916020016109dc565b60405160208183030381529060405290508560601b630af4926f60e01b8383604051602401610292929190610a0b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909516949094179093525161031c939201610a2c565b604051602081830303815290604052925050509392505050565b600061044d8383604080517f4750045d47fce615521b32cee713ff8db50147e98aec5ca94926b52651ca3fa060208083019190915281830194909452815180820383018152606080830184528151918601919091207f190000000000000000000000000000000000000000000000000000000000000060808401527f010000000000000000000000000000000000000000000000000000000000000060818401527f1c7d3b72b37a35523e273aaadd7b4cd66f618bb81429ab053412d51f50ccea6160828401524660a284015293901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660c282015260d6808201939093528151808203909301835260f6019052805191012090565b90505b92915050565b6040516000907fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606086901b1690829061049260208201610737565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff8981166020840152881690820152606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261052792916020016109dc565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815282825280516020918201207fff000000000000000000000000000000000000000000000000000000000000008285015260609790971b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166021840152603583019490945260558083019690965280518083039096018652607590910190525082519201919091209392505050565b6060604051806020016105f390610737565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff8681166020840152851690820152606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261068892916020016109dc565b604051602081830303815290604052905092915050565b60607f89553be40000000000000000000000000000000000000000000000000000000085856106ce8642610a74565b856040516020016106e29493929190610aae565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261071e9291602001610af3565b6040516020818303038152906040529050949350505050565b610acb80610b3c83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461076857600080fd5b919050565b60008060006060848603121561078257600080fd5b61078b84610744565b95602085013595506040909401359392505050565b60005b838110156107bb5781810151838201526020016107a3565b50506000910152565b600081518084526107dc8160208601602086016107a0565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061044d60208301846107c4565b60008060006060848603121561083657600080fd5b61083f84610744565b925061084d60208501610744565b915061085b60408501610744565b90509250925092565b6000806040838503121561087757600080fd5b8235915061088760208401610744565b90509250929050565b600080604083850312156108a357600080fd5b6108ac83610744565b915061088760208401610744565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080608085870312156108ff57600080fd5b61090885610744565b93506020850135925060408501359150606085013567ffffffffffffffff8082111561093357600080fd5b818701915087601f83011261094757600080fd5b813581811115610959576109596108ba565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561099f5761099f6108ba565b816040528281528a60208487010111156109b857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600083516109ee8184602088016107a0565b835190830190610a028183602088016107a0565b01949350505050565b828152604060208201526000610a2460408301846107c4565b949350505050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008316815260008251610a668160148501602087016107a0565b919091016014019392505050565b80820180821115610450577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152826040820152608060608201526000610ae960808301846107c4565b9695505050505050565b7fffffffff000000000000000000000000000000000000000000000000000000008316815260008251610b2d8160048501602087016107a0565b91909101600401939250505056fe60c060405234801561001057600080fd5b50604051610acb380380610acb83398101604081905261002f91610062565b6001600160a01b039182166080521660a052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a051610a046100c760003960008181607101526102b801526000818161010101526101e30152610a046000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637eccf63e116100505780637eccf63e146100de57806389553be4146100e7578063dba6335f146100fc57600080fd5b8063140fcfb11461006c5780633a871cdd146100bd575b600080fd5b6100937f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d06100cb366004610646565b610123565b6040519081526020016100b4565b6100d060005481565b6100fa6100f53660046106da565b6102a0565b005b6100937f000000000000000000000000000000000000000000000000000000000000000081565b60008054846020013514610179576000546040517f7ba633940000000000000000000000000000000000000000000000000000000081526004810191909152602085013560248201526044015b60405180910390fd5b60006101858430610439565b90506000610197610140870187610777565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016915061021190508284610550565b73ffffffffffffffffffffffffffffffffffffffff161461024257610239600160008061060e565b92505050610299565b60008054908061025183610812565b90915550600090506102666060880188610777565b61027491600490829061084a565b81019061028191906108a3565b5092505050610293600082600061060e565b93505050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610311576040517f4a0bfec1000000000000000000000000000000000000000000000000000000008152336004820152602401610170565b65ffffffffffff83161580159061032f57508265ffffffffffff1642115b15610376576040517f300249d700000000000000000000000000000000000000000000000000000000815265ffffffffffff84166004820152426024820152604401610170565b6000808673ffffffffffffffffffffffffffffffffffffffff168685856040516103a192919061099f565b60006040518083038185875af1925050503d80600081146103de576040519150601f19603f3d011682016040523d82523d6000602084013e6103e3565b606091505b509150915081610430578051600003610428576040517f20e9b5d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b50505050505050565b604080517f4750045d47fce615521b32cee713ff8db50147e98aec5ca94926b52651ca3fa0602080830191909152818301859052825180830384018152606080840185528151918301919091207f190000000000000000000000000000000000000000000000000000000000000060808501527f010000000000000000000000000000000000000000000000000000000000000060818501527f1c7d3b72b37a35523e273aaadd7b4cd66f618bb81429ab053412d51f50ccea6160828501524660a28501529085901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660c284015260d6808401919091528351808403909101815260f690920190925280519101205b92915050565b602082015160408084015184516000939284918791908110610574576105746109af565b016020015160f81c905060018561058c83601b6109de565b6040805160008152602081018083529390935260ff90911690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156105db573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00151979650505050505050565b600060d08265ffffffffffff16901b60a08465ffffffffffff16901b85610636576000610639565b60015b60ff161717949350505050565b60008060006060848603121561065b57600080fd5b833567ffffffffffffffff81111561067257600080fd5b8401610160818703121561068557600080fd5b95602085013595506040909401359392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106bc57600080fd5b50565b803565ffffffffffff811681146106d557600080fd5b919050565b6000806000806000608086880312156106f257600080fd5b85356106fd8161069a565b945060208601359350610712604087016106bf565b9250606086013567ffffffffffffffff8082111561072f57600080fd5b818801915088601f83011261074357600080fd5b81358181111561075257600080fd5b89602082850101111561076457600080fd5b9699959850939650602001949392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126107ac57600080fd5b83018035915067ffffffffffffffff8211156107c757600080fd5b6020019150368190038213156107dc57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610843576108436107e3565b5060010190565b6000808585111561085a57600080fd5b8386111561086757600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080608085870312156108b957600080fd5b84356108c48161069a565b9350602085013592506108d9604086016106bf565b9150606085013567ffffffffffffffff808211156108f657600080fd5b818701915087601f83011261090a57600080fd5b81358181111561091c5761091c610874565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561096257610962610874565b816040528281528a602084870101111561097b57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60ff818116838216019081111561054a5761054a6107e356fea164736f6c6343000813000aa164736f6c6343000813000a",
-}
-
-var SmartContractAccountHelperABI = SmartContractAccountHelperMetaData.ABI
-
-var SmartContractAccountHelperBin = SmartContractAccountHelperMetaData.Bin
-
-func DeploySmartContractAccountHelper(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SmartContractAccountHelper, error) {
- parsed, err := SmartContractAccountHelperMetaData.GetAbi()
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- if parsed == nil {
- return common.Address{}, nil, nil, errors.New("GetABI returned nil")
- }
-
- address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SmartContractAccountHelperBin), backend)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &SmartContractAccountHelper{address: address, abi: *parsed, SmartContractAccountHelperCaller: SmartContractAccountHelperCaller{contract: contract}, SmartContractAccountHelperTransactor: SmartContractAccountHelperTransactor{contract: contract}, SmartContractAccountHelperFilterer: SmartContractAccountHelperFilterer{contract: contract}}, nil
-}
-
-type SmartContractAccountHelper struct {
- address common.Address
- abi abi.ABI
- SmartContractAccountHelperCaller
- SmartContractAccountHelperTransactor
- SmartContractAccountHelperFilterer
-}
-
-type SmartContractAccountHelperCaller struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountHelperTransactor struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountHelperFilterer struct {
- contract *bind.BoundContract
-}
-
-type SmartContractAccountHelperSession struct {
- Contract *SmartContractAccountHelper
- CallOpts bind.CallOpts
- TransactOpts bind.TransactOpts
-}
-
-type SmartContractAccountHelperCallerSession struct {
- Contract *SmartContractAccountHelperCaller
- CallOpts bind.CallOpts
-}
-
-type SmartContractAccountHelperTransactorSession struct {
- Contract *SmartContractAccountHelperTransactor
- TransactOpts bind.TransactOpts
-}
-
-type SmartContractAccountHelperRaw struct {
- Contract *SmartContractAccountHelper
-}
-
-type SmartContractAccountHelperCallerRaw struct {
- Contract *SmartContractAccountHelperCaller
-}
-
-type SmartContractAccountHelperTransactorRaw struct {
- Contract *SmartContractAccountHelperTransactor
-}
-
-func NewSmartContractAccountHelper(address common.Address, backend bind.ContractBackend) (*SmartContractAccountHelper, error) {
- abi, err := abi.JSON(strings.NewReader(SmartContractAccountHelperABI))
- if err != nil {
- return nil, err
- }
- contract, err := bindSmartContractAccountHelper(address, backend, backend, backend)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountHelper{address: address, abi: abi, SmartContractAccountHelperCaller: SmartContractAccountHelperCaller{contract: contract}, SmartContractAccountHelperTransactor: SmartContractAccountHelperTransactor{contract: contract}, SmartContractAccountHelperFilterer: SmartContractAccountHelperFilterer{contract: contract}}, nil
-}
-
-func NewSmartContractAccountHelperCaller(address common.Address, caller bind.ContractCaller) (*SmartContractAccountHelperCaller, error) {
- contract, err := bindSmartContractAccountHelper(address, caller, nil, nil)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountHelperCaller{contract: contract}, nil
-}
-
-func NewSmartContractAccountHelperTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartContractAccountHelperTransactor, error) {
- contract, err := bindSmartContractAccountHelper(address, nil, transactor, nil)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountHelperTransactor{contract: contract}, nil
-}
-
-func NewSmartContractAccountHelperFilterer(address common.Address, filterer bind.ContractFilterer) (*SmartContractAccountHelperFilterer, error) {
- contract, err := bindSmartContractAccountHelper(address, nil, nil, filterer)
- if err != nil {
- return nil, err
- }
- return &SmartContractAccountHelperFilterer{contract: contract}, nil
-}
-
-func bindSmartContractAccountHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
- parsed, err := SmartContractAccountHelperMetaData.GetAbi()
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SmartContractAccountHelper.Contract.SmartContractAccountHelperCaller.contract.Call(opts, result, method, params...)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SmartContractAccountHelper.Contract.SmartContractAccountHelperTransactor.contract.Transfer(opts)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SmartContractAccountHelper.Contract.SmartContractAccountHelperTransactor.contract.Transact(opts, method, params...)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
- return _SmartContractAccountHelper.Contract.contract.Call(opts, result, method, params...)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _SmartContractAccountHelper.Contract.contract.Transfer(opts)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _SmartContractAccountHelper.Contract.contract.Transact(opts, method, params...)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) CalculateSmartContractAccountAddress(opts *bind.CallOpts, owner common.Address, entryPoint common.Address, factory common.Address) (common.Address, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "calculateSmartContractAccountAddress", owner, entryPoint, factory)
-
- if err != nil {
- return *new(common.Address), err
- }
-
- out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) CalculateSmartContractAccountAddress(owner common.Address, entryPoint common.Address, factory common.Address) (common.Address, error) {
- return _SmartContractAccountHelper.Contract.CalculateSmartContractAccountAddress(&_SmartContractAccountHelper.CallOpts, owner, entryPoint, factory)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) CalculateSmartContractAccountAddress(owner common.Address, entryPoint common.Address, factory common.Address) (common.Address, error) {
- return _SmartContractAccountHelper.Contract.CalculateSmartContractAccountAddress(&_SmartContractAccountHelper.CallOpts, owner, entryPoint, factory)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) GetAbiEncodedDirectRequestData(opts *bind.CallOpts, recipient common.Address, topupThreshold *big.Int, topupAmount *big.Int) ([]byte, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "getAbiEncodedDirectRequestData", recipient, topupThreshold, topupAmount)
-
- if err != nil {
- return *new([]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) GetAbiEncodedDirectRequestData(recipient common.Address, topupThreshold *big.Int, topupAmount *big.Int) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetAbiEncodedDirectRequestData(&_SmartContractAccountHelper.CallOpts, recipient, topupThreshold, topupAmount)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) GetAbiEncodedDirectRequestData(recipient common.Address, topupThreshold *big.Int, topupAmount *big.Int) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetAbiEncodedDirectRequestData(&_SmartContractAccountHelper.CallOpts, recipient, topupThreshold, topupAmount)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) GetFullEndTxEncoding(opts *bind.CallOpts, endContract common.Address, value *big.Int, deadline *big.Int, data []byte) ([]byte, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "getFullEndTxEncoding", endContract, value, deadline, data)
-
- if err != nil {
- return *new([]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) GetFullEndTxEncoding(endContract common.Address, value *big.Int, deadline *big.Int, data []byte) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetFullEndTxEncoding(&_SmartContractAccountHelper.CallOpts, endContract, value, deadline, data)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) GetFullEndTxEncoding(endContract common.Address, value *big.Int, deadline *big.Int, data []byte) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetFullEndTxEncoding(&_SmartContractAccountHelper.CallOpts, endContract, value, deadline, data)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) GetFullHashForSigning(opts *bind.CallOpts, userOpHash [32]byte, scaAddress common.Address) ([32]byte, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "getFullHashForSigning", userOpHash, scaAddress)
-
- if err != nil {
- return *new([32]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) GetFullHashForSigning(userOpHash [32]byte, scaAddress common.Address) ([32]byte, error) {
- return _SmartContractAccountHelper.Contract.GetFullHashForSigning(&_SmartContractAccountHelper.CallOpts, userOpHash, scaAddress)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) GetFullHashForSigning(userOpHash [32]byte, scaAddress common.Address) ([32]byte, error) {
- return _SmartContractAccountHelper.Contract.GetFullHashForSigning(&_SmartContractAccountHelper.CallOpts, userOpHash, scaAddress)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) GetInitCode(opts *bind.CallOpts, factory common.Address, owner common.Address, entryPoint common.Address) ([]byte, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "getInitCode", factory, owner, entryPoint)
-
- if err != nil {
- return *new([]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) GetInitCode(factory common.Address, owner common.Address, entryPoint common.Address) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetInitCode(&_SmartContractAccountHelper.CallOpts, factory, owner, entryPoint)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) GetInitCode(factory common.Address, owner common.Address, entryPoint common.Address) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetInitCode(&_SmartContractAccountHelper.CallOpts, factory, owner, entryPoint)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCaller) GetSCAInitCodeWithConstructor(opts *bind.CallOpts, owner common.Address, entryPoint common.Address) ([]byte, error) {
- var out []interface{}
- err := _SmartContractAccountHelper.contract.Call(opts, &out, "getSCAInitCodeWithConstructor", owner, entryPoint)
-
- if err != nil {
- return *new([]byte), err
- }
-
- out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte)
-
- return out0, err
-
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperSession) GetSCAInitCodeWithConstructor(owner common.Address, entryPoint common.Address) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetSCAInitCodeWithConstructor(&_SmartContractAccountHelper.CallOpts, owner, entryPoint)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelperCallerSession) GetSCAInitCodeWithConstructor(owner common.Address, entryPoint common.Address) ([]byte, error) {
- return _SmartContractAccountHelper.Contract.GetSCAInitCodeWithConstructor(&_SmartContractAccountHelper.CallOpts, owner, entryPoint)
-}
-
-func (_SmartContractAccountHelper *SmartContractAccountHelper) Address() common.Address {
- return _SmartContractAccountHelper.address
-}
-
-type SmartContractAccountHelperInterface interface {
- CalculateSmartContractAccountAddress(opts *bind.CallOpts, owner common.Address, entryPoint common.Address, factory common.Address) (common.Address, error)
-
- GetAbiEncodedDirectRequestData(opts *bind.CallOpts, recipient common.Address, topupThreshold *big.Int, topupAmount *big.Int) ([]byte, error)
-
- GetFullEndTxEncoding(opts *bind.CallOpts, endContract common.Address, value *big.Int, deadline *big.Int, data []byte) ([]byte, error)
-
- GetFullHashForSigning(opts *bind.CallOpts, userOpHash [32]byte, scaAddress common.Address) ([32]byte, error)
-
- GetInitCode(opts *bind.CallOpts, factory common.Address, owner common.Address, entryPoint common.Address) ([]byte, error)
-
- GetSCAInitCodeWithConstructor(opts *bind.CallOpts, owner common.Address, entryPoint common.Address) ([]byte, error)
-
- Address() common.Address
-}
diff --git a/core/gethwrappers/transmission/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/transmission/generation/generated-wrapper-dependency-versions-do-not-edit.txt
deleted file mode 100644
index 3ccf8656388..00000000000
--- a/core/gethwrappers/transmission/generation/generated-wrapper-dependency-versions-do-not-edit.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-GETH_VERSION: 1.14.11
-entry_point: ../../../contracts/solc/v0.8.19/EntryPoint/EntryPoint.abi ../../../contracts/solc/v0.8.19/EntryPoint/EntryPoint.bin e43da0e61256471b317cab1c87f2425cecba9b81ac21633334f889bab2f0777d
-greeter: ../../../contracts/solc/v0.8.15/Greeter.abi ../../../contracts/solc/v0.8.15/Greeter.bin 653dcba5c33a46292073939ce1e639372cf521c0ec2814d4c9f20c72f796f18c
-greeter_wrapper: ../../../contracts/solc/v0.8.19/Greeter/Greeter.abi ../../../contracts/solc/v0.8.19/Greeter/Greeter.bin 7f6def58e337a53553a46cb7992cf2d75ec951014d79376fcb869a2b16b53f6d
-paymaster_wrapper: ../../../contracts/solc/v0.8.19/Paymaster/Paymaster.abi ../../../contracts/solc/v0.8.19/Paymaster/Paymaster.bin dbdd1341cfa2d5c09730e0decc32339f62d1a4ea89835a51ff774226ddfbd04b
-sca: ../../../contracts/solc/v0.8.15/SCA.abi ../../../contracts/solc/v0.8.15/SCA.bin ae0f860cdac87d4ac505edbd228bd3ea1108550453aba67aebcb61f09cf70d0b
-sca_wrapper: ../../../contracts/solc/v0.8.19/SCA/SCA.abi ../../../contracts/solc/v0.8.19/SCA/SCA.bin 6ef817bdefad1b5e84f06e0bdc40848000ab00e1a38371435b793946f425a8e6
-smart_contract_account_factory: ../../../contracts/solc/v0.8.19/SmartContractAccountFactory/SmartContractAccountFactory.abi ../../../contracts/solc/v0.8.19/SmartContractAccountFactory/SmartContractAccountFactory.bin a357132e2782c462fa31ed80c270fe002e666a48ecfe407b71c278fc3a0d3679
-smart_contract_account_helper: ../../../contracts/solc/v0.8.19/SmartContractAccountHelper/SmartContractAccountHelper.abi ../../../contracts/solc/v0.8.19/SmartContractAccountHelper/SmartContractAccountHelper.bin a06aff23aded74d53bd342fdc32d80c3b474ff38223df27f3395e9fd90abd12a
diff --git a/core/gethwrappers/transmission/go_generate.go b/core/gethwrappers/transmission/go_generate.go
deleted file mode 100644
index b3f2b4b0eb9..00000000000
--- a/core/gethwrappers/transmission/go_generate.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Package gethwrappers provides tools for wrapping solidity contracts with
-// golang packages, using abigen.
-package gethwrappers
-
-// Transmission
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/Greeter/Greeter.abi ../../../contracts/solc/v0.8.19/Greeter/Greeter.bin Greeter greeter_wrapper
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/SmartContractAccountFactory/SmartContractAccountFactory.abi ../../../contracts/solc/v0.8.19/SmartContractAccountFactory/SmartContractAccountFactory.bin SmartContractAccountFactory smart_contract_account_factory
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/EntryPoint/EntryPoint.abi ../../../contracts/solc/v0.8.19/EntryPoint/EntryPoint.bin EntryPoint entry_point
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/SmartContractAccountHelper/SmartContractAccountHelper.abi ../../../contracts/solc/v0.8.19/SmartContractAccountHelper/SmartContractAccountHelper.bin SmartContractAccountHelper smart_contract_account_helper
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/SCA/SCA.abi ../../../contracts/solc/v0.8.19/SCA/SCA.bin SCA sca_wrapper
-//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/Paymaster/Paymaster.abi ../../../contracts/solc/v0.8.19/Paymaster/Paymaster.bin Paymaster paymaster_wrapper
diff --git a/core/services/transmission/integration_test.go b/core/services/transmission/integration_test.go
deleted file mode 100644
index 6e38687313c..00000000000
--- a/core/services/transmission/integration_test.go
+++ /dev/null
@@ -1,495 +0,0 @@
-package transmission_test
-
-import (
- "math/big"
- "testing"
-
- "github.com/ethereum/go-ethereum"
- "github.com/ethereum/go-ethereum/accounts/abi/bind"
- "github.com/ethereum/go-ethereum/common"
- "github.com/stretchr/testify/require"
-
- "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_consumer_interface_v08"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_mock"
-
- "github.com/ethereum/go-ethereum/core/types"
-
- evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/entry_point"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/greeter_wrapper"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/paymaster_wrapper"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/sca_wrapper"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/smart_contract_account_factory"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/transmission/generated/smart_contract_account_helper"
- "github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
- "github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
- "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey"
- "github.com/smartcontractkit/chainlink/v2/core/services/transmission"
-)
-
-var (
- greeterABI = evmtypes.MustGetABI(greeter_wrapper.GreeterABI)
- consumerABI = evmtypes.MustGetABI(solidity_vrf_consumer_interface_v08.VRFConsumerABI)
- entrypointABI = evmtypes.MustGetABI(entry_point.EntryPointABI)
-)
-
-type EntryPointUniverse struct {
- holder1 *bind.TransactOpts
- holder1Key ethkey.KeyV2
- holder2 *bind.TransactOpts
- backend evmtypes.Backend
- entryPointAddress common.Address
- entryPoint *entry_point.EntryPoint
- factoryAddress common.Address
- helper *smart_contract_account_helper.SmartContractAccountHelper
- greeterAddress common.Address
- greeter *greeter_wrapper.Greeter
- linkTokenAddress common.Address
- linkToken *link_token_interface.LinkToken
- linkEthFeedAddress common.Address
- vrfCoordinatorAddress common.Address
- vrfCoordinator *vrf_coordinator_mock.VRFCoordinatorMock
- vrfConsumerAddress common.Address
-}
-
-func deployTransmissionUniverse(t *testing.T) *EntryPointUniverse {
- // Create a key for holder1 that we can use to sign
- holder1Key := cltest.MustGenerateRandomKey(t)
- t.Log("Holder key:", holder1Key.String())
-
- // Construct simulated blockchain environment.
- holder1Transactor, err := bind.NewKeyedTransactorWithChainID(holder1Key.ToEcdsaPrivKey(), testutils.SimulatedChainID)
- require.NoError(t, err)
- var (
- holder1 = holder1Transactor
- holder2 = testutils.MustNewSimTransactor(t)
- )
- genesisData := types.GenesisAlloc{
- holder1.From: {Balance: assets.Ether(1000).ToInt()},
- holder2.From: {Balance: assets.Ether(1000).ToInt()},
- }
- backend := cltest.NewSimulatedBackend(t, genesisData, 30e6)
- backend.Commit()
-
- // Setup all contracts and addresses used by tests.
- entryPointAddress, _, entryPoint, err := entry_point.DeployEntryPoint(holder1, backend.Client())
- require.NoError(t, err)
- factoryAddress, _, _, _ := smart_contract_account_factory.DeploySmartContractAccountFactory(holder1, backend.Client())
- require.NoError(t, err)
- _, _, helper, err := smart_contract_account_helper.DeploySmartContractAccountHelper(holder1, backend.Client())
- require.NoError(t, err)
- greeterAddress, _, greeter, err := greeter_wrapper.DeployGreeter(holder1, backend.Client())
- require.NoError(t, err)
- linkTokenAddress, _, linkToken, err := link_token_interface.DeployLinkToken(holder1, backend.Client())
- require.NoError(t, err)
- linkEthFeedAddress, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(
- holder1,
- backend.Client(),
- 18,
- (*big.Int)(assets.GWei(5000000)), // .005 ETH
- )
- require.NoError(t, err)
- vrfCoordinatorAddress, _, vrfCoordinator, err := vrf_coordinator_mock.DeployVRFCoordinatorMock(holder1, backend.Client(), linkTokenAddress)
- require.NoError(t, err)
- vrfConsumerAddress, _, _, err := solidity_vrf_consumer_interface_v08.DeployVRFConsumer(holder1, backend.Client(), vrfCoordinatorAddress, linkTokenAddress)
- require.NoError(t, err)
- backend.Commit()
-
- return &EntryPointUniverse{
- holder1: holder1,
- holder1Key: holder1Key,
- holder2: holder2,
- backend: backend,
- entryPointAddress: entryPointAddress,
- entryPoint: entryPoint,
- factoryAddress: factoryAddress,
- helper: helper,
- greeterAddress: greeterAddress,
- greeter: greeter,
- linkTokenAddress: linkTokenAddress,
- linkToken: linkToken,
- linkEthFeedAddress: linkEthFeedAddress,
- vrfCoordinatorAddress: vrfCoordinatorAddress,
- vrfCoordinator: vrfCoordinator,
- vrfConsumerAddress: vrfConsumerAddress,
- }
-}
-
-func Test4337Basic(t *testing.T) {
- // Deploy universe.
- universe := deployTransmissionUniverse(t)
- holder1 := universe.holder1
- holder2 := universe.holder2
- backend := universe.backend
-
- // Ensure no greeting is already set.
- initialGreeting, err := universe.greeter.GetGreeting(nil)
- require.NoError(t, err)
- require.Equal(t, "", initialGreeting)
-
- // Get the address at which the Smart Contract Account will be deployed.
- toDeployAddress, err := universe.helper.CalculateSmartContractAccountAddress(
- nil,
- holder1.From,
- universe.entryPointAddress,
- universe.factoryAddress,
- )
- require.NoError(t, err)
- t.Log("Smart Contract Account Address:", toDeployAddress)
-
- // Get the initialization code for the Smart Contract Account.
- fullInitializeCode, err := universe.helper.GetInitCode(nil, universe.factoryAddress, holder1.From, universe.entryPointAddress)
- require.NoError(t, err)
- t.Log("Full initialization code:", common.Bytes2Hex(fullInitializeCode))
-
- // Construct calldata for setGreeting.
- encodedGreetingCall, err := greeterABI.Pack("setGreeting", "bye")
- require.NoError(t, err)
- t.Log("Encoded greeting call:", common.Bytes2Hex(encodedGreetingCall))
-
- // Construct the calldata to be passed in the user operation.
- var (
- value = big.NewInt(0)
- nonce = big.NewInt(0)
- deadline = big.NewInt(1000)
- )
- fullEncoding, err := universe.helper.GetFullEndTxEncoding(nil, universe.greeterAddress, value, deadline, encodedGreetingCall)
- require.NoError(t, err)
- t.Log("Full user operation calldata:", common.Bytes2Hex(fullEncoding))
-
- // Construct and execute user operation.
- userOp := entry_point.UserOperation{
- Sender: toDeployAddress,
- Nonce: nonce,
- InitCode: fullInitializeCode,
- CallData: fullEncoding,
- CallGasLimit: big.NewInt(10_000_000),
- VerificationGasLimit: big.NewInt(10_000_000),
- PreVerificationGas: big.NewInt(10_000_000),
- MaxFeePerGas: big.NewInt(100),
- MaxPriorityFeePerGas: big.NewInt(200),
- PaymasterAndData: []byte(""),
- Signature: []byte(""),
- }
-
- // Generate hash from user operation, sign it, and include it in the user operation.
- userOpHash, err := universe.entryPoint.GetUserOpHash(nil, userOp)
- require.NoError(t, err)
- fullHash, err := universe.helper.GetFullHashForSigning(nil, userOpHash, toDeployAddress)
- require.NoError(t, err)
- t.Log("Full hash for signing:", common.Bytes2Hex(fullHash[:]))
- sig, err := transmission.SignMessage(universe.holder1Key.ToEcdsaPrivKey(), fullHash[:])
- require.NoError(t, err)
- t.Log("Signature:", common.Bytes2Hex(sig))
- userOp.Signature = sig
-
- // Deposit to the SCA's account to pay for this transaction.
- holder1.Value = assets.Ether(10).ToInt()
- tx, err := universe.entryPoint.DepositTo(holder1, toDeployAddress)
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(testutils.Context(t), backend.Client(), tx)
- require.NoError(t, err)
- holder1.Value = assets.Ether(0).ToInt()
- balance, err := universe.entryPoint.BalanceOf(nil, toDeployAddress)
- require.NoError(t, err)
- require.Equal(t, assets.Ether(10).ToInt(), balance)
-
- // Run handleOps from holder2's account, to demonstrate that any account can execute this signed user operation.
- tx, err = universe.entryPoint.HandleOps(holder2, []entry_point.UserOperation{userOp}, holder1.From)
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(testutils.Context(t), backend.Client(), tx)
- require.NoError(t, err)
-
- // Ensure "bye" was successfully set as the greeting.
- greetingResult, err := universe.greeter.GetGreeting(nil)
- require.NoError(t, err)
- require.Equal(t, "bye", greetingResult)
-
- // Assert smart contract account is created and nonce incremented.
- sca, err := sca_wrapper.NewSCA(toDeployAddress, backend.Client())
- require.NoError(t, err)
- onChainNonce, err := sca.SNonce(nil)
- require.NoError(t, err)
- require.Equal(t, big.NewInt(1), onChainNonce)
-}
-
-func Test4337WithLinkTokenPaymaster(t *testing.T) {
- // Deploy universe.
- universe := deployTransmissionUniverse(t)
- holder1 := universe.holder1
- holder2 := universe.holder2
- backend := universe.backend
-
- // Ensure no greeting is already set.
- initialGreeting, err := universe.greeter.GetGreeting(nil)
- require.NoError(t, err)
- require.Equal(t, "", initialGreeting)
-
- // Get the address at which the Smart Contract Account will be deployed.
- toDeployAddress, err := universe.helper.CalculateSmartContractAccountAddress(
- nil,
- holder1.From,
- universe.entryPointAddress,
- universe.factoryAddress,
- )
- require.NoError(t, err)
- t.Log("Smart Contract Account Address:", toDeployAddress)
-
- // Get the initialization code for the Smart Contract Account.
- fullInitializeCode, err := universe.helper.GetInitCode(nil, universe.factoryAddress, holder1.From, universe.entryPointAddress)
- require.NoError(t, err)
- t.Log("Full initialization code:", common.Bytes2Hex(fullInitializeCode))
-
- // Construct calldata for setGreeting.
- encodedGreetingCall, err := greeterABI.Pack("setGreeting", "bye")
- require.NoError(t, err)
- t.Log("Encoded greeting call:", common.Bytes2Hex(encodedGreetingCall))
-
- // Construct the calldata to be passed in the user operation.
- var (
- value = big.NewInt(0)
- nonce = big.NewInt(0)
- deadline = big.NewInt(1000)
- )
- fullEncoding, err := universe.helper.GetFullEndTxEncoding(nil, universe.greeterAddress, value, deadline, encodedGreetingCall)
- require.NoError(t, err)
- t.Log("Full user operation calldata:", common.Bytes2Hex(fullEncoding))
-
- // Deposit to LINK paymaster.
- linkTokenAddress, _, linkToken, err := link_token_interface.DeployLinkToken(holder1, backend.Client())
- require.NoError(t, err)
- linkEthFeedAddress, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(
- holder1,
- backend.Client(),
- 18,
- (*big.Int)(assets.GWei(5000000)), // .005 ETH
- )
- require.NoError(t, err)
- paymasterAddress, _, _, err := paymaster_wrapper.DeployPaymaster(holder1, backend.Client(), linkTokenAddress, linkEthFeedAddress, universe.entryPointAddress)
- require.NoError(t, err)
- backend.Commit()
- tx, err := linkToken.TransferAndCall(
- holder1,
- paymasterAddress,
- assets.Ether(1000).ToInt(),
- common.LeftPadBytes(toDeployAddress.Bytes(), 32),
- )
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(testutils.Context(t), backend.Client(), tx)
- require.NoError(t, err)
-
- // Construct and execute user operation.
- userOp := entry_point.UserOperation{
- Sender: toDeployAddress,
- Nonce: nonce,
- InitCode: fullInitializeCode,
- CallData: fullEncoding,
- CallGasLimit: big.NewInt(10_000_000),
- VerificationGasLimit: big.NewInt(10_000_000),
- PreVerificationGas: big.NewInt(10_000_000),
- MaxFeePerGas: big.NewInt(100),
- MaxPriorityFeePerGas: big.NewInt(200),
- PaymasterAndData: paymasterAddress.Bytes(),
- Signature: []byte(""),
- }
-
- // Generate hash from user operation, sign it, and include it in the user operation.
- userOpHash, err := universe.entryPoint.GetUserOpHash(nil, userOp)
- require.NoError(t, err)
- fullHash, err := universe.helper.GetFullHashForSigning(nil, userOpHash, toDeployAddress)
- require.NoError(t, err)
- t.Log("Full hash for signing:", common.Bytes2Hex(fullHash[:]))
- sig, err := transmission.SignMessage(universe.holder1Key.ToEcdsaPrivKey(), fullHash[:])
- require.NoError(t, err)
- t.Log("Signature:", common.Bytes2Hex(sig))
- userOp.Signature = sig
-
- // Deposit to the Paymaster's account to pay for this transaction.
- holder1.Value = assets.Ether(10).ToInt()
- tx, err = universe.entryPoint.DepositTo(holder1, paymasterAddress)
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(testutils.Context(t), backend.Client(), tx)
- require.NoError(t, err)
- holder1.Value = assets.Ether(0).ToInt()
- balance, err := universe.entryPoint.BalanceOf(nil, paymasterAddress)
- require.NoError(t, err)
- require.Equal(t, assets.Ether(10).ToInt(), balance)
-
- // Run handleOps from holder2's account, to demonstrate that any account can execute this signed user operation.
- tx, err = universe.entryPoint.HandleOps(holder2, []entry_point.UserOperation{userOp}, holder1.From)
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(testutils.Context(t), backend.Client(), tx)
- require.NoError(t, err)
-
- // Ensure "bye" was successfully set as the greeting.
- greetingResult, err := universe.greeter.GetGreeting(nil)
- require.NoError(t, err)
- require.Equal(t, "bye", greetingResult)
-
- // Assert smart contract account is created and nonce incremented.
- sca, err := sca_wrapper.NewSCA(toDeployAddress, backend.Client())
- require.NoError(t, err)
- onChainNonce, err := sca.SNonce(nil)
- require.NoError(t, err)
- require.Equal(t, big.NewInt(1), onChainNonce)
-}
-
-func Test4337WithLinkTokenVRFRequestAndPaymaster(t *testing.T) {
- // Deploy universe.
- universe := deployTransmissionUniverse(t)
- holder1 := universe.holder1
- holder2 := universe.holder2
- backend := universe.backend
-
- // Get the address at which the Smart Contract Account will be deployed.
- toDeployAddress, err := universe.helper.CalculateSmartContractAccountAddress(
- nil,
- holder1.From,
- universe.entryPointAddress,
- universe.factoryAddress,
- )
- require.NoError(t, err)
- t.Log("Smart Contract Account Address:", toDeployAddress)
-
- // Get the initialization code for the Smart Contract Account.
- fullInitializeCode, err := universe.helper.GetInitCode(nil, universe.factoryAddress, holder1.From, universe.entryPointAddress)
- require.NoError(t, err)
- t.Log("Full initialization code:", common.Bytes2Hex(fullInitializeCode))
-
- // Construct calldata for the vrf request.
- var keyhash [32]byte
- copy(keyhash[:], common.LeftPadBytes(big.NewInt(123).Bytes(), 32))
- var fee = assets.Ether(1).ToInt()
- encodedVRFRequest, err := consumerABI.Pack("doRequestRandomness", keyhash, fee)
- require.NoError(t, err)
- t.Log("Encoded vrf request:", common.Bytes2Hex(encodedVRFRequest))
-
- // Construct the calldata to be passed in the user operation.
- var (
- value = big.NewInt(0)
- nonce = big.NewInt(0)
- deadline = big.NewInt(1000)
- )
- fullEncoding, err := universe.helper.GetFullEndTxEncoding(nil, universe.vrfConsumerAddress, value, deadline, encodedVRFRequest)
- require.NoError(t, err)
- t.Log("Full user operation calldata:", common.Bytes2Hex(fullEncoding))
-
- // Deposit to LINK paymaster.
- paymasterAddress, _, _, err := paymaster_wrapper.DeployPaymaster(holder1, backend.Client(), universe.linkTokenAddress, universe.linkEthFeedAddress, universe.entryPointAddress)
- require.NoError(t, err)
- backend.Commit()
- tx, err := universe.linkToken.TransferAndCall(
- holder1,
- paymasterAddress,
- assets.Ether(1000).ToInt(),
- common.LeftPadBytes(toDeployAddress.Bytes(), 32),
- )
- require.NoError(t, err)
- backend.Commit()
-
- ctx := testutils.Context(t)
- _, err = bind.WaitMined(ctx, backend.Client(), tx)
- require.NoError(t, err)
-
- // Generate encoded paymaster data to fund the VRF consumer.
- encodedPaymasterData, err := universe.helper.GetAbiEncodedDirectRequestData(nil, universe.vrfConsumerAddress, fee, fee)
- require.NoError(t, err)
-
- // Construct and execute user operation.
- userOp := entry_point.UserOperation{
- Sender: toDeployAddress,
- Nonce: nonce,
- InitCode: fullInitializeCode,
- CallData: fullEncoding,
- CallGasLimit: big.NewInt(10_000_000),
- VerificationGasLimit: big.NewInt(10_000_000),
- PreVerificationGas: big.NewInt(10_000_000),
- MaxFeePerGas: big.NewInt(100),
- MaxPriorityFeePerGas: big.NewInt(200),
- PaymasterAndData: append(append(paymasterAddress.Bytes(), byte(0)), encodedPaymasterData...),
- Signature: []byte(""),
- }
-
- // Generate hash from user operation, sign it, and include it in the user operation.
- userOpHash, err := universe.entryPoint.GetUserOpHash(nil, userOp)
- require.NoError(t, err)
- fullHash, err := universe.helper.GetFullHashForSigning(nil, userOpHash, toDeployAddress)
- require.NoError(t, err)
- t.Log("Full hash for signing:", common.Bytes2Hex(fullHash[:]))
- sig, err := transmission.SignMessage(universe.holder1Key.ToEcdsaPrivKey(), fullHash[:])
- require.NoError(t, err)
- t.Log("Signature:", common.Bytes2Hex(sig))
- userOp.Signature = sig
-
- // Deposit to the Paymaster's account to pay for this transaction.
- holder1.Value = assets.Ether(10).ToInt()
- tx, err = universe.entryPoint.DepositTo(holder1, paymasterAddress)
- require.NoError(t, err)
- backend.Commit()
- _, err = bind.WaitMined(ctx, backend.Client(), tx)
- require.NoError(t, err)
- holder1.Value = assets.Ether(0).ToInt()
- balance, err := universe.entryPoint.BalanceOf(nil, paymasterAddress)
- require.NoError(t, err)
- require.Equal(t, assets.Ether(10).ToInt(), balance)
-
- // Run handleOps from holder2's account, to demonstrate that any account can execute this signed user operation.
- // Manually execute transaction to test ABI packing.
- gasPrice, err := backend.Client().SuggestGasPrice(ctx)
- require.NoError(t, err)
- accountNonce, err := backend.Client().PendingNonceAt(ctx, holder2.From)
- require.NoError(t, err)
- payload, err := entrypointABI.Pack("handleOps", []entry_point.UserOperation{userOp}, holder1.From)
- require.NoError(t, err)
- gas, err := backend.Client().EstimateGas(ctx, ethereum.CallMsg{
- From: holder2.From,
- To: &universe.entryPointAddress,
- Gas: 0,
- Data: payload,
- GasPrice: gasPrice,
- })
- unsigned := types.NewTx(&types.LegacyTx{
- Nonce: accountNonce,
- Gas: gas,
- To: &universe.entryPointAddress,
- Value: big.NewInt(0),
- Data: payload,
- GasPrice: gasPrice,
- })
- require.NoError(t, err)
- signedtx, err := holder2.Signer(holder2.From, unsigned)
- require.NoError(t, err)
- err = backend.Client().SendTransaction(ctx, signedtx)
- require.NoError(t, err)
- backend.Commit()
- receipt, err := bind.WaitMined(ctx, backend.Client(), signedtx)
- require.NoError(t, err)
- t.Log("Receipt:", receipt.Status)
-
- // Assert the VRF request was correctly made.
- logs, err := backend.Client().FilterLogs(ctx, ethereum.FilterQuery{
- Addresses: []common.Address{universe.vrfCoordinatorAddress},
- })
- require.NoError(t, err)
- require.Equal(t, 1, len(logs))
- randomnessRequestLog, err := universe.vrfCoordinator.ParseRandomnessRequest(logs[0])
- require.NoError(t, err)
- require.Equal(t, fee, randomnessRequestLog.Fee)
- require.Equal(t, keyhash, randomnessRequestLog.KeyHash)
- require.Equal(t, universe.vrfConsumerAddress, randomnessRequestLog.Sender)
-
- // Assert smart contract account is created and nonce incremented.
- sca, err := sca_wrapper.NewSCA(toDeployAddress, backend.Client())
- require.NoError(t, err)
- onChainNonce, err := sca.SNonce(nil)
- require.NoError(t, err)
- require.Equal(t, big.NewInt(1), onChainNonce)
-}
diff --git a/core/services/transmission/signature.go b/core/services/transmission/signature.go
deleted file mode 100644
index 50b7bc584dc..00000000000
--- a/core/services/transmission/signature.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package transmission
-
-import (
- "crypto/ecdsa"
-
- "github.com/ethereum/go-ethereum/crypto"
-)
-
-func SignMessage(
- ownerPrivateKey *ecdsa.PrivateKey,
- message []byte,
-) ([]byte, error) {
- sig, err := crypto.Sign(message, ownerPrivateKey)
- if err != nil {
- return nil, err
- }
-
- return sig, nil
-}
From 6ea85ea4fec062c7fb98c5c55511997c1ae2a2b5 Mon Sep 17 00:00:00 2001
From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com>
Date: Fri, 20 Dec 2024 09:22:34 -0800
Subject: [PATCH 02/19] Ccip-4693 deprecate add lane replaced with granular
changesets (#15784)
* remove deployCCIPContracts
* deprecate existing add lane
* more changes
* fix tests
* test fix
* updates
* review comments
* review comments
* add a test
* more validation
---
deployment/ccip/changeset/cs_add_lane.go | 227 -----------
deployment/ccip/changeset/cs_add_lane_test.go | 227 ++++-------
deployment/ccip/changeset/cs_ccip_home.go | 8 +-
.../ccip/changeset/cs_ccip_home_test.go | 2 +-
.../ccip/changeset/cs_chain_contracts.go | 384 +++++++++++++++++-
.../ccip/changeset/cs_chain_contracts_test.go | 59 +++
deployment/ccip/changeset/test_environment.go | 4 +-
deployment/ccip/changeset/test_helpers.go | 110 ++++-
deployment/environment/crib/ccip_deployer.go | 89 +++-
.../contracts/ccipreader_test.go | 26 +-
.../smoke/ccip/ccip_batching_test.go | 4 +-
.../smoke/ccip/ccip_fee_boosting_test.go | 129 ++----
.../smoke/ccip/ccip_fees_test.go | 2 +-
.../smoke/ccip/ccip_gas_price_updates_test.go | 2 +-
.../ccip/ccip_message_limitations_test.go | 2 +-
.../smoke/ccip/ccip_messaging_test.go | 2 +-
.../smoke/ccip/ccip_ooo_execution_test.go | 2 +-
integration-tests/smoke/ccip/ccip_rmn_test.go | 2 +-
.../ccip/ccip_token_price_updates_test.go | 2 +-
.../smoke/ccip/ccip_token_transfer_test.go | 2 +-
.../smoke/ccip/ccip_usdc_test.go | 2 +-
21 files changed, 764 insertions(+), 523 deletions(-)
delete mode 100644 deployment/ccip/changeset/cs_add_lane.go
diff --git a/deployment/ccip/changeset/cs_add_lane.go b/deployment/ccip/changeset/cs_add_lane.go
deleted file mode 100644
index 0bd03b56559..00000000000
--- a/deployment/ccip/changeset/cs_add_lane.go
+++ /dev/null
@@ -1,227 +0,0 @@
-package changeset
-
-import (
- "encoding/hex"
- "fmt"
- "math/big"
-
- "github.com/ethereum/go-ethereum/common"
- "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
-
- "github.com/smartcontractkit/chainlink/deployment"
- "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
-)
-
-var _ deployment.ChangeSet[AddLanesConfig] = AddLanes
-
-type InitialPrices struct {
- LinkPrice *big.Int // USD to the power of 18 (e18) per LINK
- WethPrice *big.Int // USD to the power of 18 (e18) per WETH
- GasPrice *big.Int // uint224 packed gas price in USD (112 for exec // 112 for da)
-}
-
-func (p InitialPrices) Validate() error {
- if p.LinkPrice == nil {
- return fmt.Errorf("missing link price")
- }
- if p.WethPrice == nil {
- return fmt.Errorf("missing weth price")
- }
- if p.GasPrice == nil {
- return fmt.Errorf("missing gas price")
- }
- return nil
-}
-
-type LaneConfig struct {
- SourceSelector uint64
- DestSelector uint64
- InitialPricesBySource InitialPrices
- FeeQuoterDestChain fee_quoter.FeeQuoterDestChainConfig
- TestRouter bool
-}
-
-type AddLanesConfig struct {
- LaneConfigs []LaneConfig
-}
-
-func (c AddLanesConfig) Validate() error {
- for _, pair := range c.LaneConfigs {
- if pair.SourceSelector == pair.DestSelector {
- return fmt.Errorf("cannot add lane to the same chain")
- }
- if err := pair.InitialPricesBySource.Validate(); err != nil {
- return fmt.Errorf("error in validating initial prices for chain %d : %w", pair.SourceSelector, err)
- }
- // TODO: add more FeeQuoterDestChainConfigArgs validation
- if pair.FeeQuoterDestChain == (fee_quoter.FeeQuoterDestChainConfig{}) {
- return fmt.Errorf("missing fee quoter dest chain config")
- }
- }
- return nil
-}
-
-// AddLanes adds lanes between chains.
-// AddLanes is run while the contracts are still owned by the deployer.
-// This is useful to test the initial deployment to enable lanes between chains.
-// If the testrouter is enabled, the lanes can be used to send messages between chains with testrouter.
-// On successful verification with testrouter, the lanes can be enabled with the main router with different addLane ChangeSet.
-func AddLanes(e deployment.Environment, cfg AddLanesConfig) (deployment.ChangesetOutput, error) {
- if err := cfg.Validate(); err != nil {
- return deployment.ChangesetOutput{}, fmt.Errorf("invalid AddLanesConfig: %w", err)
- }
- newAddresses := deployment.NewMemoryAddressBook()
- err := addLanes(e, cfg)
- if err != nil {
- e.Logger.Errorw("Failed to add lanes", "err", err)
- return deployment.ChangesetOutput{}, err
- }
- return deployment.ChangesetOutput{
- Proposals: []timelock.MCMSWithTimelockProposal{},
- AddressBook: newAddresses,
- JobSpecs: nil,
- }, nil
-}
-
-var DefaultInitialPrices = InitialPrices{
- LinkPrice: deployment.E18Mult(20),
- WethPrice: deployment.E18Mult(4000),
- GasPrice: ToPackedFee(big.NewInt(8e14), big.NewInt(0)),
-}
-
-func addLanes(e deployment.Environment, cfg AddLanesConfig) error {
- state, err := LoadOnchainState(e)
- if err != nil {
- return fmt.Errorf("failed to load onchain state: %w", err)
- }
- for _, laneCfg := range cfg.LaneConfigs {
- e.Logger.Infow("Enabling lane with test router", "from", laneCfg.SourceSelector, "to", laneCfg.DestSelector)
- if err := addLane(e, state, laneCfg, laneCfg.TestRouter); err != nil {
- return err
- }
- }
- return nil
-}
-
-func addLane(e deployment.Environment, state CCIPOnChainState, config LaneConfig, isTestRouter bool) error {
- // TODO: Batch
- var fromRouter *router.Router
- var toRouter *router.Router
- from := config.SourceSelector
- to := config.DestSelector
- feeQuoterDestChainConfig := config.FeeQuoterDestChain
- initialPrices := config.InitialPricesBySource
- if isTestRouter {
- fromRouter = state.Chains[from].TestRouter
- toRouter = state.Chains[to].TestRouter
- } else {
- fromRouter = state.Chains[from].Router
- toRouter = state.Chains[to].Router
- }
- tx, err := fromRouter.ApplyRampUpdates(e.Chains[from].DeployerKey, []router.RouterOnRamp{
- {
- DestChainSelector: to,
- OnRamp: state.Chains[from].OnRamp.Address(),
- },
- }, []router.RouterOffRamp{}, []router.RouterOffRamp{})
- if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil {
- return err
- }
- tx, err = state.Chains[from].OnRamp.ApplyDestChainConfigUpdates(e.Chains[from].DeployerKey,
- []onramp.OnRampDestChainConfigArgs{
- {
- DestChainSelector: to,
- Router: fromRouter.Address(),
- },
- })
- if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil {
- return err
- }
-
- _, err = state.Chains[from].FeeQuoter.UpdatePrices(
- e.Chains[from].DeployerKey, fee_quoter.InternalPriceUpdates{
- TokenPriceUpdates: []fee_quoter.InternalTokenPriceUpdate{
- {
- SourceToken: state.Chains[from].LinkToken.Address(),
- UsdPerToken: initialPrices.LinkPrice,
- },
- {
- SourceToken: state.Chains[from].Weth9.Address(),
- UsdPerToken: initialPrices.WethPrice,
- },
- },
- GasPriceUpdates: []fee_quoter.InternalGasPriceUpdate{
- {
- DestChainSelector: to,
- UsdPerUnitGas: initialPrices.GasPrice,
- },
- }})
- if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil {
- return err
- }
-
- // Enable dest in fee quoter
- tx, err = state.Chains[from].FeeQuoter.ApplyDestChainConfigUpdates(e.Chains[from].DeployerKey,
- []fee_quoter.FeeQuoterDestChainConfigArgs{
- {
- DestChainSelector: to,
- DestChainConfig: feeQuoterDestChainConfig,
- },
- })
- if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil {
- return err
- }
-
- tx, err = state.Chains[to].OffRamp.ApplySourceChainConfigUpdates(e.Chains[to].DeployerKey,
- []offramp.OffRampSourceChainConfigArgs{
- {
- Router: toRouter.Address(),
- SourceChainSelector: from,
- IsEnabled: true,
- OnRamp: common.LeftPadBytes(state.Chains[from].OnRamp.Address().Bytes(), 32),
- },
- })
- if _, err := deployment.ConfirmIfNoError(e.Chains[to], tx, err); err != nil {
- return err
- }
- tx, err = toRouter.ApplyRampUpdates(e.Chains[to].DeployerKey, []router.RouterOnRamp{}, []router.RouterOffRamp{}, []router.RouterOffRamp{
- {
- SourceChainSelector: from,
- OffRamp: state.Chains[to].OffRamp.Address(),
- },
- })
- _, err = deployment.ConfirmIfNoError(e.Chains[to], tx, err)
- return err
-}
-
-func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig {
- // https://github.com/smartcontractkit/ccip/blob/c4856b64bd766f1ddbaf5d13b42d3c4b12efde3a/contracts/src/v0.8/ccip/libraries/Internal.sol#L337-L337
- /*
- ```Solidity
- // bytes4(keccak256("CCIP ChainFamilySelector EVM"))
- bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c;
- ```
- */
- evmFamilySelector, _ := hex.DecodeString("2812d52c")
- return fee_quoter.FeeQuoterDestChainConfig{
- IsEnabled: true,
- MaxNumberOfTokensPerMsg: 10,
- MaxDataBytes: 256,
- MaxPerMsgGasLimit: 3_000_000,
- DestGasOverhead: ccipevm.DestGasOverhead,
- DefaultTokenFeeUSDCents: 1,
- DestGasPerPayloadByte: ccipevm.CalldataGasPerByte,
- DestDataAvailabilityOverheadGas: 100,
- DestGasPerDataAvailabilityByte: 100,
- DestDataAvailabilityMultiplierBps: 1,
- DefaultTokenDestGasOverhead: 125_000,
- DefaultTxGasLimit: 200_000,
- GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110%
- NetworkFeeUSDCents: 1,
- ChainFamilySelector: [4]byte(evmFamilySelector),
- }
-}
diff --git a/deployment/ccip/changeset/cs_add_lane_test.go b/deployment/ccip/changeset/cs_add_lane_test.go
index 5c324c975ef..e793c1866d9 100644
--- a/deployment/ccip/changeset/cs_add_lane_test.go
+++ b/deployment/ccip/changeset/cs_add_lane_test.go
@@ -1,17 +1,16 @@
package changeset
import (
+ "math/big"
"testing"
- "time"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
- commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"
- "github.com/smartcontractkit/chainlink/deployment"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
+ commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
+ "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
)
@@ -25,14 +24,79 @@ func TestAddLanesWithTestRouter(t *testing.T) {
selectors := e.Env.AllChainSelectors()
chain1, chain2 := selectors[0], selectors[1]
- _, err = AddLanes(e.Env, AddLanesConfig{
- LaneConfigs: []LaneConfig{
- {
- SourceSelector: chain1,
- DestSelector: chain2,
- InitialPricesBySource: DefaultInitialPrices,
- FeeQuoterDestChain: DefaultFeeQuoterDestChainConfig(),
- TestRouter: true,
+ stateChain1 := state.Chains[chain1]
+ e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateOnRampsDests),
+ Config: UpdateOnRampDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{
+ chain1: {
+ chain2: {
+ IsEnabled: true,
+ TestRouter: true,
+ AllowListEnabled: false,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterPricesCS),
+ Config: UpdateFeeQuoterPricesConfig{
+ PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{
+ chain1: {
+ TokenPrices: map[common.Address]*big.Int{
+ stateChain1.LinkToken.Address(): DefaultLinkPrice,
+ stateChain1.Weth9.Address(): DefaultWethPrice,
+ },
+ GasPrices: map[uint64]*big.Int{
+ chain2: DefaultGasPrice,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterDests),
+ Config: UpdateFeeQuoterDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{
+ chain1: {
+ chain2: DefaultFeeQuoterDestChainConfig(),
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateOffRampSources),
+ Config: UpdateOffRampSourcesConfig{
+ UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{
+ chain2: {
+ chain1: {
+ IsEnabled: true,
+ TestRouter: true,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateRouterRamps),
+ Config: UpdateRouterRampsConfig{
+ TestRouter: true,
+ UpdatesByChain: map[uint64]RouterUpdates{
+ // onRamp update on source chain
+ chain1: {
+ OnRampUpdates: map[uint64]bool{
+ chain2: true,
+ },
+ },
+ // offramp update on dest chain
+ chain2: {
+ OffRampUpdates: map[uint64]bool{
+ chain1: true,
+ },
+ },
+ },
},
},
})
@@ -58,142 +122,3 @@ func TestAddLanesWithTestRouter(t *testing.T) {
}] = []uint64{msgSentEvent.SequenceNumber}
ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks)
}
-
-// TestAddLane covers the workflow of adding a lane between two chains and enabling it.
-// It also covers the case where the onRamp is disabled on the OffRamp contract initially and then enabled.
-func TestAddLane(t *testing.T) {
- t.Skip("This test is flaky and needs to be fixed: reverted," +
- "error reason: 0x07da6ee6 InsufficientFeeTokenAmount: Replace time.sleep() with polling")
-
- t.Parallel()
- // We add more chains to the chainlink nodes than the number of chains where CCIP is deployed.
- e := NewMemoryEnvironment(t)
- // Here we have CR + nodes set up, but no CCIP contracts deployed.
- state, err := LoadOnchainState(e.Env)
- require.NoError(t, err)
-
- selectors := e.Env.AllChainSelectors()
- chain1, chain2 := selectors[0], selectors[1]
-
- // We expect no lanes available on any chain.
- for _, sel := range []uint64{chain1, chain2} {
- chain := state.Chains[sel]
- offRamps, err := chain.Router.GetOffRamps(nil)
- require.NoError(t, err)
- require.Len(t, offRamps, 0)
- }
-
- replayBlocks, err := LatestBlocksByChain(testcontext.Get(t), e.Env.Chains)
- require.NoError(t, err)
-
- // Add one lane from chain1 to chain 2 and send traffic.
- require.NoError(t, AddLaneWithDefaultPricesAndFeeQuoterConfig(e.Env, state, chain1, chain2, false))
-
- ReplayLogs(t, e.Env.Offchain, replayBlocks)
- time.Sleep(30 * time.Second)
- // disable the onRamp initially on OffRamp
- disableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{
- {
- Router: state.Chains[chain2].Router.Address(),
- SourceChainSelector: chain1,
- IsEnabled: false,
- OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32),
- },
- })
- _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], disableRampTx, err)
- require.NoError(t, err)
-
- for _, sel := range []uint64{chain1, chain2} {
- chain := state.Chains[sel]
- offRamps, err := chain.Router.GetOffRamps(nil)
- require.NoError(t, err)
- if sel == chain2 {
- require.Len(t, offRamps, 1)
- srcCfg, err := chain.OffRamp.GetSourceChainConfig(nil, chain1)
- require.NoError(t, err)
- require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp)
- require.False(t, srcCfg.IsEnabled)
- } else {
- require.Len(t, offRamps, 0)
- }
- }
-
- latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil)
- require.NoError(t, err)
- startBlock := latesthdr.Number.Uint64()
- // Send traffic on the first lane and it should not be processed by the plugin as onRamp is disabled
- // we will check this by confirming that the message is not executed by the end of the test
- msgSentEvent1 := TestSendRequest(t, e.Env, state, chain1, chain2, false, router.ClientEVM2AnyMessage{
- Receiver: common.LeftPadBytes(state.Chains[chain2].Receiver.Address().Bytes(), 32),
- Data: []byte("hello world"),
- TokenAmounts: nil,
- FeeToken: common.HexToAddress("0x0"),
- ExtraArgs: nil,
- })
- require.Equal(t, uint64(1), msgSentEvent1.SequenceNumber)
-
- // Add another lane
- require.NoError(t, AddLaneWithDefaultPricesAndFeeQuoterConfig(e.Env, state, chain2, chain1, false))
-
- // Send traffic on the second lane and it should succeed
- latesthdr, err = e.Env.Chains[chain1].Client.HeaderByNumber(testcontext.Get(t), nil)
- require.NoError(t, err)
- startBlock2 := latesthdr.Number.Uint64()
- msgSentEvent2 := TestSendRequest(t, e.Env, state, chain2, chain1, false, router.ClientEVM2AnyMessage{
- Receiver: common.LeftPadBytes(state.Chains[chain2].Receiver.Address().Bytes(), 32),
- Data: []byte("hello world"),
- TokenAmounts: nil,
- FeeToken: common.HexToAddress("0x0"),
- ExtraArgs: nil,
- })
- require.Equal(t, uint64(1), msgSentEvent2.SequenceNumber)
- require.NoError(t,
- commonutils.JustError(
- ConfirmExecWithSeqNrs(
- t,
- e.Env.Chains[chain2],
- e.Env.Chains[chain1],
- state.Chains[chain1].OffRamp,
- &startBlock2,
- []uint64{msgSentEvent2.SequenceNumber},
- ),
- ),
- )
-
- // now check for the previous message from chain 1 to chain 2 that it has not been executed till now as the onRamp was disabled
- ConfirmNoExecConsistentlyWithSeqNr(t, e.Env.Chains[chain1], e.Env.Chains[chain2], state.Chains[chain2].OffRamp, msgSentEvent1.SequenceNumber, 30*time.Second)
-
- // enable the onRamp on OffRamp
- enableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{
- {
- Router: state.Chains[chain2].Router.Address(),
- SourceChainSelector: chain1,
- IsEnabled: true,
- OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32),
- },
- })
- _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], enableRampTx, err)
- require.NoError(t, err)
-
- srcCfg, err := state.Chains[chain2].OffRamp.GetSourceChainConfig(nil, chain1)
- require.NoError(t, err)
- require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp)
- require.True(t, srcCfg.IsEnabled)
-
- // we need the replay here otherwise plugin is not able to locate the message
- ReplayLogs(t, e.Env.Offchain, replayBlocks)
- time.Sleep(30 * time.Second)
- // Now that the onRamp is enabled, the request should be processed
- require.NoError(t,
- commonutils.JustError(
- ConfirmExecWithSeqNrs(
- t,
- e.Env.Chains[chain1],
- e.Env.Chains[chain2],
- state.Chains[chain2].OffRamp,
- &startBlock,
- []uint64{msgSentEvent1.SequenceNumber},
- ),
- ),
- )
-}
diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go
index a2abad5101f..0c82afee261 100644
--- a/deployment/ccip/changeset/cs_ccip_home.go
+++ b/deployment/ccip/changeset/cs_ccip_home.go
@@ -34,7 +34,7 @@ import (
var (
_ deployment.ChangeSet[AddDonAndSetCandidateChangesetConfig] = AddDonAndSetCandidateChangeset
- _ deployment.ChangeSet[PromoteAllCandidatesChangesetConfig] = PromoteAllCandidatesChangeset
+ _ deployment.ChangeSet[PromoteCandidatesChangesetConfig] = PromoteAllCandidatesChangeset
_ deployment.ChangeSet[SetCandidateChangesetConfig] = SetCandidateChangeset
_ deployment.ChangeSet[RevokeCandidateChangesetConfig] = RevokeCandidateChangeset
_ deployment.ChangeSet[UpdateChainConfigConfig] = UpdateChainConfig
@@ -107,7 +107,7 @@ func DefaultOCRParams(
}
}
-type PromoteAllCandidatesChangesetConfig struct {
+type PromoteCandidatesChangesetConfig struct {
HomeChainSelector uint64
// RemoteChainSelectors is the chain selector of the DONs that we want to promote the candidate config of.
@@ -121,7 +121,7 @@ type PromoteAllCandidatesChangesetConfig struct {
MCMS *MCMSConfig
}
-func (p PromoteAllCandidatesChangesetConfig) Validate(e deployment.Environment) ([]uint32, error) {
+func (p PromoteCandidatesChangesetConfig) Validate(e deployment.Environment) ([]uint32, error) {
state, err := LoadOnchainState(e)
if err != nil {
return nil, err
@@ -201,7 +201,7 @@ func (p PromoteAllCandidatesChangesetConfig) Validate(e deployment.Environment)
// At that point you can call the RemoveDON changeset to remove the DON entirely from the capability registry.
func PromoteAllCandidatesChangeset(
e deployment.Environment,
- cfg PromoteAllCandidatesChangesetConfig,
+ cfg PromoteCandidatesChangesetConfig,
) (deployment.ChangesetOutput, error) {
donIDs, err := cfg.Validate(e)
if err != nil {
diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go
index 6b4683ae12c..dae32557f8b 100644
--- a/deployment/ccip/changeset/cs_ccip_home_test.go
+++ b/deployment/ccip/changeset/cs_ccip_home_test.go
@@ -88,7 +88,7 @@ func Test_PromoteCandidate(t *testing.T) {
}, []commonchangeset.ChangesetApplication{
{
Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset),
- Config: PromoteAllCandidatesChangesetConfig{
+ Config: PromoteCandidatesChangesetConfig{
HomeChainSelector: tenv.HomeChainSel,
RemoteChainSelectors: []uint64{dest},
MCMS: mcmsConfig,
diff --git a/deployment/ccip/changeset/cs_chain_contracts.go b/deployment/ccip/changeset/cs_chain_contracts.go
index e97772793b0..f85814f1768 100644
--- a/deployment/ccip/changeset/cs_chain_contracts.go
+++ b/deployment/ccip/changeset/cs_chain_contracts.go
@@ -4,35 +4,220 @@ import (
"bytes"
"context"
"encoding/hex"
+ "errors"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
+
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
+ "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
+ "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
)
var (
- _ deployment.ChangeSet[UpdateOnRampDestsConfig] = UpdateOnRampsDests
- _ deployment.ChangeSet[UpdateOffRampSourcesConfig] = UpdateOffRampSources
- _ deployment.ChangeSet[UpdateRouterRampsConfig] = UpdateRouterRamps
- _ deployment.ChangeSet[UpdateFeeQuoterDestsConfig] = UpdateFeeQuoterDests
- _ deployment.ChangeSet[SetOCR3OffRampConfig] = SetOCR3OffRamp
+ _ deployment.ChangeSet[UpdateOnRampDestsConfig] = UpdateOnRampsDests
+ _ deployment.ChangeSet[UpdateOffRampSourcesConfig] = UpdateOffRampSources
+ _ deployment.ChangeSet[UpdateRouterRampsConfig] = UpdateRouterRamps
+ _ deployment.ChangeSet[UpdateFeeQuoterDestsConfig] = UpdateFeeQuoterDests
+ _ deployment.ChangeSet[SetOCR3OffRampConfig] = SetOCR3OffRamp
+ _ deployment.ChangeSet[UpdateFeeQuoterPricesConfig] = UpdateFeeQuoterPricesCS
+ _ deployment.ChangeSet[UpdateNonceManagerConfig] = UpdateNonceManagersCS
)
+type UpdateNonceManagerConfig struct {
+ UpdatesByChain map[uint64]NonceManagerUpdate // source -> dest -> update
+ MCMS *MCMSConfig
+}
+
+type NonceManagerUpdate struct {
+ AddedAuthCallers []common.Address
+ RemovedAuthCallers []common.Address
+ PreviousRampsArgs []PreviousRampCfg
+}
+
+type PreviousRampCfg struct {
+ RemoteChainSelector uint64
+ OverrideExisting bool
+ EnableOnRamp bool
+ EnableOffRamp bool
+}
+
+func (cfg UpdateNonceManagerConfig) Validate(e deployment.Environment) error {
+ state, err := LoadOnchainState(e)
+ if err != nil {
+ return err
+ }
+ for sourceSel, update := range cfg.UpdatesByChain {
+ sourceChainState, ok := state.Chains[sourceSel]
+ if !ok {
+ return fmt.Errorf("chain %d not found in onchain state", sourceSel)
+ }
+ if sourceChainState.NonceManager == nil {
+ return fmt.Errorf("missing nonce manager for chain %d", sourceSel)
+ }
+ sourceChain, ok := e.Chains[sourceSel]
+ if !ok {
+ return fmt.Errorf("missing chain %d in environment", sourceSel)
+ }
+ if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, sourceChain.DeployerKey.From, sourceChainState.Timelock.Address(), sourceChainState.OnRamp); err != nil {
+ return fmt.Errorf("chain %s: %w", sourceChain.String(), err)
+ }
+ for _, prevRamp := range update.PreviousRampsArgs {
+ if prevRamp.RemoteChainSelector == sourceSel {
+ return errors.New("source and dest chain cannot be the same")
+ }
+ if _, ok := state.Chains[prevRamp.RemoteChainSelector]; !ok {
+ return fmt.Errorf("dest chain %d not found in onchain state for chain %d", prevRamp.RemoteChainSelector, sourceSel)
+ }
+ if !prevRamp.EnableOnRamp && !prevRamp.EnableOffRamp {
+ return errors.New("must specify either onramp or offramp")
+ }
+ if prevRamp.EnableOnRamp {
+ if prevOnRamp := state.Chains[sourceSel].EVM2EVMOnRamp; prevOnRamp == nil {
+ return fmt.Errorf("no previous onramp for source chain %d", sourceSel)
+ } else if prevOnRamp[prevRamp.RemoteChainSelector] == nil {
+ return fmt.Errorf("no previous onramp for source chain %d and dest chain %d", sourceSel, prevRamp.RemoteChainSelector)
+ }
+ }
+ if prevRamp.EnableOffRamp {
+ if prevOffRamp := state.Chains[sourceSel].EVM2EVMOffRamp; prevOffRamp == nil {
+ return fmt.Errorf("missing previous offramps for chain %d", sourceSel)
+ } else if prevOffRamp[prevRamp.RemoteChainSelector] == nil {
+ return fmt.Errorf("no previous offramp for source chain %d and dest chain %d", prevRamp.RemoteChainSelector, sourceSel)
+ }
+ }
+ }
+ }
+ return nil
+}
+
+func UpdateNonceManagersCS(e deployment.Environment, cfg UpdateNonceManagerConfig) (deployment.ChangesetOutput, error) {
+ if err := cfg.Validate(e); err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ s, err := LoadOnchainState(e)
+ if err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ var batches []timelock.BatchChainOperation
+ timelocks := make(map[uint64]common.Address)
+ proposers := make(map[uint64]*gethwrappers.ManyChainMultiSig)
+ for chainSel, updates := range cfg.UpdatesByChain {
+ txOpts := e.Chains[chainSel].DeployerKey
+ if cfg.MCMS != nil {
+ txOpts = deployment.SimTransactOpts()
+ }
+ nm := s.Chains[chainSel].NonceManager
+ var authTx, prevRampsTx *types.Transaction
+ if len(updates.AddedAuthCallers) > 0 || len(updates.RemovedAuthCallers) > 0 {
+ authTx, err = nm.ApplyAuthorizedCallerUpdates(txOpts, nonce_manager.AuthorizedCallersAuthorizedCallerArgs{
+ AddedCallers: updates.AddedAuthCallers,
+ RemovedCallers: updates.RemovedAuthCallers,
+ })
+ if err != nil {
+ return deployment.ChangesetOutput{}, fmt.Errorf("error updating authorized callers for chain %s: %w", e.Chains[chainSel].String(), err)
+ }
+ }
+ if len(updates.PreviousRampsArgs) > 0 {
+ previousRampsArgs := make([]nonce_manager.NonceManagerPreviousRampsArgs, 0)
+ for _, prevRamp := range updates.PreviousRampsArgs {
+ var onRamp, offRamp common.Address
+ if prevRamp.EnableOnRamp {
+ onRamp = s.Chains[chainSel].EVM2EVMOnRamp[prevRamp.RemoteChainSelector].Address()
+ }
+ if prevRamp.EnableOffRamp {
+ offRamp = s.Chains[chainSel].EVM2EVMOffRamp[prevRamp.RemoteChainSelector].Address()
+ }
+ previousRampsArgs = append(previousRampsArgs, nonce_manager.NonceManagerPreviousRampsArgs{
+ RemoteChainSelector: prevRamp.RemoteChainSelector,
+ OverrideExistingRamps: prevRamp.OverrideExisting,
+ PrevRamps: nonce_manager.NonceManagerPreviousRamps{
+ PrevOnRamp: onRamp,
+ PrevOffRamp: offRamp,
+ },
+ })
+ }
+ prevRampsTx, err = nm.ApplyPreviousRampsUpdates(txOpts, previousRampsArgs)
+ if err != nil {
+ return deployment.ChangesetOutput{}, fmt.Errorf("error updating previous ramps for chain %s: %w", e.Chains[chainSel].String(), err)
+ }
+ if err != nil {
+ return deployment.ChangesetOutput{}, fmt.Errorf("error updating previous ramps for chain %s: %w", e.Chains[chainSel].String(), err)
+ }
+ }
+ if cfg.MCMS == nil {
+ if authTx != nil {
+ if _, err := deployment.ConfirmIfNoError(e.Chains[chainSel], authTx, err); err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ }
+ if prevRampsTx != nil {
+ if _, err := deployment.ConfirmIfNoError(e.Chains[chainSel], prevRampsTx, err); err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ }
+ } else {
+ ops := make([]mcms.Operation, 0)
+ if authTx != nil {
+ ops = append(ops, mcms.Operation{
+ To: nm.Address(),
+ Data: authTx.Data(),
+ Value: big.NewInt(0),
+ })
+ }
+ if prevRampsTx != nil {
+ ops = append(ops, mcms.Operation{
+ To: nm.Address(),
+ Data: prevRampsTx.Data(),
+ Value: big.NewInt(0),
+ })
+ }
+ if len(ops) == 0 {
+ return deployment.ChangesetOutput{}, errors.New("no operations to batch")
+ }
+ batches = append(batches, timelock.BatchChainOperation{
+ ChainIdentifier: mcms.ChainIdentifier(chainSel),
+ Batch: ops,
+ })
+ timelocks[chainSel] = s.Chains[chainSel].Timelock.Address()
+ proposers[chainSel] = s.Chains[chainSel].ProposerMcm
+ }
+ }
+ if cfg.MCMS == nil {
+ return deployment.ChangesetOutput{}, nil
+ }
+
+ p, err := proposalutils.BuildProposalFromBatches(
+ timelocks,
+ proposers,
+ batches,
+ "Update nonce manager for previous ramps and authorized callers",
+ cfg.MCMS.MinDelay,
+ )
+ if err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ return deployment.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{
+ *p,
+ }}, nil
+}
+
type UpdateOnRampDestsConfig struct {
UpdatesByChain map[uint64]map[uint64]OnRampDestinationUpdate
// Disallow mixing MCMS/non-MCMS per chain for simplicity.
@@ -167,6 +352,165 @@ func UpdateOnRampsDests(e deployment.Environment, cfg UpdateOnRampDestsConfig) (
}}, nil
}
+type UpdateFeeQuoterPricesConfig struct {
+ PricesByChain map[uint64]FeeQuoterPriceUpdatePerSource // source -> PriceDetails
+ MCMS *MCMSConfig
+}
+
+type FeeQuoterPriceUpdatePerSource struct {
+ TokenPrices map[common.Address]*big.Int // token address -> price
+ GasPrices map[uint64]*big.Int // dest chain -> gas price
+}
+
+func (cfg UpdateFeeQuoterPricesConfig) Validate(e deployment.Environment) error {
+ state, err := LoadOnchainState(e)
+ if err != nil {
+ return err
+ }
+ for chainSel, initialPrice := range cfg.PricesByChain {
+ if err := deployment.IsValidChainSelector(chainSel); err != nil {
+ return fmt.Errorf("invalid chain selector: %w", err)
+ }
+ chainState, ok := state.Chains[chainSel]
+ if !ok {
+ return fmt.Errorf("chain %d not found in onchain state", chainSel)
+ }
+ fq := chainState.FeeQuoter
+ if fq == nil {
+ return fmt.Errorf("missing fee quoter for chain %d", chainSel)
+ }
+ if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.FeeQuoter); err != nil {
+ return err
+ }
+ // check that whether price updaters are set
+ authCallers, err := fq.GetAllAuthorizedCallers(&bind.CallOpts{Context: e.GetContext()})
+ if err != nil {
+ return fmt.Errorf("failed to get authorized callers for chain %d: %w", chainSel, err)
+ }
+ if len(authCallers) == 0 {
+ return fmt.Errorf("no authorized callers for chain %d", chainSel)
+ }
+ expectedAuthCaller := e.Chains[chainSel].DeployerKey.From
+ if cfg.MCMS != nil {
+ expectedAuthCaller = chainState.Timelock.Address()
+ }
+ foundCaller := false
+ for _, authCaller := range authCallers {
+ if authCaller.Cmp(expectedAuthCaller) == 0 {
+ foundCaller = true
+ }
+ }
+ if !foundCaller {
+ return fmt.Errorf("expected authorized caller %s not found for chain %d", expectedAuthCaller.String(), chainSel)
+ }
+ for token, price := range initialPrice.TokenPrices {
+ if price == nil {
+ return fmt.Errorf("token price for chain %d is nil", chainSel)
+ }
+ if token == (common.Address{}) {
+ return fmt.Errorf("token address for chain %d is empty", chainSel)
+ }
+ contains, err := deployment.AddressBookContains(e.ExistingAddresses, chainSel, token.String())
+ if err != nil {
+ return fmt.Errorf("error checking address book for token %s: %w", token.String(), err)
+ }
+ if !contains {
+ return fmt.Errorf("token %s not found in address book for chain %d", token.String(), chainSel)
+ }
+ }
+ for dest, price := range initialPrice.GasPrices {
+ if chainSel == dest {
+ return errors.New("source and dest chain cannot be the same")
+ }
+ if err := deployment.IsValidChainSelector(dest); err != nil {
+ return fmt.Errorf("invalid dest chain selector: %w", err)
+ }
+ if price == nil {
+ return fmt.Errorf("gas price for chain %d is nil", chainSel)
+ }
+ if _, ok := state.Chains[dest]; !ok {
+ return fmt.Errorf("dest chain %d not found in onchain state for chain %d", dest, chainSel)
+ }
+ }
+ }
+
+ return nil
+}
+
+func UpdateFeeQuoterPricesCS(e deployment.Environment, cfg UpdateFeeQuoterPricesConfig) (deployment.ChangesetOutput, error) {
+ if err := cfg.Validate(e); err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ s, err := LoadOnchainState(e)
+ if err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ var batches []timelock.BatchChainOperation
+ timelocks := make(map[uint64]common.Address)
+ proposers := make(map[uint64]*gethwrappers.ManyChainMultiSig)
+ for chainSel, initialPrice := range cfg.PricesByChain {
+ txOpts := e.Chains[chainSel].DeployerKey
+ if cfg.MCMS != nil {
+ txOpts = deployment.SimTransactOpts()
+ }
+ fq := s.Chains[chainSel].FeeQuoter
+ var tokenPricesArgs []fee_quoter.InternalTokenPriceUpdate
+ for token, price := range initialPrice.TokenPrices {
+ tokenPricesArgs = append(tokenPricesArgs, fee_quoter.InternalTokenPriceUpdate{
+ SourceToken: token,
+ UsdPerToken: price,
+ })
+ }
+ var gasPricesArgs []fee_quoter.InternalGasPriceUpdate
+ for dest, price := range initialPrice.GasPrices {
+ gasPricesArgs = append(gasPricesArgs, fee_quoter.InternalGasPriceUpdate{
+ DestChainSelector: dest,
+ UsdPerUnitGas: price,
+ })
+ }
+ tx, err := fq.UpdatePrices(txOpts, fee_quoter.InternalPriceUpdates{
+ TokenPriceUpdates: tokenPricesArgs,
+ GasPriceUpdates: gasPricesArgs,
+ })
+ if err != nil {
+ return deployment.ChangesetOutput{}, fmt.Errorf("error updating prices for chain %s: %w", e.Chains[chainSel].String(), err)
+ }
+ if cfg.MCMS == nil {
+ if _, err := deployment.ConfirmIfNoError(e.Chains[chainSel], tx, err); err != nil {
+ return deployment.ChangesetOutput{}, fmt.Errorf("error confirming transaction for chain %s: %w", e.Chains[chainSel].String(), err)
+ }
+ } else {
+ batches = append(batches, timelock.BatchChainOperation{
+ ChainIdentifier: mcms.ChainIdentifier(chainSel),
+ Batch: []mcms.Operation{
+ {
+ To: fq.Address(),
+ Data: tx.Data(),
+ Value: big.NewInt(0),
+ },
+ },
+ })
+ }
+ }
+ if cfg.MCMS == nil {
+ return deployment.ChangesetOutput{}, nil
+ }
+
+ p, err := proposalutils.BuildProposalFromBatches(
+ timelocks,
+ proposers,
+ batches,
+ "Update fq prices",
+ cfg.MCMS.MinDelay,
+ )
+ if err != nil {
+ return deployment.ChangesetOutput{}, err
+ }
+ return deployment.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{
+ *p,
+ }}, nil
+}
+
type UpdateFeeQuoterDestsConfig struct {
UpdatesByChain map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig
// Disallow mixing MCMS/non-MCMS per chain for simplicity.
@@ -208,7 +552,7 @@ func (cfg UpdateFeeQuoterDestsConfig) Validate(e deployment.Environment) error {
return fmt.Errorf("failed to get onramp static config %s: %w", chainState.OnRamp.Address(), err)
}
if destination == sc.ChainSelector {
- return fmt.Errorf("cannot update onramp destination to the same chain")
+ return fmt.Errorf("source and destination chain cannot be the same")
}
}
}
@@ -755,3 +1099,31 @@ func isOCR3ConfigSetOnOffRamp(
}
return true, nil
}
+
+func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig {
+ // https://github.com/smartcontractkit/ccip/blob/c4856b64bd766f1ddbaf5d13b42d3c4b12efde3a/contracts/src/v0.8/ccip/libraries/Internal.sol#L337-L337
+ /*
+ ```Solidity
+ // bytes4(keccak256("CCIP ChainFamilySelector EVM"))
+ bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c;
+ ```
+ */
+ evmFamilySelector, _ := hex.DecodeString("2812d52c")
+ return fee_quoter.FeeQuoterDestChainConfig{
+ IsEnabled: true,
+ MaxNumberOfTokensPerMsg: 10,
+ MaxDataBytes: 256,
+ MaxPerMsgGasLimit: 3_000_000,
+ DestGasOverhead: ccipevm.DestGasOverhead,
+ DefaultTokenFeeUSDCents: 1,
+ DestGasPerPayloadByte: ccipevm.CalldataGasPerByte,
+ DestDataAvailabilityOverheadGas: 100,
+ DestGasPerDataAvailabilityByte: 100,
+ DestDataAvailabilityMultiplierBps: 1,
+ DefaultTokenDestGasOverhead: 125_000,
+ DefaultTxGasLimit: 200_000,
+ GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110%
+ NetworkFeeUSDCents: 1,
+ ChainFamilySelector: [4]byte(evmFamilySelector),
+ }
+}
diff --git a/deployment/ccip/changeset/cs_chain_contracts_test.go b/deployment/ccip/changeset/cs_chain_contracts_test.go
index ad1b1a9f2b5..0a1e0ce3b7b 100644
--- a/deployment/ccip/changeset/cs_chain_contracts_test.go
+++ b/deployment/ccip/changeset/cs_chain_contracts_test.go
@@ -9,6 +9,7 @@ import (
"golang.org/x/exp/maps"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"
+
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
)
@@ -303,3 +304,61 @@ func TestUpdateRouterRamps(t *testing.T) {
})
}
}
+
+func TestUpdateNonceManagersCS(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ mcmsEnabled bool
+ }{
+ {
+ name: "MCMS enabled",
+ mcmsEnabled: true,
+ },
+ {
+ name: "MCMS disabled",
+ mcmsEnabled: false,
+ },
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ tenv := NewMemoryEnvironment(t)
+ state, err := LoadOnchainState(tenv.Env)
+ require.NoError(t, err)
+
+ allChains := maps.Keys(tenv.Env.Chains)
+ source := allChains[0]
+ dest := allChains[1]
+
+ if tc.mcmsEnabled {
+ // Transfer ownership to timelock so that we can promote the zero digest later down the line.
+ transferToTimelock(t, tenv, state, source, dest)
+ }
+
+ var mcmsConfig *MCMSConfig
+ if tc.mcmsEnabled {
+ mcmsConfig = &MCMSConfig{
+ MinDelay: 0,
+ }
+ }
+
+ _, err = commonchangeset.ApplyChangesets(t, tenv.Env, tenv.TimelockContracts(t), []commonchangeset.ChangesetApplication{
+ {
+ Changeset: commonchangeset.WrapChangeSet(UpdateNonceManagersCS),
+ Config: UpdateNonceManagerConfig{
+ UpdatesByChain: map[uint64]NonceManagerUpdate{
+ source: {
+ RemovedAuthCallers: []common.Address{state.Chains[source].OnRamp.Address()},
+ },
+ },
+ MCMS: mcmsConfig,
+ },
+ },
+ })
+ require.NoError(t, err)
+ // Assert the nonce manager configuration is as we expect.
+ callers, err := state.Chains[source].NonceManager.GetAllAuthorizedCallers(nil)
+ require.NoError(t, err)
+ require.NotContains(t, callers, state.Chains[source].OnRamp.Address())
+ require.Contains(t, callers, state.Chains[source].OffRamp.Address())
+ })
+ }
+}
diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go
index 1ab184573ce..f723efbf619 100644
--- a/deployment/ccip/changeset/test_environment.go
+++ b/deployment/ccip/changeset/test_environment.go
@@ -551,7 +551,7 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test
{
// Promote everything
Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset),
- Config: PromoteAllCandidatesChangesetConfig{
+ Config: PromoteCandidatesChangesetConfig{
HomeChainSelector: e.HomeChainSel,
RemoteChainSelectors: allChains,
PluginType: types.PluginTypeCCIPCommit,
@@ -560,7 +560,7 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test
{
// Promote everything
Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset),
- Config: PromoteAllCandidatesChangesetConfig{
+ Config: PromoteCandidatesChangesetConfig{
HomeChainSelector: e.HomeChainSel,
RemoteChainSelectors: allChains,
PluginType: types.PluginTypeCCIPExec,
diff --git a/deployment/ccip/changeset/test_helpers.go b/deployment/ccip/changeset/test_helpers.go
index 75801d99cff..cfd24d88ebd 100644
--- a/deployment/ccip/changeset/test_helpers.go
+++ b/deployment/ccip/changeset/test_helpers.go
@@ -18,6 +18,8 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/pkg/errors"
+ commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
+ "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
"github.com/smartcontractkit/chainlink/v2/core/services/relay"
"github.com/ethereum/go-ethereum/common"
@@ -60,6 +62,10 @@ var (
evmExtraArgsV2Tag = hexutil.MustDecode("0x181dcf10")
routerABI = abihelpers.MustParseABI(router.RouterABI)
+
+ DefaultLinkPrice = deployment.E18Mult(20)
+ DefaultWethPrice = deployment.E18Mult(4000)
+ DefaultGasPrice = ToPackedFee(big.NewInt(8e14), big.NewInt(0))
)
// Context returns a context with the test's deadline, if available.
@@ -384,30 +390,102 @@ func MakeEVMExtraArgsV2(gasLimit uint64, allowOOO bool) []byte {
return extraArgs
}
-func AddLaneWithDefaultPricesAndFeeQuoterConfig(e deployment.Environment, state CCIPOnChainState, from, to uint64, isTestRouter bool) error {
- cfg := LaneConfig{
- SourceSelector: from,
- DestSelector: to,
- InitialPricesBySource: DefaultInitialPrices,
- FeeQuoterDestChain: DefaultFeeQuoterDestChainConfig(),
- }
- return addLane(e, state, cfg, isTestRouter)
+func AddLane(t *testing.T, e *DeployedEnv, from, to uint64, isTestRouter bool, gasprice map[uint64]*big.Int, tokenPrices map[common.Address]*big.Int, fqCfg fee_quoter.FeeQuoterDestChainConfig) {
+ var err error
+ e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateOnRampsDests),
+ Config: UpdateOnRampDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]OnRampDestinationUpdate{
+ from: {
+ to: {
+ IsEnabled: true,
+ TestRouter: isTestRouter,
+ AllowListEnabled: false,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterPricesCS),
+ Config: UpdateFeeQuoterPricesConfig{
+ PricesByChain: map[uint64]FeeQuoterPriceUpdatePerSource{
+ from: {
+ TokenPrices: tokenPrices,
+ GasPrices: gasprice,
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateFeeQuoterDests),
+ Config: UpdateFeeQuoterDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{
+ from: {
+ to: fqCfg,
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateOffRampSources),
+ Config: UpdateOffRampSourcesConfig{
+ UpdatesByChain: map[uint64]map[uint64]OffRampSourceUpdate{
+ to: {
+ from: {
+ IsEnabled: true,
+ TestRouter: isTestRouter,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commoncs.WrapChangeSet(UpdateRouterRamps),
+ Config: UpdateRouterRampsConfig{
+ TestRouter: isTestRouter,
+ UpdatesByChain: map[uint64]RouterUpdates{
+ // onRamp update on source chain
+ from: {
+ OnRampUpdates: map[uint64]bool{
+ to: true,
+ },
+ },
+ // offramp update on dest chain
+ to: {
+ OffRampUpdates: map[uint64]bool{
+ from: true,
+ },
+ },
+ },
+ },
+ },
+ })
+ require.NoError(t, err)
+}
+
+func AddLaneWithDefaultPricesAndFeeQuoterConfig(t *testing.T, e *DeployedEnv, state CCIPOnChainState, from, to uint64, isTestRouter bool) {
+ stateChainFrom := state.Chains[from]
+ AddLane(t, e, from, to, isTestRouter,
+ map[uint64]*big.Int{
+ to: DefaultGasPrice,
+ }, map[common.Address]*big.Int{
+ stateChainFrom.LinkToken.Address(): DefaultLinkPrice,
+ stateChainFrom.Weth9.Address(): DefaultWethPrice,
+ }, DefaultFeeQuoterDestChainConfig())
}
// AddLanesForAll adds densely connected lanes for all chains in the environment so that each chain
// is connected to every other chain except itself.
-func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error {
- for source := range e.Chains {
- for dest := range e.Chains {
+func AddLanesForAll(t *testing.T, e *DeployedEnv, state CCIPOnChainState) {
+ for source := range e.Env.Chains {
+ for dest := range e.Env.Chains {
if source != dest {
- err := AddLaneWithDefaultPricesAndFeeQuoterConfig(e, state, source, dest, false)
- if err != nil {
- return err
- }
+ AddLaneWithDefaultPricesAndFeeQuoterConfig(t, e, state, source, dest, false)
}
}
}
- return nil
}
func ToPackedFee(execFee, daFee *big.Int) *big.Int {
diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go
index 4c52cc72416..bb3acec8aa4 100644
--- a/deployment/environment/crib/ccip_deployer.go
+++ b/deployment/environment/crib/ccip_deployer.go
@@ -12,6 +12,7 @@ import (
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
commontypes "github.com/smartcontractkit/chainlink/deployment/common/types"
"github.com/smartcontractkit/chainlink/deployment/environment/devenv"
+ "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
"github.com/smartcontractkit/chainlink/v2/core/services/relay"
"github.com/smartcontractkit/chainlink/deployment"
@@ -126,9 +127,91 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de
return DeployCCIPOutput{}, fmt.Errorf("failed to load onchain state: %w", err)
}
// Add all lanes
- err = changeset.AddLanesForAll(*e, state)
- if err != nil {
- return DeployCCIPOutput{}, fmt.Errorf("failed to add lanes: %w", err)
+ for from := range e.Chains {
+ for to := range e.Chains {
+ if from != to {
+ stateChain1 := state.Chains[from]
+ newEnv, err := commonchangeset.ApplyChangesets(nil, *e, nil, []commonchangeset.ChangesetApplication{
+ {
+ Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOnRampsDests),
+ Config: changeset.UpdateOnRampDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]changeset.OnRampDestinationUpdate{
+ from: {
+ to: {
+ IsEnabled: true,
+ TestRouter: false,
+ AllowListEnabled: false,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS),
+ Config: changeset.UpdateFeeQuoterPricesConfig{
+ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{
+ from: {
+ TokenPrices: map[common.Address]*big.Int{
+ stateChain1.LinkToken.Address(): changeset.DefaultLinkPrice,
+ stateChain1.Weth9.Address(): changeset.DefaultWethPrice,
+ },
+ GasPrices: map[uint64]*big.Int{
+ to: changeset.DefaultGasPrice,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commonchangeset.WrapChangeSet(changeset.UpdateFeeQuoterDests),
+ Config: changeset.UpdateFeeQuoterDestsConfig{
+ UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{
+ from: {
+ to: changeset.DefaultFeeQuoterDestChainConfig(),
+ },
+ },
+ },
+ },
+ {
+ Changeset: commonchangeset.WrapChangeSet(changeset.UpdateOffRampSources),
+ Config: changeset.UpdateOffRampSourcesConfig{
+ UpdatesByChain: map[uint64]map[uint64]changeset.OffRampSourceUpdate{
+ to: {
+ from: {
+ IsEnabled: true,
+ TestRouter: true,
+ },
+ },
+ },
+ },
+ },
+ {
+ Changeset: commonchangeset.WrapChangeSet(changeset.UpdateRouterRamps),
+ Config: changeset.UpdateRouterRampsConfig{
+ TestRouter: true,
+ UpdatesByChain: map[uint64]changeset.RouterUpdates{
+ // onRamp update on source chain
+ from: {
+ OnRampUpdates: map[uint64]bool{
+ to: true,
+ },
+ },
+ // off
+ from: {
+ OffRampUpdates: map[uint64]bool{
+ to: true,
+ },
+ },
+ },
+ },
+ },
+ })
+ if err != nil {
+ return DeployCCIPOutput{}, fmt.Errorf("failed to apply changesets: %w", err)
+ }
+ e = &newEnv
+ }
+ }
}
addresses, err := e.ExistingAddresses.Addresses()
diff --git a/integration-tests/contracts/ccipreader_test.go b/integration-tests/contracts/ccipreader_test.go
index 3b0ac1d79a1..f46a680c8a0 100644
--- a/integration-tests/contracts/ccipreader_test.go
+++ b/integration-tests/contracts/ccipreader_test.go
@@ -597,8 +597,8 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) {
selectors := env.Env.AllChainSelectors()
destChain, srcChain := selectors[0], selectors[1]
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, destChain, srcChain, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, srcChain, destChain, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, destChain, srcChain, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, srcChain, destChain, false)
reader := testSetupRealContracts(
ctx,
@@ -707,8 +707,8 @@ func Test_GetChainFeePriceUpdates(t *testing.T) {
selectors := env.Env.AllChainSelectors()
chain1, chain2 := selectors[0], selectors[1]
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain1, chain2, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain2, chain1, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
// Change the gas price for chain2
feeQuoter := state.Chains[chain1].FeeQuoter
@@ -763,8 +763,8 @@ func Test_LinkPriceUSD(t *testing.T) {
selectors := env.Env.AllChainSelectors()
chain1, chain2 := selectors[0], selectors[1]
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain1, chain2, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain2, chain1, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
reader := testSetupRealContracts(
ctx,
@@ -785,7 +785,7 @@ func Test_LinkPriceUSD(t *testing.T) {
linkPriceUSD, err := reader.LinkPriceUSD(ctx)
require.NoError(t, err)
require.NotNil(t, linkPriceUSD.Int)
- require.Equal(t, changeset.DefaultInitialPrices.LinkPrice, linkPriceUSD.Int)
+ require.Equal(t, changeset.DefaultLinkPrice, linkPriceUSD.Int)
}
func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) {
@@ -798,9 +798,9 @@ func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) {
selectors := env.Env.AllChainSelectors()
destChain, chain1, chain2, chain3 := selectors[0], selectors[1], selectors[2], selectors[3]
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain1, destChain, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain2, destChain, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain3, destChain, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, destChain, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, destChain, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain3, destChain, false)
boundContracts := map[cciptypes.ChainSelector][]types.BoundContract{}
for i, selector := range env.Env.AllChainSelectorsExcluding([]uint64{destChain}) {
@@ -857,8 +857,8 @@ func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) {
selectors := env.Env.AllChainSelectors()
chain1, chain2 := selectors[0], selectors[1]
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain1, chain2, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(env.Env, state, chain2, chain1, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
reader := testSetupRealContracts(
ctx,
@@ -884,7 +884,7 @@ func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) {
// Only chainD has reader contracts bound
require.Len(t, prices, 1)
- require.Equal(t, changeset.DefaultInitialPrices.WethPrice, prices[cciptypes.ChainSelector(chain1)].Int)
+ require.Equal(t, changeset.DefaultWethPrice, prices[cciptypes.ChainSelector(chain1)].Int)
}
// Benchmark Results:
diff --git a/integration-tests/smoke/ccip/ccip_batching_test.go b/integration-tests/smoke/ccip/ccip_batching_test.go
index 58f4e922ac5..3752faa4e6e 100644
--- a/integration-tests/smoke/ccip/ccip_batching_test.go
+++ b/integration-tests/smoke/ccip/ccip_batching_test.go
@@ -63,8 +63,8 @@ func newBatchTestSetup(t *testing.T) batchTestSetup {
)
// connect sourceChain1 and sourceChain2 to destChain
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(e.Env, state, sourceChain1, destChain, false))
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(e.Env, state, sourceChain2, destChain, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain1, destChain, false)
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain2, destChain, false)
return batchTestSetup{e, state, sourceChain1, sourceChain2, destChain}
}
diff --git a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go
index 576ee356fbb..3b0ebf22455 100644
--- a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go
+++ b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go
@@ -2,15 +2,13 @@ package smoke
import (
"context"
- "fmt"
"math/big"
"testing"
"time"
- "github.com/pkg/errors"
-
"github.com/smartcontractkit/chainlink-common/pkg/config"
- commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
+
+ commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -20,11 +18,10 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"
- "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
-
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
+ "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
+
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp"
@@ -84,32 +81,31 @@ func Test_CCIPFeeBoosting(t *testing.T) {
)
t.Log("Adjusted gas price on dest chain:", adjustedGasPriceDest)
- initialPrices := changeset.InitialPrices{
- LinkPrice: linkPrice,
- WethPrice: wethPrice,
- GasPrice: changeset.ToPackedFee(adjustedGasPriceDest, big.NewInt(0)),
- }
-
- laneCfg := changeset.LaneConfig{
- SourceSelector: sourceChain,
- DestSelector: destChain,
- InitialPricesBySource: initialPrices,
- FeeQuoterDestChain: changeset.DefaultFeeQuoterDestChainConfig(),
- TestRouter: false,
- }
-
- e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{
- {
- Changeset: commonchangeset.WrapChangeSet(changeset.AddLanes),
- Config: changeset.AddLanesConfig{LaneConfigs: []changeset.LaneConfig{laneCfg}},
+ changeset.AddLane(t, &e, sourceChain, destChain, false,
+ map[uint64]*big.Int{
+ destChain: changeset.ToPackedFee(adjustedGasPriceDest, big.NewInt(0)),
},
- })
- require.NoError(t, err)
+ map[common.Address]*big.Int{
+ state.Chains[sourceChain].LinkToken.Address(): linkPrice,
+ state.Chains[sourceChain].Weth9.Address(): wethPrice,
+ },
+ changeset.DefaultFeeQuoterDestChainConfig())
// Update token prices in destination chain FeeQuoter
- err = updateTokensPrices(e, state, destChain, map[common.Address]*big.Int{
- state.Chains[destChain].LinkToken.Address(): linkPrice,
- state.Chains[destChain].Weth9.Address(): wethPrice,
+ e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{
+ {
+ Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS),
+ Config: changeset.UpdateFeeQuoterPricesConfig{
+ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{
+ destChain: {
+ TokenPrices: map[common.Address]*big.Int{
+ state.Chains[destChain].LinkToken.Address(): linkPrice,
+ state.Chains[destChain].Weth9.Address(): wethPrice,
+ },
+ },
+ },
+ },
+ },
})
require.NoError(t, err)
@@ -137,7 +133,20 @@ func Test_CCIPFeeBoosting(t *testing.T) {
DestChainSelector: destChain,
}] = []uint64{msgSentEvent.SequenceNumber}
- err = updateGasPrice(e, state, sourceChain, destChain, originalGasPriceDestUSD)
+ e.Env, err = commoncs.ApplyChangesets(t, e.Env, e.TimelockContracts(t), []commoncs.ChangesetApplication{
+ {
+ Changeset: commoncs.WrapChangeSet(changeset.UpdateFeeQuoterPricesCS),
+ Config: changeset.UpdateFeeQuoterPricesConfig{
+ PricesByChain: map[uint64]changeset.FeeQuoterPriceUpdatePerSource{
+ sourceChain: {
+ GasPrices: map[uint64]*big.Int{
+ destChain: originalGasPriceDestUSD,
+ },
+ },
+ },
+ },
+ },
+ })
require.NoError(t, err)
// Confirm gas prices are updated
@@ -270,61 +279,3 @@ func convertToMessage(msg onramp.InternalEVM2AnyRampMessage) cciptypes.Message {
TokenAmounts: tokenAmounts,
}
}
-
-func updateGasPrice(env changeset.DeployedEnv, state changeset.CCIPOnChainState, srcChain, destChain uint64, gasPrice *big.Int) error {
- chainState, exists := state.Chains[srcChain]
- if !exists {
- return fmt.Errorf("chain state not found for selector: %d", srcChain)
- }
-
- feeQuoter := chainState.FeeQuoter
- // Update gas price
- auth := env.Env.Chains[srcChain].DeployerKey
- tx, err := feeQuoter.UpdatePrices(auth, fee_quoter.InternalPriceUpdates{
- TokenPriceUpdates: nil,
- GasPriceUpdates: []fee_quoter.InternalGasPriceUpdate{
- {
- DestChainSelector: destChain,
- UsdPerUnitGas: gasPrice,
- },
- },
- })
- if err != nil {
- return errors.Wrapf(err, "updating gas price on chain %d", srcChain)
- }
- if _, err := deployment.ConfirmIfNoError(env.Env.Chains[srcChain], tx, err); err != nil {
- return err
- }
-
- return nil
-}
-
-func updateTokensPrices(env changeset.DeployedEnv, state changeset.CCIPOnChainState, chain uint64, tokenPrices map[common.Address]*big.Int) error {
- chainState, exists := state.Chains[chain]
- if !exists {
- return fmt.Errorf("chain state not found for selector: %d", chain)
- }
-
- feeQuoter := chainState.FeeQuoter
- // Update token prices
- auth := env.Env.Chains[chain].DeployerKey
- tokenPricesUpdates := make([]fee_quoter.InternalTokenPriceUpdate, 0, len(tokenPrices))
- for token, price := range tokenPrices {
- tokenPricesUpdates = append(tokenPricesUpdates, fee_quoter.InternalTokenPriceUpdate{
- SourceToken: token,
- UsdPerToken: price,
- })
- }
- tx, err := feeQuoter.UpdatePrices(auth, fee_quoter.InternalPriceUpdates{
- TokenPriceUpdates: tokenPricesUpdates,
- GasPriceUpdates: nil,
- })
- if err != nil {
- return errors.Wrapf(err, "updating token prices on chain %d", chain)
- }
- if _, err := deployment.ConfirmIfNoError(env.Env.Chains[chain], tx, err); err != nil {
- return err
- }
-
- return nil
-}
diff --git a/integration-tests/smoke/ccip/ccip_fees_test.go b/integration-tests/smoke/ccip/ccip_fees_test.go
index 55788a4aa5f..57a6bc58d82 100644
--- a/integration-tests/smoke/ccip/ccip_fees_test.go
+++ b/integration-tests/smoke/ccip/ccip_fees_test.go
@@ -130,7 +130,7 @@ func Test_CCIPFees(t *testing.T) {
changeset.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks)
// Add all lanes
- require.NoError(t, changeset.AddLanesForAll(e, state))
+ changeset.AddLanesForAll(t, &tenv, state)
t.Run("Send programmable token transfer pay with Link token", func(t *testing.T) {
runFeeTokenTestCase(feeTokenTestCase{
diff --git a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go
index d11e4304366..2c1d97f6c12 100644
--- a/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go
+++ b/integration-tests/smoke/ccip/ccip_gas_price_updates_test.go
@@ -34,7 +34,7 @@ func Test_CCIPGasPriceUpdates(t *testing.T) {
)
state, err := changeset.LoadOnchainState(e.Env)
require.NoError(t, err)
- require.NoError(t, changeset.AddLanesForAll(e.Env, state))
+ changeset.AddLanesForAll(t, &e, state)
allChainSelectors := maps.Keys(e.Env.Chains)
assert.GreaterOrEqual(t, len(allChainSelectors), 2, "test requires at least 2 chains")
diff --git a/integration-tests/smoke/ccip/ccip_message_limitations_test.go b/integration-tests/smoke/ccip/ccip_message_limitations_test.go
index 9398fd9f932..f9299b735d0 100644
--- a/integration-tests/smoke/ccip/ccip_message_limitations_test.go
+++ b/integration-tests/smoke/ccip/ccip_message_limitations_test.go
@@ -29,7 +29,7 @@ func Test_CCIPMessageLimitations(t *testing.T) {
onChainState, err := changeset.LoadOnchainState(testEnv.Env)
require.NoError(t, err)
- require.NoError(t, changeset.AddLanesForAll(testEnv.Env, onChainState))
+ changeset.AddLanesForAll(t, &testEnv, onChainState)
srcToken, _ := setupTokens(
t,
diff --git a/integration-tests/smoke/ccip/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go
index 13f14fcda16..8ee18a31918 100644
--- a/integration-tests/smoke/ccip/ccip_messaging_test.go
+++ b/integration-tests/smoke/ccip/ccip_messaging_test.go
@@ -63,7 +63,7 @@ func Test_CCIPMessaging(t *testing.T) {
", dest chain selector:", destChain,
)
// connect a single lane, source to dest
- require.NoError(t, changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(e.Env, state, sourceChain, destChain, false))
+ changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false)
var (
replayed bool
diff --git a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go
index 19c36c6e021..e3da473984d 100644
--- a/integration-tests/smoke/ccip/ccip_ooo_execution_test.go
+++ b/integration-tests/smoke/ccip/ccip_ooo_execution_test.go
@@ -86,7 +86,7 @@ func Test_OutOfOrderExecution(t *testing.T) {
},
},
)
- require.NoError(t, changeset.AddLanesForAll(e, state))
+ changeset.AddLanesForAll(t, &tenv, state)
tokenTransfer := []router.ClientEVMTokenAmount{
{
diff --git a/integration-tests/smoke/ccip/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go
index 166f4422fe6..a3877013103 100644
--- a/integration-tests/smoke/ccip/ccip_rmn_test.go
+++ b/integration-tests/smoke/ccip/ccip_rmn_test.go
@@ -323,7 +323,7 @@ func runRmnTestCase(t *testing.T, tc rmnTestCase) {
tc.killMarkedRmnNodes(t, rmnCluster)
changeset.ReplayLogs(t, envWithRMN.Env.Offchain, envWithRMN.ReplayBlocks)
- require.NoError(t, changeset.AddLanesForAll(envWithRMN.Env, onChainState))
+ changeset.AddLanesForAll(t, &envWithRMN, onChainState)
disabledNodes := tc.disableOraclesIfThisIsACursingTestCase(ctx, t, envWithRMN)
startBlocks, seqNumCommit, seqNumExec := tc.sendMessages(t, onChainState, envWithRMN)
diff --git a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go
index e3496b6f407..fb7ddc847d4 100644
--- a/integration-tests/smoke/ccip/ccip_token_price_updates_test.go
+++ b/integration-tests/smoke/ccip/ccip_token_price_updates_test.go
@@ -35,7 +35,7 @@ func Test_CCIPTokenPriceUpdates(t *testing.T) {
}))
state, err := changeset.LoadOnchainState(e.Env)
require.NoError(t, err)
- require.NoError(t, changeset.AddLanesForAll(e.Env, state))
+ changeset.AddLanesForAll(t, &e, state)
allChainSelectors := maps.Keys(e.Env.Chains)
assert.GreaterOrEqual(t, len(allChainSelectors), 2, "test requires at least 2 chains")
diff --git a/integration-tests/smoke/ccip/ccip_token_transfer_test.go b/integration-tests/smoke/ccip/ccip_token_transfer_test.go
index 2088960639e..c5cabfe63e4 100644
--- a/integration-tests/smoke/ccip/ccip_token_transfer_test.go
+++ b/integration-tests/smoke/ccip/ccip_token_transfer_test.go
@@ -69,7 +69,7 @@ func TestTokenTransfer(t *testing.T) {
"SELF_SERVE_TOKEN",
)
require.NoError(t, err)
- require.NoError(t, changeset.AddLanesForAll(e, state))
+ changeset.AddLanesForAll(t, &tenv, state)
changeset.MintAndAllow(
t,
diff --git a/integration-tests/smoke/ccip/ccip_usdc_test.go b/integration-tests/smoke/ccip/ccip_usdc_test.go
index 174ab941387..7bea68a9cbf 100644
--- a/integration-tests/smoke/ccip/ccip_usdc_test.go
+++ b/integration-tests/smoke/ccip/ccip_usdc_test.go
@@ -71,7 +71,7 @@ func TestUSDCTokenTransfer(t *testing.T) {
require.NoError(t, err)
// Add all lanes
- require.NoError(t, changeset.AddLanesForAll(e, state))
+ changeset.AddLanesForAll(t, &tenv, state)
changeset.MintAndAllow(
t,
From 0b8172dfcc9bc5ca3c166139286b9675239250c8 Mon Sep 17 00:00:00 2001
From: krehermann <16602512+krehermann@users.noreply.github.com>
Date: Fri, 20 Dec 2024 11:46:42 -0700
Subject: [PATCH 03/19] deprecate kslib (#15759)
* logging, edge case fixes
* delete used CLO code
* remove unused test data
* deprecate kslib
* mv to internal; expose func required downstream
* code comments
* fix scripts deps
* missing file
* typo
---
.changeset/sour-hairs-cross.md | 5 +
.../keystone/src/01_deploy_contracts_cmd.go | 4 +-
core/scripts/keystone/src/88_gen_jobspecs.go | 4 +-
.../keystone/src/88_gen_ocr3_config.go | 4 +-
core/scripts/keystone/src/99_fetch_keys.go | 10 +-
.../keystone/changeset/accept_ownership.go | 2 +-
.../changeset/accept_ownership_test.go | 2 +-
.../keystone/changeset/addrbook_utils.go | 15 ++-
.../changeset/append_node_capabilities.go | 3 +-
deployment/keystone/changeset/compatiblity.go | 95 +++++++++++++
.../keystone/changeset/configure_contracts.go | 2 +-
.../keystone/changeset/deploy_consumer.go | 2 +-
.../keystone/changeset/deploy_forwarder.go | 32 +++--
.../changeset/deploy_forwarder_test.go | 2 +-
deployment/keystone/changeset/deploy_ocr3.go | 2 +-
.../keystone/changeset/deploy_ocr3_test.go | 8 +-
.../keystone/changeset/deploy_registry.go | 2 +-
.../internal/append_node_capabilities.go | 6 +-
.../internal}/capability_definitions.go | 2 +-
.../internal}/capability_management.go | 4 +-
.../internal}/capability_registry_deployer.go | 2 +-
.../internal}/consumer_deployer.go | 2 +-
.../{ => changeset/internal}/contract_set.go | 17 +--
.../{ => changeset/internal}/deploy.go | 25 ++--
.../internal}/forwarder_deployer.go | 2 +-
.../{ => changeset/internal}/ocr3_deployer.go | 2 +-
.../{ => changeset/internal}/ocr3config.go | 8 +-
.../internal}/ocr3config_test.go | 2 +-
.../{ => changeset/internal}/state.go | 2 +-
.../keystone/changeset/internal/test/utils.go | 108 +++++----------
.../internal}/testdata/testnet_wf_view.json | 0
.../{ => changeset/internal}/types.go | 2 +-
.../{ => changeset/internal}/types_test.go | 2 +-
.../keystone/changeset/internal/update_don.go | 8 +-
.../changeset/internal/update_don_test.go | 20 ++-
.../internal/update_node_capabilities.go | 5 +-
.../internal/update_node_capabilities_test.go | 16 +--
.../changeset/internal/update_nodes.go | 19 ++-
.../changeset/internal/update_nodes_test.go | 11 +-
deployment/keystone/changeset/test/helpers.go | 49 ++++---
deployment/keystone/changeset/update_don.go | 3 +-
.../changeset/update_node_capabilities.go | 3 +-
deployment/keystone/changeset/update_nodes.go | 3 +-
deployment/keystone/changeset/view.go | 4 +-
deployment/keystone/changeset/view_test.go | 2 +-
.../changeset/workflowregistry/deploy.go | 3 +-
.../changeset/workflowregistry/setup_test.go | 54 ++++++++
.../changeset/workflowregistry/strategies.go | 3 +-
.../workflowregistry/update_allowed_dons.go | 5 +-
.../update_allowed_dons_test.go | 3 +-
.../update_authorized_addresses.go | 7 +-
.../update_authorized_addresses_test.go | 3 +-
.../workflow_registry_deployer.go | 37 +++--
deployment/keystone/deprecated.go | 127 ++++++++++++++++++
.../test/changeset/capability_registry.go | 13 +-
55 files changed, 506 insertions(+), 272 deletions(-)
create mode 100644 .changeset/sour-hairs-cross.md
create mode 100644 deployment/keystone/changeset/compatiblity.go
rename deployment/keystone/{ => changeset/internal}/capability_definitions.go (98%)
rename deployment/keystone/{ => changeset/internal}/capability_management.go (97%)
rename deployment/keystone/{ => changeset/internal}/capability_registry_deployer.go (99%)
rename deployment/keystone/{ => changeset/internal}/consumer_deployer.go (98%)
rename deployment/keystone/{ => changeset/internal}/contract_set.go (86%)
rename deployment/keystone/{ => changeset/internal}/deploy.go (97%)
rename deployment/keystone/{ => changeset/internal}/forwarder_deployer.go (99%)
rename deployment/keystone/{ => changeset/internal}/ocr3_deployer.go (98%)
rename deployment/keystone/{ => changeset/internal}/ocr3config.go (98%)
rename deployment/keystone/{ => changeset/internal}/ocr3config_test.go (99%)
rename deployment/keystone/{ => changeset/internal}/state.go (99%)
rename deployment/keystone/{ => changeset/internal}/testdata/testnet_wf_view.json (100%)
rename deployment/keystone/{ => changeset/internal}/types.go (99%)
rename deployment/keystone/{ => changeset/internal}/types_test.go (99%)
create mode 100644 deployment/keystone/changeset/workflowregistry/setup_test.go
rename deployment/keystone/{ => changeset/workflowregistry}/workflow_registry_deployer.go (50%)
create mode 100644 deployment/keystone/deprecated.go
diff --git a/.changeset/sour-hairs-cross.md b/.changeset/sour-hairs-cross.md
new file mode 100644
index 00000000000..fa12a38b5be
--- /dev/null
+++ b/.changeset/sour-hairs-cross.md
@@ -0,0 +1,5 @@
+---
+"chainlink": patch
+---
+
+#internal depreciate keystone deployment library
diff --git a/core/scripts/keystone/src/01_deploy_contracts_cmd.go b/core/scripts/keystone/src/01_deploy_contracts_cmd.go
index 59ddc79acd8..14c8d989063 100644
--- a/core/scripts/keystone/src/01_deploy_contracts_cmd.go
+++ b/core/scripts/keystone/src/01_deploy_contracts_cmd.go
@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/common"
helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
- ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
forwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0"
ocr3_capability "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability_1_0_0"
)
@@ -157,7 +157,7 @@ func deploy(
func setOCR3Config(
env helpers.Environment,
- ocrConfig ksdeploy.OCR2OracleConfig,
+ ocrConfig changeset.OCR3OnchainConfig,
artefacts string,
) {
loadedContracts, err := LoadDeployedContracts(artefacts)
diff --git a/core/scripts/keystone/src/88_gen_jobspecs.go b/core/scripts/keystone/src/88_gen_jobspecs.go
index 4f59a89be2d..e88833c9865 100644
--- a/core/scripts/keystone/src/88_gen_jobspecs.go
+++ b/core/scripts/keystone/src/88_gen_jobspecs.go
@@ -7,7 +7,7 @@ import (
"strings"
helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
- ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
)
type spec []string
@@ -74,7 +74,7 @@ func replacePlaceholders(
chainID, p2pPort int64,
contractAddress, bootHost string,
- boot, node ksdeploy.NodeKeys,
+ boot, node changeset.NodeKeys,
) (output []string) {
chainIDStr := strconv.FormatInt(chainID, 10)
bootstrapper := fmt.Sprintf("%s@%s:%d", boot.P2PPeerID, bootHost, p2pPort)
diff --git a/core/scripts/keystone/src/88_gen_ocr3_config.go b/core/scripts/keystone/src/88_gen_ocr3_config.go
index 707616b833b..94217b07f4e 100644
--- a/core/scripts/keystone/src/88_gen_ocr3_config.go
+++ b/core/scripts/keystone/src/88_gen_ocr3_config.go
@@ -3,14 +3,14 @@ package src
import (
helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
"github.com/smartcontractkit/chainlink/deployment"
- ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone"
+ ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
)
func mustReadConfig(fileName string) (output ksdeploy.TopLevelConfigSource) {
return mustParseJSON[ksdeploy.TopLevelConfigSource](fileName)
}
-func generateOCR3Config(nodeList string, configFile string, chainID int64, pubKeysPath string) ksdeploy.OCR2OracleConfig {
+func generateOCR3Config(nodeList string, configFile string, chainID int64, pubKeysPath string) ksdeploy.OCR3OnchainConfig {
topLevelCfg := mustReadConfig(configFile)
cfg := topLevelCfg.OracleConfig
nca := downloadNodePubKeys(nodeList, chainID, pubKeysPath)
diff --git a/core/scripts/keystone/src/99_fetch_keys.go b/core/scripts/keystone/src/99_fetch_keys.go
index 8899da95b11..056769dc714 100644
--- a/core/scripts/keystone/src/99_fetch_keys.go
+++ b/core/scripts/keystone/src/99_fetch_keys.go
@@ -13,17 +13,17 @@ import (
"github.com/urfave/cli"
helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
- ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big"
"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/web/presenters"
)
-func downloadNodePubKeys(nodeList string, chainID int64, pubKeysPath string) []ksdeploy.NodeKeys {
+func downloadNodePubKeys(nodeList string, chainID int64, pubKeysPath string) []changeset.NodeKeys {
// Check if file exists already, and if so, return the keys
if _, err := os.Stat(pubKeysPath); err == nil {
fmt.Println("Loading existing public keys at:", pubKeysPath)
- return mustParseJSON[[]ksdeploy.NodeKeys](pubKeysPath)
+ return mustParseJSON[[]changeset.NodeKeys](pubKeysPath)
}
nodes := downloadNodeAPICredentials(nodeList)
@@ -97,7 +97,7 @@ type ocr2Bundle struct {
ConfigPublicKey string `json:"configPublicKey"`
}
-func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []ksdeploy.NodeKeys) {
+func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []changeset.NodeKeys) {
for _, n := range nodes {
output := &bytes.Buffer{}
client, app := newApp(n, output)
@@ -209,7 +209,7 @@ func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []ksdeploy.NodeKeys)
helpers.PanicErr(err)
output.Reset()
- nc := ksdeploy.NodeKeys{
+ nc := changeset.NodeKeys{
EthAddress: ethAddress,
AptosAccount: aptosAccount,
P2PPeerID: peerID,
diff --git a/deployment/keystone/changeset/accept_ownership.go b/deployment/keystone/changeset/accept_ownership.go
index 662a4c2dcfa..dd709523bc2 100644
--- a/deployment/keystone/changeset/accept_ownership.go
+++ b/deployment/keystone/changeset/accept_ownership.go
@@ -5,7 +5,7 @@ import (
"github.com/ethereum/go-ethereum/common"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/changeset"
diff --git a/deployment/keystone/changeset/accept_ownership_test.go b/deployment/keystone/changeset/accept_ownership_test.go
index d949e63c7aa..4007fde4f79 100644
--- a/deployment/keystone/changeset/accept_ownership_test.go
+++ b/deployment/keystone/changeset/accept_ownership_test.go
@@ -35,7 +35,7 @@ func TestAcceptAllOwnership(t *testing.T) {
},
{
Changeset: commonchangeset.WrapChangeSet(changeset.DeployForwarder),
- Config: registrySel,
+ Config: changeset.DeployForwarderRequest{},
},
{
Changeset: commonchangeset.WrapChangeSet(changeset.DeployFeedsConsumer),
diff --git a/deployment/keystone/changeset/addrbook_utils.go b/deployment/keystone/changeset/addrbook_utils.go
index 3eb23011ef0..fa4dd27ca18 100644
--- a/deployment/keystone/changeset/addrbook_utils.go
+++ b/deployment/keystone/changeset/addrbook_utils.go
@@ -8,7 +8,8 @@ import (
ccipowner "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"
"github.com/smartcontractkit/chainlink/deployment"
- "github.com/smartcontractkit/chainlink/deployment/keystone"
+
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
capReg "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
feeds_consumer "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/feeds_consumer_1_0_0"
keystoneForwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0"
@@ -56,7 +57,7 @@ func capRegistriesFromAddrBook(addrBook deployment.AddressBook, chain deployment
return getContractsFromAddrBook[capReg.CapabilitiesRegistry](
addrBook,
chain,
- keystone.CapabilitiesRegistry,
+ internal.CapabilitiesRegistry,
capReg.NewCapabilitiesRegistry,
)
}
@@ -66,7 +67,7 @@ func ocr3FromAddrBook(addrBook deployment.AddressBook, chain deployment.Chain) (
return getContractsFromAddrBook[ocr3Capability.OCR3Capability](
addrBook,
chain,
- keystone.OCR3Capability,
+ internal.OCR3Capability,
ocr3Capability.NewOCR3Capability,
)
}
@@ -76,7 +77,7 @@ func forwardersFromAddrBook(addrBook deployment.AddressBook, chain deployment.Ch
return getContractsFromAddrBook[keystoneForwarder.KeystoneForwarder](
addrBook,
chain,
- keystone.KeystoneForwarder,
+ internal.KeystoneForwarder,
keystoneForwarder.NewKeystoneForwarder,
)
}
@@ -86,7 +87,7 @@ func feedsConsumersFromAddrBook(addrBook deployment.AddressBook, chain deploymen
return getContractsFromAddrBook[feeds_consumer.KeystoneFeedsConsumer](
addrBook,
chain,
- keystone.FeedConsumer,
+ internal.FeedConsumer,
feeds_consumer.NewKeystoneFeedsConsumer,
)
}
@@ -96,7 +97,7 @@ func proposersFromAddrBook(addrBook deployment.AddressBook, chain deployment.Cha
return getContractsFromAddrBook[ccipowner.ManyChainMultiSig](
addrBook,
chain,
- keystone.ProposerManyChainMultiSig,
+ internal.ProposerManyChainMultiSig,
ccipowner.NewManyChainMultiSig,
)
}
@@ -106,7 +107,7 @@ func timelocksFromAddrBook(addrBook deployment.AddressBook, chain deployment.Cha
return getContractsFromAddrBook[ccipowner.RBACTimelock](
addrBook,
chain,
- keystone.RBACTimelock,
+ internal.RBACTimelock,
ccipowner.NewRBACTimelock,
)
}
diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go
index 688d4fd8d2f..d558cf39c95 100644
--- a/deployment/keystone/changeset/append_node_capabilities.go
+++ b/deployment/keystone/changeset/append_node_capabilities.go
@@ -8,7 +8,6 @@ import (
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
@@ -63,7 +62,7 @@ func (req *AppendNodeCapabilitiesRequest) convert(e deployment.Environment) (*in
if !ok {
return nil, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel)
}
- resp, err := kslib.GetContractSets(e.Logger, &kslib.GetContractSetsRequest{
+ resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{
Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain},
AddressBook: e.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/compatiblity.go b/deployment/keystone/changeset/compatiblity.go
new file mode 100644
index 00000000000..7f80b6ab53d
--- /dev/null
+++ b/deployment/keystone/changeset/compatiblity.go
@@ -0,0 +1,95 @@
+package changeset
+
+import "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
+
+//TODO: KS-673 refactor internal package to reduce and remove the duplication
+
+// OracleConfig is the configuration for an oracle
+type OracleConfig = internal.OracleConfig
+
+// OCR3OnchainConfig is the onchain configuration of an OCR2 contract
+type OCR3OnchainConfig = internal.OCR2OracleConfig
+
+// NodeKeys is a set of public keys for a node
+type NodeKeys = internal.NodeKeys
+
+// TopLevelConfigSource is the top level configuration source
+type TopLevelConfigSource = internal.TopLevelConfigSource
+
+// GenerateOCR3Config generates an OCR3 config
+var GenerateOCR3Config = internal.GenerateOCR3Config
+
+// FeedConsumer is a feed consumer contract type
+var FeedConsumer = internal.FeedConsumer
+
+// KeystoneForwarder is a keystone forwarder contract type
+var KeystoneForwarder = internal.KeystoneForwarder
+
+// GetContractSetsRequest is a request to get contract sets
+type GetContractSetsRequest = internal.GetContractSetsRequest
+
+// GetContractSetsResponse is a response to get contract sets
+type GetContractSetsResponse = internal.GetContractSetsResponse
+
+// GetContractSets gets contract sets
+var GetContractSets = internal.GetContractSets
+
+// RegisterCapabilitiesRequest is a request to register capabilities
+type RegisterCapabilitiesRequest = internal.RegisterCapabilitiesRequest
+
+// RegisterCapabilitiesResponse is a response to register capabilities
+type RegisterCapabilitiesResponse = internal.RegisterCapabilitiesResponse
+
+// RegisterCapabilities registers capabilities
+var RegisterCapabilities = internal.RegisterCapabilities
+
+// RegisterNOPSRequest is a request to register NOPS
+type RegisterNOPSRequest = internal.RegisterNOPSRequest
+
+// RegisterNOPSResponse is a response to register NOPS
+type RegisterNOPSResponse = internal.RegisterNOPSResponse
+
+// RegisterNOPS registers NOPS
+var RegisterNOPS = internal.RegisterNOPS
+
+// RegisterNodesRequest is a request to register nodes with the capabilities registry
+type RegisterNodesRequest = internal.RegisterNodesRequest
+
+// RegisterNodesResponse is a response to register nodes with the capabilities registry
+type RegisterNodesResponse = internal.RegisterNodesResponse
+
+// RegisterNodes registers nodes with the capabilities registry
+var RegisterNodes = internal.RegisterNodes
+
+// RegisteredCapability is a wrapper of a capability and its ID
+type RegisteredCapability = internal.RegisteredCapability
+
+// FromCapabilitiesRegistryCapability converts a capabilities registry capability to a registered capability
+var FromCapabilitiesRegistryCapability = internal.FromCapabilitiesRegistryCapability
+
+// RegisterDonsRequest is a request to register Dons with the capabilities registry
+type RegisterDonsRequest = internal.RegisterDonsRequest
+
+// RegisterDonsResponse is a response to register Dons with the capabilities registry
+type RegisterDonsResponse = internal.RegisterDonsResponse
+
+// RegisterDons registers Dons with the capabilities registry
+var RegisterDons = internal.RegisterDons
+
+// DONToRegister is the minimal information needed to register a DON with the capabilities registry
+type DONToRegister = internal.DONToRegister
+
+// ConfigureContractsRequest is a request to configure ALL the contracts
+type ConfigureContractsRequest = internal.ConfigureContractsRequest
+
+// ConfigureContractsResponse is a response to configure ALL the contracts
+type ConfigureContractsResponse = internal.ConfigureContractsResponse
+
+// DonCapabilities is a set of capabilities hosted by a set of node operators
+// in is in a convenient form to handle the CLO representation of the nop data
+type DonCapabilities = internal.DonCapabilities
+
+type DeployRequest = internal.DeployRequest
+type DeployResponse = internal.DeployResponse
+
+type ContractSet = internal.ContractSet
diff --git a/deployment/keystone/changeset/configure_contracts.go b/deployment/keystone/changeset/configure_contracts.go
index 3a92782e12b..b57ebb0ed52 100644
--- a/deployment/keystone/changeset/configure_contracts.go
+++ b/deployment/keystone/changeset/configure_contracts.go
@@ -7,7 +7,7 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
var _ deployment.ChangeSet[InitialContractsCfg] = ConfigureInitialContractsChangeset
diff --git a/deployment/keystone/changeset/deploy_consumer.go b/deployment/keystone/changeset/deploy_consumer.go
index fc7992e2a7d..d94d7ac0adc 100644
--- a/deployment/keystone/changeset/deploy_consumer.go
+++ b/deployment/keystone/changeset/deploy_consumer.go
@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
type DeployFeedsConsumerRequest struct {
diff --git a/deployment/keystone/changeset/deploy_forwarder.go b/deployment/keystone/changeset/deploy_forwarder.go
index b4b242b72df..66923140e6a 100644
--- a/deployment/keystone/changeset/deploy_forwarder.go
+++ b/deployment/keystone/changeset/deploy_forwarder.go
@@ -2,26 +2,40 @@ package changeset
import (
"fmt"
+ "maps"
+ "slices"
"github.com/ethereum/go-ethereum/common"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
-var _ deployment.ChangeSet[uint64] = DeployForwarder
+var _ deployment.ChangeSet[DeployForwarderRequest] = DeployForwarder
+
+type DeployForwarderRequest struct {
+ ChainSelectors []uint64 // filter to only deploy to these chains; if empty, deploy to all chains
+}
// DeployForwarder deploys the KeystoneForwarder contract to all chains in the environment
// callers must merge the output addressbook with the existing one
// TODO: add selectors to deploy only to specific chains
-func DeployForwarder(env deployment.Environment, _ uint64) (deployment.ChangesetOutput, error) {
+func DeployForwarder(env deployment.Environment, cfg DeployForwarderRequest) (deployment.ChangesetOutput, error) {
lggr := env.Logger
ab := deployment.NewMemoryAddressBook()
- for _, chain := range env.Chains {
+ selectors := cfg.ChainSelectors
+ if len(selectors) == 0 {
+ selectors = slices.Collect(maps.Keys(env.Chains))
+ }
+ for _, sel := range selectors {
+ chain, ok := env.Chains[sel]
+ if !ok {
+ return deployment.ChangesetOutput{}, fmt.Errorf("chain with selector %d not found", sel)
+ }
lggr.Infow("deploying forwarder", "chainSelector", chain.Selector)
- forwarderResp, err := kslib.DeployForwarder(chain, ab)
+ forwarderResp, err := internal.DeployForwarder(chain, ab)
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy KeystoneForwarder to chain selector %d: %w", chain.Selector, err)
}
@@ -55,7 +69,7 @@ func (r ConfigureForwardContractsRequest) UseMCMS() bool {
}
func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardContractsRequest) (deployment.ChangesetOutput, error) {
- wfDon, err := kslib.NewRegisteredDon(env, kslib.RegisteredDonConfig{
+ wfDon, err := internal.NewRegisteredDon(env, internal.RegisteredDonConfig{
NodeIDs: req.WFNodeIDs,
Name: req.WFDonName,
RegistryChainSel: req.RegistryChainSel,
@@ -63,15 +77,15 @@ func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardC
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to create registered don: %w", err)
}
- r, err := kslib.ConfigureForwardContracts(&env, kslib.ConfigureForwarderContractsRequest{
- Dons: []kslib.RegisteredDon{*wfDon},
+ r, err := internal.ConfigureForwardContracts(&env, internal.ConfigureForwarderContractsRequest{
+ Dons: []internal.RegisteredDon{*wfDon},
UseMCMS: req.UseMCMS(),
})
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to configure forward contracts: %w", err)
}
- cresp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/deploy_forwarder_test.go b/deployment/keystone/changeset/deploy_forwarder_test.go
index f40b0f560c4..ec80a9432b0 100644
--- a/deployment/keystone/changeset/deploy_forwarder_test.go
+++ b/deployment/keystone/changeset/deploy_forwarder_test.go
@@ -34,7 +34,7 @@ func TestDeployForwarder(t *testing.T) {
// deploy forwarder
env.ExistingAddresses = ab
- resp, err := changeset.DeployForwarder(env, registrySel)
+ resp, err := changeset.DeployForwarder(env, changeset.DeployForwarderRequest{})
require.NoError(t, err)
require.NotNil(t, resp)
// registry, ocr3, forwarder should be deployed on registry chain
diff --git a/deployment/keystone/changeset/deploy_ocr3.go b/deployment/keystone/changeset/deploy_ocr3.go
index 057bba4c12d..4e85590e521 100644
--- a/deployment/keystone/changeset/deploy_ocr3.go
+++ b/deployment/keystone/changeset/deploy_ocr3.go
@@ -11,7 +11,7 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
var _ deployment.ChangeSet[uint64] = DeployOCR3
diff --git a/deployment/keystone/changeset/deploy_ocr3_test.go b/deployment/keystone/changeset/deploy_ocr3_test.go
index 1aa8f0a0caa..c12f6878835 100644
--- a/deployment/keystone/changeset/deploy_ocr3_test.go
+++ b/deployment/keystone/changeset/deploy_ocr3_test.go
@@ -15,8 +15,8 @@ import (
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test"
)
@@ -48,7 +48,7 @@ func TestDeployOCR3(t *testing.T) {
func TestConfigureOCR3(t *testing.T) {
t.Parallel()
- c := kslib.OracleConfig{
+ c := internal.OracleConfig{
MaxFaultyOracles: 1,
DeltaProgressMillis: 12345,
}
@@ -77,7 +77,7 @@ func TestConfigureOCR3(t *testing.T) {
csOut, err := changeset.ConfigureOCR3Contract(te.Env, cfg)
require.NoError(t, err)
- var got kslib.OCR2OracleConfig
+ var got internal.OCR2OracleConfig
err = json.Unmarshal(w.Bytes(), &got)
require.NoError(t, err)
assert.Len(t, got.Signers, 4)
@@ -110,7 +110,7 @@ func TestConfigureOCR3(t *testing.T) {
csOut, err := changeset.ConfigureOCR3Contract(te.Env, cfg)
require.NoError(t, err)
- var got kslib.OCR2OracleConfig
+ var got internal.OCR2OracleConfig
err = json.Unmarshal(w.Bytes(), &got)
require.NoError(t, err)
assert.Len(t, got.Signers, 4)
diff --git a/deployment/keystone/changeset/deploy_registry.go b/deployment/keystone/changeset/deploy_registry.go
index d07e2728282..2b8342c06dd 100644
--- a/deployment/keystone/changeset/deploy_registry.go
+++ b/deployment/keystone/changeset/deploy_registry.go
@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+ kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
)
var _ deployment.ChangeSet[uint64] = DeployCapabilityRegistry
diff --git a/deployment/keystone/changeset/internal/append_node_capabilities.go b/deployment/keystone/changeset/internal/append_node_capabilities.go
index 652dff4693a..32fe8572da3 100644
--- a/deployment/keystone/changeset/internal/append_node_capabilities.go
+++ b/deployment/keystone/changeset/internal/append_node_capabilities.go
@@ -5,14 +5,14 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
+
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
)
type AppendNodeCapabilitiesRequest struct {
Chain deployment.Chain
- ContractSet *kslib.ContractSet
+ ContractSet *ContractSet
P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability
UseMCMS bool
@@ -48,7 +48,7 @@ func AppendNodeCapabilitiesImpl(lggr logger.Logger, req *AppendNodeCapabilitiesR
for _, cap := range req.P2pToCapabilities {
capabilities = append(capabilities, cap...)
}
- op, err := kslib.AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS)
+ op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS)
if err != nil {
return nil, fmt.Errorf("failed to add capabilities: %w", err)
}
diff --git a/deployment/keystone/capability_definitions.go b/deployment/keystone/changeset/internal/capability_definitions.go
similarity index 98%
rename from deployment/keystone/capability_definitions.go
rename to deployment/keystone/changeset/internal/capability_definitions.go
index 2a234e18f52..21c2b4fce01 100644
--- a/deployment/keystone/capability_definitions.go
+++ b/deployment/keystone/changeset/internal/capability_definitions.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
diff --git a/deployment/keystone/capability_management.go b/deployment/keystone/changeset/internal/capability_management.go
similarity index 97%
rename from deployment/keystone/capability_management.go
rename to deployment/keystone/changeset/internal/capability_management.go
index a643112457f..268b4fd0d01 100644
--- a/deployment/keystone/capability_management.go
+++ b/deployment/keystone/changeset/internal/capability_management.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
@@ -27,7 +27,7 @@ func AddCapabilities(lggr logger.Logger, contractSet *ContractSet, chain deploym
}
tx, err := registry.AddCapabilities(txOpts, deduped)
if err != nil {
- err = DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to add capabilities: %w", err)
}
var batch *timelock.BatchChainOperation
diff --git a/deployment/keystone/capability_registry_deployer.go b/deployment/keystone/changeset/internal/capability_registry_deployer.go
similarity index 99%
rename from deployment/keystone/capability_registry_deployer.go
rename to deployment/keystone/changeset/internal/capability_registry_deployer.go
index 217250cd606..492ba168c9d 100644
--- a/deployment/keystone/capability_registry_deployer.go
+++ b/deployment/keystone/changeset/internal/capability_registry_deployer.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"context"
diff --git a/deployment/keystone/consumer_deployer.go b/deployment/keystone/changeset/internal/consumer_deployer.go
similarity index 98%
rename from deployment/keystone/consumer_deployer.go
rename to deployment/keystone/changeset/internal/consumer_deployer.go
index 4886039e791..3c2de539ccb 100644
--- a/deployment/keystone/consumer_deployer.go
+++ b/deployment/keystone/changeset/internal/consumer_deployer.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
diff --git a/deployment/keystone/contract_set.go b/deployment/keystone/changeset/internal/contract_set.go
similarity index 86%
rename from deployment/keystone/contract_set.go
rename to deployment/keystone/changeset/internal/contract_set.go
index 51b5c823600..e60f37d6f76 100644
--- a/deployment/keystone/contract_set.go
+++ b/deployment/keystone/changeset/internal/contract_set.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
@@ -58,21 +58,6 @@ func DeployCapabilitiesRegistry(chain deployment.Chain, ab deployment.AddressBoo
return capabilitiesRegistryResp, nil
}
-// DeployWorkflowRegistry deploys the WorkflowRegistry contract to the chain
-// and saves the address in the address book. This mutates the address book.
-func DeployWorkflowRegistry(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) {
- deployer, err := NewWorkflowRegistryDeployer()
- resp, err := deployer.Deploy(DeployRequest{Chain: chain})
- if err != nil {
- return nil, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err)
- }
- err = ab.Save(chain.Selector, resp.Address.String(), resp.Tv)
- if err != nil {
- return nil, fmt.Errorf("failed to save WorkflowRegistry: %w", err)
- }
- return resp, nil
-}
-
// DeployOCR3 deploys the OCR3Capability contract to the chain
// and saves the address in the address book. This mutates the address book.
func DeployOCR3(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) {
diff --git a/deployment/keystone/deploy.go b/deployment/keystone/changeset/internal/deploy.go
similarity index 97%
rename from deployment/keystone/deploy.go
rename to deployment/keystone/changeset/internal/deploy.go
index 58fbf07963c..5afcae11e93 100644
--- a/deployment/keystone/deploy.go
+++ b/deployment/keystone/changeset/internal/deploy.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"bytes"
@@ -540,7 +540,7 @@ func RegisterNOPS(ctx context.Context, lggr logger.Logger, req RegisterNOPSReque
}
tx, err := registry.AddNodeOperators(registryChain.DeployerKey, nops)
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call AddNodeOperators: %w", err)
}
// for some reason that i don't understand, the confirm must be called before the WaitMined or the latter will hang
@@ -603,12 +603,6 @@ func DefaultCapConfig(capType uint8, nNodes int) *capabilitiespb.CapabilityConfi
}
}
-// DEPRECATED: use deployment.DecodeErr instead
-// todo: refactor all keystone deps to use deployment.DecodeErr
-func DecodeErr(encodedABI string, err error) error {
- return deployment.DecodeErr(encodedABI, err)
-}
-
// register nodes
type RegisterNodesRequest struct {
Env *deployment.Environment
@@ -624,7 +618,6 @@ type RegisterNodesResponse struct {
// registerNodes registers the nodes with the registry. it assumes that the deployer key in the Chain
// can sign the transactions update the contract state
-// TODO: 467 refactor to support MCMS. Specifically need to separate the call data generation from the actual contract call
func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNodesResponse, error) {
registry, registryChain, err := GetRegistryContract(req.Env, req.RegistryChainSelector)
if err != nil {
@@ -727,7 +720,7 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode
lggr.Debugw("unique node params to add", "count", len(uniqueNodeParams), "params", uniqueNodeParams)
tx, err := registry.AddNodes(registryChain.DeployerKey, uniqueNodeParams)
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
// no typed errors in the abi, so we have to do string matching
// try to add all nodes in one go, if that fails, fall back to 1-by-1
if !strings.Contains(err.Error(), "NodeAlreadyExists") {
@@ -737,7 +730,7 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode
for _, singleNodeParams := range uniqueNodeParams {
tx, err = registry.AddNodes(registryChain.DeployerKey, []capabilities_registry.CapabilitiesRegistryNodeParams{singleNodeParams})
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
if strings.Contains(err.Error(), "NodeAlreadyExists") {
lggr.Warnw("node already exists, skipping", "p2pid", hex.EncodeToString(singleNodeParams.P2pId[:]))
continue
@@ -806,7 +799,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes
donInfos, err := registry.GetDONs(&bind.CallOpts{})
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call GetDONs: %w", err)
}
existingDONs := make(map[string]struct{})
@@ -860,7 +853,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes
tx, err := registry.AddDON(registryChain.DeployerKey, p2pIds, cfgs, true, wfSupported, don.F)
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call AddDON for don '%s' p2p2Id hash %s capability %v: %w", don.Name, p2pSortedHash, cfgs, err)
}
_, err = registryChain.Confirm(tx)
@@ -887,7 +880,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes
}
}
if err != nil {
- err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call GetDONs: %w", err)
}
if !foundAll {
@@ -943,13 +936,13 @@ func configureForwarder(lggr logger.Logger, chain deployment.Chain, contractSet
}
tx, err := fwdr.SetConfig(txOpts, dn.Info.Id, ver, dn.Info.F, signers)
if err != nil {
- err = DecodeErr(kf.KeystoneForwarderABI, err)
+ err = deployment.DecodeErr(kf.KeystoneForwarderABI, err)
return nil, fmt.Errorf("failed to call SetConfig for forwarder %s on chain %d: %w", fwdr.Address().String(), chain.Selector, err)
}
if !useMCMS {
_, err = chain.Confirm(tx)
if err != nil {
- err = DecodeErr(kf.KeystoneForwarderABI, err)
+ err = deployment.DecodeErr(kf.KeystoneForwarderABI, err)
return nil, fmt.Errorf("failed to confirm SetConfig for forwarder %s: %w", fwdr.Address().String(), err)
}
} else {
diff --git a/deployment/keystone/forwarder_deployer.go b/deployment/keystone/changeset/internal/forwarder_deployer.go
similarity index 99%
rename from deployment/keystone/forwarder_deployer.go
rename to deployment/keystone/changeset/internal/forwarder_deployer.go
index 33ff61eb834..2ce3ae88146 100644
--- a/deployment/keystone/forwarder_deployer.go
+++ b/deployment/keystone/changeset/internal/forwarder_deployer.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
diff --git a/deployment/keystone/ocr3_deployer.go b/deployment/keystone/changeset/internal/ocr3_deployer.go
similarity index 98%
rename from deployment/keystone/ocr3_deployer.go
rename to deployment/keystone/changeset/internal/ocr3_deployer.go
index fae05cbfbcd..beafe9bb9e2 100644
--- a/deployment/keystone/ocr3_deployer.go
+++ b/deployment/keystone/changeset/internal/ocr3_deployer.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
diff --git a/deployment/keystone/ocr3config.go b/deployment/keystone/changeset/internal/ocr3config.go
similarity index 98%
rename from deployment/keystone/ocr3config.go
rename to deployment/keystone/changeset/internal/ocr3config.go
index b23eaf8c462..74f8a9dabd5 100644
--- a/deployment/keystone/ocr3config.go
+++ b/deployment/keystone/changeset/internal/ocr3config.go
@@ -1,6 +1,6 @@
// TODO: KS-458 copied from https://github.com/smartcontractkit/chainlink/blob/65924811dc53a211613927c814d7f04fd85439a4/core/scripts/keystone/src/88_gen_ocr3_config.go#L1
// to unblock go mod issues when trying to import the scripts package
-package keystone
+package internal
import (
"crypto/ed25519"
@@ -327,15 +327,15 @@ func configureOCR3contract(req configureOCR3Request) (*configureOCR3Response, er
ocrConfig.OffchainConfig,
)
if err != nil {
- err = DecodeErr(kocr3.OCR3CapabilityABI, err)
- return nil, fmt.Errorf("failed to call SetConfig for OCR3 contract %s using mcms: %t: %w", req.contract.Address().String(), req.useMCMS, err)
+ err = deployment.DecodeErr(kocr3.OCR3CapabilityABI, err)
+ return nil, fmt.Errorf("failed to call SetConfig for OCR3 contract %s using mcms: %T: %w", req.contract.Address().String(), req.useMCMS, err)
}
var ops *timelock.BatchChainOperation
if !req.useMCMS {
_, err = req.chain.Confirm(tx)
if err != nil {
- err = DecodeErr(kocr3.OCR3CapabilityABI, err)
+ err = deployment.DecodeErr(kocr3.OCR3CapabilityABI, err)
return nil, fmt.Errorf("failed to confirm SetConfig for OCR3 contract %s: %w", req.contract.Address().String(), err)
}
} else {
diff --git a/deployment/keystone/ocr3config_test.go b/deployment/keystone/changeset/internal/ocr3config_test.go
similarity index 99%
rename from deployment/keystone/ocr3config_test.go
rename to deployment/keystone/changeset/internal/ocr3config_test.go
index 55fa16af68c..b412a727eb9 100644
--- a/deployment/keystone/ocr3config_test.go
+++ b/deployment/keystone/changeset/internal/ocr3config_test.go
@@ -1,6 +1,6 @@
// TODO: KS-458 copied from https://github.com/smartcontractkit/chainlink/blob/65924811dc53a211613927c814d7f04fd85439a4/core/scripts/keystone/src/88_gen_ocr3_config.go#L1
// to unblock go mod issues when trying to import the scripts package
-package keystone
+package internal
import (
"encoding/json"
diff --git a/deployment/keystone/state.go b/deployment/keystone/changeset/internal/state.go
similarity index 99%
rename from deployment/keystone/state.go
rename to deployment/keystone/changeset/internal/state.go
index 85259bdc342..d0817069d9a 100644
--- a/deployment/keystone/state.go
+++ b/deployment/keystone/changeset/internal/state.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"fmt"
diff --git a/deployment/keystone/changeset/internal/test/utils.go b/deployment/keystone/changeset/internal/test/utils.go
index a0cad0039e8..cc7e3b27160 100644
--- a/deployment/keystone/changeset/internal/test/utils.go
+++ b/deployment/keystone/changeset/internal/test/utils.go
@@ -17,45 +17,11 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
- "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
- kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
- workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper"
+ capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
)
-type SetupTestWorkflowRegistryResponse struct {
- Registry *workflow_registry.WorkflowRegistry
- Chain deployment.Chain
- RegistrySelector uint64
- AddressBook deployment.AddressBook
-}
-
-func SetupTestWorkflowRegistry(t *testing.T, lggr logger.Logger, chainSel uint64) *SetupTestWorkflowRegistryResponse {
- chain := testChain(t)
-
- deployer, err := kslib.NewWorkflowRegistryDeployer()
- require.NoError(t, err)
- resp, err := deployer.Deploy(kslib.DeployRequest{Chain: chain})
- require.NoError(t, err)
-
- addressBook := deployment.NewMemoryAddressBookFromMap(
- map[uint64]map[string]deployment.TypeAndVersion{
- chainSel: map[string]deployment.TypeAndVersion{
- resp.Address.Hex(): resp.Tv,
- },
- },
- )
-
- return &SetupTestWorkflowRegistryResponse{
- Registry: deployer.Contract(),
- Chain: chain,
- RegistrySelector: chain.Selector,
- AddressBook: addressBook,
- }
-}
-
type Don struct {
Name string
P2PIDs []p2pkey.PeerID
@@ -63,17 +29,17 @@ type Don struct {
}
type SetupTestRegistryRequest struct {
- P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability
- NopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc
+ P2pToCapabilities map[p2pkey.PeerID][]capabilities_registry.CapabilitiesRegistryCapability
+ NopToNodes map[capabilities_registry.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc
Dons []Don
// TODO maybe add support for MCMS at this level
}
type SetupTestRegistryResponse struct {
- Registry *kcr.CapabilitiesRegistry
+ Registry *capabilities_registry.CapabilitiesRegistry
Chain deployment.Chain
RegistrySelector uint64
- ContractSet *kslib.ContractSet
+ ContractSet *internal.ContractSet
}
func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryRequest) *SetupTestRegistryResponse {
@@ -81,7 +47,7 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR
// deploy the registry
registry := deployCapReg(t, chain)
// convert req to nodeoperators
- nops := make([]kcr.CapabilitiesRegistryNodeOperator, 0)
+ nops := make([]capabilities_registry.CapabilitiesRegistryNodeOperator, 0)
for nop := range req.NopToNodes {
nops = append(nops, nop)
}
@@ -93,19 +59,19 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR
// add capabilities to registry
capCache := NewCapabiltyCache(t)
- var capabilities []kcr.CapabilitiesRegistryCapability
+ var capabilities []capabilities_registry.CapabilitiesRegistryCapability
for _, caps := range req.P2pToCapabilities {
capabilities = append(capabilities, caps...)
}
registeredCapabilities := capCache.AddCapabilities(lggr, chain, registry, capabilities)
- expectedDeduped := make(map[kcr.CapabilitiesRegistryCapability]struct{})
+ expectedDeduped := make(map[capabilities_registry.CapabilitiesRegistryCapability]struct{})
for _, cap := range capabilities {
expectedDeduped[cap] = struct{}{}
}
require.Len(t, registeredCapabilities, len(expectedDeduped))
// make the nodes and register node
- var nodeParams []kcr.CapabilitiesRegistryNodeParams
+ var nodeParams []capabilities_registry.CapabilitiesRegistryNodeParams
initialp2pToCapabilities := make(map[p2pkey.PeerID][][32]byte)
for p2pID := range req.P2pToCapabilities {
initialp2pToCapabilities[p2pID] = mustCapabilityIds(t, registry, registeredCapabilities)
@@ -116,7 +82,7 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR
require.Fail(t, "missing nopToNodes for %s", nop.Name)
}
for _, p2pSignerEnc := range req.NopToNodes[nop] {
- nodeParams = append(nodeParams, kcr.CapabilitiesRegistryNodeParams{
+ nodeParams = append(nodeParams, capabilities_registry.CapabilitiesRegistryNodeParams{
Signer: p2pSignerEnc.Signer,
P2pId: p2pSignerEnc.P2PKey,
EncryptionPublicKey: p2pSignerEnc.EncryptionPublicKey,
@@ -134,21 +100,21 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR
Registry: registry,
Chain: chain,
RegistrySelector: chain.Selector,
- ContractSet: &kslib.ContractSet{
+ ContractSet: &internal.ContractSet{
CapabilitiesRegistry: registry,
},
}
}
-func deployCapReg(t *testing.T, chain deployment.Chain) *kcr.CapabilitiesRegistry {
- capabilitiesRegistryDeployer, err := kslib.NewCapabilitiesRegistryDeployer()
+func deployCapReg(t *testing.T, chain deployment.Chain) *capabilities_registry.CapabilitiesRegistry {
+ capabilitiesRegistryDeployer, err := internal.NewCapabilitiesRegistryDeployer()
require.NoError(t, err)
- _, err = capabilitiesRegistryDeployer.Deploy(kslib.DeployRequest{Chain: chain})
+ _, err = capabilitiesRegistryDeployer.Deploy(internal.DeployRequest{Chain: chain})
require.NoError(t, err)
return capabilitiesRegistryDeployer.Contract()
}
-func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, nops []kcr.CapabilitiesRegistryNodeOperator) *kslib.RegisterNOPSResponse {
+func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, nops []capabilities_registry.CapabilitiesRegistryNodeOperator) *internal.RegisterNOPSResponse {
env := &deployment.Environment{
Logger: lggr,
Chains: map[uint64]deployment.Chain{
@@ -157,13 +123,13 @@ func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry
ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{
chain.Selector: {
registry.Address().String(): deployment.TypeAndVersion{
- Type: kslib.CapabilitiesRegistry,
+ Type: internal.CapabilitiesRegistry,
Version: deployment.Version1_0_0,
},
},
}),
}
- resp, err := kslib.RegisterNOPS(context.TODO(), lggr, kslib.RegisterNOPSRequest{
+ resp, err := internal.RegisterNOPS(context.TODO(), lggr, internal.RegisterNOPSRequest{
Env: env,
RegistryChainSelector: chain.Selector,
Nops: nops,
@@ -172,23 +138,23 @@ func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry
return resp
}
-func addNodes(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, nodes []kcr.CapabilitiesRegistryNodeParams) {
+func addNodes(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, nodes []capabilities_registry.CapabilitiesRegistryNodeParams) {
tx, err := registry.AddNodes(chain.DeployerKey, nodes)
if err != nil {
- err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
require.Fail(t, fmt.Sprintf("failed to call AddNodes: %s: %s", err, err2))
}
_, err = chain.Confirm(tx)
require.NoError(t, err)
}
-func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, capCache *CapabilityCache, dons []Don) {
+func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, capCache *CapabilityCache, dons []Don) {
for _, don := range dons {
acceptsWorkflows := false
// lookup the capabilities
- var capConfigs []kcr.CapabilitiesRegistryCapabilityConfiguration
+ var capConfigs []capabilities_registry.CapabilitiesRegistryCapabilityConfiguration
for _, ccfg := range don.CapabilityConfigs {
- var cc = kcr.CapabilitiesRegistryCapabilityConfiguration{
+ var cc = capabilities_registry.CapabilitiesRegistryCapabilityConfiguration{
CapabilityId: [32]byte{},
Config: ccfg.Config,
}
@@ -208,7 +174,7 @@ func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry
f := len(don.P2PIDs)/3 + 1
tx, err := registry.AddDON(chain.DeployerKey, internal.PeerIDsToBytes(don.P2PIDs), capConfigs, isPublic, acceptsWorkflows, uint8(f))
if err != nil {
- err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
require.Fail(t, fmt.Sprintf("failed to call AddDON: %s: %s", err, err2))
}
_, err = chain.Confirm(tx)
@@ -216,7 +182,7 @@ func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry
}
}
-func defaultCapConfig(t *testing.T, cap kcr.CapabilitiesRegistryCapability) []byte {
+func defaultCapConfig(t *testing.T, cap capabilities_registry.CapabilitiesRegistryCapability) []byte {
empty := &capabilitiespb.CapabilityConfig{
DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(),
}
@@ -237,24 +203,24 @@ func NewCapabiltyCache(t *testing.T) *CapabilityCache {
nameToId: make(map[string][32]byte),
}
}
-func (cc *CapabilityCache) Get(cap kcr.CapabilitiesRegistryCapability) ([32]byte, bool) {
- id, exists := cc.nameToId[kslib.CapabilityID(cap)]
+func (cc *CapabilityCache) Get(cap capabilities_registry.CapabilitiesRegistryCapability) ([32]byte, bool) {
+ id, exists := cc.nameToId[internal.CapabilityID(cap)]
return id, exists
}
// AddCapabilities adds the capabilities to the registry and returns the registered capabilities
// if the capability is already registered, it will not be re-registered
// if duplicate capabilities are passed, they will be deduped
-func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, capabilities []kcr.CapabilitiesRegistryCapability) []kslib.RegisteredCapability {
+func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, capabilities []capabilities_registry.CapabilitiesRegistryCapability) []internal.RegisteredCapability {
t := cc.t
- var out []kslib.RegisteredCapability
+ var out []internal.RegisteredCapability
// get the registered capabilities & dedup
- seen := make(map[kcr.CapabilitiesRegistryCapability]struct{})
- var toRegister []kcr.CapabilitiesRegistryCapability
+ seen := make(map[capabilities_registry.CapabilitiesRegistryCapability]struct{})
+ var toRegister []capabilities_registry.CapabilitiesRegistryCapability
for _, cap := range capabilities {
- id, cached := cc.nameToId[kslib.CapabilityID(cap)]
+ id, cached := cc.nameToId[internal.CapabilityID(cap)]
if cached {
- out = append(out, kslib.RegisteredCapability{
+ out = append(out, internal.RegisteredCapability{
CapabilitiesRegistryCapability: cap,
ID: id,
})
@@ -271,7 +237,7 @@ func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.
}
tx, err := registry.AddCapabilities(chain.DeployerKey, toRegister)
if err != nil {
- err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)
require.Fail(t, fmt.Sprintf("failed to call AddCapabilities: %s: %s", err, err2))
}
_, err = chain.Confirm(tx)
@@ -282,12 +248,12 @@ func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.
capb := capb
id, err := registry.GetHashedCapabilityId(&bind.CallOpts{}, capb.LabelledName, capb.Version)
require.NoError(t, err)
- out = append(out, kslib.RegisteredCapability{
+ out = append(out, internal.RegisteredCapability{
CapabilitiesRegistryCapability: capb,
ID: id,
})
// cache the id
- cc.nameToId[kslib.CapabilityID(capb)] = id
+ cc.nameToId[internal.CapabilityID(capb)] = id
}
return out
}
@@ -303,7 +269,7 @@ func testChain(t *testing.T) deployment.Chain {
return chain
}
-func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []kslib.RegisteredCapability) ([][32]byte, error) {
+func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []internal.RegisteredCapability) ([][32]byte, error) {
out := make([][32]byte, len(rcs))
for i := range rcs {
id, err := registry.GetHashedCapabilityId(&bind.CallOpts{}, rcs[i].LabelledName, rcs[i].Version)
@@ -315,7 +281,7 @@ func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []k
return out, nil
}
-func mustCapabilityIds(t *testing.T, registry *capabilities_registry.CapabilitiesRegistry, rcs []kslib.RegisteredCapability) [][32]byte {
+func mustCapabilityIds(t *testing.T, registry *capabilities_registry.CapabilitiesRegistry, rcs []internal.RegisteredCapability) [][32]byte {
t.Helper()
out, err := capabilityIds(registry, rcs)
require.NoError(t, err)
diff --git a/deployment/keystone/testdata/testnet_wf_view.json b/deployment/keystone/changeset/internal/testdata/testnet_wf_view.json
similarity index 100%
rename from deployment/keystone/testdata/testnet_wf_view.json
rename to deployment/keystone/changeset/internal/testdata/testnet_wf_view.json
diff --git a/deployment/keystone/types.go b/deployment/keystone/changeset/internal/types.go
similarity index 99%
rename from deployment/keystone/types.go
rename to deployment/keystone/changeset/internal/types.go
index e12cf935d3d..173e3ba1ad0 100644
--- a/deployment/keystone/types.go
+++ b/deployment/keystone/changeset/internal/types.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"errors"
diff --git a/deployment/keystone/types_test.go b/deployment/keystone/changeset/internal/types_test.go
similarity index 99%
rename from deployment/keystone/types_test.go
rename to deployment/keystone/changeset/internal/types_test.go
index ea122837aa6..cfc953d6126 100644
--- a/deployment/keystone/types_test.go
+++ b/deployment/keystone/changeset/internal/types_test.go
@@ -1,4 +1,4 @@
-package keystone
+package internal
import (
"encoding/hex"
diff --git a/deployment/keystone/changeset/internal/update_don.go b/deployment/keystone/changeset/internal/update_don.go
index fd9288c7426..3cfc386b2ba 100644
--- a/deployment/keystone/changeset/internal/update_don.go
+++ b/deployment/keystone/changeset/internal/update_don.go
@@ -18,8 +18,6 @@ import (
"google.golang.org/protobuf/proto"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
-
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
)
// CapabilityConfig is a struct that holds a capability and its configuration
@@ -30,7 +28,7 @@ type CapabilityConfig struct {
type UpdateDonRequest struct {
Chain deployment.Chain
- ContractSet *kslib.ContractSet // contract set for the given chain
+ ContractSet *ContractSet // contract set for the given chain
P2PIDs []p2pkey.PeerID // this is the unique identifier for the don
CapabilityConfigs []CapabilityConfig // if Config subfield is nil, a default config is used
@@ -97,7 +95,7 @@ func UpdateDon(lggr logger.Logger, req *UpdateDonRequest) (*UpdateDonResponse, e
}
tx, err := registry.UpdateDON(txOpts, don.Id, don.NodeP2PIds, cfgs, don.IsPublic, don.F)
if err != nil {
- err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call UpdateDON: %w", err)
}
var ops *timelock.BatchChainOperation
@@ -150,7 +148,7 @@ func computeConfigs(registry *kcr.CapabilitiesRegistry, caps []CapabilityConfig,
}
out[i].CapabilityId = id
if out[i].Config == nil {
- c := kslib.DefaultCapConfig(cap.Capability.CapabilityType, int(donInfo.F))
+ c := DefaultCapConfig(cap.Capability.CapabilityType, int(donInfo.F))
cb, err := proto.Marshal(c)
if err != nil {
return nil, fmt.Errorf("failed to marshal capability config for %v: %w", c, err)
diff --git a/deployment/keystone/changeset/internal/update_don_test.go b/deployment/keystone/changeset/internal/update_don_test.go
index f4b5fd46fc7..57b15138538 100644
--- a/deployment/keystone/changeset/internal/update_don_test.go
+++ b/deployment/keystone/changeset/internal/update_don_test.go
@@ -13,8 +13,6 @@ import (
chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- "github.com/smartcontractkit/chainlink/deployment/keystone"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
kscs "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test"
@@ -100,14 +98,14 @@ func TestUpdateDon(t *testing.T) {
t.Run("empty", func(t *testing.T) {
cfg := setupUpdateDonTestConfig{
- dons: []kslib.DonInfo{
+ dons: []internal.DonInfo{
{
Name: "don 1",
Nodes: []deployment.Node{node_1, node_2, node_3, node_4},
Capabilities: []kcr.CapabilitiesRegistryCapability{initialCap},
},
},
- nops: []keystone.NOP{
+ nops: []internal.NOP{
{
Name: "nop 1",
Nodes: []string{node_1.NodeID, node_2.NodeID, node_3.NodeID, node_4.NodeID},
@@ -223,8 +221,8 @@ func newNode(t *testing.T, cfg minimalNodeCfg) deployment.Node {
}
type setupUpdateDonTestConfig struct {
- dons []kslib.DonInfo
- nops []keystone.NOP
+ dons []internal.DonInfo
+ nops []internal.NOP
}
type setupUpdateDonTestResult struct {
@@ -239,7 +237,7 @@ func registerTestDon(t *testing.T, lggr logger.Logger, cfg setupUpdateDonTestCon
}
-func newSetupTestRegistryRequest(t *testing.T, dons []kslib.DonInfo, nops []keystone.NOP) *kstest.SetupTestRegistryRequest {
+func newSetupTestRegistryRequest(t *testing.T, dons []internal.DonInfo, nops []internal.NOP) *kstest.SetupTestRegistryRequest {
t.Helper()
nodes := make(map[string]deployment.Node)
for _, don := range dons {
@@ -258,7 +256,7 @@ func newSetupTestRegistryRequest(t *testing.T, dons []kslib.DonInfo, nops []keys
return req
}
-func makeNopToNodes(t *testing.T, nops []keystone.NOP, nodes map[string]deployment.Node) map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc {
+func makeNopToNodes(t *testing.T, nops []internal.NOP, nodes map[string]deployment.Node) map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc {
nopToNodes := make(map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc)
for _, nop := range nops {
@@ -282,7 +280,7 @@ func makeNopToNodes(t *testing.T, nops []keystone.NOP, nodes map[string]deployme
return nopToNodes
}
-func makeP2PToCapabilities(t *testing.T, dons []kslib.DonInfo) map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability {
+func makeP2PToCapabilities(t *testing.T, dons []internal.DonInfo) map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability {
p2pToCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability)
for _, don := range dons {
for _, node := range don.Nodes {
@@ -296,7 +294,7 @@ func makeP2PToCapabilities(t *testing.T, dons []kslib.DonInfo) map[p2pkey.PeerID
return p2pToCapabilities
}
-func makeTestDon(t *testing.T, dons []kslib.DonInfo) []kstest.Don {
+func makeTestDon(t *testing.T, dons []internal.DonInfo) []kstest.Don {
out := make([]kstest.Don, len(dons))
for i, don := range dons {
out[i] = testDon(t, don)
@@ -304,7 +302,7 @@ func makeTestDon(t *testing.T, dons []kslib.DonInfo) []kstest.Don {
return out
}
-func testDon(t *testing.T, don kslib.DonInfo) kstest.Don {
+func testDon(t *testing.T, don internal.DonInfo) kstest.Don {
var p2pids []p2pkey.PeerID
for _, node := range don.Nodes {
// all chain configs are the same wrt admin address & node keys
diff --git a/deployment/keystone/changeset/internal/update_node_capabilities.go b/deployment/keystone/changeset/internal/update_node_capabilities.go
index fba8e78f7ab..16c37267060 100644
--- a/deployment/keystone/changeset/internal/update_node_capabilities.go
+++ b/deployment/keystone/changeset/internal/update_node_capabilities.go
@@ -5,14 +5,13 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
)
type UpdateNodeCapabilitiesImplRequest struct {
Chain deployment.Chain
- ContractSet *kslib.ContractSet
+ ContractSet *ContractSet
P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability
UseMCMS bool
@@ -38,7 +37,7 @@ func UpdateNodeCapabilitiesImpl(lggr logger.Logger, req *UpdateNodeCapabilitiesI
for _, cap := range req.P2pToCapabilities {
capabilities = append(capabilities, cap...)
}
- op, err := kslib.AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS)
+ op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS)
if err != nil {
return nil, fmt.Errorf("failed to add capabilities: %w", err)
}
diff --git a/deployment/keystone/changeset/internal/update_node_capabilities_test.go b/deployment/keystone/changeset/internal/update_node_capabilities_test.go
index 804fc32e537..65da264dd01 100644
--- a/deployment/keystone/changeset/internal/update_node_capabilities_test.go
+++ b/deployment/keystone/changeset/internal/update_node_capabilities_test.go
@@ -8,7 +8,7 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
@@ -25,9 +25,9 @@ func TestUpdateNodeCapabilities(t *testing.T) {
},
},
}
- nopToNodes = map[kcr.CapabilitiesRegistryNodeOperator][]*kslib.P2PSignerEnc{
- testNop(t, "testNop"): []*kslib.P2PSignerEnc{
- &kslib.P2PSignerEnc{
+ nopToNodes = map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc{
+ testNop(t, "testNop"): []*internal.P2PSignerEnc{
+ &internal.P2PSignerEnc{
Signer: [32]byte{0: 1},
P2PKey: testPeerID(t, "0x1"),
EncryptionPublicKey: [32]byte{3: 16, 4: 2},
@@ -40,7 +40,7 @@ func TestUpdateNodeCapabilities(t *testing.T) {
type args struct {
lggr logger.Logger
- req *kslib.UpdateNodeCapabilitiesImplRequest // chain and registry are set in the test setup
+ req *internal.UpdateNodeCapabilitiesImplRequest // chain and registry are set in the test setup
initialState *kstest.SetupTestRegistryRequest
}
tests := []struct {
@@ -53,7 +53,7 @@ func TestUpdateNodeCapabilities(t *testing.T) {
name: "invalid request",
args: args{
lggr: lggr,
- req: &kslib.UpdateNodeCapabilitiesImplRequest{
+ req: &internal.UpdateNodeCapabilitiesImplRequest{
Chain: deployment.Chain{},
},
initialState: &kstest.SetupTestRegistryRequest{},
@@ -68,7 +68,7 @@ func TestUpdateNodeCapabilities(t *testing.T) {
P2pToCapabilities: initialp2pToCapabilities,
NopToNodes: nopToNodes,
},
- req: &kslib.UpdateNodeCapabilitiesImplRequest{
+ req: &internal.UpdateNodeCapabilitiesImplRequest{
P2pToCapabilities: map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{
testPeerID(t, "0x1"): []kcr.CapabilitiesRegistryCapability{
{
@@ -95,7 +95,7 @@ func TestUpdateNodeCapabilities(t *testing.T) {
tt.args.req.Chain = setupResp.Chain
tt.args.req.ContractSet = setupResp.ContractSet
- got, err := kslib.UpdateNodeCapabilitiesImpl(tt.args.lggr, tt.args.req)
+ got, err := internal.UpdateNodeCapabilitiesImpl(tt.args.lggr, tt.args.req)
if (err != nil) != tt.wantErr {
t.Errorf("UpdateNodeCapabilities() error = %v, wantErr %v", err, tt.wantErr)
return
diff --git a/deployment/keystone/changeset/internal/update_nodes.go b/deployment/keystone/changeset/internal/update_nodes.go
index e483c5ddf87..b27c17ad19f 100644
--- a/deployment/keystone/changeset/internal/update_nodes.go
+++ b/deployment/keystone/changeset/internal/update_nodes.go
@@ -17,7 +17,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
)
type NodeUpdate struct {
@@ -30,7 +29,7 @@ type NodeUpdate struct {
type UpdateNodesRequest struct {
Chain deployment.Chain
- ContractSet *kslib.ContractSet // contract set for the given chain
+ ContractSet *ContractSet // contract set for the given chain
P2pToUpdates map[p2pkey.PeerID]NodeUpdate
@@ -60,7 +59,7 @@ func (req *UpdateNodesRequest) Validate() error {
for peer, updates := range req.P2pToUpdates {
seen := make(map[string]struct{})
for _, cap := range updates.Capabilities {
- id := kslib.CapabilityID(cap)
+ id := CapabilityID(cap)
if _, exists := seen[id]; exists {
return fmt.Errorf("duplicate capability %s for %s", id, peer)
}
@@ -103,7 +102,7 @@ func UpdateNodes(lggr logger.Logger, req *UpdateNodesRequest) (*UpdateNodesRespo
params, err := req.NodeParams()
if err != nil {
- err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to make node params: %w", err)
}
txOpts := req.Chain.DeployerKey
@@ -113,7 +112,7 @@ func UpdateNodes(lggr logger.Logger, req *UpdateNodesRequest) (*UpdateNodesRespo
registry := req.ContractSet.CapabilitiesRegistry
tx, err := registry.UpdateNodes(txOpts, params)
if err != nil {
- err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to call UpdateNodes: %w", err)
}
@@ -183,8 +182,8 @@ func AppendCapabilities(lggr logger.Logger, registry *kcr.CapabilitiesRegistry,
var deduped []kcr.CapabilitiesRegistryCapability
seen := make(map[string]struct{})
for _, cap := range mergedCaps {
- if _, ok := seen[kslib.CapabilityID(cap)]; !ok {
- seen[kslib.CapabilityID(cap)] = struct{}{}
+ if _, ok := seen[CapabilityID(cap)]; !ok {
+ seen[CapabilityID(cap)] = struct{}{}
deduped = append(deduped, cap)
}
}
@@ -204,7 +203,7 @@ func makeNodeParams(registry *kcr.CapabilitiesRegistry,
nodes, err := registry.GetNodesByP2PIds(&bind.CallOpts{}, PeerIDsToBytes(p2pIds))
if err != nil {
- err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
return nil, fmt.Errorf("failed to get nodes by p2p ids: %w", err)
}
for _, node := range nodes {
@@ -261,11 +260,11 @@ func makeNodeParams(registry *kcr.CapabilitiesRegistry,
}
-// fetchkslib.CapabilityIDs fetches the capability ids for the given capabilities
+// fetchCapabilityIDs fetches the capability ids for the given capabilities
func fetchCapabilityIDs(registry *kcr.CapabilitiesRegistry, caps []kcr.CapabilitiesRegistryCapability) (map[string][32]byte, error) {
out := make(map[string][32]byte)
for _, cap := range caps {
- name := kslib.CapabilityID(cap)
+ name := CapabilityID(cap)
if _, exists := out[name]; exists {
continue
}
diff --git a/deployment/keystone/changeset/internal/update_nodes_test.go b/deployment/keystone/changeset/internal/update_nodes_test.go
index a0810225762..0f22120998a 100644
--- a/deployment/keystone/changeset/internal/update_nodes_test.go
+++ b/deployment/keystone/changeset/internal/update_nodes_test.go
@@ -16,7 +16,6 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test"
@@ -30,7 +29,7 @@ func Test_UpdateNodesRequest_validate(t *testing.T) {
p2pToUpdates map[p2pkey.PeerID]internal.NodeUpdate
nopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc
chain deployment.Chain
- contractSet *kslib.ContractSet
+ contractSet *internal.ContractSet
}
tests := []struct {
name string
@@ -465,14 +464,14 @@ func TestUpdateNodes(t *testing.T) {
require.NoError(t, err)
// register the capabilities that the Update will use
- expectedUpdatedCaps := make(map[p2pkey.PeerID][]kslib.RegisteredCapability)
+ expectedUpdatedCaps := make(map[p2pkey.PeerID][]internal.RegisteredCapability)
capCache := kstest.NewCapabiltyCache(t)
for p2p, update := range tt.args.req.P2pToUpdates {
if len(update.Capabilities) > 0 {
expectedCaps := capCache.AddCapabilities(tt.args.lggr, tt.args.req.Chain, registry, update.Capabilities)
expectedUpdatedCaps[p2p] = expectedCaps
} else {
- expectedUpdatedCaps[p2p] = []kslib.RegisteredCapability{
+ expectedUpdatedCaps[p2p] = []internal.RegisteredCapability{
{CapabilitiesRegistryCapability: phonyCap, ID: id},
}
}
@@ -564,7 +563,7 @@ func TestUpdateNodes(t *testing.T) {
toRegister := p2pToCapabilitiesUpdated[testPeerID(t, "peerID_1")]
tx, err := registry.AddCapabilities(chain.DeployerKey, toRegister)
if err != nil {
- err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err)
+ err2 := deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err)
require.Fail(t, fmt.Sprintf("failed to call AddCapabilities: %s: %s", err, err2))
}
_, err = chain.Confirm(tx)
@@ -654,7 +653,7 @@ func TestAppendCapabilities(t *testing.T) {
wantCaps = append(wantCaps, newCaps...)
for i, got := range gotCaps {
- assert.Equal(t, kslib.CapabilityID(wantCaps[i]), kslib.CapabilityID(got))
+ assert.Equal(t, internal.CapabilityID(wantCaps[i]), internal.CapabilityID(got))
}
// trying to append an existing capability should not change the result
diff --git a/deployment/keystone/changeset/test/helpers.go b/deployment/keystone/changeset/test/helpers.go
index 94a65920cf5..5ddaeda524e 100644
--- a/deployment/keystone/changeset/test/helpers.go
+++ b/deployment/keystone/changeset/test/helpers.go
@@ -22,9 +22,8 @@ import (
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
commontypes "github.com/smartcontractkit/chainlink/deployment/common/types"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
- "github.com/smartcontractkit/chainlink/deployment/keystone"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
kschangeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
@@ -81,8 +80,8 @@ type TestEnv struct {
AssetNodes map[string]memory.Node
}
-func (te TestEnv) ContractSets() map[uint64]kslib.ContractSet {
- r, err := kslib.GetContractSets(te.Env.Logger, &kslib.GetContractSetsRequest{
+func (te TestEnv) ContractSets() map[uint64]internal.ContractSet {
+ r, err := internal.GetContractSets(te.Env.Logger, &internal.GetContractSetsRequest{
Chains: te.Env.Chains,
AddressBook: te.Env.ExistingAddresses,
})
@@ -118,7 +117,7 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv {
},
{
Changeset: commonchangeset.WrapChangeSet(kschangeset.DeployForwarder),
- Config: registryChainSel,
+ Config: kschangeset.DeployForwarderRequest{},
},
{
Changeset: commonchangeset.WrapChangeSet(workflowregistry.Deploy),
@@ -153,35 +152,35 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv {
// TODO: partition nodes into multiple nops
- wfDon := keystone.DonCapabilities{
- Name: keystone.WFDonName,
- Nops: []keystone.NOP{
+ wfDon := internal.DonCapabilities{
+ Name: internal.WFDonName,
+ Nops: []internal.NOP{
{
Name: "nop 1",
Nodes: maps.Keys(wfNodes),
},
},
- Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.OCR3Cap},
+ Capabilities: []kcr.CapabilitiesRegistryCapability{internal.OCR3Cap},
}
- cwDon := keystone.DonCapabilities{
- Name: keystone.TargetDonName,
- Nops: []keystone.NOP{
+ cwDon := internal.DonCapabilities{
+ Name: internal.TargetDonName,
+ Nops: []internal.NOP{
{
Name: "nop 2",
Nodes: maps.Keys(cwNodes),
},
},
- Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.WriteChainCap},
+ Capabilities: []kcr.CapabilitiesRegistryCapability{internal.WriteChainCap},
}
- assetDon := keystone.DonCapabilities{
- Name: keystone.StreamDonName,
- Nops: []keystone.NOP{
+ assetDon := internal.DonCapabilities{
+ Name: internal.StreamDonName,
+ Nops: []internal.NOP{
{
Name: "nop 3",
Nodes: maps.Keys(assetNodes),
},
},
- Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.StreamTriggerCap},
+ Capabilities: []kcr.CapabilitiesRegistryCapability{internal.StreamTriggerCap},
}
allChains := make(map[uint64]deployment.Chain)
@@ -196,10 +195,10 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv {
err = env.ExistingAddresses.Merge(e.ExistingAddresses)
require.NoError(t, err)
- var ocr3Config = keystone.OracleConfig{
+ var ocr3Config = internal.OracleConfig{
MaxFaultyOracles: len(wfNodes) / 3,
}
- var allDons = []keystone.DonCapabilities{wfDon, cwDon, assetDon}
+ var allDons = []internal.DonCapabilities{wfDon, cwDon, assetDon}
csOut, err := kschangeset.ConfigureInitialContractsChangeset(env, kschangeset.InitialContractsCfg{
RegistryChainSel: registryChainSel,
@@ -209,12 +208,12 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv {
require.NoError(t, err)
require.Nil(t, csOut.AddressBook, "no new addresses should be created in configure initial contracts")
- req := &keystone.GetContractSetsRequest{
+ req := &internal.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
}
- contractSetsResp, err := keystone.GetContractSets(lggr, req)
+ contractSetsResp, err := internal.GetContractSets(lggr, req)
require.NoError(t, err)
require.Len(t, contractSetsResp.ContractSets, len(env.Chains))
// check the registry
@@ -249,7 +248,7 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv {
})
require.NoError(t, err)
// extract the MCMS address
- r, err := kslib.GetContractSets(lggr, &kslib.GetContractSetsRequest{
+ r, err := internal.GetContractSets(lggr, &internal.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
@@ -311,7 +310,7 @@ func validateInitialChainState(t *testing.T, env deployment.Environment, registr
}
containsForwarder := false
for _, tv := range chainAddrs {
- if tv.Type == keystone.KeystoneForwarder {
+ if tv.Type == internal.KeystoneForwarder {
containsForwarder = true
break
}
@@ -331,7 +330,7 @@ func validateNodes(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes ma
}
// validateDon checks that the don exists and has the expected capabilities
-func validateDon(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes map[string]memory.Node, don kslib.DonCapabilities) {
+func validateDon(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes map[string]memory.Node, don internal.DonCapabilities) {
gotDons, err := gotRegistry.GetDONs(nil)
require.NoError(t, err)
wantP2PID := sortedHash(p2pIDs(t, maps.Keys(nodes)))
@@ -370,7 +369,7 @@ func p2pIDs(t *testing.T, vals []string) [][32]byte {
return out
}
-func expectedHashedCapabilities(t *testing.T, registry *kcr.CapabilitiesRegistry, don kslib.DonCapabilities) [][32]byte {
+func expectedHashedCapabilities(t *testing.T, registry *kcr.CapabilitiesRegistry, don internal.DonCapabilities) [][32]byte {
out := make([][32]byte, len(don.Capabilities))
var err error
for i, cap := range don.Capabilities {
diff --git a/deployment/keystone/changeset/update_don.go b/deployment/keystone/changeset/update_don.go
index fd1312448ef..5b381a4e498 100644
--- a/deployment/keystone/changeset/update_don.go
+++ b/deployment/keystone/changeset/update_don.go
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
@@ -100,7 +99,7 @@ func appendRequest(r *UpdateDonRequest) *AppendNodeCapabilitiesRequest {
}
func updateDonRequest(env deployment.Environment, r *UpdateDonRequest) (*internal.UpdateDonRequest, error) {
- resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ resp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go
index c386228b4a2..8c4d01159ed 100644
--- a/deployment/keystone/changeset/update_node_capabilities.go
+++ b/deployment/keystone/changeset/update_node_capabilities.go
@@ -11,7 +11,6 @@ import (
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
@@ -84,7 +83,7 @@ func (req *MutateNodeCapabilitiesRequest) updateNodeCapabilitiesImplRequest(e de
if !ok {
return nil, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel)
}
- resp, err := kslib.GetContractSets(e.Logger, &kslib.GetContractSetsRequest{
+ resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{
Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain},
AddressBook: e.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go
index bb12f32cb94..10a7ad4e441 100644
--- a/deployment/keystone/changeset/update_nodes.go
+++ b/deployment/keystone/changeset/update_nodes.go
@@ -10,7 +10,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
)
@@ -50,7 +49,7 @@ func UpdateNodes(env deployment.Environment, req *UpdateNodesRequest) (deploymen
if !ok {
return deployment.ChangesetOutput{}, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel)
}
- cresp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/view.go b/deployment/keystone/changeset/view.go
index 417484ed6aa..9c8678d8778 100644
--- a/deployment/keystone/changeset/view.go
+++ b/deployment/keystone/changeset/view.go
@@ -8,14 +8,14 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
commonview "github.com/smartcontractkit/chainlink/deployment/common/view"
- "github.com/smartcontractkit/chainlink/deployment/keystone"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment/keystone/view"
)
var _ deployment.ViewState = ViewKeystone
func ViewKeystone(e deployment.Environment) (json.Marshaler, error) {
- state, err := keystone.GetContractSets(e.Logger, &keystone.GetContractSetsRequest{
+ state, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{
Chains: e.Chains,
AddressBook: e.ExistingAddresses,
})
diff --git a/deployment/keystone/changeset/view_test.go b/deployment/keystone/changeset/view_test.go
index 023b4462549..5b32699fd89 100644
--- a/deployment/keystone/changeset/view_test.go
+++ b/deployment/keystone/changeset/view_test.go
@@ -26,7 +26,7 @@ func TestKeystoneView(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, resp)
require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook))
- resp, err = DeployForwarder(env, registryChain)
+ resp, err = DeployForwarder(env, DeployForwarderRequest{})
require.NoError(t, err)
require.NotNil(t, resp)
require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook))
diff --git a/deployment/keystone/changeset/workflowregistry/deploy.go b/deployment/keystone/changeset/workflowregistry/deploy.go
index 352336dd168..e55484aa711 100644
--- a/deployment/keystone/changeset/workflowregistry/deploy.go
+++ b/deployment/keystone/changeset/workflowregistry/deploy.go
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
)
var _ deployment.ChangeSet[uint64] = Deploy
@@ -16,7 +15,7 @@ func Deploy(env deployment.Environment, registrySelector uint64) (deployment.Cha
return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment")
}
ab := deployment.NewMemoryAddressBook()
- wrResp, err := kslib.DeployWorkflowRegistry(chain, ab)
+ wrResp, err := deployWorkflowRegistry(chain, ab)
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy CapabilitiesRegistry: %w", err)
}
diff --git a/deployment/keystone/changeset/workflowregistry/setup_test.go b/deployment/keystone/changeset/workflowregistry/setup_test.go
new file mode 100644
index 00000000000..78e7d852080
--- /dev/null
+++ b/deployment/keystone/changeset/workflowregistry/setup_test.go
@@ -0,0 +1,54 @@
+package workflowregistry
+
+import (
+ "testing"
+
+ "github.com/smartcontractkit/chainlink-common/pkg/logger"
+ "github.com/smartcontractkit/chainlink/deployment"
+ "github.com/smartcontractkit/chainlink/deployment/environment/memory"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
+ workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper"
+ "github.com/stretchr/testify/require"
+)
+
+type SetupTestWorkflowRegistryResponse struct {
+ Registry *workflow_registry.WorkflowRegistry
+ Chain deployment.Chain
+ RegistrySelector uint64
+ AddressBook deployment.AddressBook
+}
+
+func SetupTestWorkflowRegistry(t *testing.T, lggr logger.Logger, chainSel uint64) *SetupTestWorkflowRegistryResponse {
+ chain := testChain(t)
+
+ deployer, err := newWorkflowRegistryDeployer()
+ require.NoError(t, err)
+ resp, err := deployer.Deploy(changeset.DeployRequest{Chain: chain})
+ require.NoError(t, err)
+
+ addressBook := deployment.NewMemoryAddressBookFromMap(
+ map[uint64]map[string]deployment.TypeAndVersion{
+ chainSel: map[string]deployment.TypeAndVersion{
+ resp.Address.Hex(): resp.Tv,
+ },
+ },
+ )
+
+ return &SetupTestWorkflowRegistryResponse{
+ Registry: deployer.Contract(),
+ Chain: chain,
+ RegistrySelector: chain.Selector,
+ AddressBook: addressBook,
+ }
+}
+
+func testChain(t *testing.T) deployment.Chain {
+ chains, _ := memory.NewMemoryChains(t, 1, 5)
+ var chain deployment.Chain
+ for _, c := range chains {
+ chain = c
+ break
+ }
+ require.NotEmpty(t, chain)
+ return chain
+}
diff --git a/deployment/keystone/changeset/workflowregistry/strategies.go b/deployment/keystone/changeset/workflowregistry/strategies.go
index f799092d4ce..617d6e6e8dc 100644
--- a/deployment/keystone/changeset/workflowregistry/strategies.go
+++ b/deployment/keystone/changeset/workflowregistry/strategies.go
@@ -13,7 +13,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
)
@@ -40,7 +39,7 @@ type mcmsTransaction struct {
Description string
Address common.Address
ChainSel uint64
- ContractSet *kslib.ContractSet
+ ContractSet *changeset.ContractSet
}
func (m *mcmsTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Transaction, error)) (deployment.ChangesetOutput, error) {
diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go
index b07414221dd..5001370b552 100644
--- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go
+++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go
@@ -9,7 +9,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper"
)
@@ -37,7 +36,7 @@ func UpdateAllowedDons(env deployment.Environment, req *UpdateAllowedDonsRequest
return deployment.ChangesetOutput{}, err
}
- resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
@@ -74,7 +73,7 @@ func UpdateAllowedDons(env deployment.Environment, req *UpdateAllowedDonsRequest
return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) {
tx, err := registry.UpdateAllowedDONs(opts, req.DonIDs, req.Allowed)
if err != nil {
- err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err)
+ err = deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err)
}
return tx, err
})
diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go
index bb17a85b1aa..f24db609553 100644
--- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go
+++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go
@@ -15,7 +15,6 @@ import (
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
- kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry"
)
@@ -24,7 +23,7 @@ func TestUpdateAllowedDons(t *testing.T) {
lggr := logger.Test(t)
chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector
- resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel)
+ resp := workflowregistry.SetupTestWorkflowRegistry(t, lggr, chainSel)
registry := resp.Registry
dons, err := registry.GetAllAllowedDONs(&bind.CallOpts{})
diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go
index f05c6cd58c9..b2d5ffcce1e 100644
--- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go
+++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go
@@ -10,7 +10,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment"
- kslib "github.com/smartcontractkit/chainlink/deployment/keystone"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper"
)
@@ -35,7 +34,7 @@ func (r *UpdateAuthorizedAddressesRequest) Validate() error {
}
func getWorkflowRegistry(env deployment.Environment, chainSel uint64) (*workflow_registry.WorkflowRegistry, error) {
- resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
@@ -57,7 +56,7 @@ func UpdateAuthorizedAddresses(env deployment.Environment, req *UpdateAuthorized
return deployment.ChangesetOutput{}, err
}
- resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{
+ resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: env.ExistingAddresses,
})
@@ -99,7 +98,7 @@ func UpdateAuthorizedAddresses(env deployment.Environment, req *UpdateAuthorized
return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) {
tx, err := registry.UpdateAuthorizedAddresses(opts, addr, req.Allowed)
if err != nil {
- err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err)
+ err = deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err)
}
return tx, err
})
diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go
index 36dfd4371b1..a8d969fce0c 100644
--- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go
+++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go
@@ -16,7 +16,6 @@ import (
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
- kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test"
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry"
)
@@ -25,7 +24,7 @@ func TestUpdateAuthorizedAddresses(t *testing.T) {
lggr := logger.Test(t)
chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector
- resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel)
+ resp := workflowregistry.SetupTestWorkflowRegistry(t, lggr, chainSel)
registry := resp.Registry
dons, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{})
diff --git a/deployment/keystone/workflow_registry_deployer.go b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go
similarity index 50%
rename from deployment/keystone/workflow_registry_deployer.go
rename to deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go
index 794e6ad0202..ac5bbd16cc8 100644
--- a/deployment/keystone/workflow_registry_deployer.go
+++ b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go
@@ -1,4 +1,4 @@
-package keystone
+package workflowregistry
import (
"fmt"
@@ -8,38 +8,34 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/deployment"
+ "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper"
)
-type WorkflowRegistryDeployer struct {
+type workflowRegistryDeployer struct {
lggr logger.Logger
contract *workflow_registry.WorkflowRegistry
}
-func NewWorkflowRegistryDeployer() (*WorkflowRegistryDeployer, error) {
+func newWorkflowRegistryDeployer() (*workflowRegistryDeployer, error) {
lggr, err := logger.New()
if err != nil {
return nil, err
}
- return &WorkflowRegistryDeployer{lggr: lggr}, nil
+ return &workflowRegistryDeployer{lggr: lggr}, nil
}
-func (c *WorkflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistry {
+func (c *workflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistry {
return c.contract
}
-func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, error) {
- est, err := estimateDeploymentGas(req.Chain.Client, workflow_registry.WorkflowRegistryABI)
- if err != nil {
- return nil, fmt.Errorf("failed to estimate gas: %w", err)
- }
- c.lggr.Debugf("WorkflowRegistry estimated gas: %d", est)
+func (c *workflowRegistryDeployer) Deploy(req changeset.DeployRequest) (*changeset.DeployResponse, error) {
addr, tx, wr, err := workflow_registry.DeployWorkflowRegistry(
req.Chain.DeployerKey,
req.Chain.Client)
if err != nil {
- return nil, DecodeErr(workflow_registry.WorkflowRegistryABI, err)
+ return nil, deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err)
}
_, err = req.Chain.Confirm(tx)
@@ -55,7 +51,7 @@ func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, e
if err != nil {
return nil, fmt.Errorf("failed to parse type and version from %s: %w", tvStr, err)
}
- resp := &DeployResponse{
+ resp := &changeset.DeployResponse{
Address: addr,
Tx: tx.Hash(),
Tv: tv,
@@ -63,3 +59,18 @@ func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, e
c.contract = wr
return resp, nil
}
+
+// deployWorkflowRegistry deploys the WorkflowRegistry contract to the chain
+// and saves the address in the address book. This mutates the address book.
+func deployWorkflowRegistry(chain deployment.Chain, ab deployment.AddressBook) (*changeset.DeployResponse, error) {
+ deployer, err := newWorkflowRegistryDeployer()
+ resp, err := deployer.Deploy(changeset.DeployRequest{Chain: chain})
+ if err != nil {
+ return nil, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err)
+ }
+ err = ab.Save(chain.Selector, resp.Address.String(), resp.Tv)
+ if err != nil {
+ return nil, fmt.Errorf("failed to save WorkflowRegistry: %w", err)
+ }
+ return resp, nil
+}
diff --git a/deployment/keystone/deprecated.go b/deployment/keystone/deprecated.go
new file mode 100644
index 00000000000..0e85cbedb17
--- /dev/null
+++ b/deployment/keystone/deprecated.go
@@ -0,0 +1,127 @@
+package keystone
+
+import "github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
+
+//TODO: delete this after the downstream migration is done
+
+// DEPRECATED: Use changeset package instead
+// OracleConfig is the configuration for an oracle
+type OracleConfig = changeset.OracleConfig
+
+// DEPRECATED: Use changeset package instead
+// OCR3OnchainConfig is the onchain configuration of an OCR2 contract
+type OCR2OracleConfig = changeset.OCR3OnchainConfig
+
+// DEPRECATED: Use changeset package instead
+// NodeKeys is a set of public keys for a node
+type NodeKeys = changeset.NodeKeys
+
+// DEPRECATED: Use changeset package instead
+// TopLevelConfigSource is the top level configuration source
+type TopLevelConfigSource = changeset.TopLevelConfigSource
+
+// DEPRECATED: Use changeset package instead
+// GenerateOCR3Config generates an OCR3 config
+var GenerateOCR3Config = changeset.GenerateOCR3Config
+
+// DEPRECATED: Use changeset package instead
+// FeedConsumer is a feed consumer contract type
+var FeedConsumer = changeset.FeedConsumer
+
+// DEPRECATED: Use changeset package instead
+// KeystoneForwarder is a keystone forwarder contract type
+var KeystoneForwarder = changeset.KeystoneForwarder
+
+// DEPRECATED: Use changeset package instead
+// GetContractSetsRequest is a request to get contract sets
+type GetContractSetsRequest = changeset.GetContractSetsRequest
+
+// DEPRECATED: Use changeset package instead
+// GetContractSetsResponse is a response to get contract sets
+type GetContractSetsResponse = changeset.GetContractSetsResponse
+
+// DEPRECATED: Use changeset package instead
+// GetContractSets gets contract sets
+var GetContractSets = changeset.GetContractSets
+
+// DEPRECATED: Use changeset package instead
+// RegisterCapabilitiesRequest is a request to register capabilities
+type RegisterCapabilitiesRequest = changeset.RegisterCapabilitiesRequest
+
+// DEPRECATED: Use changeset package instead
+// RegisterCapabilitiesResponse is a response to register capabilities
+type RegisterCapabilitiesResponse = changeset.RegisterCapabilitiesResponse
+
+// DEPRECATED: Use changeset package instead
+// RegisterCapabilities registers capabilities
+var RegisterCapabilities = changeset.RegisterCapabilities
+
+// DEPRECATED: Use changeset package instead
+// RegisterNOPSRequest is a request to register NOPS
+type RegisterNOPSRequest = changeset.RegisterNOPSRequest
+
+// DEPRECATED: Use changeset package instead
+// RegisterNOPSResponse is a response to register NOPS
+type RegisterNOPSResponse = changeset.RegisterNOPSResponse
+
+// DEPRECATED: Use changeset package instead
+// RegisterNOPS registers NOPS
+var RegisterNOPS = changeset.RegisterNOPS
+
+// DEPRECATED: Use changeset package instead
+// RegisterNodesRequest is a request to register nodes with the capabilities registry
+type RegisterNodesRequest = changeset.RegisterNodesRequest
+
+// DEPRECATED: Use changeset package instead
+// RegisterNodesResponse is a response to register nodes with the capabilities registry
+type RegisterNodesResponse = changeset.RegisterNodesResponse
+
+// DEPRECATED: Use changeset package instead
+// RegisterNodes registers nodes with the capabilities registry
+var RegisterNodes = changeset.RegisterNodes
+
+// DEPRECATED: Use changeset package instead
+// RegisteredCapability is a wrapper of a capability and its ID
+type RegisteredCapability = changeset.RegisteredCapability
+
+// DEPRECATED: Use changeset package instead
+// FromCapabilitiesRegistryCapability converts a capabilities registry capability to a registered capability
+var FromCapabilitiesRegistryCapability = changeset.FromCapabilitiesRegistryCapability
+
+// DEPRECATED: Use changeset package instead
+// RegisterDonsRequest is a request to register Dons with the capabilities registry
+type RegisterDonsRequest = changeset.RegisterDonsRequest
+
+// DEPRECATED: Use changeset package instead
+// RegisterDonsResponse is a response to register Dons with the capabilities registry
+type RegisterDonsResponse = changeset.RegisterDonsResponse
+
+// DEPRECATED: Use changeset package instead
+// RegisterDons registers Dons with the capabilities registry
+var RegisterDons = changeset.RegisterDons
+
+// DEPRECATED: Use changeset package instead
+// DONToRegister is the minimal information needed to register a DON with the capabilities registry
+type DONToRegister = changeset.DONToRegister
+
+// DEPRECATED: Use changeset package instead
+// ConfigureContractsRequest is a request to configure ALL the contracts
+type ConfigureContractsRequest = changeset.ConfigureContractsRequest
+
+// DEPRECATED: Use changeset package instead
+// ConfigureContractsResponse is a response to configure ALL the contracts
+type ConfigureContractsResponse = changeset.ConfigureContractsResponse
+
+// DEPRECATED: Use changeset package instead
+// DonCapabilities is a set of capabilities hosted by a set of node operators
+// in is in a convenient form to handle the CLO representation of the nop data
+type DonCapabilities = changeset.DonCapabilities
+
+// DEPRECATED: Use changeset package instead
+type DeployRequest = changeset.DeployRequest
+
+// DEPRECATED: Use changeset package instead
+type DeployResponse = changeset.DeployResponse
+
+// DEPRECATED: Use changeset package instead
+type ContractSet = changeset.ContractSet
diff --git a/deployment/keystone/test/changeset/capability_registry.go b/deployment/keystone/test/changeset/capability_registry.go
index dad41415510..98f1e752f5a 100644
--- a/deployment/keystone/test/changeset/capability_registry.go
+++ b/deployment/keystone/test/changeset/capability_registry.go
@@ -7,8 +7,9 @@ import (
chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/chainlink/deployment"
+
"github.com/smartcontractkit/chainlink/deployment/common/view/v1_0"
- "github.com/smartcontractkit/chainlink/deployment/keystone"
+
"github.com/smartcontractkit/chainlink/deployment/keystone/changeset"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
)
@@ -33,7 +34,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env
return nil, fmt.Errorf("failed to deploy contract: %w", err)
}
- resp, err := keystone.GetContractSets(env.Logger, &keystone.GetContractSetsRequest{
+ resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{
Chains: env.Chains,
AddressBook: changesetOutput.AddressBook,
})
@@ -49,13 +50,13 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env
nopsParams := v.NopsToNopsParams()
tx, err := deployedContract.AddNodeOperators(chain.DeployerKey, nopsParams)
- if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
+ if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
return nil, fmt.Errorf("failed to add node operators: %w", err)
}
capabilitiesParams := v.CapabilitiesToCapabilitiesParams()
tx, err = deployedContract.AddCapabilities(chain.DeployerKey, capabilitiesParams)
- if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
+ if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
return nil, fmt.Errorf("failed to add capabilities: %w", err)
}
@@ -64,7 +65,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env
return nil, fmt.Errorf("failed to convert nodes to nodes params: %w", err)
}
tx, err = deployedContract.AddNodes(chain.DeployerKey, nodesParams)
- if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
+ if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
return nil, fmt.Errorf("failed to add nodes: %w", err)
}
@@ -78,7 +79,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env
peerIds = append(peerIds, id)
}
tx, err = deployedContract.AddDON(chain.DeployerKey, peerIds, cfgs, don.IsPublic, don.AcceptsWorkflows, don.F)
- if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
+ if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil {
return nil, fmt.Errorf("failed to add don: %w", err)
}
}
From 30b857bf1bcd0c6234716d9aa1bf8f81feb9e956 Mon Sep 17 00:00:00 2001
From: Adam Hamrick
+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 10 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '1s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 5 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 100 +RPCBlockQueryDelay = 10 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 500 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'FeeHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 8000000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 10 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 100 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[HeadTracker] +HistoryDepth = 50 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +
```toml @@ -7867,6 +7971,110 @@ GasLimitDefault = 400000
+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 10 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '1s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 5 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 100 +RPCBlockQueryDelay = 10 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +Enabled = true +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 500 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'FeeHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 8000000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 10 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 100 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '2s' + +[HeadTracker] +HistoryDepth = 50 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +
```toml
From 0fb754617727e72b31956d7a089b98f3d3417c64 Mon Sep 17 00:00:00 2001
From: Jordan Krage