Sponsor Smart Account Deployment
checkbox.RPC URL
selector for chain-specific URLs. All
URLs follow the same format, varying only by chain ID, so you can generate the
URL in your Dapp based on the active chain.
policyId
in the optional to the RPC. This can
be sent by the dapp via the the context
field per ERC 7677.
However - please note that different paymasters may accept policyId
with a
different key or format. For Reown’s Paymaster, that key is policyId
.
Is some key from a user operation equivalent to (or some other comparison) some value?This is defined in
params
as such:
callData
, two different methods are needed to access this information:
callDataMethodEquals
: Verifies that the callData
targets a specific functioncallDataToEquals
: Verifies that the callData
targets a specific contractparams
:
ands
. The way the schema is designed, Each params
object, can be
accompanied with an ands
OR an ors
field which is an array of more params that will require that they
either all pass as true, or only one of them is true, respectively.
A params
object can not have both an ors
and
an ands
simultaneously. However, its “children” (the params in an ands
or ors
) can have different conditionals than their parent.
For example, to make it so that the above policy also passes for methodBar
and methodBaz
, it can be amended as follows:
The UserOp should target smart contract 0xa123.. and either use the methodsNote that at the top it usedmethodFoo
ormethodBar
ormethodBaz
.
ands
and then used ors
for the children. This is fully legal within the schema.
However, the following is incorrect :
ors
will be completely ignored. If both ors
and ands
are present, then the ands
will take precedence.
callData
it needs to know the smart contract’s ABI.
For this we introduce 2 new fields. policyStaticProps
and metadata
. Both are essentially free range key-value
dictionaries used to store information within the policy to be accessed later. The key thing to note is that
values within policyStaticProps
can be accessed from within metadata
. This becomes invaluable with policies
that have multiple conditionals like the one above.
contractAbi
is a variable that callDataMethodEquals
requires. To supplement its value, we use <contract1.abi>
.
What <contract1.abi>
means is essentially policyStaticProps.contract1.abi
. The <>
indicate that this value is coming from policyStaticProps
.
Note that the values within policyStaticProps
can be named anything. The only constraint is that contractAbi
is named the same within the metadata
as that is what callDataMethodEquals
will look for.
Extrapolating this to our running example above, the complete policy becomes:
metadata
to the root of your policy, to keep basic metadata like what chains to support, the startTime and endTime.
startTime
, endTime
and chainIds
. This is because they are edited in
the previous UI panels.The policy starts on the 23rd of October 2024, does not expire and will support Ethereum, Polygon and Testnet. For a UserOp to pass this policy, it needs to be targeting smart contract0xa123cd918...
and it has to be using One of the following methods from the contract:methodFoo
ormethodBar
ormethodBaz
.
policyType
useroperation_payload_control
is available.
policyStaticProps
params
key
sender
nonce
callData
callGasLimit
verificationGasLimit
maxFeePerGas
maxPriorityFeePerGas
op
equals
: Exact 1:1 match with value
lessThanOrEquals
: Is the numeric value less than or equals value
callDataMethodEquals
: Within callData
, is the method
equal to a value
contractAbi
defined in metadata
callDataToEquals
: Within callData
, is the to
equal to a value
value
ands
policyType
and policyStaticProps
omitted)
ors
policyType
and policyStaticProps
omitted)
metadata
params
Special fields within metadata
. At the root of a policy, there needs to be a metadata
object defined.
It has to contain the following:
startTime
endTime
chains
number[]