Links

wethDYDX Smart Contract

Overview of the wethDYDX Smart Contract

Disclaimer

The wethDYDX Smart Contract enables a permissionless and autonomous one-way bridge for the ethDYDX token to be migrated from Ethereum to the dYdX Chain. The dYdX Foundation will not provide a user interface or front-end related to access the wethDYDX Smart Contract.
Neither the dYdX Foundation or any other party will be able to exercise any kind of power over the wethDYDX Smart Contract once it is deployed. Consequently, the dYdX Foundation does not make any representations, warranties, or covenants as to the technical properties, performance and will not be responsible for the use made by the people of the wethDYDX Smart Contract, including, without limitation, with regard to (i) potential deployments of the wethDYDX Smart Contract, (ii) potential adaptations, forks or modified versions of the wethDYDX Smart Contract, and its deployment, or (iii) users’ interactions with the wethDYDX Smart Contract.
Note, ethDYDX holders should only consider sending ethDYDX to the wethDYDX Smart Contract if and when the corresponding governance proposal is executed on-chain. Otherwise, a user sending its ethDYDX to the wethDYDX Smart Contract before such governance proposal is adopted and implemented would receive wethDYDX before the governance or utility functions of that token in dYdX v3 are known or confirmed. Users should also refrain from interacting with the wethDYDX Smart Contract without proper knowledge of how to derive private keys on the dYdX Chain (if and when deployed on mainnet).

Resources

Overview

When interacted with, the one-way bridge wethDYDX Smart Contract would carry out the following functions in a fully permissionless and automated manner:
Step 1: Receive and permanently lock the ethDYDX tokens sent by the user to the wethDYDX Smart Contract,
Step 2: Send wethDYDX to the user on a 1-1 proportion basis on Ethereum, and
Step 3: dYdX Chain validators can also read and ingest the information in the Ethereum Smart Contract such that corresponding DYDX can be distributed to users by validators on the dYdX Chain (if and when deployed) once there is confirmation that Step 1 above is complete and the Ethereum-based DYDX is permanently locked in the Ethereum Smart Contract.
For users who decide to migrate their ethDYDX tokens to the dYdX Chain using the wethDYDX Smart Contractreferred to in this documentation, the method that users would be credited with DYDX tokens on the dYdX Chain is expected to depend on when they interact with the wethDYDX Smart Contract, as follows:
  • Step 3(a): If a user interacts with the wethDYDX Smart Contract before a certain cut-off date prior to the genesis of the dYdX Chain (“Genesis”), the amount of ethDYDX tokens sent by the user to the wethDYDX Smart Contract would be registered as event information of the wethDYDX Smart Contract. At this point, the user’s dYdX Chain wallet cannot be allocated with DYDX tokens because the dYdX Chain would not exist yet.
Note, should the dYdX community decide to use DYDX as the L1 protocol token of the dYdX Chain (if and when deployed after mainnet release), the potential mainnet launch of the dYdX Chain would be dependent on prospective validators sending ethDYDX tokens to the wethDYDX Smart Contract before the relevant cut-off date prior to Genesis, because dYdX Chain validators would require a certain amount of staked L1 tokens to start and secure the network.
  • Step 3(b): If a user interacts with the wethDYDX Smart Contract after Genesis, then each dYdX Chain validator participating in the consensus process would read the event information of the wethDYDX Smart Contract and allocate DYDX tokens on the dYdX Chain to a given user’s dYdX Chain address based on the corresponding amount (1-1) of ethDYDX tokens that the user sent to the wethDYDX Smart Contract. Note, a user who interacts with the wethDYDX Smart Contract after the relevant cut-off time referred to above but before Genesis would be credited with L1 dYdX Chain tokens by the dYdX Chain validators in the blocks confirmed after Genesis.

Contract Design

Wrapped Ethereum DYDX (wethDYDX)

The wethDYDX token contract is a new ERC-20 contract that is similar to theDYDX token contract with the following specifications:
  • A new bridge() function that takes ethDYDX tokens from the caller and mints them an equivalent amount of wethDYDX tokens
    • This function will emit an event log indicating it has occurred
    • Note, there is no way to reverse the bridge function
  • No transfer or minting restrictions
  • Zero INITIAL_SUPPLY
  • A new
    • NAME: Wrapped Ethereum DYDX
    • SYMBOL: wethDYDX

Transferability and Utility

The wethDYDX token is freely transferable like a normal ERC-20 contract. The governance and utility function of wethDYDX, if deployed, must be determined through dYdX governance. For wethDYDX to have the same governance and utility function as ethDYDX, a dYdX community member would need to create a governance proposal subject to the Long Timelock Executor to replace the original GovernanceStrategy Smart Contract with the GovernanceStrategyV2 Smart Contract.
Similar to DYDX, if the market value of wethDYDX drops, it may introduce a governance security issue because the wethDYDX tokens retain the same voting rights as the DYDX token.

