Sitelet https://github.com/ithacaxyz/account/commit/544e17eb147c38cfa78441a1030c7c1a0399f6e4
Skip to content

Commit 544e17e

Browse files
Merge remote-tracking branch 'origin/Legion' into Dargon789-Refactor-deployment-scripts-and-update-configs
2 parents abbcf1d + 4b94c1c commit 544e17e

29 files changed

Lines changed: 2223 additions & 712 deletions

‎CHANGELOG.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
- All fill related functions removed from EP.
9595
- EP is now completely stateless, also does not have a constructor.
9696
- PreCall with `nonce = type(uint256).max` is not replayable anymore.
97-
- `OpDataTooShort` error, udpated to `OpDataError`, to enforce tighter validation of opdata.
97+
- `OpDataTooShort` error, updated to `OpDataError`, to enforce tighter validation of opdata.
9898
- `checkAndIncrementNonce` function added to account. Can only be called by EP.
9999
- 6b3294a: Optimize `_isSuperAdmin`
100100

@@ -131,7 +131,7 @@
131131

132132
- Add back the INSUFFICIENT_GAS check, which prevents the relay from setting up the `execute` call on the
133133
account, in such a way causing it to intentionally fail.
134-
For the relay, gExecute now has to be set atleast as `gExecute > (gCombined + 100_000) * 64/63)`
134+
For the relay, gExecute now has to be set at least as `gExecute > (gCombined + 100_000) * 64/63)`
135135

136136
### Patch Changes
137137

‎foundry.lock‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"lib/LayerZero-v2": {
33
"rev": "88428755be6caa71cb1d2926141d73c8989296b5"
44
},
5-
"lib/devtools": {
6-
"rev": "01c1eaeb123e4364fbe96cdddf875640edf2566c"
7-
},
85
"lib/forge-std": {
9-
"rev": "a3dca253700f19f15b1837c57c67b9388f5cc3fb"
6+
"branch": {
7+
"name": "master",
8+
"rev": "27ab851c7cde58b22cc4de426d59e23a31c5cb9c"
9+
}
1010
},
1111
"lib/murky": {
1212
"rev": "5feccd1253d7da820f7cccccdedf64471025455d"
@@ -17,7 +17,7 @@
1717
"lib/solady": {
1818
"branch": {
1919
"name": "main",
20-
"rev": "834bbc4fd366ca8bce8c532a0e3b34eca6be709c"
20+
"rev": "73f13dd1483707ef6b4d16cb0543570b7e1715a8"
2121
}
2222
}
2323
}

‎lib/solady‎

Submodule solady updated 104 files

