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

Pepe

PepeToken

buildstoken

Most traded meme token on 0.8.

Ethereum
0x6982508145454Ce325dDbE47a25d4ec3d2311933
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.

exact1,165

proved equivalent, no assumption

mapped8

equivalent under a recorded assumption

divergent0

behaves differently on Starknet

blocked0

cannot be preserved; the source must change

mapped Mapped: equivalent under the assumptions below

HD0130EVM log emitted as a Starknet event5

indexers read topics from event keys and data from event data

PepeToken.sol:104emit OwnershipTransferred(oldOwner, newOwner);
PepeToken.sol:462emit Transfer(sender, recipient, amount);
PepeToken.sol:483emit Transfer(address(0), account, amount);
PepeToken.sol:511emit Transfer(account, address(0), amount);
PepeToken.sol:538emit Approval(owner, spender, amount);
HD0101msg.sender is the caller's 160-bit alias2

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

PepeToken.sol:22return msg.sender;
PepeToken.sol:630_burn(msg.sender, value);
HD0123mapping and array slots are hashed with Poseidon instead of keccak2561
PepeToken.sol:590contract PepeToken is Ownable, ERC20 {

The other 1,165 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-HASH35 keccak256 storage slot computation(s) use Poseidon (HD0123): neither keccak256 nor rt::ctx::slot_hash collides on reachable slot preimages, no constant slot of the contract lies within 2^64 slots above a hashed slot, and offsets added to a hashed slot stay below 2^64 (solc's layout: array lengths capped at 2^64, bounds-checked indices). Proved under it: SlotsProof.slot_hashing_preserves_storage. Storage holds the EVM's words at renamed slots, so off-chain tools that compute a mapping entry's EVM slot number must use hyperdrive's slot function.
  • A-SLOT-MODECode compiled with Poseidon slots and code with keccak256 slots never share storage. The constructor records slot mode poseidon 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).

Tested against the EVM#

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

Cairo against revm (solc 0.8.38): identical behaviour: 4 calls, 11 storage slots compared, 0 mismatch(es)

CallResultEVM gasStarknet L2 gas
transfer(bob, 100)match60,1131,141,309
balanceOf(bob)match23,886353,397
bob: approve(carol, 5)match45,742788,424
carol: transferFrom(bob, dave, 5)matchnot yet measurednot 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.

CallEVM gasL2 gas, rawL2 gas, typed
transfer(bob, 100)60,1131,141,3091,382,547
balanceOf(bob)23,886353,397583,495
approve(carol, 5)45,742788,4241,029,662

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
PepeTokennot declared
62,360

Build time: 0.5 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 0x6982508145454Ce325dDbE47a25d4ec3d2311933
solc (deployed)
0.8.0
Optimizer runs
200
Via IR (deployed)
no
Compilation target
PepeToken.sol:PepeToken
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.