diff --git a/.gas-snapshot b/.gas-snapshot index ad833fbb..8daa3aa0 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,20 +1,20 @@ -BatchCallbackTest:testBatchCallWithCallback() (gas: 114554) -BatchExecutorTest:testBatchExecuteWithPartialFailures() (gas: 121350) -BatchExecutorTest:testBatchExecuteWithPartialFailuresDoesNotRevertIfAnyCallsRevert() (gas: 99552) -BatchExecutorTest:testBatchExecuteWithoutPartialFailures() (gas: 121658) -BatchExecutorTest:testBatchExecuteWithoutPartialFailuresRevertsIfAnyCallsRevert() (gas: 96868) -CallbacksTest:testAllowNestedCallbacks() (gas: 116999) -CallbacksTest:testCallbackFromCounter() (gas: 69395) -CallbacksTest:testDelegatecallReentrancyExploitWithUnprotectedScript() (gas: 70908) -CallbacksTest:testDelegatecallReentrancyProtectionWithProtectedScript() (gas: 114122) -CallbacksTest:testNestedCallWithNoCallbackSucceeds() (gas: 110258) -CallbacksTest:testNestedCallbackResetsCallbackSlot() (gas: 87858) -CallbacksTest:testPayableCallback() (gas: 76928) -CallbacksTest:testReentrancyGuardProtectsAgainstDoubleDipping() (gas: 54343) -CallbacksTest:testRevertsOnCallbackWhenNoActiveCallback() (gas: 72601) -CallbacksTest:testSimpleCallback() (gas: 284460) -CallbacksTest:testWithClearedCallback() (gas: 156369) -CallbacksTest:testWithoutAllowCallback() (gas: 156138) +BatchCallbackTest:testBatchCallWithCallback() (gas: 114944) +BatchExecutorTest:testBatchExecuteWithPartialFailures() (gas: 121740) +BatchExecutorTest:testBatchExecuteWithPartialFailuresDoesNotRevertIfAnyCallsRevert() (gas: 99942) +BatchExecutorTest:testBatchExecuteWithoutPartialFailures() (gas: 122048) +BatchExecutorTest:testBatchExecuteWithoutPartialFailuresRevertsIfAnyCallsRevert() (gas: 97258) +CallbacksTest:testAllowNestedCallbacks() (gas: 117389) +CallbacksTest:testCallbackFromCounter() (gas: 69590) +CallbacksTest:testDelegatecallReentrancyExploitWithUnprotectedScript() (gas: 71103) +CallbacksTest:testDelegatecallReentrancyProtectionWithProtectedScript() (gas: 114512) +CallbacksTest:testNestedCallWithNoCallbackSucceeds() (gas: 110648) +CallbacksTest:testNestedCallbackResetsCallbackSlot() (gas: 88248) +CallbacksTest:testPayableCallback() (gas: 77123) +CallbacksTest:testReentrancyGuardProtectsAgainstDoubleDipping() (gas: 54538) +CallbacksTest:testRevertsOnCallbackWhenNoActiveCallback() (gas: 72796) +CallbacksTest:testSimpleCallback() (gas: 284840) +CallbacksTest:testWithClearedCallback() (gas: 156559) +CallbacksTest:testWithoutAllowCallback() (gas: 156328) CodeJarTest:testCodeJarCanBeWacky() (gas: 114646) CodeJarTest:testCodeJarCanDeployCodeThatHadEthSent() (gas: 6153300) CodeJarTest:testCodeJarCounter() (gas: 466199) @@ -31,172 +31,174 @@ CodeJarTest:testCodeJarStoresSelfReference() (gas: 121367) CodeJarTest:testCodeJarTickCounter() (gas: 198471) CodeJarTest:testRevertsOnConstructorRevert() (gas: 85038) CodeJarTest:testRevertsOnSelfDestructingConstructor() (gas: 53921) -ConditionalMulticallTest:testConditionalRunEmptyInputIsValid() (gas: 45945) -ConditionalMulticallTest:testConditionalRunInvalidInput() (gas: 46044) -ConditionalMulticallTest:testConditionalRunMulticallError() (gas: 289817) -ConditionalMulticallTest:testConditionalRunOnPeriodicRepay() (gas: 281063) -ConditionalMulticallTest:testConditionalRunPassed() (gas: 267960) -ConditionalMulticallTest:testConditionalRunUnmet() (gas: 77851) -EIP1271Test:testReturnsMagicValueForValidSignature() (gas: 69498) +ConditionalMulticallTest:testConditionalRunEmptyInputIsValid() (gas: 46140) +ConditionalMulticallTest:testConditionalRunInvalidInput() (gas: 46239) +ConditionalMulticallTest:testConditionalRunMulticallError() (gas: 290012) +ConditionalMulticallTest:testConditionalRunOnPeriodicRepay() (gas: 282038) +ConditionalMulticallTest:testConditionalRunPassed() (gas: 268155) +ConditionalMulticallTest:testConditionalRunUnmet() (gas: 78046) +EIP1271Test:testReturnsMagicValueForValidSignature() (gas: 69693) EIP1271Test:testRevertsIfSignerContractDoesNotReturnMagic() (gas: 16856) -EIP712Test:testExecuteQuarkOperation() (gas: 71158) -EIP712Test:testRequirements() (gas: 166122) +EIP712Test:testExecuteQuarkOperation() (gas: 71353) +EIP712Test:testRequirements() (gas: 166707) EIP712Test:testRevertBadRequirements() (gas: 24437) EIP712Test:testRevertsForBadCalldata() (gas: 19763) EIP712Test:testRevertsForBadCode() (gas: 21547) EIP712Test:testRevertsForBadExpiry() (gas: 20071) EIP712Test:testRevertsForExpiredSignature() (gas: 12635) EIP712Test:testRevertsInvalidS() (gas: 16718) -EIP712Test:testRevertsOnReusedNonce() (gas: 83249) +EIP712Test:testRevertsOnReusedNonce() (gas: 83446) EIP712Test:testStructHash() (gas: 9223372036854754743) -EthcallTest:testEthcallCallReraiseError() (gas: 54324) -EthcallTest:testEthcallCounter() (gas: 66115) -EthcallTest:testEthcallShouldReturnCallResult() (gas: 46931) -EthcallTest:testEthcallSupplyUSDCToComet() (gas: 154844) -EthcallTest:testEthcallWithdrawUSDCFromComet() (gas: 308452) -ExecutorTest:testExecutorCanDirectCall() (gas: 100488) -ExecutorTest:testExecutorCanDirectCallBySig() (gas: 104469) -MulticallTest:testCreateSubWalletAndExecute() (gas: 603354) -MulticallTest:testDelegatecallToMulticallSucceedsWhenInitialized() (gas: 74226) -MulticallTest:testEmptyInputIsValid() (gas: 45590) -MulticallTest:testExecutorCanMulticallAcrossSubwallets() (gas: 252883) -MulticallTest:testInvalidInput() (gas: 45804) -MulticallTest:testInvokeCounterTwice() (gas: 74160) -MulticallTest:testMulticallError() (gas: 282681) -MulticallTest:testMulticallShouldReturnCallResults() (gas: 76649) +EthcallTest:testEthcallCallReraiseError() (gas: 54519) +EthcallTest:testEthcallCounter() (gas: 66310) +EthcallTest:testEthcallShouldReturnCallResult() (gas: 47126) +EthcallTest:testEthcallSupplyUSDCToComet() (gas: 155234) +EthcallTest:testEthcallWithdrawUSDCFromComet() (gas: 309037) +ExecutorTest:testExecutorCanDirectCall() (gas: 100878) +ExecutorTest:testExecutorCanDirectCallBySig() (gas: 104859) +MulticallTest:testCreateSubWalletAndExecute() (gas: 603939) +MulticallTest:testDelegatecallToMulticallSucceedsWhenInitialized() (gas: 74421) +MulticallTest:testEmptyInputIsValid() (gas: 45785) +MulticallTest:testExecutorCanMulticallAcrossSubwallets() (gas: 253663) +MulticallTest:testInvalidInput() (gas: 45999) +MulticallTest:testInvokeCounterTwice() (gas: 74355) +MulticallTest:testMulticallError() (gas: 282876) +MulticallTest:testMulticallShouldReturnCallResults() (gas: 76844) MulticallTest:testRevertsForInvalidCallContext() (gas: 11543) -MulticallTest:testSupplyWETHWithdrawUSDCOnComet() (gas: 247586) -NoncerTest:testGetActiveNonceNested() (gas: 88525) -NoncerTest:testGetActiveNonceReplayable() (gas: 65730) -NoncerTest:testGetActiveNonceSingle() (gas: 44961) -NoncerTest:testGetActiveReplayCount() (gas: 85364) -NoncerTest:testGetActiveReplayCountNested() (gas: 88957) -NoncerTest:testGetActiveReplayCountSingle() (gas: 44799) -NoncerTest:testGetActiveReplayCountWithNonReplaySoftCancel() (gas: 69325) -NoncerTest:testGetActiveSubmissionTokenNested() (gas: 88031) -NoncerTest:testGetActiveSubmissionTokenReplayable() (gas: 65756) -NoncerTest:testGetActiveSubmissionTokenSingle() (gas: 47765) -NoncerTest:testNestedPlayPullingActiveReplayCount() (gas: 608321) -NoncerTest:testPostNestReadsCorrectValue() (gas: 141247) +MulticallTest:testSupplyWETHWithdrawUSDCOnComet() (gas: 247781) +NoncerTest:testGetActiveNonceNested() (gas: 88915) +NoncerTest:testGetActiveNonceReplayable() (gas: 66110) +NoncerTest:testGetActiveNonceSingle() (gas: 45156) +NoncerTest:testGetActiveReplayCount() (gas: 85934) +NoncerTest:testGetActiveReplayCountNested() (gas: 89347) +NoncerTest:testGetActiveReplayCountSingle() (gas: 44994) +NoncerTest:testGetActiveReplayCountWithNonReplaySoftCancel() (gas: 69710) +NoncerTest:testGetActiveSubmissionTokenNested() (gas: 88421) +NoncerTest:testGetActiveSubmissionTokenReplayable() (gas: 66136) +NoncerTest:testGetActiveSubmissionTokenSingle() (gas: 47960) +NoncerTest:testNestedPlayPullingActiveReplayCount() (gas: 608701) +NoncerTest:testPostNestReadsCorrectValue() (gas: 141637) PaycallTest:testInitializeProperlyFromConstructor() (gas: 6368) -PaycallTest:testPaycallForPayWithUSDT() (gas: 116565) -PaycallTest:testPaycallForPayWithWBTC() (gas: 109705) -PaycallTest:testPaycallRevertsWhenCallReverts() (gas: 50543) -PaycallTest:testReturnCallResult() (gas: 86447) +PaycallTest:testPaycallForPayWithUSDT() (gas: 116760) +PaycallTest:testPaycallForPayWithWBTC() (gas: 109900) +PaycallTest:testPaycallRevertsWhenCallReverts() (gas: 50738) +PaycallTest:testReturnCallResult() (gas: 86642) PaycallTest:testRevertsForInvalidCallContext() (gas: 15789) -PaycallTest:testRevertsWhenCostIsMoreThanMaxPaymentCost() (gas: 96355) -PaycallTest:testSimpleCounterAndPayWithUSDC() (gas: 137614) -PaycallTest:testSimpleTransferTokenAndPayWithUSDC() (gas: 138968) -PaycallTest:testSupplyWETHWithdrawUSDCOnCometAndPayWithUSDC() (gas: 290738) -QuarkFactoryTest:testInvariantAddressesBetweenNonces() (gas: 3343501) -QuarkFactoryTest:testQuarkFactoryDeployToDeterministicAddresses() (gas: 3343232) -QuarkFactoryTest:testQuarkFactoryDeployTwice() (gas: 3374202) -QuarkMinimalProxyTest:testSignerExecutor() (gas: 61493) -QuarkNonceManagerTest:testCancelChain() (gas: 49553) -QuarkNonceManagerTest:testCancelExhaustedIsNoOp() (gas: 40796) -QuarkNonceManagerTest:testChangingReplayableness() (gas: 38431) -QuarkNonceManagerTest:testClaimsSequentialNonces() (gas: 13854737) -QuarkNonceManagerTest:testInvalidNonces() (gas: 14997) -QuarkNonceManagerTest:testIsSet() (gas: 31643) -QuarkNonceManagerTest:testNextNonceChain() (gas: 92598) -QuarkNonceManagerTest:testNonLinearNonce() (gas: 40308) -QuarkNonceManagerTest:testNonceOneIsValid() (gas: 35700) -QuarkNonceManagerTest:testPrecancelNonce() (gas: 37966) -QuarkNonceManagerTest:testRevertsDefenseInDepthReplayableSubmissionTokenZero() (gas: 40041) -QuarkNonceManagerTest:testRevertsIfNonceIsAlreadySet() (gas: 36842) -QuarkNonceManagerTest:testRevertsIfSubmittingNonMatchingNonceForNonReplayable() (gas: 19507) -QuarkNonceManagerTest:testSingleUseRandomValidNonce() (gas: 45067) +PaycallTest:testRevertsWhenCostIsMoreThanMaxPaymentCost() (gas: 96550) +PaycallTest:testSimpleCounterAndPayWithUSDC() (gas: 137809) +PaycallTest:testSimpleTransferTokenAndPayWithUSDC() (gas: 139163) +PaycallTest:testSupplyWETHWithdrawUSDCOnCometAndPayWithUSDC() (gas: 290933) +QuarkFactoryTest:testInvariantAddressesBetweenNonces() (gas: 3338644) +QuarkFactoryTest:testQuarkFactoryDeployToDeterministicAddresses() (gas: 3338375) +QuarkFactoryTest:testQuarkFactoryDeployTwice() (gas: 3369302) +QuarkMinimalProxyTest:testSignerExecutor() (gas: 61688) +QuarkNonceManagerTest:testCancelChain() (gas: 49985) +QuarkNonceManagerTest:testCancelExhaustedIsNoOp() (gas: 41243) +QuarkNonceManagerTest:testChangingReplayableness() (gas: 38818) +QuarkNonceManagerTest:testClaimsSequentialNonces() (gas: 13962071) +QuarkNonceManagerTest:testInvalidNonces() (gas: 15019) +QuarkNonceManagerTest:testIsSet() (gas: 31860) +QuarkNonceManagerTest:testNextNonceChain() (gas: 93457) +QuarkNonceManagerTest:testNonLinearNonce() (gas: 40551) +QuarkNonceManagerTest:testNonReplayableEmitsEvent() (gas: 35645) +QuarkNonceManagerTest:testNonceOneIsValid() (gas: 35917) +QuarkNonceManagerTest:testPrecancelNonce() (gas: 38220) +QuarkNonceManagerTest:testReplayableEmitsEvent() (gas: 35911) +QuarkNonceManagerTest:testRevertsDefenseInDepthReplayableSubmissionTokenZero() (gas: 40240) +QuarkNonceManagerTest:testRevertsIfNonceIsAlreadySet() (gas: 37085) +QuarkNonceManagerTest:testRevertsIfSubmittingNonMatchingNonceForNonReplayable() (gas: 19536) +QuarkNonceManagerTest:testSingleUseRandomValidNonce() (gas: 45311) QuarkWalletProxyFactoryTest:testCreateAdditionalWalletWithSalt() (gas: 221800) -QuarkWalletProxyFactoryTest:testCreateAndExecuteCreatesWallet() (gas: 497480) -QuarkWalletProxyFactoryTest:testCreateAndExecuteMultiCreatesWallet() (gas: 551388) -QuarkWalletProxyFactoryTest:testCreateAndExecuteMultiWithSalt() (gas: 555749) -QuarkWalletProxyFactoryTest:testCreateAndExecuteSetsMsgSender() (gas: 217657) -QuarkWalletProxyFactoryTest:testCreateAndExecuteWithSalt() (gas: 499762) -QuarkWalletProxyFactoryTest:testCreateAndExecuteWithSaltSetsMsgSender() (gas: 370326) +QuarkWalletProxyFactoryTest:testCreateAndExecuteCreatesWallet() (gas: 497675) +QuarkWalletProxyFactoryTest:testCreateAndExecuteMultiCreatesWallet() (gas: 551778) +QuarkWalletProxyFactoryTest:testCreateAndExecuteMultiWithSalt() (gas: 556139) +QuarkWalletProxyFactoryTest:testCreateAndExecuteSetsMsgSender() (gas: 217852) +QuarkWalletProxyFactoryTest:testCreateAndExecuteWithSalt() (gas: 499957) +QuarkWalletProxyFactoryTest:testCreateAndExecuteWithSaltSetsMsgSender() (gas: 370716) QuarkWalletProxyFactoryTest:testCreateRevertsOnRepeat() (gas: 8937393460516733348) QuarkWalletProxyFactoryTest:testCreatesWalletAtDeterministicAddress() (gas: 228550) -QuarkWalletProxyFactoryTest:testExecuteMultiOnExistingWallet() (gas: 549560) -QuarkWalletProxyFactoryTest:testExecuteOnExistingWallet() (gas: 496064) -QuarkWalletProxyFactoryTest:testExecutorIsOtherWallet() (gas: 333600) +QuarkWalletProxyFactoryTest:testExecuteMultiOnExistingWallet() (gas: 549950) +QuarkWalletProxyFactoryTest:testExecuteOnExistingWallet() (gas: 496259) +QuarkWalletProxyFactoryTest:testExecutorIsOtherWallet() (gas: 333990) QuarkWalletProxyFactoryTest:testExecutorSetInCreate() (gas: 109661) QuarkWalletProxyFactoryTest:testVersion() (gas: 5998) -QuarkWalletTest:testAllowsForReusedNonceWithChangedScript() (gas: 100131) -QuarkWalletTest:testAtomicIncrementer() (gas: 69037) -QuarkWalletTest:testAtomicMaxCounterScript() (gas: 162100) -QuarkWalletTest:testAtomicPing() (gas: 47208) -QuarkWalletTest:testAtomicPingWithExternalSignature() (gas: 100297) -QuarkWalletTest:testCanReplaySameScriptWithDifferentCall() (gas: 155828) -QuarkWalletTest:testDirectExecuteFromEOA() (gas: 62241) -QuarkWalletTest:testDirectExecuteFromOtherQuarkWallet() (gas: 100883) -QuarkWalletTest:testDirectExecuteWithScriptSources() (gas: 370522) -QuarkWalletTest:testDisallowAllNullScriptAddress() (gas: 163064) -QuarkWalletTest:testEmitsEventsInDirectExecute() (gas: 40865) -QuarkWalletTest:testEmitsEventsInExecuteQuarkOperation() (gas: 91653) -QuarkWalletTest:testEmitsEventsInReplayableQuarkOperation() (gas: 94513) -QuarkWalletTest:testFailsWithRepeatNonceInDirectExecute() (gas: 90197) +QuarkWalletTest:testAllowsForReusedNonceWithChangedScript() (gas: 100516) +QuarkWalletTest:testAtomicIncrementer() (gas: 69232) +QuarkWalletTest:testAtomicMaxCounterScript() (gas: 162860) +QuarkWalletTest:testAtomicPing() (gas: 47403) +QuarkWalletTest:testAtomicPingWithExternalSignature() (gas: 100492) +QuarkWalletTest:testCanReplaySameScriptWithDifferentCall() (gas: 156220) +QuarkWalletTest:testDirectExecuteFromEOA() (gas: 62436) +QuarkWalletTest:testDirectExecuteFromOtherQuarkWallet() (gas: 101273) +QuarkWalletTest:testDirectExecuteWithScriptSources() (gas: 370717) +QuarkWalletTest:testDisallowAllNullScriptAddress() (gas: 163844) +QuarkWalletTest:testEmitsEventsInDirectExecute() (gas: 41060) +QuarkWalletTest:testEmitsEventsInExecuteQuarkOperation() (gas: 92043) +QuarkWalletTest:testEmitsEventsInReplayableQuarkOperation() (gas: 95083) +QuarkWalletTest:testFailsWithRepeatNonceInDirectExecute() (gas: 90394) QuarkWalletTest:testGetCodeJar() (gas: 11158) QuarkWalletTest:testGetExecutor() (gas: 5396) QuarkWalletTest:testGetNonceManager() (gas: 11070) QuarkWalletTest:testGetSigner() (gas: 8521) -QuarkWalletTest:testHalfReplayableMultiQuarkOperation() (gas: 281139) -QuarkWalletTest:testMultiQuarkOperationCanCallMultipleOperationsWithOneSignature() (gas: 115448) -QuarkWalletTest:testPrecompileBigModExp() (gas: 45579) -QuarkWalletTest:testPrecompileBlake2F() (gas: 47831) -QuarkWalletTest:testPrecompileBn256Add() (gas: 47077) -QuarkWalletTest:testPrecompileBn256ScalarMul() (gas: 52017) -QuarkWalletTest:testPrecompileDataCopy() (gas: 53592) -QuarkWalletTest:testPrecompileEcRecover() (gas: 51354) -QuarkWalletTest:testPrecompileRipemd160() (gas: 47243) -QuarkWalletTest:testPrecompileSha256() (gas: 47039) -QuarkWalletTest:testQuarkOperationDoesNotRevertOnNestedCallFromSelf() (gas: 87690) -QuarkWalletTest:testQuarkOperationRevertsIfCallReverts() (gas: 45568) -QuarkWalletTest:testQuarkOperationRevertsOnNestedCallFromOutsideContract() (gas: 86837) -QuarkWalletTest:testReadStorageForWallet() (gas: 161553) -QuarkWalletTest:testReplayableMultiQuarkOperation() (gas: 372785) -QuarkWalletTest:testReplayableMultiQuarkOperationWithSharedNonce() (gas: 252338) -QuarkWalletTest:testRequiresCorrectSubmissionToken() (gas: 124073) -QuarkWalletTest:testRevertOnAllPrecompilesDirectCall() (gas: 415639) +QuarkWalletTest:testHalfReplayableMultiQuarkOperation() (gas: 281919) +QuarkWalletTest:testMultiQuarkOperationCanCallMultipleOperationsWithOneSignature() (gas: 115838) +QuarkWalletTest:testPrecompileBigModExp() (gas: 45774) +QuarkWalletTest:testPrecompileBlake2F() (gas: 48026) +QuarkWalletTest:testPrecompileBn256Add() (gas: 47272) +QuarkWalletTest:testPrecompileBn256ScalarMul() (gas: 52212) +QuarkWalletTest:testPrecompileDataCopy() (gas: 53787) +QuarkWalletTest:testPrecompileEcRecover() (gas: 51549) +QuarkWalletTest:testPrecompileRipemd160() (gas: 47438) +QuarkWalletTest:testPrecompileSha256() (gas: 47234) +QuarkWalletTest:testQuarkOperationDoesNotRevertOnNestedCallFromSelf() (gas: 88080) +QuarkWalletTest:testQuarkOperationRevertsIfCallReverts() (gas: 45763) +QuarkWalletTest:testQuarkOperationRevertsOnNestedCallFromOutsideContract() (gas: 87227) +QuarkWalletTest:testReadStorageForWallet() (gas: 162313) +QuarkWalletTest:testReplayableMultiQuarkOperation() (gas: 373947) +QuarkWalletTest:testReplayableMultiQuarkOperationWithSharedNonce() (gas: 252929) +QuarkWalletTest:testRequiresCorrectSubmissionToken() (gas: 124280) +QuarkWalletTest:testRevertOnAllPrecompilesDirectCall() (gas: 417394) QuarkWalletTest:testRevertsForBadInputsInMultiQuarkOperation() (gas: 11255) QuarkWalletTest:testRevertsForDirectExecuteByNonExecutorSigner() (gas: 12014) -QuarkWalletTest:testRevertsForNonceReuse() (gas: 83795) -QuarkWalletTest:testRevertsForRandomEmptyScriptAddress() (gas: 93625) +QuarkWalletTest:testRevertsForNonceReuse() (gas: 83992) +QuarkWalletTest:testRevertsForRandomEmptyScriptAddress() (gas: 93820) QuarkWalletTest:testRevertsForUnauthorizedDirectExecuteByRandomAddress() (gas: 14184) -QuarkWalletTest:testScriptCanBeCanceledByNewOp() (gas: 153659) -QuarkWalletTest:testScriptCanBeCanceledByNoOp() (gas: 128469) -QuarkWalletTest:testSetsMsgSender() (gas: 46374) -QuarkWalletTest:testSetsMsgSenderDuringDirectExecute() (gas: 38362) +QuarkWalletTest:testScriptCanBeCanceledByNewOp() (gas: 154468) +QuarkWalletTest:testScriptCanBeCanceledByNoOp() (gas: 128859) +QuarkWalletTest:testSetsMsgSender() (gas: 46569) +QuarkWalletTest:testSetsMsgSenderDuringDirectExecute() (gas: 38557) QuotecallTest:testInitializeProperlyFromConstructor() (gas: 6996) -QuotecallTest:testQuotecallForPayWithUSDT() (gas: 116718) -QuotecallTest:testQuotecallForPayWithWBTC() (gas: 109939) -QuotecallTest:testQuotecallRevertsWhenCallReverts() (gas: 86826) -QuotecallTest:testReturnCallResult() (gas: 106539) +QuotecallTest:testQuotecallForPayWithUSDT() (gas: 116913) +QuotecallTest:testQuotecallForPayWithWBTC() (gas: 110134) +QuotecallTest:testQuotecallRevertsWhenCallReverts() (gas: 87021) +QuotecallTest:testReturnCallResult() (gas: 106734) QuotecallTest:testRevertsForInvalidCallContext() (gas: 15764) -QuotecallTest:testRevertsWhenQuoteTooHigh() (gas: 132290) -QuotecallTest:testRevertsWhenQuoteTooLow() (gas: 132132) -QuotecallTest:testSimpleCounterAndPayWithUSDC() (gas: 137755) -QuotecallTest:testSimpleTransferTokenAndPayWithUSDC() (gas: 139121) -ReplayableTransactionsTest:testCancelRecurringPurchase() (gas: 249372) -ReplayableTransactionsTest:testRecurringPurchaseHappyPath() (gas: 198495) -ReplayableTransactionsTest:testRecurringPurchaseMultiplePurchases() (gas: 295957) -ReplayableTransactionsTest:testRecurringPurchaseWithDifferentCalldata() (gas: 484445) +QuotecallTest:testRevertsWhenQuoteTooHigh() (gas: 132485) +QuotecallTest:testRevertsWhenQuoteTooLow() (gas: 132327) +QuotecallTest:testSimpleCounterAndPayWithUSDC() (gas: 137950) +QuotecallTest:testSimpleTransferTokenAndPayWithUSDC() (gas: 139316) +ReplayableTransactionsTest:testCancelRecurringPurchase() (gas: 249761) +ReplayableTransactionsTest:testRecurringPurchaseHappyPath() (gas: 198690) +ReplayableTransactionsTest:testRecurringPurchaseMultiplePurchases() (gas: 296527) +ReplayableTransactionsTest:testRecurringPurchaseWithDifferentCalldata() (gas: 485404) ReplayableTransactionsTest:testRevertsForExpiredQuarkOperation() (gas: 9702) -ReplayableTransactionsTest:testRevertsForExpiredUniswapParams() (gas: 89245) -ReplayableTransactionsTest:testRevertsForPurchaseBeforeNextPurchasePeriod() (gas: 225136) -ReplayableTransactionsTest:testRevertsForPurchasingOverTheLimit() (gas: 225809) -RevertsTest:testRevertsInteger() (gas: 45367) -RevertsTest:testRevertsInvalidOpcode() (gas: 8660281895700907393) -RevertsTest:testRevertsOutOfGas() (gas: 302743) -RevertsTest:testRevertsWhenDividingByZero() (gas: 45208) -UniswapFlashLoanTest:testFlashLoanForCollateralSwapOnCompound() (gas: 369580) -UniswapFlashLoanTest:testRevertsForInsufficientFundsToRepayFlashLoan() (gas: 139873) -UniswapFlashLoanTest:testRevertsForInvalidCaller() (gas: 47393) -UniswapFlashLoanTest:testRevertsForSecondCallback() (gas: 128893) -UniswapFlashLoanTest:testTokensOrderInvariant() (gas: 82860) -UniswapFlashSwapExactOutTest:testInvalidCallerFlashSwap() (gas: 47611) -UniswapFlashSwapExactOutTest:testNotEnoughToPayFlashSwap() (gas: 235050) -UniswapFlashSwapExactOutTest:testRevertsForSecondCallback() (gas: 111879) +ReplayableTransactionsTest:testRevertsForExpiredUniswapParams() (gas: 89435) +ReplayableTransactionsTest:testRevertsForPurchaseBeforeNextPurchasePeriod() (gas: 225516) +ReplayableTransactionsTest:testRevertsForPurchasingOverTheLimit() (gas: 226189) +RevertsTest:testRevertsInteger() (gas: 45562) +RevertsTest:testRevertsInvalidOpcode() (gas: 8660281895700907402) +RevertsTest:testRevertsOutOfGas() (gas: 302746) +RevertsTest:testRevertsWhenDividingByZero() (gas: 45403) +UniswapFlashLoanTest:testFlashLoanForCollateralSwapOnCompound() (gas: 369775) +UniswapFlashLoanTest:testRevertsForInsufficientFundsToRepayFlashLoan() (gas: 140068) +UniswapFlashLoanTest:testRevertsForInvalidCaller() (gas: 47588) +UniswapFlashLoanTest:testRevertsForSecondCallback() (gas: 129088) +UniswapFlashLoanTest:testTokensOrderInvariant() (gas: 83055) +UniswapFlashSwapExactOutTest:testInvalidCallerFlashSwap() (gas: 47806) +UniswapFlashSwapExactOutTest:testNotEnoughToPayFlashSwap() (gas: 235245) +UniswapFlashSwapExactOutTest:testRevertsForSecondCallback() (gas: 112074) UniswapFlashSwapExactOutTest:testRevertsIfCalledDirectly() (gas: 104456) -UniswapFlashSwapExactOutTest:testUniswapFlashSwapExactOutLeverageComet() (gas: 312203) +UniswapFlashSwapExactOutTest:testUniswapFlashSwapExactOutLeverageComet() (gas: 312398) isValidSignatureTest:testIsValidSignatureForEOAOwner() (gas: 13062) isValidSignatureTest:testReturnsMagicValueForValidSignature() (gas: 8324) isValidSignatureTest:testRevertsForEmptyContract() (gas: 10910) diff --git a/src/quark-core/src/QuarkNonceManager.sol b/src/quark-core/src/QuarkNonceManager.sol index e9acda4c..7583a15b 100644 --- a/src/quark-core/src/QuarkNonceManager.sol +++ b/src/quark-core/src/QuarkNonceManager.sol @@ -19,7 +19,7 @@ contract QuarkNonceManager { error InvalidNonce(address wallet, bytes32 nonce); error InvalidSubmissionToken(address wallet, bytes32 nonce, bytes32 submissionToken); - event NonceSubmitted(address wallet, bytes32 nonce, bytes32 submissionToken); + event NonceSubmitted(address indexed wallet, bytes32 indexed nonce, bytes32 submissionToken); /// @notice Represents the unclaimed bytes32 value. bytes32 public constant FREE = QuarkNonceManagerMetadata.FREE; @@ -70,7 +70,8 @@ contract QuarkNonceManager { } // Note: Even with a valid submission token, we always set non-replayables to exhausted (e.g. for cancellations) - submissions[msg.sender][nonce] = isReplayable ? submissionToken : EXHAUSTED; - emit NonceSubmitted(msg.sender, nonce, submissionToken); + bytes32 finalSubmissionToken = isReplayable ? submissionToken : EXHAUSTED; + submissions[msg.sender][nonce] = finalSubmissionToken; + emit NonceSubmitted(msg.sender, nonce, finalSubmissionToken); } } diff --git a/src/quark-core/src/QuarkScript.sol b/src/quark-core/src/QuarkScript.sol index 9826c8c0..2f59bbac 100644 --- a/src/quark-core/src/QuarkScript.sol +++ b/src/quark-core/src/QuarkScript.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.27; import {QuarkWalletMetadata, IHasSignerExecutor} from "quark-core/src/QuarkWallet.sol"; -import {QuarkNonceManager, QuarkNonceManagerMetadata} from "quark-core/src/QuarkNonceManager.sol"; +import {QuarkNonceManager} from "quark-core/src/QuarkNonceManager.sol"; import {IQuarkWallet} from "quark-core/src/interfaces/IQuarkWallet.sol"; /** diff --git a/test/quark-core/QuarkNonceManager.t.sol b/test/quark-core/QuarkNonceManager.t.sol index 826a38b1..86aecb97 100644 --- a/test/quark-core/QuarkNonceManager.t.sol +++ b/test/quark-core/QuarkNonceManager.t.sol @@ -152,6 +152,22 @@ contract QuarkNonceManagerTest is Test { nonceManager.submit(nonce, false, nonce); } + function testNonReplayableEmitsEvent() public { + vm.expectEmit(true, true, true, true); + emit QuarkNonceManager.NonceSubmitted(address(this), NONCE_ONE, EXHAUSTED_TOKEN); + nonceManager.submit(NONCE_ONE, false, NONCE_ONE); + + assertEq(nonceManager.submissions(address(this), NONCE_ONE), EXHAUSTED_TOKEN); + } + + function testReplayableEmitsEvent() public { + vm.expectEmit(true, true, true, true); + emit QuarkNonceManager.NonceSubmitted(address(this), NONCE_ONE, NONCE_ONE); + nonceManager.submit(NONCE_ONE, true, NONCE_ONE); + + assertEq(nonceManager.submissions(address(this), NONCE_ONE), NONCE_ONE); + } + function testIsSet() public { // nonce is unset by default assertEq(nonceManager.submissions(address(this), NONCE_ONE), FREE_TOKEN);