‎snapshots/BenchmarkTest.json‎

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
2-
"testERC20Transfer_AlchemyModularAccount": "179494",
3-
"testERC20Transfer_AlchemyModularAccount_AppSponsor": "176436",
4-
"testERC20Transfer_AlchemyModularAccount_ERC20SelfPay": "207779",
5-
"testERC20Transfer_Batch100_AlchemyModularAccount_AppSponsor": "8897167",
6-
"testERC20Transfer_Batch100_CoinbaseSmartWallet": "9952203",
7-
"testERC20Transfer_Batch100_CoinbaseSmartWallet_AppSponsor": "8787327",
8-
"testERC20Transfer_Batch100_CoinbaseSmartWallet_ERC20SelfPay": "11335605",
9-
"testERC20Transfer_Batch100_Safe4337": "11685484",
10-
"testERC20Transfer_Batch100_Safe4337_AppSponsor": "10198375",
11-
"testERC20Transfer_Batch100_Safe4337_ERC20SelfPay": "12757523",
12-
"testERC20Transfer_Batch100_ZerodevKernel_AppSponsor": "11427583",
13-
"testERC20Transfer_CoinbaseSmartWallet": "177855",
14-
"testERC20Transfer_CoinbaseSmartWallet_AppSponsor": "175259",
15-
"testERC20Transfer_CoinbaseSmartWallet_ERC20SelfPay": "204919",
16-
"testERC20Transfer_ERC4337MinimalAccount": "171509",
17-
"testERC20Transfer_ERC4337MinimalAccount_AppSponsor": "168500",
18-
"testERC20Transfer_ERC4337MinimalAccount_ERC20SelfPay": "199831",
19-
"testERC20Transfer_IthacaAccount": "128195",
20-
"testERC20Transfer_IthacaAccountWithSpendLimits": "193658",
21-
"testERC20Transfer_IthacaAccount_AppSponsor": "138709",
22-
"testERC20Transfer_IthacaAccount_AppSponsor_ERC20": "144010",
23-
"testERC20Transfer_IthacaAccount_ERC20SelfPay": "128684",
24-
"testERC20Transfer_Safe4337": "197561",
25-
"testERC20Transfer_Safe4337_AppSponsor": "191725",
26-
"testERC20Transfer_Safe4337_ERC20SelfPay": "221464",
27-
"testERC20Transfer_ZerodevKernel": "207117",
28-
"testERC20Transfer_ZerodevKernel_AppSponsor": "204120",
29-
"testERC20Transfer_ZerodevKernel_ERC20SelfPay": "235489",
30-
"testERC20Transfer_batch100_AlchemyModularAccount": "10109066",
31-
"testERC20Transfer_batch100_AlchemyModularAccount_ERC20SelfPay": "11609298",
32-
"testERC20Transfer_batch100_IthacaAccount": "7545392",
33-
"testERC20Transfer_batch100_IthacaAccount_AppSponsor": "8151496",
34-
"testERC20Transfer_batch100_IthacaAccount_AppSponsor_ERC20": "7977508",
35-
"testERC20Transfer_batch100_IthacaAccount_ERC20SelfPay": "7366652",
36-
"testERC20Transfer_batch100_ZerodevKernel": "12631318",
37-
"testERC20Transfer_batch100_ZerodevKernel_ERC20SelfPay": "14149937",
38-
"testNativeTransfer_AlchemyModularAccount": "180829",
39-
"testNativeTransfer_CoinbaseSmartWallet": "178916",
40-
"testNativeTransfer_IthacaAccount": "129551",
41-
"testNativeTransfer_IthacaAccount_AppSponsor": "140096",
42-
"testNativeTransfer_IthacaAccount_ERC20SelfPay": "137340",
43-
"testNativeTransfer_Safe4337": "198595",
44-
"testNativeTransfer_ZerodevKernel": "208635",
45-
"testUniswapV2Swap_AlchemyModularAccount": "238647",
46-
"testUniswapV2Swap_CoinbaseSmartWallet": "237451",
47-
"testUniswapV2Swap_ERC4337MinimalAccount": "230691",
48-
"testUniswapV2Swap_IthacaAccount": "187339",
49-
"testUniswapV2Swap_IthacaAccount_AppSponsor": "197817",
50-
"testUniswapV2Swap_IthacaAccount_ERC20SelfPay": "192628",
51-
"testUniswapV2Swap_Safe4337": "257333",
52-
"testUniswapV2Swap_ZerodevKernel": "266367"
2+
"testERC20Transfer_AlchemyModularAccount": "159052",
3+
"testERC20Transfer_AlchemyModularAccount_AppSponsor": "134278",
4+
"testERC20Transfer_AlchemyModularAccount_ERC20SelfPay": "160169",
5+
"testERC20Transfer_Batch100_AlchemyModularAccount_AppSponsor": "7053863",
6+
"testERC20Transfer_Batch100_CoinbaseSmartWallet": "9801043",
7+
"testERC20Transfer_Batch100_CoinbaseSmartWallet_AppSponsor": "6483523",
8+
"testERC20Transfer_Batch100_CoinbaseSmartWallet_ERC20SelfPay": "8487729",
9+
"testERC20Transfer_Batch100_Safe4337": "11165400",
10+
"testERC20Transfer_Batch100_Safe4337_AppSponsor": "7525827",
11+
"testERC20Transfer_Batch100_Safe4337_ERC20SelfPay": "9540939",
12+
"testERC20Transfer_Batch100_ZerodevKernel_AppSponsor": "8956539",
13+
"testERC20Transfer_CoinbaseSmartWallet": "150133",
14+
"testERC20Transfer_CoinbaseSmartWallet_AppSponsor": "126009",
15+
"testERC20Transfer_CoinbaseSmartWallet_ERC20SelfPay": "150241",
16+
"testERC20Transfer_ERC4337MinimalAccount": "148602",
17+
"testERC20Transfer_ERC4337MinimalAccount_AppSponsor": "123885",
18+
"testERC20Transfer_ERC4337MinimalAccount_ERC20SelfPay": "149776",
19+
"testERC20Transfer_IthacaAccount": "91666",
20+
"testERC20Transfer_IthacaAccountWithSpendLimits": "113167",
21+
"testERC20Transfer_IthacaAccount_AppSponsor": "99218",
22+
"testERC20Transfer_IthacaAccount_AppSponsor_ERC20": "104319",
23+
"testERC20Transfer_IthacaAccount_ERC20SelfPay": "91967",
24+
"testERC20Transfer_Safe4337": "163675",
25+
"testERC20Transfer_Safe4337_AppSponsor": "136323",
26+
"testERC20Transfer_Safe4337_ERC20SelfPay": "160610",
27+
"testERC20Transfer_ZerodevKernel": "175447",
28+
"testERC20Transfer_ZerodevKernel_AppSponsor": "150734",
29+
"testERC20Transfer_ZerodevKernel_ERC20SelfPay": "176663",
30+
"testERC20Transfer_batch100_AlchemyModularAccount": "10438358",
31+
"testERC20Transfer_batch100_AlchemyModularAccount_ERC20SelfPay": "9221814",
32+
"testERC20Transfer_batch100_IthacaAccount": "6201928",
33+
"testERC20Transfer_batch100_IthacaAccount_AppSponsor": "6758228",
34+
"testERC20Transfer_batch100_IthacaAccount_AppSponsor_ERC20": "6565428",
35+
"testERC20Transfer_batch100_IthacaAccount_ERC20SelfPay": "6004328",
36+
"testERC20Transfer_batch100_ZerodevKernel": "12332690",
37+
"testERC20Transfer_batch100_ZerodevKernel_ERC20SelfPay": "11134785",
38+
"testNativeTransfer_AlchemyModularAccount": "168453",
39+
"testNativeTransfer_CoinbaseSmartWallet": "159248",
40+
"testNativeTransfer_IthacaAccount": "101064",
41+
"testNativeTransfer_IthacaAccount_AppSponsor": "108635",
42+
"testNativeTransfer_IthacaAccount_ERC20SelfPay": "101365",
43+
"testNativeTransfer_Safe4337": "172763",
44+
"testNativeTransfer_ZerodevKernel": "184855",
45+
"testUniswapV2Swap_AlchemyModularAccount": "210111",
46+
"testUniswapV2Swap_CoinbaseSmartWallet": "201623",
47+
"testUniswapV2Swap_ERC4337MinimalAccount": "199690",
48+
"testUniswapV2Swap_IthacaAccount": "142728",
49+
"testUniswapV2Swap_IthacaAccount_AppSponsor": "150244",
50+
"testUniswapV2Swap_IthacaAccount_ERC20SelfPay": "143029",
51+
"testUniswapV2Swap_Safe4337": "215353",
52+
"testUniswapV2Swap_ZerodevKernel": "226591"
5353
}

