Source Code
Overview
HYPE Balance
HYPE Value
$0.00Latest 5 internal transactions
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 10241125 | 174 days ago | 0.5 HYPE | ||||
| 10241125 | 174 days ago | Contract Creation | 0 HYPE | |||
| 9102599 | 187 days ago | 0.5 HYPE | ||||
| 9102599 | 187 days ago | Contract Creation | 0 HYPE | |||
| 8713865 | 192 days ago | Contract Creation | 0 HYPE |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
NodePaymasterFactory
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 999 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {NodePaymaster} from "contracts/NodePaymaster.sol";
import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol";
contract NodePaymasterFactory {
/// @notice The error thrown when the NodePaymaster deployment fails
error NodePMDeployFailed();
/// @notice Deploy and fund a new NodePaymaster
/// @param entryPoint The 4337 EntryPoint address expected to call the NodePaymaster
/// @param owner The owner of the NodePaymaster
/// @param index The deployment index of the NodePaymaster
/// @return nodePaymaster The address of the deployed NodePaymaster
/// @dev The NodePaymaster is deployed using create2 with a deterministic address
/// @dev The NodePaymaster is funded with the msg.value
function deployAndFundNodePaymaster(address entryPoint, address owner, address[] calldata workerEOAs, uint256 index) public payable returns (address nodePaymaster) {
address expectedPm = _predictNodePaymasterAddress(entryPoint, owner, workerEOAs, index);
bytes memory deploymentData = abi.encodePacked(
type(NodePaymaster).creationCode,
abi.encode(entryPoint, owner, workerEOAs)
);
assembly {
nodePaymaster := create2(
0x0,
add(0x20, deploymentData),
mload(deploymentData),
index
)
}
if(address(nodePaymaster) == address(0) || address(nodePaymaster) != expectedPm) {
revert NodePMDeployFailed();
}
// deposit the msg.value to the EP at the node paymaster's name
IEntryPoint(entryPoint).depositTo{value: msg.value}(nodePaymaster);
}
/// @notice Get the counterfactual address of a NodePaymaster
/// @param entryPoint The 4337 EntryPoint address expected to call the NodePaymaster
/// @param owner The owner of the NodePaymaster
/// @param index The deployment index of the NodePaymaster
/// @return nodePaymaster The counterfactual address of the NodePaymaster
function getNodePaymasterAddress(address entryPoint, address owner, address[] calldata workerEOAs, uint256 index) public view returns (address) {
return _predictNodePaymasterAddress(entryPoint, owner, workerEOAs, index);
}
// function to check if some EOA got PmContract deployed
function _predictNodePaymasterAddress(address entryPoint, address owner, address[] calldata workerEOAs, uint256 index) internal view returns (address) {
bytes32 initCodeHash =
keccak256(abi.encodePacked(
type(NodePaymaster).creationCode,
abi.encode(entryPoint, owner, workerEOAs)
));
// Return the predicted address
return payable(address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), index, initCodeHash))))));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol";
import {PackedUserOperation} from "account-abstraction/core/UserOperationLib.sol";
import {BaseNodePaymaster} from "./BaseNodePaymaster.sol";
import {EcdsaLib} from "./lib/util/EcdsaLib.sol";
/**
* @title Node Paymaster
* @notice A paymaster every MEE Node should deploy.
* @dev Allows handleOps calls by any address allowed by owner().
* It is used to sponsor userOps. Introduced for gas efficient MEE flow.
*/
contract NodePaymaster is BaseNodePaymaster {
mapping(address => bool) private _workerEOAs;
constructor(
IEntryPoint _entryPoint,
address _meeNodeMasterEOA,
address[] memory workerEOAs
)
payable
BaseNodePaymaster(_entryPoint, _meeNodeMasterEOA)
{
for (uint256 i; i < workerEOAs.length; i++) {
_workerEOAs[workerEOAs[i]] = true;
}
}
/**
* @dev Accepts all userOps
* Verifies that the handleOps is called by the MEE Node, so it sponsors only for superTxns by owner MEE Node
* @dev The use of tx.origin makes the NodePaymaster incompatible with the general ERC4337 mempool.
* This is intentional, and the NodePaymaster is restricted to the MEE node owner anyway.
*
* PaymasterAndData is encoded as follows:
* 20 bytes: Paymaster address
* 32 bytes: pm gas values
* 4 bytes: mode
* 4 bytes: premium mode
* 24 bytes: financial data:: premiumPercentage or fixedPremium
* 20 bytes: refundReceiver (only for DAPP mode)
*
* @param userOp the userOp to validate
* @param userOpHash the hash of the userOp
* @param maxCost the max cost of the userOp
* @return context the context to be used in the postOp
* @return validationData the validationData to be used in the postOp
*/
function _validatePaymasterUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 maxCost)
internal
virtual
override
returns (bytes memory, uint256)
{
if( tx.origin == owner() || _workerEOAs[tx.origin]) {
return _validate(userOp, userOpHash, maxCost);
}
return ("", 1);
}
// ====== Manage worker EOAs ======
/**
* @notice Whitelist a worker EOA
* @param workerEOA The worker EOA to whitelist
*/
function whitelistWorkerEOA(address workerEOA) external onlyOwner {
_workerEOAs[workerEOA] = true;
}
/**
* @notice Whitelist a list of worker EOAs
* @param workerEOAs The list of worker EOAs to whitelist
*/
function whitelistWorkerEOAs(address[] calldata workerEOAs) external onlyOwner {
for (uint256 i; i < workerEOAs.length; i++) {
_workerEOAs[workerEOAs[i]] = true;
}
}
/**
* @notice Remove a worker EOA from the whitelist
* @param workerEOA The worker EOA to remove from the whitelist
*/
function removeWorkerEOAFromWhitelist(address workerEOA) external onlyOwner {
_workerEOAs[workerEOA] = false;
}
/**
* @notice Remove a list of worker EOAs from the whitelist
* @param workerEOAs The list of worker EOAs to remove from the whitelist
*/
function removeWorkerEOAsFromWhitelist(address[] calldata workerEOAs) external onlyOwner {
for (uint256 i; i < workerEOAs.length; i++) {
_workerEOAs[workerEOAs[i]] = false;
}
}
/**
* @notice Check if a worker EOA is whitelisted
* @param workerEOA The worker EOA to check
* @return True if the worker EOA is whitelisted, false otherwise
*/
function isWorkerEOAWhitelisted(address workerEOA) external view returns (bool) {
return _workerEOAs[workerEOA];
}
/**
* @notice Check if a list of worker EOAs are whitelisted
* @param workerEOAs The list of worker EOAs to check
* @return An array of booleans, where each element corresponds to the whitelist status of the corresponding worker EOA
*/
function areWorkerEOAsWhitelisted(address[] calldata workerEOAs) external view returns (bool[] memory) {
bool[] memory whitelisted = new bool[](workerEOAs.length);
for (uint256 i; i < workerEOAs.length; i++) {
whitelisted[i] = _workerEOAs[workerEOAs[i]];
}
return whitelisted;
}
}/**
** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.
** Only one instance required on each chain.
**/
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
/* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable reason-string */
import "./PackedUserOperation.sol";
import "./IStakeManager.sol";
import "./IAggregator.sol";
import "./INonceManager.sol";
interface IEntryPoint is IStakeManager, INonceManager {
/***
* 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
);
/**
* An event emitted if the UserOperation Paymaster's "postOp" call 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 PostOpRevertReason(
bytes32 indexed userOpHash,
address indexed sender,
uint256 nonce,
bytes revertReason
);
/**
* UserOp consumed more than prefund. The UserOperation is reverted, and no refund is made.
* @param userOpHash - The request unique identifier.
* @param sender - The sender of this request.
* @param nonce - The nonce used in the request.
*/
event UserOperationPrefundTooLow(
bytes32 indexed userOpHash,
address indexed sender,
uint256 nonce
);
/**
* An event emitted by handleOps(), before starting the execution loop.
* Any event emitted before this event, is part of the validation.
*/
event BeforeExecution();
/**
* Signature aggregator used by the following UserOperationEvents within this bundle.
* @param aggregator - The aggregator used for the following UserOperationEvents.
*/
event SignatureAggregatorChanged(address indexed aggregator);
/**
* A custom revert error of handleOps, to identify the offending op.
* 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.
* 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.
*/
error FailedOp(uint256 opIndex, string reason);
/**
* A custom revert error of handleOps, to report a revert by account or paymaster.
* @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).
* @param reason - Revert reason. see FailedOp(uint256,string), above
* @param inner - data from inner cought revert reason
* @dev note that inner is truncated to 2048 bytes
*/
error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);
error PostOpReverted(bytes returnData);
/**
* Error case when a signature aggregator fails to verify the aggregated signature it had created.
* @param aggregator The aggregator that failed to verify the signature
*/
error SignatureValidationFailed(address aggregator);
// Return value of getSenderAddress.
error SenderAddressResult(address sender);
// UserOps handled, per aggregator.
struct UserOpsPerAggregator {
PackedUserOperation[] userOps;
// Aggregator address
IAggregator aggregator;
// Aggregated signature
bytes signature;
}
/**
* 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(
PackedUserOperation[] 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.
* @param userOp - The user operation to generate the request ID for.
* @return hash the hash of this UserOperation
*/
function getUserOpHash(
PackedUserOperation calldata userOp
) external view returns (bytes32);
/**
* Gas and return values during simulation.
* @param preOpGas - The gas used for validation (including preValidationGas)
* @param prefund - The required prefund for this operation
* @param accountValidationData - returned validationData from account.
* @param paymasterValidationData - return validationData from paymaster.
* @param paymasterContext - Returned by validatePaymasterUserOp (to be passed into postOp)
*/
struct ReturnInfo {
uint256 preOpGas;
uint256 prefund;
uint256 accountValidationData;
uint256 paymasterValidationData;
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;
error DelegateAndRevert(bool success, bytes ret);
/**
* Helper method for dry-run testing.
* @dev calling this method, the EntryPoint will make a delegatecall to the given data, and report (via revert) the result.
* The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace
* actual EntryPoint code is less convenient.
* @param target a target contract to make a delegatecall from entrypoint
* @param data data to pass to target in a delegatecall
*/
function delegateAndRevert(address target, bytes calldata data) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.23;
/* solhint-disable no-inline-assembly */
import "../interfaces/PackedUserOperation.sol";
import {calldataKeccak, min} from "./Helpers.sol";
/**
* Utility functions helpful when working with UserOperation structs.
*/
library UserOperationLib {
uint256 public constant PAYMASTER_VALIDATION_GAS_OFFSET = 20;
uint256 public constant PAYMASTER_POSTOP_GAS_OFFSET = 36;
uint256 public constant PAYMASTER_DATA_OFFSET = 52;
/**
* Get sender from user operation data.
* @param userOp - The user operation data.
*/
function getSender(
PackedUserOperation 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.
* @param userOp - The user operation data.
*/
function gasPrice(
PackedUserOperation calldata userOp
) internal view returns (uint256) {
unchecked {
(uint256 maxPriorityFeePerGas, uint256 maxFeePerGas) = unpackUints(userOp.gasFees);
if (maxFeePerGas == maxPriorityFeePerGas) {
//legacy mode (for networks that don't support basefee opcode)
return maxFeePerGas;
}
return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);
}
}
/**
* Pack the user operation data into bytes for hashing.
* @param userOp - The user operation data.
*/
function encode(
PackedUserOperation calldata userOp
) internal pure returns (bytes memory ret) {
address sender = getSender(userOp);
uint256 nonce = userOp.nonce;
bytes32 hashInitCode = calldataKeccak(userOp.initCode);
bytes32 hashCallData = calldataKeccak(userOp.callData);
bytes32 accountGasLimits = userOp.accountGasLimits;
uint256 preVerificationGas = userOp.preVerificationGas;
bytes32 gasFees = userOp.gasFees;
bytes32 hashPaymasterAndData = calldataKeccak(userOp.paymasterAndData);
return abi.encode(
sender, nonce,
hashInitCode, hashCallData,
accountGasLimits, preVerificationGas, gasFees,
hashPaymasterAndData
);
}
function unpackUints(
bytes32 packed
) internal pure returns (uint256 high128, uint256 low128) {
return (uint128(bytes16(packed)), uint128(uint256(packed)));
}
//unpack just the high 128-bits from a packed value
function unpackHigh128(bytes32 packed) internal pure returns (uint256) {
return uint256(packed) >> 128;
}
// unpack just the low 128-bits from a packed value
function unpackLow128(bytes32 packed) internal pure returns (uint256) {
return uint128(uint256(packed));
}
function unpackMaxPriorityFeePerGas(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return unpackHigh128(userOp.gasFees);
}
function unpackMaxFeePerGas(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return unpackLow128(userOp.gasFees);
}
function unpackVerificationGasLimit(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return unpackHigh128(userOp.accountGasLimits);
}
function unpackCallGasLimit(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return unpackLow128(userOp.accountGasLimits);
}
function unpackPaymasterVerificationGasLimit(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET]));
}
function unpackPostOpGasLimit(PackedUserOperation calldata userOp)
internal pure returns (uint256) {
return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]));
}
function unpackPaymasterStaticFields(
bytes calldata paymasterAndData
) internal pure returns (address paymaster, uint256 validationGasLimit, uint256 postOpGasLimit) {
return (
address(bytes20(paymasterAndData[: PAYMASTER_VALIDATION_GAS_OFFSET])),
uint128(bytes16(paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET])),
uint128(bytes16(paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]))
);
}
/**
* Hash the user operation data.
* @param userOp - The user operation data.
*/
function hash(
PackedUserOperation calldata userOp
) internal pure returns (bytes32) {
return keccak256(encode(userOp));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {BasePaymaster} from "account-abstraction/core/BasePaymaster.sol";
import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol";
import {IEntryPointSimulations} from "account-abstraction/interfaces/IEntryPointSimulations.sol";
import "account-abstraction/core/Helpers.sol";
import {UserOperationLib} from "account-abstraction/core/UserOperationLib.sol";
import {PackedUserOperation} from "account-abstraction/core/UserOperationLib.sol";
import {EcdsaLib} from "./lib/util/EcdsaLib.sol";
import {NODE_PM_MODE_USER, NODE_PM_MODE_DAPP, NODE_PM_MODE_KEEP, NODE_PM_PREMIUM_PERCENT, NODE_PM_PREMIUM_FIXED} from "./types/Constants.sol";
/**
* @title BaseNode Paymaster
* @notice Base PM functionality for MEE Node PMs.
* It is used to sponsor userOps. Introduced for gas efficient MEE flow.
*/
abstract contract BaseNodePaymaster is BasePaymaster {
error InvalidNodePMRefundMode(bytes4 mode);
error InvalidNodePMPremiumMode(bytes4 mode);
error InvalidContext(uint256 length);
using UserOperationLib for PackedUserOperation;
using UserOperationLib for bytes32;
// 100% with 5 decimals precision
uint256 private constant PREMIUM_CALCULATION_BASE = 100_00000;
error EmptyMessageValue();
error InsufficientBalance();
error PaymasterVerificationGasLimitTooHigh();
error Disabled();
error PostOpGasLimitTooLow();
constructor(IEntryPoint _entryPoint, address _meeNodeMasterEOA) payable BasePaymaster(_entryPoint) {
_transferOwnership(_meeNodeMasterEOA);
}
/**
* @dev Accepts all userOps
* Verifies that the handleOps is called by the MEE Node, so it sponsors only for superTxns by owner MEE Node
* @dev The use of tx.origin makes the NodePaymaster incompatible with the general ERC4337 mempool.
* This is intentional, and the NodePaymaster is restricted to the MEE node owner anyway.
*
* PaymasterAndData is encoded as follows:
* 20 bytes: Paymaster address
* 32 bytes: pm gas values
* === PM_DATA_START ===
* 4 bytes: mode
* 4 bytes: premium mode
* 24 bytes: financial data:: premiumPercentage (only for according premium mode)
* 20 bytes: refundReceiver (only for DAPP refund mode)
*
* @param userOp the userOp to validate
* param userOpHash the hash of the userOp
* @param maxCost the max cost of the userOp
* @return context the context to be used in the postOp
* @return validationData the validationData to be used in the postOp
*/
function _validate(PackedUserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 maxCost)
internal
virtual
returns (bytes memory, uint256)
{
bytes4 refundMode;
bytes4 premiumMode;
bytes calldata pmAndData = userOp.paymasterAndData;
assembly {
// 0x34 = 52 => PAYMASTER_DATA_OFFSET
refundMode := calldataload(add(pmAndData.offset, 0x34))
}
address refundReceiver;
// Handle refund mode
if (refundMode == NODE_PM_MODE_KEEP) { // NO REFUND
return ("", 0);
} else {
assembly {
// 0x38 = 56 => PAYMASTER_DATA_OFFSET + 4
premiumMode := calldataload(add(pmAndData.offset, 0x38))
}
if (refundMode == NODE_PM_MODE_USER) {
refundReceiver = userOp.sender;
} else if (refundMode == NODE_PM_MODE_DAPP) {
// if fixed premium => no financial data => offset is 0x08
// if % premium => financial data => offset is 0x08 + 0x18 = 0x20
uint256 refundReceiverOffset = premiumMode == NODE_PM_PREMIUM_FIXED ? 0x08 : 0x20;
assembly {
let o := add(0x34, refundReceiverOffset)
refundReceiver := shr(96, calldataload(add(pmAndData.offset, o)))
}
} else {
revert InvalidNodePMRefundMode(refundMode);
}
}
bytes memory context = _prepareContext({
refundReceiver: refundReceiver,
premiumMode: premiumMode,
maxCost: maxCost,
postOpGasLimit: userOp.unpackPostOpGasLimit(),
paymasterAndData: userOp.paymasterAndData
});
return (context, 0);
}
/**
* Post-operation handler.
* Checks mode and refunds the userOp.sender if needed.
* param PostOpMode enum with the following options: // not used
* 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.
* @dev postOpGasLimit is very important parameter that Node SHOULD use to balance its economic interests
since penalty is not involved with refunds to sponsor here,
postOpGasLimit should account for gas that is spend by AA-EP after benchmarking actualGasSpent
if it is too low (still enough for _postOp), nodePM will be underpaid
if it is too high, nodePM will be overcharging the superTxn sponsor as refund is going to be lower
* @param context - the context value returned by validatePaymasterUserOp
* context is encoded as follows:
* if mode is KEEP:
* 0 bytes
* ==== if there is a refund, always add ===
* 20 bytes: refundReceiver
* >== if % premium mode also add ===
* 24 bytes: financial data:: premiumPercentage
* 32 bytes: maxGasCost
* 32 bytes: postOpGasLimit
* (108 bytes total)
* >== if fixed premium ====
* 32 bytes: maxGasCost
* 32 bytes: postOpGasLimit
* (84 bytes total)
* @param actualGasCost - actual gas used so far (without this postOp call).
* @param actualUserOpFeePerGas - actual userOp fee per gas
*/
function _postOp(PostOpMode, bytes calldata context, uint256 actualGasCost, uint256 actualUserOpFeePerGas)
internal
virtual
override
{
uint256 refund;
address refundReceiver;
// Prepare refund info if any
if (context.length == 0x00) { // 0 bytes => KEEP mode => NO REFUND
// do nothing
} else if (context.length == 0x54) { // 84 bytes => REFUND: fixed premium mode.
(refundReceiver, refund) = _handleFixedPremium(context, actualGasCost, actualUserOpFeePerGas);
} else if (context.length == 0x6c) { // 108 bytes => REFUND: % premium mode.
(refundReceiver, refund) = _handlePercentagePremium(context, actualGasCost, actualUserOpFeePerGas);
} else {
revert InvalidContext(context.length);
}
// send refund to the superTxn sponsor
if (refund > 0) {
// Note: At this point the paymaster hasn't received the refund yet, so this withdrawTo() is
// using the paymaster's existing balance. The paymaster's deposit in the entrypoint will be
// incremented after postOp() concludes.
entryPoint.withdrawTo(payable(refundReceiver), refund);
}
}
// ==== Helper functions ====
function _prepareContext(
address refundReceiver,
bytes4 premiumMode,
uint256 maxCost,
uint256 postOpGasLimit,
bytes calldata paymasterAndData
) internal pure returns (bytes memory context) {
context = abi.encodePacked(
refundReceiver
);
if (premiumMode == NODE_PM_PREMIUM_PERCENT) {
uint192 premiumPercentage;
// 0x3c = 60 => PAYMASTER_DATA_OFFSET + 8
assembly {
premiumPercentage := shr(64, calldataload(add(paymasterAndData.offset, 0x3c)))
}
context = abi.encodePacked(
context,
premiumPercentage,
maxCost,
postOpGasLimit
); // 108 bytes
} else if (premiumMode == NODE_PM_PREMIUM_FIXED) {
context = abi.encodePacked(
context,
maxCost,
postOpGasLimit
); // 84 bytes
} else {
revert InvalidNodePMPremiumMode(premiumMode);
}
}
function _handleFixedPremium(
bytes calldata context,
uint256 actualGasCost,
uint256 actualUserOpFeePerGas
) internal pure returns (address refundReceiver, uint256 refund) {
uint256 maxGasCost;
uint256 postOpGasLimit;
assembly {
refundReceiver := shr(96, calldataload(context.offset))
maxGasCost := calldataload(add(context.offset, 0x14))
postOpGasLimit := calldataload(add(context.offset, 0x34))
}
// account for postOpGas
actualGasCost += postOpGasLimit * actualUserOpFeePerGas;
// when premium is fixed, payment by superTxn sponsor is maxGasCost + fixedPremium
// so we refund just the gas difference, while fixedPremium is going to the MEE Node
if (actualGasCost < maxGasCost) {
refund = maxGasCost - actualGasCost;
}
}
function _handlePercentagePremium(
bytes calldata context,
uint256 actualGasCost,
uint256 actualUserOpFeePerGas
) internal pure returns (address refundReceiver, uint256 refund) {
uint192 premiumPercentage;
uint256 maxGasCost;
uint256 postOpGasLimit;
assembly {
refundReceiver := shr(96, calldataload(context.offset))
premiumPercentage := shr(64, calldataload(add(context.offset, 0x14)))
maxGasCost := calldataload(add(context.offset, 0x2c))
postOpGasLimit := calldataload(add(context.offset, 0x4c))
}
// account for postOpGas
actualGasCost += postOpGasLimit * actualUserOpFeePerGas;
// we do not need to account for the penalty here because it goes to the beneficiary
// which is the MEE Node itself, so we do not have to charge user for the penalty
// account for MEE Node premium
uint256 costWithPremium = _applyPercentagePremium(actualGasCost, premiumPercentage);
// as MEE_NODE charges user with the premium
uint256 maxCostWithPremium = _applyPercentagePremium(maxGasCost, premiumPercentage);
// We do not check for the case, when costWithPremium > maxCost
// maxCost charged by the MEE Node should include the premium
// if this is done, costWithPremium can never be > maxCost
if (costWithPremium < maxCostWithPremium) {
refund = maxCostWithPremium - costWithPremium;
}
}
function _applyPercentagePremium(uint256 amount, uint256 premiumPercentage) internal pure returns (uint256) {
return amount * (PREMIUM_CALCULATION_BASE + premiumPercentage) / PREMIUM_CALCULATION_BASE;
}
/// @dev This function is used to receive ETH from the user and immediately deposit it to the entryPoint
receive() external payable {
entryPoint.depositTo{value: msg.value}(address(this));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {ECDSA} from "solady/utils/ECDSA.sol";
library EcdsaLib {
using ECDSA for bytes32;
/**
* @dev Solady ECDSA does not revert on incorrect signatures.
* Instead, it returns address(0) as the recovered address.
* Make sure to never pass address(0) as expectedSigner to this function.
*/
function isValidSignature(address expectedSigner, bytes32 hash, bytes memory signature)
internal
view
returns (bool)
{
if (hash.tryRecover(signature) == expectedSigner) return true;
if (hash.toEthSignedMessageHash().tryRecover(signature) == expectedSigner) return true;
return false;
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
/**
* 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 accountGasLimits - Packed gas limits for validateUserOp and gas limit passed to the callData method call.
* @param preVerificationGas - Gas not calculated by the handleOps method, but added to the gas paid.
* Covers batch overhead.
* @param gasFees - packed gas fields maxPriorityFeePerGas and maxFeePerGas - Same as EIP-1559 gas parameters.
* @param paymasterAndData - If set, this field holds the paymaster address, verification gas limit, postOp gas limit and paymaster-specific extra 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 PackedUserOperation {
address sender;
uint256 nonce;
bytes initCode;
bytes callData;
bytes32 accountGasLimits;
uint256 preVerificationGas;
bytes32 gasFees;
bytes paymasterAndData;
bytes signature;
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.7.5;
/**
* 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 fits into one cell (used during handleOp)
* and the rest fit into a 2nd cell (used during stake/unstake)
* - 112 bit allows for 10^15 eth
* - 48 bit for full timestamp
* - 32 bit allows 150 years for unstake delay
*/
struct DepositInfo {
uint256 deposit;
bool staked;
uint112 stake;
uint32 unstakeDelaySec;
uint48 withdrawTime;
}
// API struct used by getStakeInfo and simulateValidation.
struct StakeInfo {
uint256 stake;
uint256 unstakeDelaySec;
}
/**
* Get deposit info.
* @param account - The account to query.
* @return info - Full deposit information of given account.
*/
function getDepositInfo(
address account
) external view returns (DepositInfo memory info);
/**
* Get account balance.
* @param account - The account to query.
* @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.
* @param account - The account to add to.
*/
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;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
import "./PackedUserOperation.sol";
/**
* Aggregated Signatures validator.
*/
interface IAggregator {
/**
* Validate aggregated signature.
* Revert if the aggregated signature does not match the given list of operations.
* @param userOps - Array of UserOperations to validate the signature for.
* @param signature - The aggregated signature.
*/
function validateSignatures(
PackedUserOperation[] calldata userOps,
bytes calldata signature
) external view;
/**
* Validate signature of a single userOp.
* This method should be called by bundler after EntryPointSimulation.simulateValidation() returns
* the aggregator this account uses.
* 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(
PackedUserOperation 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(
PackedUserOperation[] calldata userOps
) external view returns (bytes memory aggregatedSignature);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
interface INonceManager {
/**
* Return the next nonce for this sender.
* Within a given key, the nonce values are sequenced (starting with zero, and incremented by one on each userop)
* But UserOp with different keys can come with arbitrary order.
*
* @param sender the account address
* @param key the high 192 bit of the nonce
* @return nonce a full nonce to pass for next UserOp with this sender.
*/
function getNonce(address sender, uint192 key)
external view returns (uint256 nonce);
/**
* Manually increment the nonce of the sender.
* This method is exposed just for completeness..
* Account does NOT need to call it, neither during validation, nor elsewhere,
* as the EntryPoint will update the nonce regardless.
* Possible use-case is call it with various keys to "initialize" their nonces to one, so that future
* UserOperations will not pay extra for the first transaction with a given key.
*/
function incrementNonce(uint192 key) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.23;
/* solhint-disable no-inline-assembly */
/*
* For simulation purposes, validateUserOp (and validatePaymasterUserOp)
* must return this value in case of signature failure, instead of revert.
*/
uint256 constant SIG_VALIDATION_FAILED = 1;
/*
* For simulation purposes, validateUserOp (and validatePaymasterUserOp)
* return this value on success.
*/
uint256 constant SIG_VALIDATION_SUCCESS = 0;
/**
* Returned data from validateUserOp.
* validateUserOp returns a uint256, which 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.
* @param validationData - The packed validation data.
*/
function _parseValidationData(
uint256 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);
}
/**
* 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));
}
/**
* keccak function over calldata.
* @dev copy calldata into memory, do keccak and drop allocated memory. Strangely, this is more efficient than letting solidity do it.
*/
function calldataKeccak(bytes calldata data) pure returns (bytes32 ret) {
assembly ("memory-safe") {
let mem := mload(0x40)
let len := data.length
calldatacopy(mem, data.offset, len)
ret := keccak256(mem, len)
}
}
/**
* The minimum of two numbers.
* @param a - First number.
* @param b - Second number.
*/
function min(uint256 a, uint256 b) pure returns (uint256) {
return a < b ? a : b;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.23;
/* solhint-disable reason-string */
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "../interfaces/IPaymaster.sol";
import "../interfaces/IEntryPoint.sol";
import "./UserOperationLib.sol";
/**
* Helper class for creating a paymaster.
* provides helper methods for staking.
* Validates that the postOp is called only by the entryPoint.
*/
abstract contract BasePaymaster is IPaymaster, Ownable {
IEntryPoint public immutable entryPoint;
uint256 internal constant PAYMASTER_VALIDATION_GAS_OFFSET = UserOperationLib.PAYMASTER_VALIDATION_GAS_OFFSET;
uint256 internal constant PAYMASTER_POSTOP_GAS_OFFSET = UserOperationLib.PAYMASTER_POSTOP_GAS_OFFSET;
uint256 internal constant PAYMASTER_DATA_OFFSET = UserOperationLib.PAYMASTER_DATA_OFFSET;
constructor(IEntryPoint _entryPoint) Ownable(msg.sender) {
_validateEntryPointInterface(_entryPoint);
entryPoint = _entryPoint;
}
//sanity check: make sure this EntryPoint was compiled against the same
// IEntryPoint of this paymaster
function _validateEntryPointInterface(IEntryPoint _entryPoint) internal virtual {
require(IERC165(address(_entryPoint)).supportsInterface(type(IEntryPoint).interfaceId), "IEntryPoint interface mismatch");
}
/// @inheritdoc IPaymaster
function validatePaymasterUserOp(
PackedUserOperation calldata userOp,
bytes32 userOpHash,
uint256 maxCost
) external override returns (bytes memory context, uint256 validationData) {
_requireFromEntryPoint();
return _validatePaymasterUserOp(userOp, userOpHash, maxCost);
}
/**
* Validate a user operation.
* @param userOp - The user operation.
* @param userOpHash - The hash of the user operation.
* @param maxCost - The maximum cost of the user operation.
*/
function _validatePaymasterUserOp(
PackedUserOperation calldata userOp,
bytes32 userOpHash,
uint256 maxCost
) internal virtual returns (bytes memory context, uint256 validationData);
/// @inheritdoc IPaymaster
function postOp(
PostOpMode mode,
bytes calldata context,
uint256 actualGasCost,
uint256 actualUserOpFeePerGas
) external override {
_requireFromEntryPoint();
_postOp(mode, context, actualGasCost, actualUserOpFeePerGas);
}
/**
* Post-operation handler.
* (verified to be called only through the entryPoint)
* @dev If subclass returns a non-empty context from validatePaymasterUserOp,
* it must also implement this method.
* @param mode - Enum with the following options:
* opSucceeded - User operation succeeded.
* opReverted - User op reverted. The paymaster still has to pay for gas.
* postOpReverted - never passed in a call to postOp().
* @param context - The context value returned by validatePaymasterUserOp
* @param actualGasCost - Actual gas used so far (without this postOp call).
* @param actualUserOpFeePerGas - the gas price this UserOp pays. This value is based on the UserOp's maxFeePerGas
* and maxPriorityFee (and basefee)
* It is not the same as tx.gasprice, which is what the bundler pays.
*/
function _postOp(
PostOpMode mode,
bytes calldata context,
uint256 actualGasCost,
uint256 actualUserOpFeePerGas
) internal virtual {
(mode, context, actualGasCost, actualUserOpFeePerGas); // unused params
// subclass must override this method if validatePaymasterUserOp returns a context
revert("must override");
}
/**
* Add a deposit for this paymaster, used for paying for transaction fees.
*/
function deposit() public payable {
entryPoint.depositTo{value: msg.value}(address(this));
}
/**
* Withdraw value from the deposit.
* @param withdrawAddress - Target to send to.
* @param amount - Amount to withdraw.
*/
function withdrawTo(
address payable withdrawAddress,
uint256 amount
) public onlyOwner {
entryPoint.withdrawTo(withdrawAddress, amount);
}
/**
* Add stake for this paymaster.
* This method can also carry eth value to add to the current stake.
* @param unstakeDelaySec - The unstake delay for this paymaster. Can only be increased.
*/
function addStake(uint32 unstakeDelaySec) external payable onlyOwner {
entryPoint.addStake{value: msg.value}(unstakeDelaySec);
}
/**
* Return current paymaster's deposit on the entryPoint.
*/
function getDeposit() public view returns (uint256) {
return entryPoint.balanceOf(address(this));
}
/**
* Unlock the stake, in order to withdraw it.
* The paymaster can't serve requests once unlocked, until it calls addStake again
*/
function unlockStake() external onlyOwner {
entryPoint.unlockStake();
}
/**
* Withdraw the entire paymaster's stake.
* stake must be unlocked first (and then wait for the unstakeDelay to be over)
* @param withdrawAddress - The address to send withdrawn value.
*/
function withdrawStake(address payable withdrawAddress) external onlyOwner {
entryPoint.withdrawStake(withdrawAddress);
}
/**
* Validate the call is made from a valid entrypoint
*/
function _requireFromEntryPoint() internal virtual {
require(msg.sender == address(entryPoint), "Sender not EntryPoint");
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
import "./PackedUserOperation.sol";
import "./IEntryPoint.sol";
interface IEntryPointSimulations is IEntryPoint {
// Return value of simulateHandleOp.
struct ExecutionResult {
uint256 preOpGas;
uint256 paid;
uint256 accountValidationData;
uint256 paymasterValidationData;
bool targetSuccess;
bytes targetResult;
}
/**
* Successful result from simulateValidation.
* If the account returns a signature aggregator the "aggregatorInfo" struct is filled in as well.
* @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.
*/
struct ValidationResult {
ReturnInfo returnInfo;
StakeInfo senderInfo;
StakeInfo factoryInfo;
StakeInfo paymasterInfo;
AggregatorStakeInfo aggregatorInfo;
}
/**
* Simulate a call to account.validateUserOp and paymaster.validatePaymasterUserOp.
* @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.
* @return the validation result structure
*/
function simulateValidation(
PackedUserOperation calldata userOp
)
external
returns (
ValidationResult memory
);
/**
* Simulate full execution of a UserOperation (including both validation and target execution)
* 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.
* @return the execution result structure
*/
function simulateHandleOp(
PackedUserOperation calldata op,
address target,
bytes calldata targetCallData
)
external
returns (
ExecutionResult memory
);
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; bytes3 constant SIG_TYPE_MEE_FLOW = 0x177eee; bytes4 constant SIG_TYPE_SIMPLE = 0x177eee00; bytes4 constant SIG_TYPE_ON_CHAIN = 0x177eee01; bytes4 constant SIG_TYPE_ERC20_PERMIT = 0x177eee02; // ...other sig types: ERC-7683, Permit2, etc bytes4 constant EIP1271_SUCCESS = 0x1626ba7e; bytes4 constant EIP1271_FAILED = 0xffffffff; uint256 constant MODULE_TYPE_STATELESS_VALIDATOR = 7; bytes4 constant NODE_PM_MODE_USER = 0x170de000; // refund goes to the user bytes4 constant NODE_PM_MODE_DAPP = 0x170de001; // refund goes to the dApp bytes4 constant NODE_PM_MODE_KEEP = 0x170de002; // no refund as node sponsored bytes4 constant NODE_PM_PREMIUM_PERCENT = 0x9ee4ce00; // premium percentage bytes4 constant NODE_PM_PREMIUM_FIXED = 0x9ee4ce01; // fixed premium
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Gas optimized ECDSA wrapper.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)
///
/// @dev Note:
/// - The recovery functions use the ecrecover precompile (0x1).
/// - As of Solady version 0.0.68, the `recover` variants will revert upon recovery failure.
/// This is for more safety by default.
/// Use the `tryRecover` variants if you need to get the zero address back
/// upon recovery failure instead.
/// - As of Solady version 0.0.134, all `bytes signature` variants accept both
/// regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures.
/// See: https://eips.ethereum.org/EIPS/eip-2098
/// This is for calldata efficiency on smart accounts prevalent on L2s.
///
/// WARNING! Do NOT directly use signatures as unique identifiers:
/// - The recovery operations do NOT check if a signature is non-malleable.
/// - Use a nonce in the digest to prevent replay attacks on the same contract.
/// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.
/// EIP-712 also enables readable signing of typed data for better user safety.
/// - If you need a unique hash from a signature, please use the `canonicalHash` functions.
library ECDSA {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The order of the secp256k1 elliptic curve.
uint256 internal constant N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141;
/// @dev `N/2 + 1`. Used for checking the malleability of the signature.
uint256 private constant _HALF_N_PLUS_1 =
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The signature is invalid.
error InvalidSignature();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* RECOVERY OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
function recover(bytes32 hash, bytes memory signature) internal view returns (address result) {
/// @solidity memory-safe-assembly
assembly {
for { let m := mload(0x40) } 1 {
mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
revert(0x1c, 0x04)
} {
switch mload(signature)
case 64 {
let vs := mload(add(signature, 0x40))
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x60, shr(1, shl(1, vs))) // `s`.
}
case 65 {
mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.
mstore(0x60, mload(add(signature, 0x40))) // `s`.
}
default { continue }
mstore(0x00, hash)
mstore(0x40, mload(add(signature, 0x20))) // `r`.
result := mload(staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20))
mstore(0x60, 0) // Restore the zero slot.
mstore(0x40, m) // Restore the free memory pointer.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
if returndatasize() { break }
}
}
}
/// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
function recoverCalldata(bytes32 hash, bytes calldata signature)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
for { let m := mload(0x40) } 1 {
mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
revert(0x1c, 0x04)
} {
switch signature.length
case 64 {
let vs := calldataload(add(signature.offset, 0x20))
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x40, calldataload(signature.offset)) // `r`.
mstore(0x60, shr(1, shl(1, vs))) // `s`.
}
case 65 {
mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.
calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.
}
default { continue }
mstore(0x00, hash)
result := mload(staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20))
mstore(0x60, 0) // Restore the zero slot.
mstore(0x40, m) // Restore the free memory pointer.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
if returndatasize() { break }
}
}
}
/// @dev Recovers the signer's address from a message digest `hash`,
/// and the EIP-2098 short form signature defined by `r` and `vs`.
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x00, hash)
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x40, r)
mstore(0x60, shr(1, shl(1, vs))) // `s`.
result := mload(staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20))
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
if iszero(returndatasize()) {
mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Recovers the signer's address from a message digest `hash`,
/// and the signature defined by `v`, `r`, `s`.
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x00, hash)
mstore(0x20, and(v, 0xff))
mstore(0x40, r)
mstore(0x60, s)
result := mload(staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20))
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
if iszero(returndatasize()) {
mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* TRY-RECOVER OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// WARNING!
// These functions will NOT revert upon recovery failure.
// Instead, they will return the zero address upon recovery failure.
// It is critical that the returned address is NEVER compared against
// a zero address (e.g. an uninitialized address variable).
/// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
function tryRecover(bytes32 hash, bytes memory signature)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
for { let m := mload(0x40) } 1 {} {
switch mload(signature)
case 64 {
let vs := mload(add(signature, 0x40))
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x60, shr(1, shl(1, vs))) // `s`.
}
case 65 {
mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.
mstore(0x60, mload(add(signature, 0x40))) // `s`.
}
default { break }
mstore(0x00, hash)
mstore(0x40, mload(add(signature, 0x20))) // `r`.
pop(staticcall(gas(), 1, 0x00, 0x80, 0x40, 0x20))
mstore(0x60, 0) // Restore the zero slot.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
result := mload(xor(0x60, returndatasize()))
mstore(0x40, m) // Restore the free memory pointer.
break
}
}
}
/// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
function tryRecoverCalldata(bytes32 hash, bytes calldata signature)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
for { let m := mload(0x40) } 1 {} {
switch signature.length
case 64 {
let vs := calldataload(add(signature.offset, 0x20))
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x40, calldataload(signature.offset)) // `r`.
mstore(0x60, shr(1, shl(1, vs))) // `s`.
}
case 65 {
mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.
calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.
}
default { break }
mstore(0x00, hash)
pop(staticcall(gas(), 1, 0x00, 0x80, 0x40, 0x20))
mstore(0x60, 0) // Restore the zero slot.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
result := mload(xor(0x60, returndatasize()))
mstore(0x40, m) // Restore the free memory pointer.
break
}
}
}
/// @dev Recovers the signer's address from a message digest `hash`,
/// and the EIP-2098 short form signature defined by `r` and `vs`.
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x00, hash)
mstore(0x20, add(shr(255, vs), 27)) // `v`.
mstore(0x40, r)
mstore(0x60, shr(1, shl(1, vs))) // `s`.
pop(staticcall(gas(), 1, 0x00, 0x80, 0x40, 0x20))
mstore(0x60, 0) // Restore the zero slot.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
result := mload(xor(0x60, returndatasize()))
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Recovers the signer's address from a message digest `hash`,
/// and the signature defined by `v`, `r`, `s`.
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
internal
view
returns (address result)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x00, hash)
mstore(0x20, and(v, 0xff))
mstore(0x40, r)
mstore(0x60, s)
pop(staticcall(gas(), 1, 0x00, 0x80, 0x40, 0x20))
mstore(0x60, 0) // Restore the zero slot.
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
result := mload(xor(0x60, returndatasize()))
mstore(0x40, m) // Restore the free memory pointer.
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* HASHING OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns an Ethereum Signed Message, created from a `hash`.
/// This produces a hash corresponding to the one signed with the
/// [`eth_sign`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign)
/// JSON-RPC method as part of EIP-191.
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x20, hash) // Store into scratch space for keccak256.
mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32") // 28 bytes.
result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`.
}
}
/// @dev Returns an Ethereum Signed Message, created from `s`.
/// This produces a hash corresponding to the one signed with the
/// [`eth_sign`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign)
/// JSON-RPC method as part of EIP-191.
/// Note: Supports lengths of `s` up to 999999 bytes.
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {
/// @solidity memory-safe-assembly
assembly {
let sLength := mload(s)
let o := 0x20
mstore(o, "\x19Ethereum Signed Message:\n") // 26 bytes, zero-right-padded.
mstore(0x00, 0x00)
// Convert the `s.length` to ASCII decimal representation: `base10(s.length)`.
for { let temp := sLength } 1 {} {
o := sub(o, 1)
mstore8(o, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let n := sub(0x3a, o) // Header length: `26 + 32 - o`.
// Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes.
returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20))
mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header.
result := keccak256(add(s, sub(0x20, n)), add(n, sLength))
mstore(s, sLength) // Restore the length.
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CANONICAL HASH FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// The following functions returns the hash of the signature in it's canonicalized format,
// which is the 65-byte `abi.encodePacked(r, s, uint8(v))`, where `v` is either 27 or 28.
// If `s` is greater than `N / 2` then it will be converted to `N - s`
// and the `v` value will be flipped.
// If the signature has an invalid length, or if `v` is invalid,
// a uniquely corrupt hash will be returned.
// These functions are useful for "poor-mans-VRF".
/// @dev Returns the canonical hash of `signature`.
function canonicalHash(bytes memory signature) internal pure returns (bytes32 result) {
// @solidity memory-safe-assembly
assembly {
let l := mload(signature)
for {} 1 {} {
mstore(0x00, mload(add(signature, 0x20))) // `r`.
let s := mload(add(signature, 0x40))
let v := mload(add(signature, 0x41))
if eq(l, 64) {
v := add(shr(255, s), 27)
s := shr(1, shl(1, s))
}
if iszero(lt(s, _HALF_N_PLUS_1)) {
v := xor(v, 7)
s := sub(N, s)
}
mstore(0x21, v)
mstore(0x20, s)
result := keccak256(0x00, 0x41)
mstore(0x21, 0) // Restore the overwritten part of the free memory pointer.
break
}
// If the length is neither 64 nor 65, return a uniquely corrupted hash.
if iszero(lt(sub(l, 64), 2)) {
// `bytes4(keccak256("InvalidSignatureLength"))`.
result := xor(keccak256(add(signature, 0x20), l), 0xd62f1ab2)
}
}
}
/// @dev Returns the canonical hash of `signature`.
function canonicalHashCalldata(bytes calldata signature)
internal
pure
returns (bytes32 result)
{
// @solidity memory-safe-assembly
assembly {
for {} 1 {} {
mstore(0x00, calldataload(signature.offset)) // `r`.
let s := calldataload(add(signature.offset, 0x20))
let v := calldataload(add(signature.offset, 0x21))
if eq(signature.length, 64) {
v := add(shr(255, s), 27)
s := shr(1, shl(1, s))
}
if iszero(lt(s, _HALF_N_PLUS_1)) {
v := xor(v, 7)
s := sub(N, s)
}
mstore(0x21, v)
mstore(0x20, s)
result := keccak256(0x00, 0x41)
mstore(0x21, 0) // Restore the overwritten part of the free memory pointer.
break
}
// If the length is neither 64 nor 65, return a uniquely corrupted hash.
if iszero(lt(sub(signature.length, 64), 2)) {
calldatacopy(mload(0x40), signature.offset, signature.length)
// `bytes4(keccak256("InvalidSignatureLength"))`.
result := xor(keccak256(mload(0x40), signature.length), 0xd62f1ab2)
}
}
}
/// @dev Returns the canonical hash of `signature`.
function canonicalHash(bytes32 r, bytes32 vs) internal pure returns (bytes32 result) {
// @solidity memory-safe-assembly
assembly {
mstore(0x00, r) // `r`.
let v := add(shr(255, vs), 27)
let s := shr(1, shl(1, vs))
mstore(0x21, v)
mstore(0x20, s)
result := keccak256(0x00, 0x41)
mstore(0x21, 0) // Restore the overwritten part of the free memory pointer.
}
}
/// @dev Returns the canonical hash of `signature`.
function canonicalHash(uint8 v, bytes32 r, bytes32 s) internal pure returns (bytes32 result) {
// @solidity memory-safe-assembly
assembly {
mstore(0x00, r) // `r`.
if iszero(lt(s, _HALF_N_PLUS_1)) {
v := xor(v, 7)
s := sub(N, s)
}
mstore(0x21, v)
mstore(0x20, s)
result := keccak256(0x00, 0x41)
mstore(0x21, 0) // Restore the overwritten part of the free memory pointer.
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EMPTY CALLDATA HELPERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns an empty calldata bytes.
function emptySignature() internal pure returns (bytes calldata signature) {
/// @solidity memory-safe-assembly
assembly {
signature.length := 0
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.5;
import "./PackedUserOperation.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 {
// User op succeeded.
opSucceeded,
// User op reverted. Still has to pay for gas.
opReverted,
// Only used internally in the EntryPoint (cleanup after postOp reverts). Never calling paymaster with this value
postOpReverted
}
/**
* 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,
* other values are invalid for paymaster.
* <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(
PackedUserOperation 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. The paymaster still has to pay for gas.
* postOpReverted - never passed in a call to postOp().
* @param context - The context value returned by validatePaymasterUserOp
* @param actualGasCost - Actual gas used so far (without this postOp call).
* @param actualUserOpFeePerGas - the gas price this UserOp pays. This value is based on the UserOp's maxFeePerGas
* and maxPriorityFee (and basefee)
* It is not the same as tx.gasprice, which is what the bundler pays.
*/
function postOp(
PostOpMode mode,
bytes calldata context,
uint256 actualGasCost,
uint256 actualUserOpFeePerGas
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"openzeppelin/=node_modules/@openzeppelin/contracts/",
"account-abstraction/=node_modules/account-abstraction/contracts/",
"erc7739Validator/=node_modules/erc7739-validator-base/src/",
"solady/=node_modules/solady/src/",
"forge-std/=lib/forge-std/src/",
"erc7579/=node_modules/erc7579/src/",
"EnumerableSet4337/=node_modules/enumerablemap4337/src/",
"byteslib/=node_modules/solidity-bytes-utils/contracts/",
"rlp-reader/=node_modules/Solidity-RLP/contracts/",
"murky-trees/=node_modules/murky/src/",
"sentinellist/=node_modules/@rhinestone/sentinellist/src/",
"@ERC4337/=node_modules/@ERC4337/",
"@erc7579/=node_modules/@erc7579/",
"@gnosis.pm/=node_modules/@gnosis.pm/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@prb/=node_modules/@prb/",
"@rhinestone/=node_modules/@rhinestone/",
"@safe-global/=node_modules/@safe-global/",
"@zerodev/=node_modules/@zerodev/",
"ExcessivelySafeCall/=node_modules/erc7739-validator-base/node_modules/excessively-safe-call/src/",
"account-abstraction-v0.6/=node_modules/account-abstraction-v0.6/",
"ds-test/=node_modules/ds-test/",
"enumerablemap4337/=node_modules/enumerablemap4337/",
"enumerableset4337/=node_modules/erc7739-validator-base/node_modules/@erc7579/enumerablemap4337/src/",
"erc4337-validation/=node_modules/erc7739-validator-base/node_modules/@rhinestone/erc4337-validation/src/",
"erc7739-validator-base/=node_modules/erc7739-validator-base/",
"excessively-safe-call/=node_modules/excessively-safe-call/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/",
"kernel/=node_modules/erc7739-validator-base/node_modules/@zerodev/kernel/src/",
"module-bases/=node_modules/erc7739-validator-base/node_modules/@rhinestone/module-bases/src/",
"modulekit/=node_modules/erc7739-validator-base/node_modules/@rhinestone/modulekit/src/",
"murky/=node_modules/murky/",
"safe7579/=node_modules/erc7739-validator-base/node_modules/@rhinestone/safe7579/src/",
"solarray/=node_modules/solarray/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
"solidity-rlp/=node_modules/solidity-rlp/"
],
"optimizer": {
"enabled": true,
"runs": 999
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"NodePMDeployFailed","type":"error"},{"inputs":[{"internalType":"address","name":"entryPoint","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"workerEOAs","type":"address[]"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"deployAndFundNodePaymaster","outputs":[{"internalType":"address","name":"nodePaymaster","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"entryPoint","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"workerEOAs","type":"address[]"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getNodePaymasterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608080604052346015576117c4908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c806384774403146100345763922d945d1461002f575f80fd5b610238565b61008d6100b16100ab610046366101ca565b9493959296909161009b61005d8785848c8c610348565b9861008d61139195610071602088016102b4565b9680885261042760208901396040519485938c602086016102c4565b03601f198101835282610265565b6040519485936020850190610321565b90610321565b8051906020015ff5916001600160a01b03831680159182156101a2575b505061017a576001600160a01b031690813b15610176576040517fb760faf90000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152915f908390602490829034905af19182156101715761015392610157575b506040516001600160a01b0390911681529081906020820190565b0390f35b806101655f61016b93610265565b80610333565b82610138565b61033d565b5f80fd5b7f25ba697b000000000000000000000000000000000000000000000000000000005f5260045ffd5b6001600160a01b03161415905083806100ce565b35906001600160a01b038216820361017657565b906080600319830112610176576101e160046101b6565b916101ec60246101b6565b9160443567ffffffffffffffff811161017657826023820112156101765780600401359267ffffffffffffffff84116101765760248460051b8301011161017657602401919060643590565b3461017657602061025461024b366101ca565b93929092610348565b6001600160a01b0360405191168152f35b90601f8019910116810190811067ffffffffffffffff82111761028757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b906102c26040519283610265565b565b6001600160a01b039182168152911660208201526060604082018190528101839052608001915f5b8181106102f95750505090565b9091926020806001926001600160a01b03610313886101b6565b1681520194019291016102ec565b805191908290602001825e015f815290565b5f91031261017657565b6040513d5f823e3d90fd5b9361008d6104086104179461008d6103aa610417966103966104239b61008d6104179c6113919761037b60208a016102b4565b98808a5261042760208b0139604051958694602086016102c4565b6040519283916100ab602084018097610321565b5190206040519283916020830195308791605593917fff0000000000000000000000000000000000000000000000000000000000000084526bffffffffffffffffffffffff199060601b166001840152601583015260358201520190565b5190206001600160a01b031690565b6001600160a01b031690565b9056fe60a0806040526113918038038091610017828561025c565b8339810190606081830312610206578051906001600160a01b038216808303610206576100466020830161027f565b604083015190926001600160401b03821161020657019380601f86011215610206578451946001600160401b038611610248578560051b906040519661008f602084018961025c565b875260208088019282010192831161020657602001905b82821061023057505050331561021d5760206024916100c433610293565b6040516301ffc9a760e01b815263122a0e9b60e31b600482015292839182905afa908115610212575f916101d3575b501561018e5761010591608052610293565b5f5b815181101561013e57600190818060a01b0360208260051b85010151165f528160205260405f208260ff1982541617905501610107565b6040516110b790816102da8239608051818181610250015281816102f9015281816104020152818161048a01528181610601015281816109a201528181610a3901528181610bbb0152610c7c0152f35b60405162461bcd60e51b815260206004820152601e60248201527f49456e747279506f696e7420696e74657266616365206d69736d6174636800006044820152606490fd5b90506020813d60201161020a575b816101ee6020938361025c565b8101031261020657518015158103610206575f6100f3565b5f80fd5b3d91506101e1565b6040513d5f823e3d90fd5b631e4fbdf760e01b5f525f60045260245ffd5b6020809161023d8461027f565b8152019101906100a6565b634e487b7160e01b5f52604160045260245ffd5b601f909101601f19168101906001600160401b0382119082101761024857604052565b51906001600160a01b038216820361020657565b5f80546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe60806040526004361015610022575b3615610018575f80fd5b610020610bb1565b005b5f5f3560e01c80630396cb6014610a09578063205c2878146109755780632488d78414610931578063300d84791461084957806352b7512c146107c0578063715018a61461075a5780637c627b211461056d57806383e22319146105155780638da5cb5b146104ef5780639bdfeb94146104ae578063b0d691fe1461046a578063bb9fe6bf146103de578063bc300d9814610383578063c23a5cea146102cc578063c399ec8814610203578063cc69d1fd146101bc578063d0e30db0146101a55763f2fde38b146100f3575061000e565b346101a25760203660031901126101a2576004356001600160a01b0381168091036101a057610120610c33565b8015610174576001600160a01b0382548273ffffffffffffffffffffffffffffffffffffffff198216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b505b80fd5b50806003193601126101a2576101b9610bb1565b80f35b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a0576101ea610c33565b8152600160205260408120600160ff1982541617905580f35b50346101a257806003193601126101a2576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526020816024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9081156102c157829161028b575b602082604051908152f35b90506020813d6020116102b9575b816102a660209383610b2b565b810103126101a05760209150515f610280565b3d9150610299565b6040513d84823e3d90fd5b50346101a25760203660031901126101a257806102e7610ac1565b6102ef610c33565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b1561037f576001600160a01b03602484928360405195869485937fc23a5cea0000000000000000000000000000000000000000000000000000000085521660048401525af180156102c15761036e5750f35b8161037891610b2b565b6101a25780f35b5050fd5b50346101a25761039236610ad7565b61039a610c33565b825b8181106103a7578380f35b806001600160a01b036103c56103c06001948688610b79565b610b9d565b168552816020526040852060ff1981541690550161039c565b50346101a257806003193601126101a2576103f7610c33565b806001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610467578180916004604051809481937fbb9fe6bf0000000000000000000000000000000000000000000000000000000083525af180156102c15761036e5750f35b50fd5b50346101a257806003193601126101a25760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a05760408260ff9260209452600184522054166040519015158152f35b50346101a257806003193601126101a2576001600160a01b036020915416604051908152f35b50346101a25761052436610ad7565b61052c610c33565b825b818110610539578380f35b806001600160a01b036105526103c06001948688610b79565b16855281602052604085208260ff198254161790550161052e565b50346101a25760803660031901126101a257600360043510156101a2576024359067ffffffffffffffff82116101a257366023830112156101a25781600401359167ffffffffffffffff83116101a0576024810192366024828401011161075657604435936064356105dd610c72565b849385938061066c575b50505050829350816105f7575050f35b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691823b156106675760405163040b850f60e31b81526001600160a01b0392909216600483015260248201529082908290604490829084905af180156102c15761036e5750f35b505050fd5b92945090925090605481036106c6575061069b8495610695869460586038860135950135611046565b9061106d565b908082106106b5575b5050903560601c5b5f8080806105e7565b6106bf925061107a565b5f806106a4565b919491606c810361072b575061070661069560506106fe87986106f98997603888013560401c95869360708a0135611046565b611087565b930135611087565b80821061071a575b5050903560601c6106ac565b610724925061107a565b5f8061070e565b7f6eb313c6000000000000000000000000000000000000000000000000000000008552600452602484fd5b8280fd5b50346101a257806003193601126101a257610773610c33565b806001600160a01b03815473ffffffffffffffffffffffffffffffffffffffff1981168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a25760603660031901126101a25760043567ffffffffffffffff81116101a05761012060031982360301126101a0576020610813606092610803610c72565b6044359060243590600401610d02565b604092919251948593604085528051938491826040880152018686015e8383018501526020830152601f01601f19168101030190f35b50346101a25761085836610ad7565b9061086282610b61565b906108706040519283610b2b565b82825261087c83610b61565b602083019390601f1901368537845b8181106108d95750505090604051928392602084019060208552518091526040840192915b8181106108be575050500390f35b825115158452859450602093840193909201916001016108b0565b6001600160a01b036108ef6103c0838587610b79565b168652600160205260ff604087205416845182101561091d571515600582901b85016020015260010161088b565b602487634e487b7160e01b81526032600452fd5b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a05761095f610c33565b8152600160205260408120805460ff1916905580f35b50346101a25760403660031901126101a25780610990610ac1565b610998610c33565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b1561037f5760405163040b850f60e31b81526001600160a01b03929092166004830152602480359083015282908290604490829084905af180156102c15761036e5750f35b506020366003190112610abd5760043563ffffffff8116809103610abd57610a2f610c33565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b15610abd575f906024604051809481937f0396cb60000000000000000000000000000000000000000000000000000000008352600483015234905af18015610ab257610aa6575080f35b61002091505f90610b2b565b6040513d5f823e3d90fd5b5f80fd5b600435906001600160a01b0382168203610abd57565b906020600319830112610abd5760043567ffffffffffffffff8111610abd5782602382011215610abd5780600401359267ffffffffffffffff8411610abd5760248460051b83010111610abd576024019190565b90601f8019910116810190811067ffffffffffffffff821117610b4d57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff8111610b4d5760051b60200190565b9190811015610b895760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b0381168103610abd5790565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610abd575f602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610ab257610c275750565b5f610c3191610b2b565b565b6001600160a01b035f54163303610c4657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610ca457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f53656e646572206e6f7420456e747279506f696e7400000000000000000000006044820152fd5b9190506001600160a01b035f541632148015610d43575b610d36575050604051610d2d602082610b2b565b5f815290600190565b610d3f91610d8c565b9091565b50325f52600160205260ff60405f205416610d19565b903590601e1981360301821215610abd570180359067ffffffffffffffff8211610abd57602001918136038313610abd57565b60e0810191610d9b8383610d59565b5060348101357fffffffff000000000000000000000000000000000000000000000000000000001692907f170de002000000000000000000000000000000000000000000000000000000008403610e07575050505050604051610dff602082610b2b565b5f8152905f90565b6038810135937f170de000000000000000000000000000000000000000000000000000000000008103610fa5575050610e3f81610b9d565b935b610e4b8183610d59565b603492919211610abd576024610e6692013560801c92610d59565b509160405160208101956bffffffffffffffffffffffff199060601b16865260148152610e94603482610b2b565b7fffffffff000000000000000000000000000000000000000000000000000000008195167f9ee4ce000000000000000000000000000000000000000000000000000000000081145f14610f3557505060209450926058928592610f30956040519784899551918291018787015e840192603c67ffffffffffffffff19910135168584015260388301528482015203016038810184520182610b2b565b905f90565b909450909250639ee4ce0160e01b8103610f7a5750610f309260409260209284519687935180918686015e830191848301528482015203016020810184520182610b2b565b7ffb96c33d000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f170de00100000000000000000000000000000000000000000000000000000000810361101b57506034907fffffffff000000000000000000000000000000000000000000000000000000008516639ee4ce0160e01b036110125760ff60085b1601013560601c93610e41565b60ff6020611005565b7f83aa2c17000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b8181029291811591840414171561105957565b634e487b7160e01b5f52601160045260245ffd5b9190820180921161105957565b9190820391821161105957565b906298968001908162989680116110595762989680916110a691611046565b049056fea164736f6c634300081b000aa164736f6c634300081b000a
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c806384774403146100345763922d945d1461002f575f80fd5b610238565b61008d6100b16100ab610046366101ca565b9493959296909161009b61005d8785848c8c610348565b9861008d61139195610071602088016102b4565b9680885261042760208901396040519485938c602086016102c4565b03601f198101835282610265565b6040519485936020850190610321565b90610321565b8051906020015ff5916001600160a01b03831680159182156101a2575b505061017a576001600160a01b031690813b15610176576040517fb760faf90000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152915f908390602490829034905af19182156101715761015392610157575b506040516001600160a01b0390911681529081906020820190565b0390f35b806101655f61016b93610265565b80610333565b82610138565b61033d565b5f80fd5b7f25ba697b000000000000000000000000000000000000000000000000000000005f5260045ffd5b6001600160a01b03161415905083806100ce565b35906001600160a01b038216820361017657565b906080600319830112610176576101e160046101b6565b916101ec60246101b6565b9160443567ffffffffffffffff811161017657826023820112156101765780600401359267ffffffffffffffff84116101765760248460051b8301011161017657602401919060643590565b3461017657602061025461024b366101ca565b93929092610348565b6001600160a01b0360405191168152f35b90601f8019910116810190811067ffffffffffffffff82111761028757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b906102c26040519283610265565b565b6001600160a01b039182168152911660208201526060604082018190528101839052608001915f5b8181106102f95750505090565b9091926020806001926001600160a01b03610313886101b6565b1681520194019291016102ec565b805191908290602001825e015f815290565b5f91031261017657565b6040513d5f823e3d90fd5b9361008d6104086104179461008d6103aa610417966103966104239b61008d6104179c6113919761037b60208a016102b4565b98808a5261042760208b0139604051958694602086016102c4565b6040519283916100ab602084018097610321565b5190206040519283916020830195308791605593917fff0000000000000000000000000000000000000000000000000000000000000084526bffffffffffffffffffffffff199060601b166001840152601583015260358201520190565b5190206001600160a01b031690565b6001600160a01b031690565b9056fe60a0806040526113918038038091610017828561025c565b8339810190606081830312610206578051906001600160a01b038216808303610206576100466020830161027f565b604083015190926001600160401b03821161020657019380601f86011215610206578451946001600160401b038611610248578560051b906040519661008f602084018961025c565b875260208088019282010192831161020657602001905b82821061023057505050331561021d5760206024916100c433610293565b6040516301ffc9a760e01b815263122a0e9b60e31b600482015292839182905afa908115610212575f916101d3575b501561018e5761010591608052610293565b5f5b815181101561013e57600190818060a01b0360208260051b85010151165f528160205260405f208260ff1982541617905501610107565b6040516110b790816102da8239608051818181610250015281816102f9015281816104020152818161048a01528181610601015281816109a201528181610a3901528181610bbb0152610c7c0152f35b60405162461bcd60e51b815260206004820152601e60248201527f49456e747279506f696e7420696e74657266616365206d69736d6174636800006044820152606490fd5b90506020813d60201161020a575b816101ee6020938361025c565b8101031261020657518015158103610206575f6100f3565b5f80fd5b3d91506101e1565b6040513d5f823e3d90fd5b631e4fbdf760e01b5f525f60045260245ffd5b6020809161023d8461027f565b8152019101906100a6565b634e487b7160e01b5f52604160045260245ffd5b601f909101601f19168101906001600160401b0382119082101761024857604052565b51906001600160a01b038216820361020657565b5f80546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe60806040526004361015610022575b3615610018575f80fd5b610020610bb1565b005b5f5f3560e01c80630396cb6014610a09578063205c2878146109755780632488d78414610931578063300d84791461084957806352b7512c146107c0578063715018a61461075a5780637c627b211461056d57806383e22319146105155780638da5cb5b146104ef5780639bdfeb94146104ae578063b0d691fe1461046a578063bb9fe6bf146103de578063bc300d9814610383578063c23a5cea146102cc578063c399ec8814610203578063cc69d1fd146101bc578063d0e30db0146101a55763f2fde38b146100f3575061000e565b346101a25760203660031901126101a2576004356001600160a01b0381168091036101a057610120610c33565b8015610174576001600160a01b0382548273ffffffffffffffffffffffffffffffffffffffff198216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b505b80fd5b50806003193601126101a2576101b9610bb1565b80f35b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a0576101ea610c33565b8152600160205260408120600160ff1982541617905580f35b50346101a257806003193601126101a2576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526020816024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9081156102c157829161028b575b602082604051908152f35b90506020813d6020116102b9575b816102a660209383610b2b565b810103126101a05760209150515f610280565b3d9150610299565b6040513d84823e3d90fd5b50346101a25760203660031901126101a257806102e7610ac1565b6102ef610c33565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b1561037f576001600160a01b03602484928360405195869485937fc23a5cea0000000000000000000000000000000000000000000000000000000085521660048401525af180156102c15761036e5750f35b8161037891610b2b565b6101a25780f35b5050fd5b50346101a25761039236610ad7565b61039a610c33565b825b8181106103a7578380f35b806001600160a01b036103c56103c06001948688610b79565b610b9d565b168552816020526040852060ff1981541690550161039c565b50346101a257806003193601126101a2576103f7610c33565b806001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610467578180916004604051809481937fbb9fe6bf0000000000000000000000000000000000000000000000000000000083525af180156102c15761036e5750f35b50fd5b50346101a257806003193601126101a25760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a05760408260ff9260209452600184522054166040519015158152f35b50346101a257806003193601126101a2576001600160a01b036020915416604051908152f35b50346101a25761052436610ad7565b61052c610c33565b825b818110610539578380f35b806001600160a01b036105526103c06001948688610b79565b16855281602052604085208260ff198254161790550161052e565b50346101a25760803660031901126101a257600360043510156101a2576024359067ffffffffffffffff82116101a257366023830112156101a25781600401359167ffffffffffffffff83116101a0576024810192366024828401011161075657604435936064356105dd610c72565b849385938061066c575b50505050829350816105f7575050f35b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691823b156106675760405163040b850f60e31b81526001600160a01b0392909216600483015260248201529082908290604490829084905af180156102c15761036e5750f35b505050fd5b92945090925090605481036106c6575061069b8495610695869460586038860135950135611046565b9061106d565b908082106106b5575b5050903560601c5b5f8080806105e7565b6106bf925061107a565b5f806106a4565b919491606c810361072b575061070661069560506106fe87986106f98997603888013560401c95869360708a0135611046565b611087565b930135611087565b80821061071a575b5050903560601c6106ac565b610724925061107a565b5f8061070e565b7f6eb313c6000000000000000000000000000000000000000000000000000000008552600452602484fd5b8280fd5b50346101a257806003193601126101a257610773610c33565b806001600160a01b03815473ffffffffffffffffffffffffffffffffffffffff1981168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a25760603660031901126101a25760043567ffffffffffffffff81116101a05761012060031982360301126101a0576020610813606092610803610c72565b6044359060243590600401610d02565b604092919251948593604085528051938491826040880152018686015e8383018501526020830152601f01601f19168101030190f35b50346101a25761085836610ad7565b9061086282610b61565b906108706040519283610b2b565b82825261087c83610b61565b602083019390601f1901368537845b8181106108d95750505090604051928392602084019060208552518091526040840192915b8181106108be575050500390f35b825115158452859450602093840193909201916001016108b0565b6001600160a01b036108ef6103c0838587610b79565b168652600160205260ff604087205416845182101561091d571515600582901b85016020015260010161088b565b602487634e487b7160e01b81526032600452fd5b50346101a25760203660031901126101a2576004356001600160a01b0381168091036101a05761095f610c33565b8152600160205260408120805460ff1916905580f35b50346101a25760403660031901126101a25780610990610ac1565b610998610c33565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b1561037f5760405163040b850f60e31b81526001600160a01b03929092166004830152602480359083015282908290604490829084905af180156102c15761036e5750f35b506020366003190112610abd5760043563ffffffff8116809103610abd57610a2f610c33565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b15610abd575f906024604051809481937f0396cb60000000000000000000000000000000000000000000000000000000008352600483015234905af18015610ab257610aa6575080f35b61002091505f90610b2b565b6040513d5f823e3d90fd5b5f80fd5b600435906001600160a01b0382168203610abd57565b906020600319830112610abd5760043567ffffffffffffffff8111610abd5782602382011215610abd5780600401359267ffffffffffffffff8411610abd5760248460051b83010111610abd576024019190565b90601f8019910116810190811067ffffffffffffffff821117610b4d57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff8111610b4d5760051b60200190565b9190811015610b895760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b0381168103610abd5790565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610abd575f602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610ab257610c275750565b5f610c3191610b2b565b565b6001600160a01b035f54163303610c4657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610ca457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f53656e646572206e6f7420456e747279506f696e7400000000000000000000006044820152fd5b9190506001600160a01b035f541632148015610d43575b610d36575050604051610d2d602082610b2b565b5f815290600190565b610d3f91610d8c565b9091565b50325f52600160205260ff60405f205416610d19565b903590601e1981360301821215610abd570180359067ffffffffffffffff8211610abd57602001918136038313610abd57565b60e0810191610d9b8383610d59565b5060348101357fffffffff000000000000000000000000000000000000000000000000000000001692907f170de002000000000000000000000000000000000000000000000000000000008403610e07575050505050604051610dff602082610b2b565b5f8152905f90565b6038810135937f170de000000000000000000000000000000000000000000000000000000000008103610fa5575050610e3f81610b9d565b935b610e4b8183610d59565b603492919211610abd576024610e6692013560801c92610d59565b509160405160208101956bffffffffffffffffffffffff199060601b16865260148152610e94603482610b2b565b7fffffffff000000000000000000000000000000000000000000000000000000008195167f9ee4ce000000000000000000000000000000000000000000000000000000000081145f14610f3557505060209450926058928592610f30956040519784899551918291018787015e840192603c67ffffffffffffffff19910135168584015260388301528482015203016038810184520182610b2b565b905f90565b909450909250639ee4ce0160e01b8103610f7a5750610f309260409260209284519687935180918686015e830191848301528482015203016020810184520182610b2b565b7ffb96c33d000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f170de00100000000000000000000000000000000000000000000000000000000810361101b57506034907fffffffff000000000000000000000000000000000000000000000000000000008516639ee4ce0160e01b036110125760ff60085b1601013560601c93610e41565b60ff6020611005565b7f83aa2c17000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b8181029291811591840414171561105957565b634e487b7160e01b5f52601160045260245ffd5b9190820180921161105957565b9190820391821161105957565b906298968001908162989680116110595762989680916110a691611046565b049056fea164736f6c634300081b000aa164736f6c634300081b000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$86.50
Net Worth in HYPE
Token Allocations
ETH
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,883.45 | 0.03 | $86.5 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.