Skip to main content

ConfigTypes

The CallConfig struct and CallConfigIndex enum play pivotal roles in configuring and managing the behavior of metacall operations within the Atlas Protocol. They provide granular control over nonce handling, execution phases, signature verifications, and other operational parameters to ensure secure and efficient transaction processing. Check out our Configuration Guide for a comprehensive guide on configuring your DApp.

CallConfig Struct

struct CallConfig {
bool userNoncesSequential;
bool dappNoncesSequential;
bool requirePreOps;
bool trackPreOpsReturnData;
bool trackUserReturnData;
bool delegateUser;
bool requirePreSolver;
bool requirePostSolver;
bool requirePostOpsCall;
bool zeroSolvers;
bool reuseUserOp;
bool userAuctioneer;
bool solverAuctioneer;
bool unknownAuctioneer;
bool verifyCallChainHash;
bool forwardReturnData;
bool requireFulfillment;
bool trustedOpHash;
bool invertBidValue;
bool exPostBids;
bool allowAllocateValueFailure;
}

Description

The CallConfig struct encapsulates a set of boolean flags that dictate the behavior and requirements of metacall operations. Each field within the struct enables or disables specific features, controls the flow of execution phases, and enforces security measures to maintain the integrity of transactions.

Fields

NameTypeDescription
userNoncesSequentialboolIf true, the userOp nonce must be the next sequential nonce for the user's address in Atlas's nonce system. If false, nonces can be non-sequential as long as they are unique.
dappNoncesSequentialboolIf true, the dappOp nonce must be the next sequential nonce for the dApp signer's address. If false, the nonce is not checked as it's tied to the userOp nonce via callChainHash.
requirePreOpsboolExecutes the preOps hook before the userOp execution if true. If false, the preOps hook is skipped.
trackPreOpsReturnDataboolIf true, the return data from the preOps hook is passed to the next call phase. If false, it's discarded.
trackUserReturnDataboolIf true, the return data from the userOp call is passed to the next call phase. If false, it's discarded.
delegateUserboolIf true, the userOp call is made using delegatecall from the Execution Environment. If false, userOp is called using a standard call.
requirePreSolverboolExecutes the preSolver hook before the solverOp execution if true. If false, the preSolver hook is skipped.
requirePostSolverboolExecutes the postSolver hook after the solverOp execution if true. If false, the postSolver hook is skipped.
requirePostOpsCallboolExecutes the postOps hook as the final step of the metacall if true. If false, the postOps hook is skipped.
zeroSolversboolAllows the metacall to proceed even if there are no solverOps if true.
reuseUserOpboolIf true, the metacall will revert if unsuccessful to avoid storing nonce data, allowing the userOp to be reused.
userAuctioneerboolAllows the user to be the auctioneer (the signer of the dAppOp) if true.
solverAuctioneerboolAllows the solver to be the auctioneer if true. If enabled, the solver's solverOp must be the only one.
unknownAuctioneerboolPermits anyone to be the auctioneer if true. Standard signatory checks are bypassed.
verifyCallChainHashboolEnsures that the dAppOp.callChainHash matches the actual callChainHash as calculated in AtlasVerification if true.
forwardReturnDataboolIncludes return data from previous steps as calldata in the call to the solver contract if true.
requireFulfillmentboolIf true, a winning solver must be found; otherwise, the metacall will fail.
trustedOpHashboolIf true, the userOpHash excludes certain userOp inputs, implying that solvers trust changes made to these parts after signing their solverOps.
invertBidValueboolIf true, the solver with the lowest successful bid wins instead of the highest.
exPostBidsboolIf true, bids are determined on-chain using _getBidAmount in Atlas.
allowAllocateValueFailureboolIf true, the metacall will proceed even if value allocation fails. If false, the metacall will revert if value allocation fails.

CallConfigIndex Enum

enum CallConfigIndex {
UserNoncesSequential,
DAppNoncesSequential,
RequirePreOps,
TrackPreOpsReturnData,
TrackUserReturnData,
DelegateUser,
RequirePreSolver,
RequirePostSolver,
RequirePostOpsCall,
ZeroSolvers,
ReuseUserOp,
UserAuctioneer,
SolverAuctioneer,
UnknownAuctioneer,
VerifyCallChainHash,
ForwardReturnData,
RequireFulfillment,
TrustedOpHash,
InvertBidValue,
ExPostBids,
AllowAllocateValueFailure
}

Description

The CallConfigIndex enum assigns a unique index to each field within the CallConfig struct. This indexing facilitates efficient bitwise operations, storage optimizations, and streamlined access to specific configuration flags during contract execution.

Usage

The CallConfigIndex enum is primarily used for:

  • Bitwise Operations: Efficiently setting, toggling, and checking configuration flags using bit manipulation techniques.
  • Storage Optimization: Reducing storage costs by packing multiple boolean flags into a single integer using their corresponding indices.
  • Configuration Management: Streamlining the process of accessing and modifying specific configuration flags without affecting others.