OZBuilders
public enum OZBuilders
Builder utilities for OpenZeppelin smart account context rules.
Provides type-safe constructors and display utilities for OZContextRuleType
and related OZ-specific operations. These functions are separated from
OZSmartAccountBuilders to avoid a circular dependency between core and OZ
types.
OZBuilders is a caseless enum used as a namespace; it cannot be
instantiated.
-
Creates a default context rule type.
Default rules apply to any operation that does not match a more specific
callContractorcreateContractrule.Declaration
Swift
public static func createDefaultContextType() -> OZContextRuleTypeReturn Value
defaultRulefor default authorization. -
Creates a call-contract context rule type.
Call-contract rules apply only when invoking a specific contract. Useful for restricting signers to specific dApps or operations.
Throws
InvalidAddressif the contract address format is invalid.Declaration
Swift
public static func createCallContractContextType(contractAddress: String) throws -> OZContextRuleTypeParameters
contractAddressContract address this rule applies to (
C…).Return Value
An
callContract(contractAddress:)configured for the supplied contract. -
Creates a create-contract context rule type from a hex-encoded WASM hash.
Create-contract rules apply only when deploying contracts with a specific WASM hash.
Throws
InvalidInputwhen the hex string is not exactly 64 characters after stripping any0xprefix or when it contains non-hex characters.Declaration
Swift
public static func createCreateContractContextType(wasmHashHex: String) throws -> OZContextRuleTypeParameters
wasmHashHexWASM hash as a 64-character hex string (an optional
0xprefix is accepted and stripped).Return Value
An
createContract(wasmHash:)for the supplied hash. -
Creates a create-contract context rule type from raw WASM hash bytes.
Create-contract rules apply only when deploying contracts with a specific WASM hash.
Declaration
Swift
public static func createCreateContractContextType(wasmHash: Data) throws -> OZContextRuleTypeParameters
wasmHash32-byte WASM hash.
Return Value
An
createContract(wasmHash:)for the supplied hash.
-
Collects unique signers across a list of parsed context rules.
Iterates through the supplied rules, gathers each rule’s signers, and returns a deduplicated list preserving the first occurrence of each signer. Deduplication uses
uniqueKeyand shares the implementation withcollectUniqueSigners(signers:).Declaration
Swift
public static func collectUniqueSignersFromRules( rules: [OZParsedContextRule] ) -> [any OZSmartAccountSigner]Parameters
rulesThe parsed context rules to scan.
Return Value
Unique signers across all rules, in first-occurrence order.
View on GitHub
Install in Dash