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

PayPal USD

PYUSD

buildsstablecoin

PayPal USD implementation (the proxy itself is solc 0.4.24).

Ethereum
0x8C35CaA5FD5bDC64b6B11344aD57594A3676256a

Implementation behind proxy 0x6c3e…A0e8

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,338

proved equivalent, no assumption

mapped57

equivalent under a recorded assumption

divergent5

behaves differently on Starknet

blocked0

cannot be preserved; the source must change

divergent 5 findings

HD0151block.timestamp / block.number follow Starknet block cadence@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:218
uint48 newSchedule = SafeCastUpgradeable.toUint48(block.timestamp) + defaultAdminDelay();

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 cadence@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:279
uint48 newSchedule = SafeCastUpgradeable.toUint48(block.timestamp) + _delayChangeWait(newDelay);

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 cadence@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:386
return schedule < block.timestamp;

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/lib/EIP2612.sol:84
if (deadline < block.timestamp) revert PermitExpired();

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/lib/EIP3009.sol:364
if (block.timestamp <= validAfter) revert AuthorizationInvalid();

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 event30

indexers read topics from event keys and data from event data

@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:220emit DefaultAdminTransferScheduled(newAdmin, newSchedule);
@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:281emit DefaultAdminDelayChangeScheduled(newDelay, newSchedule);
@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:345emit DefaultAdminTransferCanceled();
@openzeppelin/contracts-upgradeable/access/AccessControlDefaultAdminRulesUpgradeable.sol:363emit DefaultAdminDelayChangeCanceled();
@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:237emit RoleGranted(role, account, _msgSender());
@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:251emit RoleRevoked(role, account, _msgSender());
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:125emit Initialized(version);
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:149emit Initialized(type(uint8).max);
contracts/PaxosTokenV2.sol:82emit Transfer(address(this), owner, _balance);
contracts/PaxosTokenV2.sol:93emit SupplyControlSet(supplyControlAddress);
contracts/PaxosTokenV2.sol:217emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
contracts/PaxosTokenV2.sol:238emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
contracts/PaxosTokenV2.sol:259emit Pause();
contracts/PaxosTokenV2.sol:269emit Unpause();
contracts/PaxosTokenV2.sol:283emit FrozenAddressWiped(addr);
contracts/PaxosTokenV2.sol:284emit SupplyDecreased(addr, balance);
contracts/PaxosTokenV2.sol:285emit Transfer(addr, address(0), balance);
contracts/PaxosTokenV2.sol:343emit SupplyIncreased(mintToAddress, value);
contracts/PaxosTokenV2.sol:344emit Transfer(address(0), mintToAddress, value);
contracts/PaxosTokenV2.sol:380emit SupplyDecreased(burnFromAddress, value);
contracts/PaxosTokenV2.sol:381emit Transfer(burnFromAddress, address(0), value);
contracts/PaxosTokenV2.sol:438emit Approval(owner, spender, value);
contracts/PaxosTokenV2.sol:450emit Transfer(from, to, value);
contracts/PaxosTokenV2.sol:515emit FreezeAddress(addr);
contracts/PaxosTokenV2.sol:524emit UnfreezeAddress(addr);
contracts/lib/EIP2612.sol:118emit PermitInvalidated(msg.sender, _nonces[msg.sender]);
contracts/lib/EIP3009.sol:326emit AuthorizationAlreadyUsed(authorizer, nonce);
contracts/lib/EIP3009.sol:339emit AuthorizationCanceled(authorizer, nonce);
contracts/lib/EIP3009.sol:368emit AuthorizationAlreadyUsed(from, nonce);
contracts/lib/EIP3009.sol:381emit AuthorizationUsed(from, nonce);
HD0101msg.sender is the caller's 160-bit alias18

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

@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:24return msg.sender;
contracts/PaxosTokenV2.sol:140_transfer(msg.sender, to, value);
contracts/PaxosTokenV2.sol:161if (_isAddrFrozen(msg.sender)) revert AddressFrozen();
contracts/PaxosTokenV2.sol:180if (_isAddrFrozen(msg.sender)) revert AddressFrozen();
contracts/PaxosTokenV2.sol:199if (_isAddrFrozen(spender) || _isAddrFrozen(msg.sender)) revert AddressFrozen();
contracts/PaxosTokenV2.sol:200_approve(msg.sender, spender, value);
contracts/PaxosTokenV2.sol:214if (_isAddrFrozen(spender) || _isAddrFrozen(msg.sender)) revert AddressFrozen();
contracts/PaxosTokenV2.sol:216allowed[msg.sender][spender] += addedValue;
contracts/PaxosTokenV2.sol:231if (_isAddrFrozen(spender) || _isAddrFrozen(msg.sender)) revert AddressFrozen();
contracts/PaxosTokenV2.sol:233if (subtractedValue > allowed[msg.sender][spender]) {
contracts/PaxosTokenV2.sol:339supplyControl.canMintToAddress(mintToAddress, value, msg.sender);
contracts/PaxosTokenV2.sol:354return increaseSupplyToAddress(value, msg.sender);
contracts/PaxosTokenV2.sol:375supplyControl.canBurnFromAddress(burnFromAddress, msg.sender);
contracts/PaxosTokenV2.sol:391return decreaseSupplyFromAddress(value, msg.sender);
contracts/PaxosTokenV2.sol:428if (value > allowed[from][msg.sender]) revert InsufficientAllowance();
contracts/lib/EIP2612.sol:117_nonces[msg.sender] += count;
contracts/lib/EIP3009.sol:229if (to != msg.sender) revert CallerMustBePayee();
contracts/lib/EIP3009.sol:266if (to != msg.sender) revert CallerMustBePayee();
HD0160external call routed through the alias registry3

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

@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol:43(bool success, bytes memory result) = signer.staticcall(
contracts/PaxosTokenV2.sol:339supplyControl.canMintToAddress(mintToAddress, value, msg.sender);
contracts/PaxosTokenV2.sol:375supplyControl.canBurnFromAddress(burnFromAddress, msg.sender);
HD0102address(this) is this contract's 160-bit alias2

no action needed

contracts/PaxosTokenV2.sol:78uint256 _balance = balances[address(this)];
contracts/lib/EIP712.sol:27address(this)
HD0140code size check means 'is deployed' on Starknet2

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

contracts/PaxosTokenV2.sol:339supplyControl.canMintToAddress(mintToAddress, value, msg.sender);
contracts/PaxosTokenV2.sol:375supplyControl.canBurnFromAddress(burnFromAddress, msg.sender);
HD0152block.chainid is the Starknet chain id1

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

contracts/lib/EIP712.sol:26block.chainid,
HD0161a failing external call returns false with its revert data (Starknet v0.13.4 or later)1

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

@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol:43(bool success, bytes memory result) = signer.staticcall(

The other 3,338 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
PYUSDnot declared
77,986
PYUSD_Ctornot declared
9,185
PYUSD_P1not declared
50,059
PYUSD_P2not declared
76,053

Build time: 27.9 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 0x8C35CaA5FD5bDC64b6B11344aD57594A3676256a
solc (deployed)
0.8.28
Optimizer runs
200
Via IR (deployed)
no
Compilation target
contracts/stablecoins/PYUSD.sol:PYUSD
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.