@@ -128,7 +128,7 @@ pub contract Token {
128128 amount : u128 ,
129129 _nonce : Field ,
130130 ) {
131- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
131+ self .internal ._call_auth_private (from , amount );
132132
133133 self .internal ._decrease_private_balance (from , amount , INITIAL_TRANSFER_CALL_MAX_NOTES );
134134
@@ -151,7 +151,7 @@ pub contract Token {
151151 amount : u128 ,
152152 _nonce : Field ,
153153 ) -> Field {
154- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
154+ self .internal ._call_auth_private (from , amount );
155155
156156 self .internal ._decrease_private_balance (from , amount , INITIAL_TRANSFER_CALL_MAX_NOTES );
157157
@@ -177,7 +177,7 @@ pub contract Token {
177177 amount : u128 ,
178178 _nonce : Field ,
179179 ) {
180- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
180+ self .internal ._call_auth_private (from , amount );
181181
182182 self .internal ._decrease_private_balance (from , amount , INITIAL_TRANSFER_CALL_MAX_NOTES );
183183
@@ -199,7 +199,7 @@ pub contract Token {
199199 amount : u128 ,
200200 _nonce : Field ,
201201 ) {
202- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
202+ self .internal ._call_auth_private (from , amount );
203203
204204 self .internal ._decrease_private_balance (from , amount , INITIAL_TRANSFER_CALL_MAX_NOTES );
205205
@@ -226,7 +226,7 @@ pub contract Token {
226226 amount : u128 ,
227227 _nonce : Field ,
228228 ) {
229- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
229+ self .internal ._call_auth_private (from , amount );
230230
231231 self .enqueue_self .decrease_public_balance_internal (from , amount );
232232
@@ -273,7 +273,7 @@ pub contract Token {
273273 amount : u128 ,
274274 _nonce : Field ,
275275 ) {
276- self .internal ._call_auth_public (from , amount , self . context . selector (). to_field () );
276+ self .internal ._call_auth_public (from , amount );
277277
278278 self .internal ._decrease_public_balance (from , amount );
279279 self .internal ._increase_public_balance (to , amount );
@@ -297,7 +297,7 @@ pub contract Token {
297297 amount : u128 ,
298298 _nonce : Field ,
299299 ) {
300- self .internal ._call_auth_public (from , amount , self . context . selector (). to_field () );
300+ self .internal ._call_auth_public (from , amount );
301301
302302 self .internal ._decrease_public_balance (from , amount );
303303
@@ -464,7 +464,7 @@ pub contract Token {
464464 #[authorize_once("from", "_nonce")]
465465 #[external("private")]
466466 fn burn_private (from : AztecAddress , amount : u128 , _nonce : Field ) {
467- self .internal ._call_auth_private (from , amount , self . context . selector (). to_field () );
467+ self .internal ._call_auth_private (from , amount );
468468
469469 self .internal ._burn_private (from , amount );
470470 }
@@ -477,7 +477,7 @@ pub contract Token {
477477 #[authorize_once("from", "_nonce")]
478478 #[external("public")]
479479 fn burn_public (from : AztecAddress , amount : u128 , _nonce : Field ) {
480- self .internal ._call_auth_public (from , amount , self . context . selector (). to_field () );
480+ self .internal ._call_auth_public (from , amount );
481481
482482 self .internal ._burn_public (from , amount );
483483 }
@@ -500,11 +500,11 @@ pub contract Token {
500500 /// @dev Invoked from external public functions; no-ops when auth_contract is zero
501501 /// @param from The address tokens are moved from (zero address for mints)
502502 /// @param amount The amount of tokens being moved
503- /// @param selector The selector passed is the calling function's own selector
504503 #[internal("public")]
505- fn _call_auth_public (from : AztecAddress , amount : u128 , selector : Field ) {
504+ fn _call_auth_public (from : AztecAddress , amount : u128 ) {
506505 let auth = self .storage .auth_contract .read ();
507506 if !auth .eq (AztecAddress ::zero ()) {
507+ let selector = self .context .selector ().to_field ();
508508 self .call (AuthorizationContract ::at (auth ).authorize_public (from , amount , selector ));
509509 }
510510 }
@@ -515,11 +515,11 @@ pub contract Token {
515515 /// side effects (e.g., via enqueued public calls or public events).
516516 /// @param from The address tokens are moved from (zero address for mints)
517517 /// @param amount The amount of tokens being moved
518- /// @param selector The selector passed is the calling function's own selector
519518 #[internal("private")]
520- fn _call_auth_private (from : AztecAddress , amount : u128 , selector : Field ) {
519+ fn _call_auth_private (from : AztecAddress , amount : u128 ) {
521520 let auth = self .storage .auth_contract .read ();
522521 if !auth .eq (AztecAddress ::zero ()) {
522+ let selector = self .context .selector ().to_field ();
523523 self .call (AuthorizationContract ::at (auth ).authorize_private (from , amount , selector ));
524524 }
525525 }
0 commit comments