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

Uniswap v4

PositionManager

failingdex

Uniswap v4 liquidity positions (ERC721).

Not on Starknet yet. A class is over Starknet's 81,920 CASM felt limit even after splitting by function selector.
Ethereum
0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e
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.

exact3,522

proved equivalent, no assumption

mapped84

equivalent under a recorded assumption

divergent3

behaves differently on Starknet

blocked0

cannot be preserved; the source must change

divergent 3 findings

HD0150gasleft() uses Starknet gas unitssrc/base/Notifier.sol:84
if (gasleft() < unsubscribeGasLimit) GasLimitTooLow.selector.revertWith();

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 cadencesrc/PositionManager.sol:149
if (block.timestamp > deadline) revert DeadlinePassed(deadline);

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 cadencesrc/base/ERC721Permit_v4.sol:22
if (block.timestamp > deadline) revert SignatureDeadlineExpired();

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

Acknowledged: survey: auto-acknowledged to measure the build

mapped Mapped: equivalent under the assumptions below

HD0160external call routed through the alias registry28

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

lib/permit2/src/libraries/SignatureVerification.sol:43bytes4 magicValue = IERC1271(claimedSigner).isValidSignature(hash, signature);
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:120ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") ==
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:136ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) ==
lib/v4-core/src/libraries/StateLibrary.sol:48bytes32 data = manager.extsload(stateSlot);
lib/v4-core/src/libraries/StateLibrary.sol:282liquidity = uint128(uint256(manager.extsload(slot)));
lib/v4-core/src/libraries/TransientStateLibrary.sol:42return int256(uint256(manager.exttload(key)));
lib/v4-core/src/libraries/TransientStateLibrary.sol:47return manager.exttload(Lock.IS_UNLOCKED_SLOT) != 0x0;
lib/v4-core/src/types/Currency.sol:46assembly ("memory-safe") {
lib/v4-core/src/types/Currency.sol:55assembly ("memory-safe") {
lib/v4-core/src/types/Currency.sol:94return IERC20Minimal(Currency.unwrap(currency)).balanceOf(address(this));
lib/v4-core/src/types/Currency.sol:102return IERC20Minimal(Currency.unwrap(currency)).balanceOf(owner);
src/PositionManager.sol:170return IPositionDescriptor(tokenDescriptor).tokenURI(this, tokenId);
src/PositionManager.sol:426(liquidityDelta, feesAccrued) = poolManager.modifyLiquidity(
src/PositionManager.sol:480poolManager.clear(currency, delta);
src/PositionManager.sol:500(liquidityDelta, feesAccrued) = poolManager.modifyLiquidity(
src/PositionManager.sol:522permit2.transferFrom(payer, address(poolManager), uint160(amount), Currency.unwrap(currency));
src/base/BaseActionsRouter.sol:25poolManager.unlock(unlockData);
src/base/DeltaResolver.sol:29poolManager.take(currency, recipient, amount);
src/base/DeltaResolver.sol:41poolManager.sync(currency);
src/base/DeltaResolver.sol:43poolManager.settle{value: amount}();
src/base/DeltaResolver.sol:46poolManager.settle();
src/base/NativeWrapper.sol:23if (amount > 0) WETH9.deposit{value: amount}();
src/base/NativeWrapper.sol:28if (amount > 0) WETH9.withdraw(amount);
src/base/Notifier.sol:85try _subscriber.notifyUnsubscribe{gas: unsubscribeGasLimit}(tokenId) {} catch {}
src/base/Notifier.sol:128assembly ("memory-safe") {
src/base/Permit2Forwarder.sol:23try permit2.permit(owner, permitSingle, signature) {}
src/base/Permit2Forwarder.sol:36try permit2.permit(owner, _permitBatch, signature) {}
src/base/PoolInitializer_v4.sol:14try poolManager.initialize(key, sqrtPriceX96) returns (int24 tick) {
HD0140code size check means 'is deployed' on Starknet14

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

lib/permit2/src/libraries/SignatureVerification.sol:26if (claimedSigner.code.length == 0) {
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:119to.code.length == 0 ||
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:135to.code.length == 0 ||
src/PositionManager.sol:480poolManager.clear(currency, delta);
src/PositionManager.sol:522permit2.transferFrom(payer, address(poolManager), uint160(amount), Currency.unwrap(currency));
src/base/DeltaResolver.sol:29poolManager.take(currency, recipient, amount);
src/base/DeltaResolver.sol:41poolManager.sync(currency);
src/base/NativeWrapper.sol:23if (amount > 0) WETH9.deposit{value: amount}();
src/base/NativeWrapper.sol:28if (amount > 0) WETH9.withdraw(amount);
src/base/Notifier.sol:80if (address(_subscriber).code.length > 0) {
src/base/Notifier.sol:85try _subscriber.notifyUnsubscribe{gas: unsubscribeGasLimit}(tokenId) {} catch {}
src/base/Notifier.sol:127if (target.code.length == 0) NoCodeSubscriber.selector.revertWith();
src/base/Permit2Forwarder.sol:23try permit2.permit(owner, permitSingle, signature) {}
src/base/Permit2Forwarder.sol:36try permit2.permit(owner, _permitBatch, signature) {}
HD0102address(this) is this contract's 160-bit alias12

no action needed

lib/v4-core/src/types/Currency.sol:94return IERC20Minimal(Currency.unwrap(currency)).balanceOf(address(this));
src/PositionManager.sol:170return IPositionDescriptor(tokenDescriptor).tokenURI(this, tokenId);
src/PositionManager.sol:459int256 currencyDelta = poolManager.currencyDelta(address(this), currency);
src/PositionManager.sol:518if (payer == address(this)) {
src/PositionManager.sol:560bytes32 positionId = Position.calculatePositionKey(address(this), tickLower, tickUpper, bytes32(tokenId));
src/base/BaseActionsRouter.sol:64return address(this);
src/base/BaseActionsRouter.sol:72return payerIsUser ? msgSender() : address(this);
src/base/DeltaResolver.sol:61int256 _amount = poolManager.currencyDelta(address(this), currency);
src/base/DeltaResolver.sol:72int256 _amount = poolManager.currencyDelta(address(this), currency);
src/base/DeltaResolver.sol:109uint256 balance = inputCurrency.balanceOf(address(this));
src/base/EIP712_v4.sol:36return keccak256(abi.encode(_TYPE_HASH, _HASHED_NAME, block.chainid, address(this)));
src/base/Multicall_v4.sol:13(bool success, bytes memory result) = address(this).delegatecall(data[i]);
HD0101msg.sender is the caller's 160-bit alias9

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

lib/v4-core/lib/solmate/src/tokens/ERC721.sol:92msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],
src/base/ERC721Permit_v4.sol:66_approveForAll(msg.sender, operator, approved);
src/base/ERC721Permit_v4.sol:84if (msg.sender != owner && !isApprovedForAll[owner][msg.sender]) revert Unauthorized();
src/base/NativeWrapper.sol:32if (msg.sender != address(WETH9) && msg.sender != address(poolManager)) revert InvalidEthSender();
src/base/Notifier.sol:44onlyIfApproved(msg.sender, tokenId)
src/base/Notifier.sol:67onlyIfApproved(msg.sender, tokenId)
src/base/ReentrancyLock.sol:12Locker.set(msg.sender);
src/base/SafeCallback.sol:18if (msg.sender != address(poolManager)) revert NotPoolManager();
src/base/UnorderedNonce.sol:26_useUnorderedNonce(msg.sender, nonce);
HD0130EVM log emitted as a Starknet event7

indexers read topics from event keys and data from event data

lib/v4-core/lib/solmate/src/tokens/ERC721.sol:108emit Transfer(from, to, id);
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:169emit Transfer(address(0), to, id);
lib/v4-core/lib/solmate/src/tokens/ERC721.sol:186emit Transfer(owner, address(0), id);
src/base/ERC721Permit_v4.sol:71emit ApprovalForAll(owner, operator, approved);
src/base/ERC721Permit_v4.sol:91emit Approval(owner, spender, id);
src/base/Notifier.sol:59emit Subscription(tokenId, newSubscriber);
src/base/Notifier.sol:88emit Unsubscription(tokenId, address(_subscriber));
HD0161a failing external call returns false with its revert data (Starknet v0.13.4 or later)7

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

lib/v4-core/src/types/Currency.sol:46assembly ("memory-safe") {
lib/v4-core/src/types/Currency.sol:55assembly ("memory-safe") {
src/base/Notifier.sol:85try _subscriber.notifyUnsubscribe{gas: unsubscribeGasLimit}(tokenId) {} catch {}
src/base/Notifier.sol:128assembly ("memory-safe") {
src/base/Permit2Forwarder.sol:23try permit2.permit(owner, permitSingle, signature) {}
src/base/Permit2Forwarder.sol:36try permit2.permit(owner, _permitBatch, signature) {}
src/base/PoolInitializer_v4.sol:14try poolManager.initialize(key, sqrtPriceX96) returns (int24 tick) {
HD0111balance reads the value token balance2

no action needed

lib/v4-core/src/types/Currency.sol:92return address(this).balance;
lib/v4-core/src/types/Currency.sol:100return owner.balance;
HD0121transient storage is scoped by transaction hash2

no action needed

src/libraries/Locker.sol:11assembly {
src/libraries/Locker.sol:17assembly {
HD0152block.chainid is the Starknet chain id2

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

src/base/EIP712_v4.sol:24_CACHED_CHAIN_ID = block.chainid;
src/base/EIP712_v4.sol:31return block.chainid == _CACHED_CHAIN_ID ? _CACHED_DOMAIN_SEPARATOR : _buildDomainSeparator();
HD0162delegatecall runs the target's class on this contract's storage (library call)1

no action needed

src/base/Multicall_v4.sol:13(bool success, bytes memory result) = address(this).delegatecall(data[i]);

The other 3,522 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.

Not recorded yet for this contract.

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.

Classes: not built yet.

Reproduce#

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

hyperdrive verify 0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e
solc (deployed)
0.8.26
Optimizer runs
30,000
Via IR (deployed)
yes
Compilation target
src/PositionManager.sol:PositionManager
Sourcify match
partial

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.