New circuit to support multi token withdrawal in order to save gas for a user when exit the rollup.
Brief description
Circuit will have a global variable, MAX_TOKENS that will define which is the maximum tokens to be withdrawn.
User provides should provide an array of merkle tree indexes in order to perform several withdrawals. This array is set to maximum length of MAX_TOKENS.
User could choose to withdraw or not withdraw depending on idx input. idx = 0 will skip SMTVerifier while idx != 0 will perform the SMTVerifier with account state data
Summary
New circuit to support multi token withdrawal in order to save gas for a user when exit the rollup.
Brief description
Circuit will have a global variable,
MAX_TOKENS
that will define which is the maximum tokens to be withdrawn. User provides should provide an array of merkle tree indexes in order to perform several withdrawals. This array is set to maximum length ofMAX_TOKENS
. User could choose to withdraw or not withdraw depending on idx input.idx = 0
will skipSMTVerifier
whileidx != 0
will perform theSMTVerifier
with account state data