Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f4c7993
feat: add ERC20 transfer benchmark for Porto with passkey
github-actions[bot] Aug 5, 2025
ab8f1a4
chore: use `auto-assign-pr.yml` org action
o-az Sep 16, 2025
2ecce31
feat: add merkle sigs natively into the account
legion2002 Sep 24, 2025
5577747
fix: tests
legion2002 Sep 24, 2025
995a3e1
test: add more sophisticated fuzz test
legion2002 Sep 24, 2025
4918a12
chore: bump contract versions due to bytecode changes - Contracts upd…
actions-user Sep 24, 2025
68f4e3a
Add .circleci/config.yml (#1)
Dargon789 Nov 19, 2025
2f484ce
Update ci.yaml
Dargon789 Nov 19, 2025
cef256e
Update ci.yaml (#2)
Dargon789 Nov 19, 2025
bcd8527
Update ci.yaml (#4)
Dargon789 Nov 19, 2025
01aafc5
Update ci.yaml (#5)
Dargon789 Nov 20, 2025
21aa942
Update ci.yaml
Dargon789 Nov 20, 2025
a317ddb
Create CNAME
Dargon789 Dec 20, 2025
6c02fbf
Merge branch 'master'
Dargon789 Dec 21, 2025
28ff37f
Revert "Merge branch 'master'"
Dargon789 Dec 21, 2025
30a2096
Merge branch 'ithacaxyz:main' into main
Dargon789 Jan 5, 2026
8a9cd81
Update ci.yaml (#10)
Dargon789 Jan 5, 2026
e8df747
Potential fix for code scanning alert no. 3: Workflow does not contai…
Dargon789 Jan 22, 2026
966955b
Update ci.yaml (#16)
Dargon789 Jan 22, 2026
acf68a6
Delete CNAME
Dargon789 Jan 27, 2026
ab82267
Update Brutalizer.sol
Dargon789 Jan 28, 2026
585f8e0
Potential fix for code scanning alert no. 2: Workflow does not contai…
Dargon789 Jan 28, 2026
5fc1664
Refactor deployment scripts and update configs
Dargon789 Jan 28, 2026
7fe9971
Fix commit user email format in CI workflow (#18)
Dargon789 Jan 28, 2026
06b0f0d
Potential fix for code scanning alert no. 4: Workflow does not contai…
Dargon789 Jan 28, 2026
78e1076
Potential fix for code scanning alert no. 1: Workflow does not contai…
Dargon789 Jan 28, 2026
d9fe534
Merge branch 'tanishk/native-merkle-sigs'
Dargon789 Jan 28, 2026
a5c5464
Update ci.yaml (#21)
Dargon789 Jan 28, 2026
3e316a0
Master (#22)
Dargon789 Jan 28, 2026
abebf0c
Update ci.yaml
Dargon789 Jan 28, 2026
3596151
Refactor function signatures and formatting for consistency
Dargon789 Jan 28, 2026
c8e8f2a
Merge branch 'main' into Dargon789-patch-1
Dargon789 Jan 28, 2026
b4bf831
Merge remote-tracking branch 'upstream/claude/issue-272-20250805-2250…
Dargon789 Feb 10, 2026
e86fb17
Merge remote-tracking branch 'upstream/o-az-patch-2' into fix-tests-a…
Dargon789 Feb 10, 2026
05f0843
# Default ignored files
Dargon789 Feb 10, 2026
9745888
.snapshot_worktree
Dargon789 Feb 15, 2026
d3fa551
Merge branch 'main' into IthacaAccount
Dargon789 Feb 15, 2026
7ea8d32
Merge branch 'fix-tests-account' into IthacaAccount
Dargon789 Feb 15, 2026
f03357c
Refactor function signatures and formatting for consistency
googleworkspace-bot Mar 14, 2026
ab9e883
Normalize file modes and update forge-std submodule
googleworkspace-bot Apr 10, 2026
d54a37b
Update LayerZero-v2
googleworkspace-bot Apr 11, 2026
90b1293
clear && forge fmt && forge snapshot
googleworkspace-bot Apr 20, 2026
96aeb19
Merge branch 'main' into IthacaAccount
googleworkspace-bot Apr 30, 2026
abbcf1d
Merge branch 'IthacaAccount' into Dargon789-Refactor-deployment-scrip…
googleworkspace-bot Apr 30, 2026
544e17e
Merge remote-tracking branch 'origin/Legion' into Dargon789-Refactor-…
googleworkspace-bot Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clear && forge fmt && forge snapshot --isolate --match-contract Benchmark --via-ir && git add snapshots
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/account.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,698 changes: 1,698 additions & 0 deletions .idea/caches/deviceStreaming.xml

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/markdown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 43 additions & 2 deletions src/IthacaAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {LibNonce} from "./libraries/LibNonce.sol";
import {TokenTransferLib} from "./libraries/TokenTransferLib.sol";
import {LibTStack} from "./libraries/LibTStack.sol";
import {IIthacaAccount} from "./interfaces/IIthacaAccount.sol";
import {MerkleProofLib} from "solady/utils/MerkleProofLib.sol";

/// @title Account
/// @notice A account contract for EOAs with EIP7702.
Expand Down Expand Up @@ -490,9 +491,43 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
return isMultichain ? _hashTypedDataSansChainId(structHash) : _hashTypedData(structHash);
}

/// @dev Verifies the merkle sig
/// - Note: Each leaf of the merkle tree should be a standard digest.
/// - The signature for using merkle verification is encoded as:
/// - bytes signature = abi.encode(bytes32[] proof, bytes32 root, bytes rootSig)
function _verifyMerkleSig(bytes32 digest, bytes calldata signature)
internal
view
returns (bool isValid, bytes32 keyHash)
{
bytes32[] calldata proof;
bytes32 root;
bytes calldata rootSig;

assembly ("memory-safe") {
let proofOffset := add(signature.offset, calldataload(signature.offset))
proof.length := calldataload(proofOffset)
proof.offset := add(proofOffset, 0x20)

root := calldataload(add(signature.offset, 0x20))

let rootSigOffset := add(signature.offset, calldataload(add(signature.offset, 0x40)))
rootSig.length := calldataload(rootSigOffset)
rootSig.offset := add(rootSigOffset, 0x20)
}

if (MerkleProofLib.verifyCalldata(proof, root, digest)) {
(isValid, keyHash) = unwrapAndValidateSignature(root, rootSig);

return (isValid, keyHash);
}

return (false, bytes32(0));
}

/// @dev Returns if the signature is valid, along with its `keyHash`.
/// The `signature` is a wrapped signature, given by
/// `abi.encodePacked(bytes(innerSignature), bytes32(keyHash), bool(prehash))`.
/// `abi.encode(bytes(innerSignature), bytes32(keyHash), bool(prehash), bool(merkle))`.
function unwrapAndValidateSignature(bytes32 digest, bytes calldata signature)
public
view
Expand All @@ -507,14 +542,20 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
return (ECDSA.recoverCalldata(digest, signature) == address(this), 0);
}

bool merkle;
unchecked {
uint256 n = signature.length - 0x21;
uint256 n = signature.length - 0x22;
keyHash = LibBytes.loadCalldata(signature, n);
signature = LibBytes.truncatedCalldata(signature, n);
// Do the prehash if last byte is non-zero.
if (uint256(LibBytes.loadCalldata(signature, n + 1)) & 0xff != 0) {
digest = EfficientHashLib.sha2(digest); // `sha256(abi.encode(digest))`.
}
merkle = uint256(LibBytes.loadCalldata(signature, n + 2)) & 0xff != 0;
}

if (merkle) {
return _verifyMerkleSig(digest, signature);
}

Key memory key = getKey(keyHash);
Expand Down
11 changes: 6 additions & 5 deletions test/Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ contract BaseTest is SoladyTest {
{
(bytes32 r, bytes32 s) = vm.signP256(privateKey, digest);
s = P256.normalized(s);
return abi.encodePacked(abi.encode(r, s), keyHash, uint8(prehash ? 1 : 0));
return abi.encodePacked(abi.encode(r, s), keyHash, uint8(prehash ? 1 : 0), uint8(0));
}

function _secp256k1Sig(uint256 privateKey, bytes32 keyHash, bytes32 digest)
Expand All @@ -236,7 +236,8 @@ contract BaseTest is SoladyTest {
returns (bytes memory)
{
(uint8 v, bytes32 r, bytes32 s) = vm.sign(privateKey, digest);
return abi.encodePacked(abi.encodePacked(r, s, v), keyHash, uint8(prehash ? 1 : 0));
return
abi.encodePacked(abi.encodePacked(r, s, v), keyHash, uint8(prehash ? 1 : 0), uint8(0));
}

function _multiSig(MultiSigKey memory k, bytes32 keyHash, bool preHash, bytes32 digest)
Expand All @@ -249,7 +250,7 @@ contract BaseTest is SoladyTest {
signatures[i] = _sig(k.owners[i], digest);
}

return abi.encodePacked(abi.encode(signatures), keyHash, uint8(preHash ? 1 : 0));
return abi.encodePacked(abi.encode(signatures), keyHash, uint8(preHash ? 1 : 0), uint8(0));
}

function _estimateGasForEOAKey(Orchestrator.Intent memory i)
Expand Down Expand Up @@ -281,15 +282,15 @@ contract BaseTest is SoladyTest {
{
(uint8 v, bytes32 r, bytes32 s) =
vm.sign(uint128(_randomUniform()), bytes32(_randomUniform()));
i.signature = abi.encodePacked(abi.encodePacked(r, s, v), keyHash, uint8(0));
i.signature = abi.encodePacked(abi.encodePacked(r, s, v), keyHash, uint8(0), uint8(0));
return _estimateGas(i);
}

function _estimateGasForSecp256r1Key(bytes32 keyHash, Orchestrator.Intent memory i)
internal
returns (uint256 gExecute, uint256 gCombined, uint256 gUsed)
{
i.signature = abi.encodePacked(keccak256("a"), keccak256("b"), keyHash, uint8(0));
i.signature = abi.encodePacked(keccak256("a"), keccak256("b"), keyHash, uint8(0), uint8(0));

return _estimateGas(i);
}
Expand Down
Loading