Sample data. Built from the compile survey; nothing on this site is deployed or attested yet.
hyperdriveregistry

ERC-4337

EntryPoint

buildsinfra

ERC-4337 EntryPoint v0.7, every smart account user operation.

Ethereum
0x0000000071727De22E5E9d8BAf0edAc6f37da032
Starknet Sepolia
Not deployed yet
Same code, not same state. The Starknet contract runs the same code as the Ethereum one, but it starts empty: balances, positions, owners and settings on Ethereum do not carry over.

What is different on Starknet#

hyperdrive check reports every place this contract depends on the EVM, at its Solidity line. Exact counts operations; the other tiers count findings. About tiers.

exact2,373

proved equivalent, no assumption

mapped50

equivalent under a recorded assumption

divergent17

behaves differently on Starknet

blocked0

cannot be preserved; the source must change

divergent 17 findings

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:84
uint256 preGas = gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:129
uint256 actualGas = preGas - gasleft() + opInfo.preOpGas;

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:142
uint256 actualGas = preGas - gasleft() + opInfo.preOpGas;

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:319
uint256 preGas = gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:327
gasleft() * 63 / 64 <

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:357
uint256 actualGas = preGas - gasleft() + opInfo.preOpGas;

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:527
uint256 preGas = gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:549
if (preGas - gasleft() > pmVerificationGasLimit) {

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:624
uint256 preGas = gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:655
if (preGas - gasleft() > verificationGasLimit) {

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:672
outOpInfo.preOpGas = preGas - gasleft() + userOp.preVerificationGas;

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:691
uint256 preGas = gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0150gasleft() uses Starknet gas unitscontracts/core/EntryPoint.sol:716
actualGas += preGas - gasleft();

acknowledge, or remove logic that depends on exact gas amounts

Acknowledged: survey: auto-acknowledged to measure the build

HD0151block.timestamp / block.number follow Starknet block cadencecontracts/core/EntryPoint.sol:605
outOfTimeRange = block.timestamp > data.validUntil || block.timestamp < data.validAfter;

acknowledge if your logic uses wall-clock windows, not block counts

Acknowledged: survey: auto-acknowledged to measure the build

HD0151block.timestamp / block.number follow Starknet block cadencecontracts/core/StakeManager.sol:101
uint48 withdrawTime = uint48(block.timestamp) + info.unstakeDelaySec;

acknowledge if your logic uses wall-clock windows, not block counts

Acknowledged: survey: auto-acknowledged to measure the build

HD0151block.timestamp / block.number follow Starknet block cadencecontracts/core/StakeManager.sol:118
info.withdrawTime <= block.timestamp,

acknowledge if your logic uses wall-clock windows, not block counts

Acknowledged: survey: auto-acknowledged to measure the build

HD0154fee and coinbase values have no Starknet equivalentcontracts/core/EntryPoint.sol:767
return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);

acknowledge; these return fixed values

Acknowledged: survey: auto-acknowledged to measure the build

mapped Mapped: equivalent under the assumptions below

HD0130EVM log emitted as a Starknet event14

indexers read topics from event keys and data from event data

contracts/core/EntryPoint.sol:135emit PostOpRevertReason(
contracts/core/EntryPoint.sol:154emit UserOperationEvent(
contracts/core/EntryPoint.sol:166emit UserOperationPrefundTooLow(
contracts/core/EntryPoint.sol:197emit BeforeExecution();
contracts/core/EntryPoint.sol:261emit BeforeExecution();
contracts/core/EntryPoint.sol:267emit SignatureAggregatorChanged(address(opa.aggregator));
contracts/core/EntryPoint.sol:276emit SignatureAggregatorChanged(address(0));
contracts/core/EntryPoint.sol:345emit UserOperationRevertReason(
contracts/core/EntryPoint.sol:441emit AccountDeployed(
contracts/core/StakeManager.sol:65emit Deposited(account, newDeposit);
contracts/core/StakeManager.sol:90emit StakeLocked(msg.sender, stake, unstakeDelaySec);
contracts/core/StakeManager.sol:104emit StakeUnlocked(msg.sender, withdrawTime);
contracts/core/StakeManager.sol:124emit StakeWithdrawn(msg.sender, withdrawAddress, stake);
contracts/core/StakeManager.sol:141emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);
HD0160external call routed through the alias registry11

target addresses resolve through aliases or link symbols in hyperdrive.toml

contracts/core/EntryPoint.sol:65(bool success, ) = beneficiary.call{value: amount}("");
contracts/core/EntryPoint.sol:108assembly ("memory-safe") {
contracts/core/EntryPoint.sol:228try aggregator.validateSignatures(ops, opa.signature) {} catch {
contracts/core/EntryPoint.sol:431address sender1 = senderCreator().createSender{
contracts/core/EntryPoint.sol:452address sender = senderCreator().createSender(initCode);
contracts/core/EntryPoint.sol:490IAccount(sender).validateUserOp{
contracts/core/EntryPoint.sol:538IPaymaster(paymaster).validatePaymasterUserOp{gas: pmVerificationGasLimit}(
contracts/core/EntryPoint.sol:705try IPaymaster(paymaster).postOp{
contracts/core/StakeManager.sol:125(bool success,) = withdrawAddress.call{value: stake}("");
contracts/core/StakeManager.sol:142(bool success,) = withdrawAddress.call{value: withdrawAmount}("");
contracts/utils/Exec.sol:17assembly ("memory-safe") {
HD0101msg.sender is the caller's 160-bit alias7

no action needed; Ethereum-key accounts keep their Ethereum address

contracts/core/EntryPoint.sol:320require(msg.sender == address(this), "AA92 internal call only");
contracts/core/NonceManager.sol:27nonceSequenceNumber[msg.sender][key]++;
contracts/core/StakeManager.sol:43depositTo(msg.sender);
contracts/core/StakeManager.sol:74DepositInfo storage info = deposits[msg.sender];
contracts/core/StakeManager.sol:98DepositInfo storage info = deposits[msg.sender];
contracts/core/StakeManager.sol:113DepositInfo storage info = deposits[msg.sender];
contracts/core/StakeManager.sol:138DepositInfo storage info = deposits[msg.sender];
HD0161a failing external call returns false with its revert data (Starknet v0.13.4 or later)6

no action needed; deploy to a network running Starknet v0.13.4 or later

contracts/core/EntryPoint.sol:108assembly ("memory-safe") {
contracts/core/EntryPoint.sol:228try aggregator.validateSignatures(ops, opa.signature) {} catch {
contracts/core/EntryPoint.sol:490IAccount(sender).validateUserOp{
contracts/core/EntryPoint.sol:538IPaymaster(paymaster).validatePaymasterUserOp{gas: pmVerificationGasLimit}(
contracts/core/EntryPoint.sol:705try IPaymaster(paymaster).postOp{
contracts/utils/Exec.sol:17assembly ("memory-safe") {
HD0140code size check means 'is deployed' on Starknet4

every Starknet account is a contract: code-length checks on users are always true

contracts/core/EntryPoint.sol:228try aggregator.validateSignatures(ops, opa.signature) {} catch {
contracts/core/EntryPoint.sol:429if (sender.code.length != 0)
contracts/core/EntryPoint.sol:438if (sender1.code.length == 0)
contracts/core/EntryPoint.sol:705try IPaymaster(paymaster).postOp{
HD0102address(this) is this contract's 160-bit alias3

no action needed

contracts/core/EntryPoint.sol:108assembly ("memory-safe") {
contracts/core/EntryPoint.sol:320require(msg.sender == address(this), "AA92 internal call only");
contracts/core/EntryPoint.sol:367keccak256(abi.encode(userOp.hash(), address(this), block.chainid));
HD0110msg.value is an amount of the network's value token2

no action needed; the registry admin sets the value token (ETH or STRK) once per network

contracts/core/StakeManager.sol:64uint256 newDeposit = _incrementDeposit(account, msg.value);
contracts/core/StakeManager.sol:80uint256 stake = info.stake + msg.value;
HD0152block.chainid is the Starknet chain id1

no action needed; EIP-712 domains will use the Starknet chain id

contracts/core/EntryPoint.sol:367keccak256(abi.encode(userOp.hash(), address(this), block.chainid));
HD0162delegatecall runs the target's class on this contract's storage (library call)1

no action needed

contracts/core/EntryPoint.sol:797(bool success, bytes memory ret) = target.delegatecall(data);
HD0163new Contract deploys the child's class declared in the alias registry1

declare each child class once per network: registry.declare(selector(name), class_hash)

contracts/core/EntryPoint.sol:31SenderCreator private immutable _senderCreator = new SenderCreator();

The other 2,373 operations translate exactly: proved equivalent, with no assumption.

Assumptions#

From the build's certificate: what this contract's equivalence rests on, beyond the Lean proof. What these mean.

  • A-STORAGE-HASHhyperdrive's Poseidon hashes have no collisions on reachable inputs: storage slots (HD0120), keccak256 cache keys and Poseidon slot hashes (HD0123).
  • A-ALIASContracts are registered with the HdRegistry passed to their constructor, and an unregistered account's low 160 bits are not a registered alias. Registered addresses never share an alias (proved: RegistryProof.alias_injective).
  • A-SLOT-MODECode compiled with Poseidon slots and code with keccak256 slots never share storage. The constructor records slot mode keccak in this contract's storage and every delegatecall frame running this code checks the storage owner's mode (reverting with "hyperdrive: storage slot mode mismatch"). Not checked: an upgrade with replace_class must keep the slot mode of the class it replaces (both builds' ASSUMPTIONS.md name it).
  • A-SPLITThe contract is split into several classes (split.json). A library call runs the part class with this contract's storage, caller and address, and its revert data reaches the caller unchanged; the part classes declared on the network are the ones whose class hashes are embedded here.

Tested against the EVM#

The same calls run on the compiled Cairo and on revm, compared on return data, reverts, events, storage and balances.

Differential runs: not yet measured.

Cost#

EVM gas on Ethereum next to Starknet L2 gas for the same call. They are different units with different prices, so compare contracts, not the two columns. Raw is the EVM calldata entry point; typed is the Starknet ABI entry point. About costs.

Per-call cost: not yet measured.

Classes#

Starknet limits a class to 81,920 CASM felts. A larger contract is split by function selector into classes that call each other by library call.

ClassClass hashCASM felts of 81,920
EntryPointnot declared
71,433
EntryPoint_Ctornot declared
14,218
EntryPoint_P1not declared
65,232
EntryPoint_P2not declared
71,378

Build time: 22.8 s (wall time, depends on the compile cache).

Reproduce#

Rebuild from the Sourcify source and compare class hashes with the deployed ones. Nothing here needs trusting the registry.

hyperdrive verify 0x0000000071727De22E5E9d8BAf0edAc6f37da032
solc (deployed)
0.8.23
Optimizer runs
1,000,000
Via IR (deployed)
yes
Compilation target
contracts/core/EntryPoint.sol:EntryPoint
Sourcify match
full

Attestations#

Each attestation is an on-chain record that someone rebuilt this contract and got the deployed class hashes. Anyone who runs hyperdrive verify can add one.

No attestations yet.