@@ -47,18 +47,20 @@ const TYPE_NAME = "0x7::sigma_protocol_withdraw::Withdrawal";
4747/**
4848 * BCS-serialize a WithdrawSession matching the Move struct:
4949 * ```move
50- * struct WithdrawSession { sender: address, asset_type: Object<Metadata>, num_chunks: u64 }
50+ * struct WithdrawSession { sender: address, asset_type: Object<Metadata>, num_chunks: u64, has_auditor: bool }
5151 * ```
5252 */
5353export function bcsSerializeWithdrawSession (
5454 senderAddress : Uint8Array ,
5555 tokenTypeAddress : Uint8Array ,
5656 numChunks : number ,
57+ hasAuditor : boolean ,
5758) : Uint8Array {
5859 const serializer = new Serializer ( ) ;
5960 serializer . serialize ( new FixedBytes ( senderAddress ) ) ;
6061 serializer . serialize ( new FixedBytes ( tokenTypeAddress ) ) ;
6162 serializer . serialize ( new U64 ( numChunks ) ) ;
63+ serializer . serializeBool ( hasAuditor ) ;
6264 return serializer . toUint8Array ( ) ;
6365}
6466
@@ -336,7 +338,7 @@ function proveWithdrawInternal(
336338 const witness : bigint [ ] = [ dkBigint , ...newAmountChunks , ...newRandomness ] ;
337339
338340 // Build domain separator
339- const sessionId = bcsSerializeWithdrawSession ( senderAddress , tokenAddress , ell ) ;
341+ const sessionId = bcsSerializeWithdrawSession ( senderAddress , tokenAddress , ell , hasAuditor ) ;
340342 const dst : DomainSeparator = {
341343 contractAddress : APTOS_EXPERIMENTAL_ADDRESS ,
342344 chainId,
@@ -481,7 +483,7 @@ function verifyWithdrawInternal(
481483 scalars : [ vScalar ] ,
482484 } ;
483485
484- const sessionId = bcsSerializeWithdrawSession ( senderAddress , tokenAddress , ell ) ;
486+ const sessionId = bcsSerializeWithdrawSession ( senderAddress , tokenAddress , ell , hasAuditor ) ;
485487 const dst : DomainSeparator = {
486488 contractAddress : APTOS_EXPERIMENTAL_ADDRESS ,
487489 chainId,
0 commit comments