@@ -21,7 +21,6 @@ import {IFunder} from "./interfaces/IFunder.sol";
2121import {ISettler} from "./interfaces/ISettler.sol " ;
2222import {MerkleProofLib} from "solady/utils/MerkleProofLib.sol " ;
2323import {IntentHelpers} from "./libraries/IntentHelpers.sol " ;
24- import {console} from "forge-std/console.sol " ;
2524
2625/// @title Orchestrator
2726/// @notice Enables atomic verification, gas compensation and execution across eoas.
@@ -419,28 +418,19 @@ contract Orchestrator is
419418 }
420419
421420 address eoa = _getEoa ();
422- console.log ("selfCall: EOA address: " , eoa);
423421
424422 // Start a calldata pointer, each operation points the calldata pointer to the next dynamic bytes.
425423 // Using memory might be slightly less efficient, but lets us modify in-place, resulting in cleaner top-level code.
426424 CalldataPointer memory ptr;
427425 bytes32 digest = _computeDigest (ptr);
428- console.log ("selfCall: Computed digest: " , uint256 (digest));
429426
430427 bytes calldata fundData = _getNextBytes (ptr);
431- console.log ("selfCall: Fund data length: " , fundData.length );
432428
433429 if (fundData.length > 0 ) {
434- console.log ("selfCall: Starting fund phase " );
435430 (address funder , bytes calldata sig , bytes [] calldata transfers ) =
436431 _parseFundData (fundData);
437- console.log ("selfCall: Funder address: " , funder);
438- console.log ("selfCall: Transfers length: " , transfers.length );
439432 _fund (_getEoa (), funder, digest, transfers, sig);
440- console.log ("selfCall: Fund phase completed " );
441- } else {
442- console.log ("selfCall: No funding data " );
443- }
433+ } else {}
444434
445435 // The chicken and egg problem:
446436 // A off-chain simulation of a successful Intent may not guarantee on-chain success.
@@ -458,14 +448,9 @@ contract Orchestrator is
458448
459449 // Handle the sub Intents after initialize (if any), and before the `_verify`.
460450 bytes calldata preCallsBytes = _getNextBytes (ptr);
461- console.log ("selfCall: Pre-calls data length: " , preCallsBytes.length );
462451 if (preCallsBytes.length > 0 ) {
463- console.log ("selfCall: Starting pre-calls phase " );
464452 _handlePreCalls (eoa, flags, preCallsBytes);
465- console.log ("selfCall: Pre-calls completed " );
466- } else {
467- console.log ("selfCall: No pre-calls data " );
468- }
453+ } else {}
469454
470455 // If `_verify` is invalid, just revert.
471456 // The verification gas is determined by `executionData` and the account logic.
@@ -474,56 +459,37 @@ contract Orchestrator is
474459 // in the window between off-chain simulation and on-chain execution.
475460 bytes32 keyHash;
476461 {
477- console.log ("selfCall: Starting verification phase " );
478462 bool isValid;
479463 bytes calldata signature = _getNextBytes (ptr);
480- console.log ("selfCall: Signature length: " , signature.length );
481464
482465 uint256 nonce = _getNonce ();
483- console.log ("selfCall: Nonce: " , nonce);
484466
485467 if (nonce >> 240 == MERKLE_VERIFICATION) {
486- console.log ("selfCall: Using Merkle verification " );
487468 // For multi chain intents, we have to verify using merkle sigs.
488469 (isValid, keyHash) = _verifyMerkleSig (digest, eoa, signature);
489470 bytes calldata settlerData = _getNextBytes (ptr);
490- console.log ("selfCall: Settler data length: " , settlerData.length );
491471
492472 // If this is an output intent, then send the digest as the settlementId
493473 // on all input chains.
494474 if (settlerData.length > 0 ) {
495- console.log ("selfCall: Processing output intent " );
496475 // Output intent - first 20 bytes of settler data is the settler addr
497476 ISettler (address (bytes20 (bytes32 (settlerData[:32 ])))).send (
498477 digest, settlerData[32 :]
499478 );
500479 }
501480 } else {
502- console.log ("selfCall: Using standard verification " );
503- console.log ("selfCall: Digest: " , uint256 (digest));
504- console.log ("selfCall: EOA: " , eoa);
505- console.log ("selfCall: Signature bytes: " );
506- console.logBytes (signature);
507481 (isValid, keyHash) = _verify (digest, eoa, signature);
508482 }
509483
510- console.log ("selfCall: Verification result: " , isValid);
511- console.log ("selfCall: KeyHash: " , uint256 (keyHash));
512- console.log ("selfCall: Flags: " , flags);
513-
514484 if (flags == _SIMULATION_MODE_FLAG) {
515- console.log ("selfCall: Simulation mode - forcing valid " );
516485 isValid = true ;
517486 }
518487
519488 if (! isValid) {
520- console.log ("selfCall: VERIFICATION FAILED " );
521489 revert VerificationError ();
522490 }
523491
524- console.log ("selfCall: Checking and incrementing nonce " );
525492 _checkAndIncrementNonce (eoa, nonce);
526- console.log ("selfCall: Nonce check completed " );
527493 }
528494
529495 // Payment
@@ -532,12 +498,8 @@ contract Orchestrator is
532498 // provided that the token balance does not decrease in the window between
533499 // off-chain simulation and on-chain execution.
534500 {
535- console.log ("selfCall: Starting payment phase " );
536501 uint256 paymentAmount = _getPaymentAmount ();
537- console.log ("selfCall: Payment amount: " , paymentAmount);
538502 if (paymentAmount != 0 ) {
539- console.log ("selfCall: Payment token: " , _getPaymentToken ());
540- console.log ("selfCall: Payment recipient: " , _getPaymentRecipient ());
541503 _pay (
542504 paymentAmount,
543505 keyHash,
@@ -548,26 +510,16 @@ contract Orchestrator is
548510 _getPaymentRecipient (),
549511 _getPaymentSignature ()
550512 );
551- console.log ("selfCall: Payment completed " );
552- } else {
553- console.log ("selfCall: No payment required " );
554- }
513+ } else {}
555514 }
556515 // This re-encodes the ERC7579 `executionData` with the optional `opData`.
557516 // We expect that the account supports ERC7821
558517 // (an extension of ERC7579 tailored for 7702 accounts).
559- console.log ("selfCall: Starting execution phase " );
560- console.log ("execution data is: " );
561- console.logBytes (_getExecutionData ());
562518 bytes memory executeData = LibERC7579.reencodeBatchAsExecuteCalldata (
563519 hex "01000000000078210001 " , // ERC7821 batch execution mode.
564520 _getExecutionData (),
565521 abi.encode (keyHash) // `opData`.
566522 );
567- console.log ("selfCall: Execute data length: " , executeData.length );
568- console.log ("selfCall: Calling EOA with execute data " );
569- console.log ("execution data wrapped is: " );
570- console.logBytes (executeData);
571523
572524 assembly ("memory-safe" ) {
573525 mstore (0x00 , 0 ) // Zeroize the return slot.
@@ -580,7 +532,6 @@ contract Orchestrator is
580532 return (0x00 , 0x20 )
581533 }
582534 }
583- console.log ("selfCall: Execution completed successfully " );
584535 }
585536
586537 /// @dev Loops over the `encodedPreCalls` and does the following for each:
@@ -733,29 +684,15 @@ contract Orchestrator is
733684 address paymentRecipient ,
734685 bytes calldata paymentSignature
735686 ) internal virtual {
736- console.log ("=== Orchestrator._pay() START === " );
737- console.log ("_pay: paymentAmount: " , paymentAmount);
738- console.log ("_pay: keyHash: " , uint256 (keyHash));
739- console.log ("_pay: intentDigest: " , uint256 (intentDigest));
740- console.log ("_pay: eoa: " , eoa);
741- console.log ("_pay: payer: " , payer);
742- console.log ("_pay: paymentToken: " , paymentToken);
743- console.log ("_pay: paymentRecipient: " , paymentRecipient);
744- console.log ("_pay: paymentSignature length: " , paymentSignature.length );
745-
746687 uint256 currentBalance = TokenTransferLib.balanceOf (paymentToken, paymentRecipient);
747- console.log ("_pay: Recipient current balance: " , currentBalance);
748688
749689 uint256 requiredBalanceAfter = Math.saturatingAdd (currentBalance, paymentAmount);
750- console.log ("_pay: Required balance after: " , requiredBalanceAfter);
751690
752691 // Call the pay function on the account contract
753692 // Equivalent Solidity code:
754693 // IIthacaAccount(payer).pay(paymentAmount, keyHash, digest, abi.encode(i));
755694 // Gas Savings:
756695 // Saves ~2k gas for normal use cases, by avoiding abi.encode and solidity external call overhead
757- console.log ("_pay: About to call pay() on payer account " );
758- console.log ("_pay: Calling address: " , payer);
759696 address callee = Math.coalesce (payer, eoa);
760697
761698 bool payCallSuccess;
@@ -792,21 +729,11 @@ contract Orchestrator is
792729 if iszero (payCallSuccess) { revert (0x00 , 0x20 ) }
793730 }
794731
795- console.log ("_pay: Pay call completed successfully " );
796-
797732 uint256 actualBalanceAfter = TokenTransferLib.balanceOf (paymentToken, paymentRecipient);
798- console.log ("_pay: Recipient actual balance after: " , actualBalanceAfter);
799- console.log ("_pay: Required balance after: " , requiredBalanceAfter);
800733
801734 if (actualBalanceAfter < requiredBalanceAfter) {
802- console.log ("_pay: PAYMENT VERIFICATION FAILED - Insufficient balance increase " );
803- console.log ("_pay: Expected increase: " , paymentAmount);
804- console.log ("_pay: Actual increase: " , actualBalanceAfter - currentBalance);
805735 revert PaymentError ();
806736 }
807-
808- console.log ("_pay: Payment verification passed " );
809- console.log ("=== Orchestrator._pay() END === " );
810737 }
811738
812739 /// @dev Calls `unwrapAndValidateSignature` on the `eoa`.
0 commit comments