‎src/Escrow.sol‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ contract Escrow is IEscrow {
132132
for (uint256 i = 0; i < escrowIds.length; i++) {
133133
Escrow storage _escrow = escrows[escrowIds[i]];
134134
// If refund timestamp hasn't passed yet, then the refund is invalid.
135-
if (block.timestamp <= _escrow.refundTimestamp) {
135+
if (block.timestamp > _escrow.refundTimestamp || msg.sender == _escrow.recipient) {
136+
_refundDepositor(escrowIds[i], _escrow);
137+
_refundRecipient(escrowIds[i], _escrow);
138+
} else {
136139
revert RefundInvalid();
137140
}
138-
139-
_refundDepositor(escrowIds[i], _escrow);
140-
_refundRecipient(escrowIds[i], _escrow);
141141
}
142142
}
143143

@@ -147,10 +147,11 @@ contract Escrow is IEscrow {
147147
for (uint256 i = 0; i < escrowIds.length; i++) {
148148
Escrow storage _escrow = escrows[escrowIds[i]];
149149
// If refund timestamp hasn't passed yet, then the refund is invalid.
150-
if (block.timestamp <= _escrow.refundTimestamp) {
150+
if (block.timestamp > _escrow.refundTimestamp || msg.sender == _escrow.depositor) {
151+
_refundDepositor(escrowIds[i], _escrow);
152+
} else {
151153
revert RefundInvalid();
152154
}
153-
_refundDepositor(escrowIds[i], _escrow);
154155
}
155156
}
156157

@@ -181,11 +182,11 @@ contract Escrow is IEscrow {
181182
Escrow storage _escrow = escrows[escrowIds[i]];
182183

183184
// If settlement is still within the deadline, then refund is invalid.
184-
if (block.timestamp <= _escrow.refundTimestamp) {
185+
if (block.timestamp > _escrow.refundTimestamp || msg.sender == _escrow.recipient) {
186+
_refundRecipient(escrowIds[i], _escrow);
187+
} else {
185188
revert RefundInvalid();
186189
}
187-
188-
_refundRecipient(escrowIds[i], _escrow);
189190
}
190191
}
191192

‎src/GuardedExecutor.sol‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.23;
33

4-
import {ERC7821} from "solady/accounts/ERC7821.sol";
54
import {LibSort} from "solady/utils/LibSort.sol";
65
import {LibBytes} from "solady/utils/LibBytes.sol";
76
import {LibZip} from "solady/utils/LibZip.sol";
@@ -13,6 +12,7 @@ import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
1312
import {FixedPointMathLib as Math} from "solady/utils/FixedPointMathLib.sol";
1413
import {DateTimeLib} from "solady/utils/DateTimeLib.sol";
1514
import {ICallChecker} from "./interfaces/ICallChecker.sol";
15+
import {ERC7821Ithaca as ERC7821} from "./libraries/ERC7821Ithaca.sol";
1616

1717
/// @title GuardedExecutor
1818
/// @notice Mixin for spend limits and calldata execution guards.
@@ -401,7 +401,7 @@ abstract contract GuardedExecutor is ERC7821 {
401401
checkKeyHashIsNonZero(keyHash)
402402
{
403403
if (keyHash != ANY_KEYHASH) {
404-
if (_isSuperAdmin(keyHash)) revert SuperAdminCanSpendAnything();
404+
if (_isSuperAdmin(keyHash)) revert SuperAdminCanExecuteEverything();
405405
}
406406

407407
// It is ok even if we don't check for `_isSelfExecute` here, as we will still
@@ -698,10 +698,10 @@ abstract contract GuardedExecutor is ERC7821 {
698698
// Configurables
699699
////////////////////////////////////////////////////////////////////////
700700

701-
/// @dev To be overriden to return if `keyHash` corresponds to a super admin key.
701+
/// @dev To be overridden to return if `keyHash` corresponds to a super admin key.
702702
function _isSuperAdmin(bytes32 keyHash) internal view virtual returns (bool);
703703

704-
/// @dev To be overriden to return the storage slot seed for a `keyHash`.
704+
/// @dev To be overridden to return the storage slot seed for a `keyHash`.
705705
function _getGuardedExecutorKeyStorageSeed(bytes32 keyHash)
706706
internal
707707
view

‎src/IthacaAccount.sol‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
275275

276276
(bool isValid, bytes32 keyHash) = unwrapAndValidateSignature(digest, signature);
277277
if (LibBit.and(keyHash != 0, isValid)) {
278-
isValid = _isSuperAdmin(keyHash)
279-
|| _getKeyExtraStorage(keyHash).checkers.contains(msg.sender);
278+
isValid =
279+
_isSuperAdmin(keyHash) || _getKeyExtraStorage(keyHash).checkers.contains(msg.sender);
280280
}
281281
// `bytes4(keccak256("isValidSignature(bytes32,bytes)")) = 0x1626ba7e`.
282282
// We use `0xffffffff` for invalid, in convention with the reference implementation.
@@ -400,7 +400,12 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
400400
}
401401

402402
/// @dev Returns arrays of all (non-expired) authorized keys and their hashes.
403-
function getKeys() public view virtual returns (Key[] memory keys, bytes32[] memory keyHashes) {
403+
function getKeys()
404+
public
405+
view
406+
virtual
407+
returns (Key[] memory keys, bytes32[] memory keyHashes)
408+
{
404409
uint256 totalCount = keyCount();
405410

406411
keys = new Key[](totalCount);
@@ -664,10 +669,12 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
664669
if or(shr(64, t), lt(encodedIntent.length, 0x20)) { revert(0x00, 0x00) }
665670
}
666671

667-
if (!LibBit.and(
672+
if (
673+
!LibBit.and(
668674
msg.sender == ORCHESTRATOR,
669675
LibBit.or(intent.eoa == address(this), intent.payer == address(this))
670-
)) {
676+
)
677+
) {
671678
revert Unauthorized();
672679
}
673680

‎src/MultiSigSigner.sol‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ contract MultiSigSigner is ISigner {
1212
////////////////////////////////////////////////////////////////////////
1313

1414
/// @dev The magic value returned by `isValidSignatureWithKeyHash` when the signature is valid.
15-
/// - Calcualated as: bytes4(keccak256("isValidSignatureWithKeyHash(bytes32,bytes32,bytes)")
15+
/// - Calculated as: bytes4(keccak256("isValidSignatureWithKeyHash(bytes32,bytes32,bytes)")
1616
bytes4 internal constant _MAGIC_VALUE = 0x8afc93b4;
1717

1818
/// @dev The magic value returned by `isValidSignatureWithKeyHash` when the signature is invalid.
@@ -175,7 +175,7 @@ contract MultiSigSigner is ISigner {
175175
/// for each owner key hash in the config.
176176
/// - Signature of a multi-sig should be encoded as abi.encode(bytes[] memory ownerSignatures)
177177
/// - For efficiency, place the signatures in the same order as the ownerKeyHashes in the config.
178-
/// - Failing owner signatures are ignored, as long as valid signaturs > threshold.
178+
/// - Failing owner signatures are ignored, as long as valid signatures > threshold.
179179
function isValidSignatureWithKeyHash(bytes32 digest, bytes32 keyHash, bytes memory signature)
180180
public
181181
view

0 commit comments

Comments
 (0)