# Developers

## Deployment Addresses

| Contract                    | Address                                    |
| --------------------------- | ------------------------------------------ |
| USDhl (HyperEVM)            | 0xb50A96253aBDF803D85efcDce07Ad8becBc52BD5 |
| Hyperlane (HyperEVM)        | 0x36f586A30502AE3afb555b8aA4dCc05d233c2ecE |
| Wrapped M (Ethereum)        | 0x437cc33344a0B27A429f795ff6B469C72698B291 |
| Hyperlane Portal (Ethereum) | 0x36f586A30502AE3afb555b8aA4dCc05d233c2ecE |

## Workflow 1: Lock Wrapped M and Issue USDhl

Interact with the Hyperlane Portal Lite smart contract on Ethereum to lock Wrapped M (`wM`) on Ethereum Mainnet and issue USDhl on HyperEVM.

The relevant contract is the Hyperlane Portal smart contract on Ethereum.

```
0x36f586A30502AE3afb555b8aA4dCc05d233c2ecE
```

View on [Etherscan](https://etherscan.io/address/0x36f586a30502ae3afb555b8aa4dcc05d233c2ece#writeProxyContract)

***

#### `transferMLikeToken` Function

|              |                                                          |
| ------------ | -------------------------------------------------------- |
| **Contract** | Hyperlane Portal                                         |
| **Purpose**  | Locks Wrapped M on Ethereum and issues USDhl on HyperEVM |

**Function Signature**

```
transferMLikeToken(
    uint256 amount,
    address sourceToken,
    uint256 destinationChainId,
    address destinationToken,
    address recipient,
    address refundAddress
) external payable
```

**Parameters**

| Name                 | Type      | Description                                                              |
| -------------------- | --------- | ------------------------------------------------------------------------ |
| `amount`             | `uint256` | Amount of Wrapped $M to bridge **with 6 decimals** (1 $M = `1_000_000`). |
| `sourceToken`        | `address` | 0x437cc33344a0B27A429f795ff6B469C72698B291 – Wrapped $M on Ethereum.     |
| `destinationChainId` | `uint256` | `999` (HyperEVM).                                                        |
| `destinationToken`   | `address` | 0xb50A96253aBDF803D85efcDce07Ad8becBc52BD5 – `USDhl` on HyperEVM.        |
| `recipient`          | `address` | Final holder on HyperEVM.                                                |
| `refundAddress`      | `address` | ETH refunds for any excess fee.                                          |

**Return Values**

*None (state‑changing; emits Bridge events).*

**Notes**

* **Payable** – set `msg.value` to the delivery fee (see `quoteTransfer` below).
* **Decimals** – `$M` uses 6 decimals; scale amounts accordingly.
* Any ETH overpaid for the message fee is automatically returned to `refundAddress`.

***

#### `quoteTransfer` Helper

|             |                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------- |
| **Purpose** | Estimates the ETH fee required to deliver the cross‑chain message so you can set `msg.value` accurately. |

**Function Signature**

```
quoteTransfer(
    uint256 amount,
    uint256 destinationChainId,
    address recipient
) external view returns (uint256 fee)
```

***

#### Example Use Case

A user wants to bridge **1 $M** to the same address on HyperEVM.

1. **Approve**

```solidity
IERC20(wM).approve(portalLite, 1_000_000); // 1 $M with 6 decimals
```

2. **Quote fee**

```solidity
uint256 fee = portalLite.quoteTransfer(
    1_000_000,          // amount
    999,                // destinationChainId
    msg.sender          // recipient
);
```

3. **Bridge**

```solidity
portalLite.transferMLikeToken{ value: fee }(
    1_000_000,                          // amount
    0x437cc33344a0B27A429f795ff6B469C72698B291, // sourceToken (wM)
    999,                                // destinationChainId (HyperEVM)
    0xb50A96253aBDF803D85efcDce07Ad8becBc52BD5, // destinationToken (USDhl)
    msg.sender,                         // recipient
    msg.sender                          // refundAddress
);
```

The transaction emits a `BridgeSent` event on Ethereum and, upon finality, a `BridgeDelivered` event on HyperEVM, crediting `1 $M` to `recipient`.

## Workflow 2: Burn USDhl and unlock Wrapped M

Burning USDhl unlocks the same amount of Wrapped M (wM) on Ethereum Mainnet. The operation is the mirror image of *Workflow 1* and uses the Hyperlane Portal  contract on HyperEVM.

The relevant contract is the Hyperlane Portal smart contract on Ethereum.

```
0x36f586A30502AE3afb555b8aA4dCc05d233c2ecE
```

View on [Purrsec](https://purrsec.com/address/0x36f586A30502AE3afb555b8aA4dCc05d233c2ecE)

***

#### Step‑by‑Step

1. **Approve Portal Lite to spend USDhl**

   ```solidity
   IERC20(usdhl).approve(portalLite, amount);
   ```
2. **Quote HYPE fee**

   ```solidity
   uint256 fee = portalLite.quoteTransfer(
       amount,
       1,                 // destinationChainId (Ethereum)
       recipient          // same or different address on ETH
   );
   ```
3. **Burn & bridge**

   ```solidity
   portalLite.transferMLikeToken{ value: fee }(
       amount,                // uint256  USDhl to burn (6 decimals)
       usdhl,                 // address  sourceToken on HyperEVM
       1,                     // uint256  destinationChainId (Ethereum)
       wM,                    // address  destinationToken (wM)
       recipient,             // address  recipient on Ethereum
       refundAddress          // address  HYPE refund
   );
   ```

   The call burns `amount` USDhl on HyperEVM, emits `BridgeSent`, and—after Hyperlane delivery—mints the same `amount` of wM to `recipient` on Ethereum, emitting `BridgeDelivered`.

***

#### `transferMLikeToken` Reference (Burn → Unlock)

|              |                                                            |
| ------------ | ---------------------------------------------------------- |
| **Contract** | Hyperlane Portal  on HyperEVM                              |
| **Purpose**  | Burns USDhl on HyperEVM and unlocks Wrapped M on Ethereum. |

**Signature**

```solidity
transferMLikeToken(
    uint256 amount,
    address sourceToken,        // USDhl / $M on HyperEVM
    uint256 destinationChainId, // 1
    address destinationToken,   // Wrapped $M on Ethereum
    address recipient,
    address refundAddress
) external payable
```

| Parameter            | Description                                                  |
| -------------------- | ------------------------------------------------------------ |
| `amount`             | USDhl to burn (6 decimals).                                  |
| `sourceToken`        | 0xb50A96253aBDF803D85efcDce07Ad8becBc52BD5 (USDhl HyperEVM). |
| `destinationChainId` | Ethereum Mainnet                                             |
| `destinationToken`   | 0x437cc33344a0B27A429f795ff6B469C72698B291 (Wrapped M).      |
| `recipient`          | Target Ethereum address.                                     |
| `refundAddress`      | HYPE over‑payment refund.                                    |

*Returns* – none (state‑changing; emits bridge events).

***

#### `quoteTransfer`

Same interface as in Workflow 1, but supply `destinationChainId = 1`.\
Call it as `staticcall` or via an off‑chain provider to fetch the precise HYPE fee (in wei).

***

#### Example Numbers

| Scenario           | Value                                        |
| ------------------ | -------------------------------------------- |
| Bridged amount     | **1 $M** = `1_000_000`                       |
| Quoted fee (today) | `0.0714 HYPE` ≈ `71 306 260 150 159 422` wei |
| `msg.value`        | `0.072 HYPE` (rounded up; excess refunded)   |

## Helpers

### Track Hyperlane Bridge Status

1. Copy tx hash of the confirmed transaction and paste it in Hyperlane explorer (explorer.hyperlane.xyz) to track the delivery status. Note: it takes some time for the explorer to index transaction. Wait a couple of minutes if nothing found at first.

<figure><img src="https://19009743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtMFacMgYziBI8EeWuWGb%2Fuploads%2FKSqcvn5dKwWCzdspfsnM%2Fimage%20(7).png?alt=media&#x26;token=a0dc9c4b-6130-4dc8-9f8c-b384bd65cb30" alt=""><figcaption></figcaption></figure>

2. Click on the record in the results table.
3. You can see the information about the source and destination transactions and delivery time. Usually it takes around 3 minutes to deliver message to HyperEVM
4. Click on *View in block* explorer in Destination Transaction section.

<figure><img src="https://19009743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtMFacMgYziBI8EeWuWGb%2Fuploads%2F16T6ohuz3rTL4h5Vk588%2Fimage%20(1)%20(1).png?alt=media&#x26;token=639a2279-e95c-44a6-b010-07a1a32af06c" alt=""><figcaption></figcaption></figure>

2. Now you can see in Hyperscan that USDhl tokens were issued on HyperEVM

### How to Acquire Wrapped M (wM)

Users can acquire Wrapped M (wM) on Ethereum via two ways:&#x20;

**1] Swap from USDC -> wM on Uniswap (pool is rebalanced on single tick quote)**

Pool: <https://app.uniswap.org/explore/pools/ethereum/0x970A7749EcAA4394C8B2Bf5F2471F41FD6b79288>

Pool Address: <https://etherscan.io/address/0x970a7749ecaa4394c8b2bf5f2471f41fd6b79288>

**2] Mint M via MXON minter**

Please reach out to the Felix team as direct minting requires KYB approvals.

### How to bridge USDhl between HyperCore <> HyperEVM

USDhl can be bridged between HyperCore environment and HyperEVM environment by sending to the bridge address: 0x2000000000000000000000000000000000000123
