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

Aave

GhoToken

failingstablecoin

Aave's GHO stablecoin.

Not on Starknet yet. GhoToken is 96008 CASM felts, over the 81920 limit, and has no selector dispatcher to split by.
Ethereum
0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f
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,620

proved equivalent, no assumption

mapped23

equivalent under a recorded assumption

divergent1

behaves differently on Starknet

blocked0

cannot be preserved; the source must change

divergent 1 finding

HD0151block.timestamp / block.number follow Starknet block cadencelib/gho-core/src/contracts/gho/ERC20.sol:116
require(deadline >= block.timestamp, 'PERMIT_DEADLINE_EXPIRED');

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

HD0130EVM log emitted as a Starknet event13

indexers read topics from event keys and data from event data

lib/gho-core/src/contracts/gho/ERC20.sol:66emit Approval(msg.sender, spender, amount);
lib/gho-core/src/contracts/gho/ERC20.sol:80emit Transfer(msg.sender, to, amount);
lib/gho-core/src/contracts/gho/ERC20.sol:98emit Transfer(from, to, amount);
lib/gho-core/src/contracts/gho/ERC20.sol:136emit Approval(owner, spender, value);
lib/gho-core/src/contracts/gho/ERC20.sol:171emit Transfer(address(0), to, amount);
lib/gho-core/src/contracts/gho/ERC20.sol:183emit Transfer(from, address(0), amount);
lib/gho-core/src/contracts/gho/GhoToken.sol:45emit FacilitatorBucketLevelUpdated(msg.sender, currentBucketLevel, newBucketLevel);
lib/gho-core/src/contracts/gho/GhoToken.sol:59emit FacilitatorBucketLevelUpdated(msg.sender, currentBucketLevel, newBucketLevel);
lib/gho-core/src/contracts/gho/GhoToken.sol:77emit FacilitatorAdded(
lib/gho-core/src/contracts/gho/GhoToken.sol:100emit FacilitatorRemoved(facilitatorAddress);
lib/gho-core/src/contracts/gho/GhoToken.sol:113emit FacilitatorBucketCapacityUpdated(facilitator, oldCapacity, newCapacity);
lib/openzeppelin-contracts/contracts/access/AccessControl.sol:230emit RoleGranted(role, account, _msgSender());
lib/openzeppelin-contracts/contracts/access/AccessControl.sol:244emit RoleRevoked(role, account, _msgSender());
HD0101msg.sender is the caller's 160-bit alias6

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

lib/gho-core/src/contracts/gho/ERC20.sol:64allowance[msg.sender][spender] = amount;
lib/gho-core/src/contracts/gho/ERC20.sol:72balanceOf[msg.sender] -= amount;
lib/gho-core/src/contracts/gho/ERC20.sol:86uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
lib/gho-core/src/contracts/gho/GhoToken.sol:36Facilitator storage f = _facilitators[msg.sender];
lib/gho-core/src/contracts/gho/GhoToken.sol:52Facilitator storage f = _facilitators[msg.sender];
lib/openzeppelin-contracts/contracts/utils/Context.sol:18return msg.sender;
HD0152block.chainid is the Starknet chain id3

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

lib/gho-core/src/contracts/gho/ERC20.sol:55INITIAL_CHAIN_ID = block.chainid;
lib/gho-core/src/contracts/gho/ERC20.sol:140return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
lib/gho-core/src/contracts/gho/ERC20.sol:152block.chainid,
HD0102address(this) is this contract's 160-bit alias1

no action needed

lib/gho-core/src/contracts/gho/ERC20.sol:153address(this)

The other 1,620 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
GhoTokennot declared
96,008

Build time: 2.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 0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f
solc (deployed)
0.8.10
Optimizer runs
200
Via IR (deployed)
no
Compilation target
lib/gho-core/src/contracts/gho/GhoToken.sol:GhoToken
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.