Event Emission

The wethDYDX Smart Contract emits an event log in order for the dYdX Chain to understand when a call to bridge() has occurred.
Below are some helpful links that describe Ethereum logs:
  • Event logs on the Ethereum blockchain (link)
  • Deep-dive on eth_getLogs RPC call (link)
The following log would be emitted:
event Bridge(
uint256 indexed id,
uint256 amount,
address from,
bytes accAddress,
bytes data
);
The description of each field in the log is as follows:
  • id is an incrementing number guaranteed to be unique for each log with no gaps.
    • id allows anyone to refer to a unique event easily.
    • id allows de-duplication of event processing by the v4 chain without requiring additional storage for each unique event. If the chain processes each eventId in order, then it can store a single integer of the most recently processedeventId.
  • amount is the amount of ethDYDXtokens that was transferred.
  • from is the Ethereum address the ethDYDX tokens were transferred from.
  • accAddress is the address to which the L1 token of the dYdX Chain should be minted. This field is an arbitrary value provided by the caller of the function.
  • data is additional arbitrary data that the caller provides. This field can be used to signal additional intent. For example, it can be used when migrating funds from a treasury to indicate that the funds should not go to a normal end-user account and instead should be bridged to a module account. It could also be used for pre-genesis bridging to indicate which validator to stake to in genesis.

Locked Tokens Transfer Restrictions

Per the original blog post introducing ethDYDX, 50% of the 1 billion supply of ethDYDX was reserved for:
  • past investors of dYdX Trading Inc. (27.7%),
  • founders, employees, advisors, and consultants of dYdX Trading Inc. and dYdX Foundation (15.3%); and,
  • future employees and consultants of dYdX Trading Inc. or dYdX Foundation (7.0%).
Certain ethDYDX tokens held by investors and team members are subject to transfer restrictions. Those ethDYDX tokens are referred to as locked tokens (the "Locked Tokens"). The transfer restriction shall expire pursuant to a schedule that is publicly available and can be viewed here.
Locked Tokens will be released from the transfer restrictions on the same schedule as follows:
  • 30% on December 1, 2023 (the “Initial Unlock Date”);
  • 40% in equal monthly installments on the first day of each month from January 1, 2024, to June 1, 2024;
  • 20% in equal monthly installments on the first day of each month from July 1, 2024, to June 1, 2025; and
  • 10% in equal monthly installments on the first day of each month from July 1, 2025, to June 1, 2026.
All employees and consultants with ethDYDX tokens are also subject to various vesting schedules that could result in them losing their right to receive Locked Tokens.

Bridging & Staking Locked Tokens

Locked Tokens can still be bridged from Ethereum to the dYdX Chain (if and when deployed) via the wethDYDX Smart Contract, and like all other ethDYDX token-holders, the locked eethDYDX token-holders will be entitled to receive:
  1. 1.
    wethDYDX, on a 1-1 proportional basis, on Ethereum, and
  2. 2.
    DYDX tokens, on a 1-1 proportional basis, on the dYdX Chain (if and when deployed).
Any wethDYDX and/or dYdX-Chain DYDX tokens received in exchange for locked ethDYDX tokens shall continue to be subject to the same transfer restrictions and release schedule. As with the current locked ethDYDX tokens, locked wethDYDX tokens and locked dYdX-Chain DYDX tokens may also be bridged to another blockchain, used for voting or delegating purposes and/or staked to a validator, if applicable.

FAQ

How is accAddress on the dYdX Chain derived?
Interacting with the wethDYDX Smart Contract will involve using an Ethereum private key to generate a mnemonic/master private key and that mnemonic can be used to create accounts across any Cosmos chain.
What fees are payable in connection with the token migration (gas fees on either of the two networks and/or other applicable fees)?
ethDYDX holders that are transfering ethDYDX to the wethDYDX Smart Contract will only need to pay gas fees one time to send ethDYDX to the wethDYDX Smart Contract and to receive wethDYDX.
Is wethDYDX transferable?
wethDYDX is an ERC-20 token and is freely transferable.
Can wethDYDX be sent to the bridge (wethDYDX Smart Contract) ?
No. wethDYDX can not be sent to the bridge (wethDYDX Smart Contract). Note, there is no way to reverse the bridge function.
Can wethDYDX be staked / sent to the Safety Module?
Initially, wethDYDX cannot be staked to the Safety Module. The Safety Module on dYdX v3 is no longer active as of November 28, 2022. In DIP 17, the dYdX community voted to effectively wind down the Safety Module by setting the Safety Module rewards per second to 0. The dYdX community through dYdX Governance on dYdX v3 could upgrade the Safety Module to accept wethDYDX as another form of collateral.