Sitelet https://github.com/Dargon789/account/commit/0cb7a770acad764e0bd217f27a99bc2d0c5538b8
Skip to content

Commit 0cb7a77

Browse files
Dargon789github-actions[bot]legion2002o-azactions-user
authored
Ithaca (#58)
* feat: add ERC20 transfer benchmark for Porto with passkey Add testERC20TransferViaPortoOrchestratorWithPasskey() benchmark to isolate passkey authentication costs from spend limit enforcement costs. - Uses secp256k1 passkey for transaction signing - Sets execution permissions for ERC20 transfers - Requires spend limits (set to max) for passkey operations - Gas cost: 116,094 (vs 97,030 without passkey, 117,083 with restrictive limits) - Provides clean measurement of passkey overhead (~19k gas) Resolves ithacaxyz#272 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Tanishk Goyal <legion2002@users.noreply.github.com> * chore: use `auto-assign-pr.yml` org action * feat: add merkle sigs natively into the account * fix: tests * test: add more sophisticated fuzz test * chore: bump contract versions due to bytecode changes - Contracts updated: IthacaAccount * # Default ignored files * .snapshot_worktree * Delete .idea directory (#35) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Normalize file modes and update forge-std submodule Remove executable bit from deploy/execute_config.sh, deploy/verify_config.sh, and prep/check-bytecode-changes.js (mode 100755 → 100644). Update lib/forge-std submodule from commit c2cf7017d27c1d20e74ace4dacb6c5ce4bbbe899 to 07853315f998f94dc724e464b1bab1270888ee64. No other content changes. * Revert "Delete .idea directory (#35)" (#55) This reverts commit 512c204. --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tanishk Goyal <legion2002@users.noreply.github.com> Co-authored-by: o-az <omaraziz.dev@proton.me> Co-authored-by: Tanishk Goyal <goyaltanishk02@gmail.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: googleworkspace-bot <googleworkspace-bot@google.com>
1 parent 379fa7b commit 0cb7a77

10 files changed

Lines changed: 1926 additions & 0 deletions

File tree

‎.idea/.gitignore‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/account.iml‎

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/caches/deviceStreaming.xml‎

Lines changed: 1698 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/codeStyles/Project.xml‎

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/codeStyles/codeStyleConfig.xml‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/copilot.data.migration.ask2agent.xml‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/markdown.xml‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/vcs.xml‎

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/Benchmark.t.sol‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,52 @@ contract BenchmarkTest is BaseTest {
18051805
assertEq(paymentToken.balanceOf(address(0xbabe)), 1 ether);
18061806
}
18071807

1808+
function testERC20TransferViaPortoOrchestratorWithPasskey() public {
1809+
vm.pauseGasMetering();
1810+
1811+
PassKey memory k = _randomSecp256k1PassKey();
1812+
1813+
DelegatedEOA memory d = _randomEIP7702DelegatedEOA();
1814+
vm.deal(d.eoa, type(uint128).max);
1815+
_mint(address(paymentToken), d.eoa, type(uint128).max);
1816+
1817+
vm.startPrank(d.eoa);
1818+
d.d.authorize(k.k);
1819+
d.d.setCanExecute(
1820+
k.keyHash, address(paymentToken), bytes4(keccak256("transfer(address,uint256)")), true
1821+
);
1822+
d.d.setSpendLimit(
1823+
k.keyHash, address(paymentToken), GuardedExecutor.SpendPeriod.Hour, type(uint256).max
1824+
);
1825+
d.d.setSpendLimit(k.keyHash, address(0), GuardedExecutor.SpendPeriod.Hour, type(uint256).max);
1826+
vm.stopPrank();
1827+
1828+
Orchestrator.Intent memory u;
1829+
u.eoa = d.eoa;
1830+
u.nonce = 0;
1831+
u.combinedGas = 1000000;
1832+
u.prePaymentAmount = 0 ether;
1833+
u.prePaymentMaxAmount = 0 ether;
1834+
u.totalPaymentAmount = 0.01 ether;
1835+
u.totalPaymentMaxAmount = 0.1 ether;
1836+
u.paymentToken = address(0);
1837+
// To maintain parity with the old benchmarks.
1838+
u.paymentRecipient = address(oc);
1839+
u.executionData = _transferExecutionData(address(paymentToken), address(0xbabe), 1 ether);
1840+
u.signature = _sig(k, u);
1841+
1842+
bytes[] memory encodedIntents = new bytes[](1);
1843+
encodedIntents[0] = abi.encode(u);
1844+
1845+
vm.resumeGasMetering();
1846+
1847+
oc.execute(encodedIntents);
1848+
1849+
vm.pauseGasMetering();
1850+
assertEq(paymentToken.balanceOf(address(0xbabe)), 1 ether);
1851+
vm.resumeGasMetering();
1852+
}
1853+
18081854
function testERC20TransferDirect() public {
18091855
DelegatedEOA memory d = _randomEIP7702DelegatedEOA();
18101856
_giveAccountSomeTokens(d.eoa);

0 commit comments

Comments
 (0)