Skip to content

Add Tezos X Previewnet deployment - #18

Open
skenaja wants to merge 4 commits into
mainfrom
add-previewnet
Open

Add Tezos X Previewnet deployment#18
skenaja wants to merge 4 commits into
mainfrom
add-previewnet

Conversation

@skenaja

@skenaja skenaja commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds support for deploying WXTZ to TezosX Previewnet (chainId 128064),
an ephemeral (~1–2 month) test chain with no LayerZero infrastructure.

The contract is deployed unmodified by standing up a minimal EndpointV2Stub
that satisfies the single endpoint call (setDelegate) made from
OAppCore's constructor. Local WXTZ features (deposit/withdraw, ERC20,
permit) work; cross-chain send/lzReceive intentionally do not.

Changes

  • hardhat.config.ts, chain-config.ts — register tezosXPreviewnet
    network (RPC, chainId 128064, Blockscout verifier) and add 128064 to
    testnetChains. The network has no eid because LayerZero has not
    assigned one for this chain.
  • deploy/WXTZ.ts — map chainId 128064 to itself for the
    etherlinkChainId constructor arg, so deposit/withdraw work locally.
  • contracts/mocks/tezosXPreviewnet/EndpointV2Stub.sol — new previewnet-only
    stub. Implements only setDelegate(address) with a stored mapping + event.
    Path makes its scope obvious; clearly marked as not-for-production in NatSpec.
  • deploy/tezosXPreviewnet/EndpointV2Stub.ts — new deploy script that
    registers the stub under the deployment name EndpointV2, so the existing
    hre.deployments.get('EndpointV2') call in deploy/WXTZ.ts resolves to it.
    Guarded by a skip that no-ops on every other network.
  • Lint/formatnpm run lint:fix + prettier sweep across scripts,
    tests, configs, and docs (no behaviour changes).
  • README.md — new Deployments section listing every mainnet/testnet
    address with explorer links, plus a sidenote documenting the previewnet
    stub workaround.

Deployments

Network Chain ID Contract Address
TezosX Previewnet 128064 EndpointV2Stub 0xF01b3160F2926420C7416ddA62544969063269ED
TezosX Previewnet 128064 WXTZ 0xf4a2e3BA5C14f11c23c8c4351093C058D20542f2

Both contracts are verified on Blockscout.

Cleanup

The stub, its deploy script, and the previewnet network entries should be
removed when previewnet is decommissioned. All previewnet-only code is
contained under contracts/mocks/tezosXPreviewnet/ and
deploy/tezosXPreviewnet/ to make that easy.

Test plan

  • npx hardhat compile succeeds
  • npx hardhat test passes (no logic changes to WXTZ.sol)
  • Confirm WXTZ on previewnet accepts deposit of native XTZ and returns it via withdraw
  • Confirm the stub's setDelegate mapping reflects the WXTZ contract → deployer wiring set during construction
  • Spot-check that npx hardhat deploy --tags EndpointV2Stub --network <other-network> is a no-op

@skenaja
skenaja requested review from KStasi May 1, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant