refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
This commit is contained in:
21
dev/env/node_modules/@openzeppelin/contracts/account/utils/EIP7702Utils.sol
generated
vendored
Executable file
21
dev/env/node_modules/@openzeppelin/contracts/account/utils/EIP7702Utils.sol
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v5.4.0) (account/utils/EIP7702Utils.sol)
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
/**
|
||||
* @dev Library with common EIP-7702 utility functions.
|
||||
*
|
||||
* See https://eips.ethereum.org/EIPS/eip-7702[ERC-7702].
|
||||
*/
|
||||
library EIP7702Utils {
|
||||
bytes3 internal constant EIP7702_PREFIX = 0xef0100;
|
||||
|
||||
/**
|
||||
* @dev Returns the address of the delegate if `account` as an EIP-7702 delegation setup, or address(0) otherwise.
|
||||
*/
|
||||
function fetchDelegate(address account) internal view returns (address) {
|
||||
bytes23 delegation = bytes23(account.code);
|
||||
return bytes3(delegation) == EIP7702_PREFIX ? address(bytes20(delegation << 24)) : address(0);
|
||||
}
|
||||
}
|
||||
159
dev/env/node_modules/@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol
generated
vendored
Executable file
159
dev/env/node_modules/@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol
generated
vendored
Executable file
@@ -0,0 +1,159 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v5.3.0) (account/utils/draft-ERC4337Utils.sol)
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {IEntryPoint, PackedUserOperation} from "../../interfaces/draft-IERC4337.sol";
|
||||
import {Math} from "../../utils/math/Math.sol";
|
||||
import {Calldata} from "../../utils/Calldata.sol";
|
||||
import {Packing} from "../../utils/Packing.sol";
|
||||
|
||||
/// @dev This is available on all entrypoint since v0.4.0, but is not formally part of the ERC.
|
||||
interface IEntryPointExtra {
|
||||
function getUserOpHash(PackedUserOperation calldata userOp) external view returns (bytes32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Library with common ERC-4337 utility functions.
|
||||
*
|
||||
* See https://eips.ethereum.org/EIPS/eip-4337[ERC-4337].
|
||||
*/
|
||||
library ERC4337Utils {
|
||||
using Packing for *;
|
||||
|
||||
/// @dev Address of the entrypoint v0.7.0
|
||||
IEntryPoint internal constant ENTRYPOINT_V07 = IEntryPoint(0x0000000071727De22E5E9d8BAf0edAc6f37da032);
|
||||
|
||||
/// @dev Address of the entrypoint v0.8.0
|
||||
IEntryPoint internal constant ENTRYPOINT_V08 = IEntryPoint(0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108);
|
||||
|
||||
/// @dev For simulation purposes, validateUserOp (and validatePaymasterUserOp) return this value on success.
|
||||
uint256 internal constant SIG_VALIDATION_SUCCESS = 0;
|
||||
|
||||
/// @dev For simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value in case of signature failure, instead of revert.
|
||||
uint256 internal constant SIG_VALIDATION_FAILED = 1;
|
||||
|
||||
/// @dev Parses the validation data into its components. See {packValidationData}.
|
||||
function parseValidationData(
|
||||
uint256 validationData
|
||||
) internal pure returns (address aggregator, uint48 validAfter, uint48 validUntil) {
|
||||
validAfter = uint48(bytes32(validationData).extract_32_6(0));
|
||||
validUntil = uint48(bytes32(validationData).extract_32_6(6));
|
||||
aggregator = address(bytes32(validationData).extract_32_20(12));
|
||||
if (validUntil == 0) validUntil = type(uint48).max;
|
||||
}
|
||||
|
||||
/// @dev Packs the validation data into a single uint256. See {parseValidationData}.
|
||||
function packValidationData(
|
||||
address aggregator,
|
||||
uint48 validAfter,
|
||||
uint48 validUntil
|
||||
) internal pure returns (uint256) {
|
||||
return uint256(bytes6(validAfter).pack_6_6(bytes6(validUntil)).pack_12_20(bytes20(aggregator)));
|
||||
}
|
||||
|
||||
/// @dev Same as {packValidationData}, but with a boolean signature success flag.
|
||||
function packValidationData(bool sigSuccess, uint48 validAfter, uint48 validUntil) internal pure returns (uint256) {
|
||||
return
|
||||
packValidationData(
|
||||
address(uint160(Math.ternary(sigSuccess, SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILED))),
|
||||
validAfter,
|
||||
validUntil
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Combines two validation data into a single one.
|
||||
*
|
||||
* The `aggregator` is set to {SIG_VALIDATION_SUCCESS} if both are successful, while
|
||||
* the `validAfter` is the maximum and the `validUntil` is the minimum of both.
|
||||
*/
|
||||
function combineValidationData(uint256 validationData1, uint256 validationData2) internal pure returns (uint256) {
|
||||
(address aggregator1, uint48 validAfter1, uint48 validUntil1) = parseValidationData(validationData1);
|
||||
(address aggregator2, uint48 validAfter2, uint48 validUntil2) = parseValidationData(validationData2);
|
||||
|
||||
bool success = aggregator1 == address(uint160(SIG_VALIDATION_SUCCESS)) &&
|
||||
aggregator2 == address(uint160(SIG_VALIDATION_SUCCESS));
|
||||
uint48 validAfter = uint48(Math.max(validAfter1, validAfter2));
|
||||
uint48 validUntil = uint48(Math.min(validUntil1, validUntil2));
|
||||
return packValidationData(success, validAfter, validUntil);
|
||||
}
|
||||
|
||||
/// @dev Returns the aggregator of the `validationData` and whether it is out of time range.
|
||||
function getValidationData(uint256 validationData) internal view returns (address aggregator, bool outOfTimeRange) {
|
||||
(address aggregator_, uint48 validAfter, uint48 validUntil) = parseValidationData(validationData);
|
||||
return (aggregator_, block.timestamp < validAfter || validUntil < block.timestamp);
|
||||
}
|
||||
|
||||
/// @dev Get the hash of a user operation for a given entrypoint
|
||||
function hash(PackedUserOperation calldata self, address entrypoint) internal view returns (bytes32) {
|
||||
// NOTE: getUserOpHash is available since v0.4.0
|
||||
//
|
||||
// Prior to v0.8.0, this was easy to replicate for any entrypoint and chainId. Since v0.8.0 of the
|
||||
// entrypoint, this depends on the Entrypoint's domain separator, which cannot be hardcoded and is complex
|
||||
// to recompute. Domain separator could be fetch using the `getDomainSeparatorV4` getter, or recomputed from
|
||||
// the ERC-5267 getter, but both operation would require doing a view call to the entrypoint. Overall it feels
|
||||
// simpler and less error prone to get that functionality from the entrypoint directly.
|
||||
return IEntryPointExtra(entrypoint).getUserOpHash(self);
|
||||
}
|
||||
|
||||
/// @dev Returns `factory` from the {PackedUserOperation}, or address(0) if the initCode is empty or not properly formatted.
|
||||
function factory(PackedUserOperation calldata self) internal pure returns (address) {
|
||||
return self.initCode.length < 20 ? address(0) : address(bytes20(self.initCode[0:20]));
|
||||
}
|
||||
|
||||
/// @dev Returns `factoryData` from the {PackedUserOperation}, or empty bytes if the initCode is empty or not properly formatted.
|
||||
function factoryData(PackedUserOperation calldata self) internal pure returns (bytes calldata) {
|
||||
return self.initCode.length < 20 ? Calldata.emptyBytes() : self.initCode[20:];
|
||||
}
|
||||
|
||||
/// @dev Returns `verificationGasLimit` from the {PackedUserOperation}.
|
||||
function verificationGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return uint128(self.accountGasLimits.extract_32_16(0));
|
||||
}
|
||||
|
||||
/// @dev Returns `callGasLimit` from the {PackedUserOperation}.
|
||||
function callGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return uint128(self.accountGasLimits.extract_32_16(16));
|
||||
}
|
||||
|
||||
/// @dev Returns the first section of `gasFees` from the {PackedUserOperation}.
|
||||
function maxPriorityFeePerGas(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return uint128(self.gasFees.extract_32_16(0));
|
||||
}
|
||||
|
||||
/// @dev Returns the second section of `gasFees` from the {PackedUserOperation}.
|
||||
function maxFeePerGas(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return uint128(self.gasFees.extract_32_16(16));
|
||||
}
|
||||
|
||||
/// @dev Returns the total gas price for the {PackedUserOperation} (ie. `maxFeePerGas` or `maxPriorityFeePerGas + basefee`).
|
||||
function gasPrice(PackedUserOperation calldata self) internal view returns (uint256) {
|
||||
unchecked {
|
||||
// Following values are "per gas"
|
||||
uint256 maxPriorityFee = maxPriorityFeePerGas(self);
|
||||
uint256 maxFee = maxFeePerGas(self);
|
||||
return Math.min(maxFee, maxPriorityFee + block.basefee);
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Returns the first section of `paymasterAndData` from the {PackedUserOperation}.
|
||||
function paymaster(PackedUserOperation calldata self) internal pure returns (address) {
|
||||
return self.paymasterAndData.length < 52 ? address(0) : address(bytes20(self.paymasterAndData[0:20]));
|
||||
}
|
||||
|
||||
/// @dev Returns the second section of `paymasterAndData` from the {PackedUserOperation}.
|
||||
function paymasterVerificationGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return self.paymasterAndData.length < 52 ? 0 : uint128(bytes16(self.paymasterAndData[20:36]));
|
||||
}
|
||||
|
||||
/// @dev Returns the third section of `paymasterAndData` from the {PackedUserOperation}.
|
||||
function paymasterPostOpGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {
|
||||
return self.paymasterAndData.length < 52 ? 0 : uint128(bytes16(self.paymasterAndData[36:52]));
|
||||
}
|
||||
|
||||
/// @dev Returns the fourth section of `paymasterAndData` from the {PackedUserOperation}.
|
||||
function paymasterData(PackedUserOperation calldata self) internal pure returns (bytes calldata) {
|
||||
return self.paymasterAndData.length < 52 ? Calldata.emptyBytes() : self.paymasterAndData[52:];
|
||||
}
|
||||
}
|
||||
280
dev/env/node_modules/@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol
generated
vendored
Executable file
280
dev/env/node_modules/@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol
generated
vendored
Executable file
@@ -0,0 +1,280 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v5.4.0) (account/utils/draft-ERC7579Utils.sol)
|
||||
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Execution} from "../../interfaces/draft-IERC7579.sol";
|
||||
import {Packing} from "../../utils/Packing.sol";
|
||||
import {Address} from "../../utils/Address.sol";
|
||||
|
||||
type Mode is bytes32;
|
||||
type CallType is bytes1;
|
||||
type ExecType is bytes1;
|
||||
type ModeSelector is bytes4;
|
||||
type ModePayload is bytes22;
|
||||
|
||||
/**
|
||||
* @dev Library with common ERC-7579 utility functions.
|
||||
*
|
||||
* See https://eips.ethereum.org/EIPS/eip-7579[ERC-7579].
|
||||
*/
|
||||
// slither-disable-next-line unused-state
|
||||
library ERC7579Utils {
|
||||
using Packing for *;
|
||||
|
||||
/// @dev A single `call` execution.
|
||||
CallType internal constant CALLTYPE_SINGLE = CallType.wrap(0x00);
|
||||
|
||||
/// @dev A batch of `call` executions.
|
||||
CallType internal constant CALLTYPE_BATCH = CallType.wrap(0x01);
|
||||
|
||||
/// @dev A `delegatecall` execution.
|
||||
CallType internal constant CALLTYPE_DELEGATECALL = CallType.wrap(0xFF);
|
||||
|
||||
/// @dev Default execution type that reverts on failure.
|
||||
ExecType internal constant EXECTYPE_DEFAULT = ExecType.wrap(0x00);
|
||||
|
||||
/// @dev Execution type that does not revert on failure.
|
||||
ExecType internal constant EXECTYPE_TRY = ExecType.wrap(0x01);
|
||||
|
||||
/**
|
||||
* @dev Emits when an {EXECTYPE_TRY} execution fails.
|
||||
* @param batchExecutionIndex The index of the failed call in the execution batch.
|
||||
* @param returndata The returned data from the failed call.
|
||||
*/
|
||||
event ERC7579TryExecuteFail(uint256 batchExecutionIndex, bytes returndata);
|
||||
|
||||
/// @dev The provided {CallType} is not supported.
|
||||
error ERC7579UnsupportedCallType(CallType callType);
|
||||
|
||||
/// @dev The provided {ExecType} is not supported.
|
||||
error ERC7579UnsupportedExecType(ExecType execType);
|
||||
|
||||
/// @dev The provided module doesn't match the provided module type.
|
||||
error ERC7579MismatchedModuleTypeId(uint256 moduleTypeId, address module);
|
||||
|
||||
/// @dev The module is not installed.
|
||||
error ERC7579UninstalledModule(uint256 moduleTypeId, address module);
|
||||
|
||||
/// @dev The module is already installed.
|
||||
error ERC7579AlreadyInstalledModule(uint256 moduleTypeId, address module);
|
||||
|
||||
/// @dev The module type is not supported.
|
||||
error ERC7579UnsupportedModuleType(uint256 moduleTypeId);
|
||||
|
||||
/// @dev Input calldata not properly formatted and possibly malicious.
|
||||
error ERC7579DecodingError();
|
||||
|
||||
/// @dev Executes a single call.
|
||||
function execSingle(
|
||||
bytes calldata executionCalldata,
|
||||
ExecType execType
|
||||
) internal returns (bytes[] memory returnData) {
|
||||
(address target, uint256 value, bytes calldata callData) = decodeSingle(executionCalldata);
|
||||
returnData = new bytes[](1);
|
||||
returnData[0] = _call(0, execType, target, value, callData);
|
||||
}
|
||||
|
||||
/// @dev Executes a batch of calls.
|
||||
function execBatch(
|
||||
bytes calldata executionCalldata,
|
||||
ExecType execType
|
||||
) internal returns (bytes[] memory returnData) {
|
||||
Execution[] calldata executionBatch = decodeBatch(executionCalldata);
|
||||
returnData = new bytes[](executionBatch.length);
|
||||
for (uint256 i = 0; i < executionBatch.length; ++i) {
|
||||
returnData[i] = _call(
|
||||
i,
|
||||
execType,
|
||||
executionBatch[i].target,
|
||||
executionBatch[i].value,
|
||||
executionBatch[i].callData
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Executes a delegate call.
|
||||
function execDelegateCall(
|
||||
bytes calldata executionCalldata,
|
||||
ExecType execType
|
||||
) internal returns (bytes[] memory returnData) {
|
||||
(address target, bytes calldata callData) = decodeDelegate(executionCalldata);
|
||||
returnData = new bytes[](1);
|
||||
returnData[0] = _delegatecall(0, execType, target, callData);
|
||||
}
|
||||
|
||||
/// @dev Encodes the mode with the provided parameters. See {decodeMode}.
|
||||
function encodeMode(
|
||||
CallType callType,
|
||||
ExecType execType,
|
||||
ModeSelector selector,
|
||||
ModePayload payload
|
||||
) internal pure returns (Mode mode) {
|
||||
return
|
||||
Mode.wrap(
|
||||
CallType
|
||||
.unwrap(callType)
|
||||
.pack_1_1(ExecType.unwrap(execType))
|
||||
.pack_2_4(bytes4(0))
|
||||
.pack_6_4(ModeSelector.unwrap(selector))
|
||||
.pack_10_22(ModePayload.unwrap(payload))
|
||||
);
|
||||
}
|
||||
|
||||
/// @dev Decodes the mode into its parameters. See {encodeMode}.
|
||||
function decodeMode(
|
||||
Mode mode
|
||||
) internal pure returns (CallType callType, ExecType execType, ModeSelector selector, ModePayload payload) {
|
||||
return (
|
||||
CallType.wrap(Packing.extract_32_1(Mode.unwrap(mode), 0)),
|
||||
ExecType.wrap(Packing.extract_32_1(Mode.unwrap(mode), 1)),
|
||||
ModeSelector.wrap(Packing.extract_32_4(Mode.unwrap(mode), 6)),
|
||||
ModePayload.wrap(Packing.extract_32_22(Mode.unwrap(mode), 10))
|
||||
);
|
||||
}
|
||||
|
||||
/// @dev Encodes a single call execution. See {decodeSingle}.
|
||||
function encodeSingle(
|
||||
address target,
|
||||
uint256 value,
|
||||
bytes calldata callData
|
||||
) internal pure returns (bytes memory executionCalldata) {
|
||||
return abi.encodePacked(target, value, callData);
|
||||
}
|
||||
|
||||
/// @dev Decodes a single call execution. See {encodeSingle}.
|
||||
function decodeSingle(
|
||||
bytes calldata executionCalldata
|
||||
) internal pure returns (address target, uint256 value, bytes calldata callData) {
|
||||
target = address(bytes20(executionCalldata[0:20]));
|
||||
value = uint256(bytes32(executionCalldata[20:52]));
|
||||
callData = executionCalldata[52:];
|
||||
}
|
||||
|
||||
/// @dev Encodes a delegate call execution. See {decodeDelegate}.
|
||||
function encodeDelegate(
|
||||
address target,
|
||||
bytes calldata callData
|
||||
) internal pure returns (bytes memory executionCalldata) {
|
||||
return abi.encodePacked(target, callData);
|
||||
}
|
||||
|
||||
/// @dev Decodes a delegate call execution. See {encodeDelegate}.
|
||||
function decodeDelegate(
|
||||
bytes calldata executionCalldata
|
||||
) internal pure returns (address target, bytes calldata callData) {
|
||||
target = address(bytes20(executionCalldata[0:20]));
|
||||
callData = executionCalldata[20:];
|
||||
}
|
||||
|
||||
/// @dev Encodes a batch of executions. See {decodeBatch}.
|
||||
function encodeBatch(Execution[] memory executionBatch) internal pure returns (bytes memory executionCalldata) {
|
||||
return abi.encode(executionBatch);
|
||||
}
|
||||
|
||||
/// @dev Decodes a batch of executions. See {encodeBatch}.
|
||||
///
|
||||
/// NOTE: This function runs some checks and will throw a {ERC7579DecodingError} if the input is not properly formatted.
|
||||
function decodeBatch(bytes calldata executionCalldata) internal pure returns (Execution[] calldata executionBatch) {
|
||||
unchecked {
|
||||
uint256 bufferLength = executionCalldata.length;
|
||||
|
||||
// Check executionCalldata is not empty.
|
||||
if (bufferLength < 32) revert ERC7579DecodingError();
|
||||
|
||||
// Get the offset of the array (pointer to the array length).
|
||||
uint256 arrayLengthOffset = uint256(bytes32(executionCalldata[0:32]));
|
||||
|
||||
// The array length (at arrayLengthOffset) should be 32 bytes long. We check that this is within the
|
||||
// buffer bounds. Since we know bufferLength is at least 32, we can subtract with no overflow risk.
|
||||
if (arrayLengthOffset > bufferLength - 32) revert ERC7579DecodingError();
|
||||
|
||||
// Get the array length. arrayLengthOffset + 32 is bounded by bufferLength so it does not overflow.
|
||||
uint256 arrayLength = uint256(bytes32(executionCalldata[arrayLengthOffset:arrayLengthOffset + 32]));
|
||||
|
||||
// Check that the buffer is long enough to store the array elements as "offset pointer":
|
||||
// - each element of the array is an "offset pointer" to the data.
|
||||
// - each "offset pointer" (to an array element) takes 32 bytes.
|
||||
// - validity of the calldata at that location is checked when the array element is accessed, so we only
|
||||
// need to check that the buffer is large enough to hold the pointers.
|
||||
//
|
||||
// Since we know bufferLength is at least arrayLengthOffset + 32, we can subtract with no overflow risk.
|
||||
// Solidity limits length of such arrays to 2**64-1, this guarantees `arrayLength * 32` does not overflow.
|
||||
if (arrayLength > type(uint64).max || bufferLength - arrayLengthOffset - 32 < arrayLength * 32)
|
||||
revert ERC7579DecodingError();
|
||||
|
||||
assembly ("memory-safe") {
|
||||
executionBatch.offset := add(add(executionCalldata.offset, arrayLengthOffset), 0x20)
|
||||
executionBatch.length := arrayLength
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Executes a `call` to the target with the provided {ExecType}.
|
||||
function _call(
|
||||
uint256 index,
|
||||
ExecType execType,
|
||||
address target,
|
||||
uint256 value,
|
||||
bytes calldata data
|
||||
) private returns (bytes memory) {
|
||||
(bool success, bytes memory returndata) = (target == address(0) ? address(this) : target).call{value: value}(
|
||||
data
|
||||
);
|
||||
return _validateExecutionMode(index, execType, success, returndata);
|
||||
}
|
||||
|
||||
/// @dev Executes a `delegatecall` to the target with the provided {ExecType}.
|
||||
function _delegatecall(
|
||||
uint256 index,
|
||||
ExecType execType,
|
||||
address target,
|
||||
bytes calldata data
|
||||
) private returns (bytes memory) {
|
||||
(bool success, bytes memory returndata) = (target == address(0) ? address(this) : target).delegatecall(data);
|
||||
return _validateExecutionMode(index, execType, success, returndata);
|
||||
}
|
||||
|
||||
/// @dev Validates the execution mode and returns the returndata.
|
||||
function _validateExecutionMode(
|
||||
uint256 index,
|
||||
ExecType execType,
|
||||
bool success,
|
||||
bytes memory returndata
|
||||
) private returns (bytes memory) {
|
||||
if (execType == ERC7579Utils.EXECTYPE_DEFAULT) {
|
||||
Address.verifyCallResult(success, returndata);
|
||||
} else if (execType == ERC7579Utils.EXECTYPE_TRY) {
|
||||
if (!success) emit ERC7579TryExecuteFail(index, returndata);
|
||||
} else {
|
||||
revert ERC7579UnsupportedExecType(execType);
|
||||
}
|
||||
return returndata;
|
||||
}
|
||||
}
|
||||
|
||||
// Operators
|
||||
using {eqCallType as ==} for CallType global;
|
||||
using {eqExecType as ==} for ExecType global;
|
||||
using {eqModeSelector as ==} for ModeSelector global;
|
||||
using {eqModePayload as ==} for ModePayload global;
|
||||
|
||||
/// @dev Compares two `CallType` values for equality.
|
||||
function eqCallType(CallType a, CallType b) pure returns (bool) {
|
||||
return CallType.unwrap(a) == CallType.unwrap(b);
|
||||
}
|
||||
|
||||
/// @dev Compares two `ExecType` values for equality.
|
||||
function eqExecType(ExecType a, ExecType b) pure returns (bool) {
|
||||
return ExecType.unwrap(a) == ExecType.unwrap(b);
|
||||
}
|
||||
|
||||
/// @dev Compares two `ModeSelector` values for equality.
|
||||
function eqModeSelector(ModeSelector a, ModeSelector b) pure returns (bool) {
|
||||
return ModeSelector.unwrap(a) == ModeSelector.unwrap(b);
|
||||
}
|
||||
|
||||
/// @dev Compares two `ModePayload` values for equality.
|
||||
function eqModePayload(ModePayload a, ModePayload b) pure returns (bool) {
|
||||
return ModePayload.unwrap(a) == ModePayload.unwrap(b);
|
||||
}
|
||||
Reference in New Issue
Block a user