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 b94c0236155..b4a8fdc0450 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 4066c76037e..057605c14cd 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 45272ad3f17..af038708db4 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -85,12 +85,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 -}